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/maths/division.asm | Pentium1080Ti/x86-assembly | 0 | 175994 | %include 'src/include/functions.asm'
SECTION .data
remainder db ' remainder '
SECTION .text
global _start
_start:
mov eax, 100
mov ebx, 10
div ebx
call iprint
mov eax, remainder
call sprint
mov eax, edx ; move remainder
call iprintLF
call quit |
test/unit/src/test_images.adb | Statkus/json-ada | 0 | 28426 | -- Copyright (c) 2018 RREE <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ahven; use Ahven;
with JSON.Parsers;
with JSON.Streams;
with JSON.Types;
package body Test_Images is
package Types is new JSON.Types (Long_Integer, Long_Float);
package Parsers is new JSON.Parsers (Types);
overriding
procedure Initialize (T : in out Test) is
begin
T.Set_Name ("Images");
T.Add_Test_Routine (Test_True_Text'Access, "Image 'true'");
T.Add_Test_Routine (Test_False_Text'Access, "Image 'false'");
T.Add_Test_Routine (Test_Null_Text'Access, "Image 'null'");
T.Add_Test_Routine (Test_Escaped_Text'Access, "Image '""BS CR LF \ / HT""'");
T.Add_Test_Routine (Test_Empty_String_Text'Access, "Image '""""'");
T.Add_Test_Routine (Test_Non_Empty_String_Text'Access, "Image '""test""'");
T.Add_Test_Routine (Test_Number_String_Text'Access, "Image '""12.34""'");
T.Add_Test_Routine (Test_Integer_Number_Text'Access, "Image '42'");
T.Add_Test_Routine (Test_Empty_Array_Text'Access, "Image '[]'");
T.Add_Test_Routine (Test_One_Element_Array_Text'Access, "Image '[""test""]'");
T.Add_Test_Routine (Test_Multiple_Elements_Array_Text'Access, "Image '[3.14, true]'");
T.Add_Test_Routine (Test_Empty_Object_Text'Access, "Image '{}'");
T.Add_Test_Routine (Test_One_Member_Object_Text'Access, "Image '{""foo"":""bar""}'");
T.Add_Test_Routine (Test_Multiple_Members_Object_Text'Access, "Image '{""foo"":1,""bar"":2}'");
T.Add_Test_Routine (Test_Array_Object_Array'Access, "Image '[{""foo"":[true, 42]}]'");
T.Add_Test_Routine (Test_Object_Array_Object'Access, "Image '{""foo"":[null, {""bar"": 42}]}'");
end Initialize;
use Types;
procedure Test_True_Text is
Text : aliased String := "true";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_True_Text;
procedure Test_False_Text is
Text : aliased String := "false";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_False_Text;
procedure Test_Null_Text is
Text : aliased String := "null";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Null_Text;
procedure Test_Escaped_Text is
Text : aliased String := """BS:\b LF:\n CR:\r \\ \/ HT:\t""";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Escaped_Text;
procedure Test_Empty_String_Text is
Text : aliased String := """""";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Empty_String_Text;
procedure Test_Non_Empty_String_Text is
Text : aliased String := """test""";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Non_Empty_String_Text;
procedure Test_Number_String_Text is
Text : aliased String := """12.34""";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Number_String_Text;
procedure Test_Integer_Number_Text is
Text : aliased String := "42";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Integer_Number_Text;
procedure Test_Empty_Array_Text is
Text : aliased String := "[]";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Empty_Array_Text;
procedure Test_One_Element_Array_Text is
Text : aliased String := "[""test""]";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_One_Element_Array_Text;
procedure Test_Multiple_Elements_Array_Text is
Text : aliased String := "[42,true]";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Multiple_Elements_Array_Text;
procedure Test_Empty_Object_Text is
Text : aliased String := "{}";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Empty_Object_Text;
procedure Test_One_Member_Object_Text is
Text : aliased String := "{""foo"":""bar""}";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_One_Member_Object_Text;
procedure Test_Multiple_Members_Object_Text is
Text : aliased String := "{""foo"":1,""bar"":2}";
Text2 : constant String := "{""bar"":2,""foo"":1}";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert ((Text = Image) or else (Text2 = Image), "Image '" & Image & "' is not '" & Text & "'");
end Test_Multiple_Members_Object_Text;
procedure Test_Array_Object_Array is
Text : aliased String := "[{""foo"":[true,42]}]";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Array_Object_Array;
procedure Test_Object_Array_Object is
Text : aliased String := "{""foo"":[null,{""bar"":42}]}";
Stream : JSON.Streams.Stream'Class := JSON.Streams.Create_Stream (Text'Access);
Allocator : Types.Memory_Allocator;
Value : constant JSON_Value := Parsers.Parse (Stream, Allocator);
Image : constant String := Value.Image;
begin
Assert (Text = Image, "Image not '" & Text & "'");
end Test_Object_Array_Object;
end Test_Images;
|
playground/while/parser/while.g4 | xephonhq/tsql | 5 | 7251 | grammar while;
prog: cexp+;
aexp: aexp '*' aexp # mul
| aexp '/' aexp # div
| aexp '+' aexp # sum
| aexp '-' aexp # sub
| INT # num
| ID # var
;
bexp: aexp '<' aexp # les
| aexp '>' aexp # gt
| aexp '==' aexp # eq
| aexp '!=' aexp # neq
| BOOL # bool
;
cexp: 'skip' ';' # skip
| ID ':=' aexp ';' # assign
| 'if' bexp 'then' '{' cexp+ '}' 'else' '{' cexp+ '}' # if
| 'while' bexp 'do' '{' cexp+ '}' # while
;
ID : [a-zA-Z]+;
INT : [0-9]+;
BOOL: 'true' | 'false';
WS : [ \t\r\n]+ -> skip ;
COMMENT: '//' .*? '\n' -> skip;
|
Task/XML-Input/Ada/xml-input-1.ada | LaudateCorpus1/RosettaCodeData | 1 | 25039 | with Sax.Readers;
with Input_Sources.Strings;
with Unicode.CES.Utf8;
with My_Reader;
procedure Extract_Students is
Sample_String : String :=
"<Students>" &
"<Student Name=""April"" Gender=""F"" DateOfBirth=""1989-01-02"" />" &
"<Student Name=""Bob"" Gender=""M"" DateOfBirth=""1990-03-04"" />" &
"<Student Name=""Chad"" Gender=""M"" DateOfBirth=""1991-05-06"" />" &
"<Student Name=""Dave"" Gender=""M"" DateOfBirth=""1992-07-08"">" &
"<Pet Type=""dog"" Name=""Rover"" />" &
"</Student>" &
"<Student DateOfBirth=""1993-09-10"" Gender=""F"" Name=""Émily"" />" &
"</Students>";
Reader : My_Reader.Reader;
Input : Input_Sources.Strings.String_Input;
begin
Input_Sources.Strings.Open (Sample_String, Unicode.CES.Utf8.Utf8_Encoding, Input);
My_Reader.Parse (Reader, Input);
Input_Sources.Strings.Close (Input);
end Extract_Students;
|
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/ordinary_type_declaration_range_constraint.ads | ouankou/rose | 488 | 2687 | <gh_stars>100-1000
package ordinary_type_declaration_range_constraint is
type Ordinary_Type is range 1..10;
end ordinary_type_declaration_range_constraint;
|
programs/oeis/134/A134063.asm | karttu/loda | 0 | 101834 | <filename>programs/oeis/134/A134063.asm
; A134063: a(n) = (1/2)*(3^n - 2^(n+1) + 3).
; 1,1,2,7,26,91,302,967,3026,9331,28502,86527,261626,788971,2375102,7141687,21457826,64439011,193448102,580606447,1742343626,5228079451,15686335502,47063200807,141197991026,423610750291,1270865805302,3812664524767,11438127792026
mov $1,1
mov $2,2
lpb $0,1
sub $0,1
add $3,$2
trn $3,3
add $2,$3
mul $2,2
add $3,$1
mov $1,$3
sub $2,$3
lpe
|
antlr-basics/src/main/java/com/poc/chapter_05_part03/LexerRules.g4 | cgonul/antlr-poc | 0 | 392 | grammar LexerRules;
stats : stat* ;
stat : exp* ';' ;
exp : ID | for;
ID : [a-zA-Z0-9]+;
WS : [ \t\r\n]+ -> skip ;
for : 'for' ; |
oeis/016/A016947.asm | neoneye/loda-programs | 11 | 174538 | ; A016947: a(n) = (6*n + 3)^3.
; 27,729,3375,9261,19683,35937,59319,91125,132651,185193,250047,328509,421875,531441,658503,804357,970299,1157625,1367631,1601613,1860867,2146689,2460375,2803221,3176523,3581577,4019679,4492125,5000211,5545233,6128487,6751269,7414875,8120601,8869743,9663597,10503459,11390625,12326391,13312053,14348907,15438249,16581375,17779581,19034163,20346417,21717639,23149125,24642171,26198073,27818127,29503629,31255875,33076161,34965783,36926037,38958219,41063625,43243551,45499293,47832147,50243409,52734375
mul $0,6
add $0,3
pow $0,3
|
audio/sfx/battle_34.asm | adhi-thirumala/EvoYellow | 16 | 162246 | SFX_Battle_34_Ch1:
dutycycle 237
unknownsfx0x20 8, 255, 248, 3
unknownsfx0x20 15, 255, 0, 4
unknownsfx0x20 15, 243, 0, 4
endchannel
SFX_Battle_34_Ch2:
dutycycle 180
unknownsfx0x20 8, 239, 192, 3
unknownsfx0x20 15, 239, 192, 3
unknownsfx0x20 15, 227, 192, 3
endchannel
SFX_Battle_34_Ch3:
unknownnoise0x20 4, 255, 81
unknownnoise0x20 8, 255, 84
unknownnoise0x20 15, 255, 85
unknownnoise0x20 15, 243, 86
endchannel
|
Engine Hacks/Skill System/Internals/FE8-Weapon Rank on Levelup/Display_Text_Anims_On1.asm | sme23/MekkahRestrictedHackComp1 | 0 | 163918 | .thumb
.org 0x0
@called at 75D00
push {r14}
mov r0,#2
ldr r1,Func_A240 @copies text to ram
mov r14,r1
.short 0xF800
mov r4,r0
ldr r1,Custom_Message_Func
mov r14,r1
.short 0xF800
ldr r1,Func_3EDC
mov r14,r1
.short 0xF800
pop {r1}
bx r1
.align
Func_A240:
.long 0x0800A240
Func_3EDC:
.long 0x08003EDC
Custom_Message_Func:
@
|
fun/bell.asm | takama/junior | 0 | 1224 | <filename>fun/bell.asm
.model small
.code
org 100h ;загрузить с адреса 100h
start: ;точка входа
jmp inst ;переход на инсталяцию
;----------------------------------------------------------------------------
;------ обработка прерывания 8h ---------------------------------------------
;----------------------------------------------------------------------------
int8 label byte ;точка входа
cli ;запрет прерываний
push ax ;сохранить в стеке ax и ds
push ds ;
pushf ;сохранить флаги
db 9ah ;команда вызова программы,
old8o dw 0 ;адрес которой находится
old8s dw 0 ;ниже
xor ax,ax ;ax=0
mov ds,ax ;ds=0
cmp word ptr ds:[46ch],0ff00h ;сравнить ячейку таймера
jnz nosound ;если нет, то переход
cli ;запрет прерываний
mov ax,word ptr cs:old8o ;установка старого вектора
mov word ptr ds:[20h],ax ;прерываний 8h в таблицу
mov ax,word ptr cs:old8s ;векторов
mov word ptr ds:[22h],ax ;
sti ;разрешение прерываний
call melody ;вызов подпрограммы мелодии
cli ;запрет прерываний
push cs ;установка нового вектора
pop word ptr ds:[22h] ;прерываний 8h в таблицу
mov word ptr ds:[20h],offset int8 ;векторов
sti ;разрешение прерываний
nosound: ;
pop ds ;вытолкнуть из стека
pop ax ;ds и ax
iret ;возврат из прерывания
;----------------------------------------------------------------------------
;------ подпрограмма проигрывания мелодии -----------------------------------
;----------------------------------------------------------------------------
melody proc near ;
push bx ;сохранить регистры
push dx ;bx, dx, si, ds
push si ;
push ds ;
push cs ;
pop ds ;ds = cs
in al,61h ;чтение порта 61h
or al,00000011b ;установка двух младших битов
out 61h,al ;запись в порт 61h значения
mov si,offset freq ;в si смещение мелодии
mov al,0b6h ;инициализация канала 2
out 43h,al ;таймера
next_n: ;
lodsw ;загрузить частоту ноты в ax
cmp al,0ffh ;сравнить с концом мелодии
je no_more ;если да, то переход
out 42h,al ;младший байт частоты
mov al,ah ;
out 42h,al ;старший байт частоты
mov ah,0 ;
int 1ah ;получить значение счетчика
lodsb ;длину очередной ноты в al
mov bx,dx ;младшее слово счетчика
add bx,ax ;определяем момент окончания
still_s: ;
mov ah,0 ;
int 1ah ;получить значение счетчика
cmp dx,bx ;если не равно то
jne still_s ;переход (ожидание)
jmp short next_n ;загрузка следующей ноты
no_more: ;
in al,61h ;выключить динамик
and al,0fch ;
out 61h,al ;
pop ds ;вытолкнуть из стека
pop si ;ds, si, dx, bx
pop dx ;
pop bx ;
ret ;возврат из подпрограммы
melody endp ;конец подпрограммы
;----------------------------------------------------------------------------
;------ блок данных для проигрывания мелодии --------------------------------
;----------------------------------------------------------------------------
freq db 23h,0eh,9,0e3h,0bh,9,6fh,9,9,0e3h,0bh,9,97h,0ah,18
db 0e3h,0bh,9,98h,0ch,9,6fh,9,18,97h,0ah,18,23h,0eh,18
db 54h,0,18,0e8h,8,3,54h,0,15,0e8h,8,3,54h,0,15,0e8h,8,3
db 54h,0,15,0e8h,8,3,54h,0,15,0e8h,8,3,54h,0,15,0e8h,8,9,0ffh
;----------------------------------------------------------------------------
inst: ;инициализация
mov ax,3508h ;занести вектор прерывания
int 21h ;8h в подготовленную ячейку
mov word ptr [old8o],bx ;памяти
mov word ptr [old8s],es ;
cli ;запрет прерываний
lea dx,int8 ;загрузить новый обработчик
mov ax,2508h ;прерывания
int 21h ;
sti ;разрешение прерываний
lea dx,inst ;адрес конца программы
int 27h ;выйти в ДОС оставив в
end start ;резиденте обработчик
;прерывания 8h
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_1775.asm | ljhsiun2/medusa | 9 | 95480 | <reponame>ljhsiun2/medusa<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x3b61, %r11
nop
nop
nop
cmp %rax, %rax
movl $0x61626364, (%r11)
nop
nop
xor $11639, %r14
lea addresses_WT_ht+0x40a1, %r15
nop
nop
nop
xor $22522, %r10
mov (%r15), %dx
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_WC_ht+0xaca1, %r10
nop
nop
nop
inc %r9
mov $0x6162636465666768, %rax
movq %rax, %xmm5
movups %xmm5, (%r10)
nop
nop
xor $43304, %rax
lea addresses_UC_ht+0x9419, %rsi
lea addresses_A_ht+0x49f1, %rdi
nop
nop
nop
nop
cmp %r10, %r10
mov $7, %rcx
rep movsq
nop
nop
inc %r11
lea addresses_normal_ht+0x10a1, %rsi
lea addresses_WT_ht+0x14821, %rdi
nop
cmp %r15, %r15
mov $76, %rcx
rep movsq
dec %r14
lea addresses_normal_ht+0x5aa1, %r14
and $57076, %r11
mov $0x6162636465666768, %rdi
movq %rdi, (%r14)
nop
cmp $47012, %r10
lea addresses_A_ht+0x3761, %r15
dec %rdi
mov (%r15), %ax
nop
nop
nop
sub $35781, %r14
lea addresses_WT_ht+0x54a1, %rsi
lea addresses_UC_ht+0x1c4a1, %rdi
nop
nop
sub %rax, %rax
mov $86, %rcx
rep movsb
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_D_ht+0x10921, %rcx
nop
nop
nop
sub %r9, %r9
movups (%rcx), %xmm5
vpextrq $1, %xmm5, %rdx
nop
nop
nop
nop
cmp $16638, %r11
lea addresses_A_ht+0xfc5d, %rsi
lea addresses_A_ht+0x184a9, %rdi
nop
nop
nop
nop
nop
sub %r14, %r14
mov $37, %rcx
rep movsw
nop
nop
nop
and %rax, %rax
lea addresses_D_ht+0x178f1, %r9
cmp %r14, %r14
and $0xffffffffffffffc0, %r9
movaps (%r9), %xmm7
vpextrq $0, %xmm7, %rdx
nop
nop
nop
nop
sub %r14, %r14
lea addresses_WC_ht+0x6751, %r10
nop
nop
nop
nop
cmp $46166, %r14
movb (%r10), %cl
nop
and %rsi, %rsi
lea addresses_UC_ht+0x5c21, %rsi
nop
inc %r14
and $0xffffffffffffffc0, %rsi
movaps (%rsi), %xmm3
vpextrq $0, %xmm3, %r11
and %r9, %r9
lea addresses_D_ht+0x15ca1, %r15
clflush (%r15)
nop
nop
nop
and $38678, %rdx
mov (%r15), %ecx
and $31314, %r10
lea addresses_WT_ht+0x12fa1, %rsi
lea addresses_WT_ht+0xd4a1, %rdi
nop
nop
nop
nop
cmp $32987, %rdx
mov $7, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %r15, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r9
push %rbp
push %rcx
push %rsi
// Store
lea addresses_WT+0x1b0a1, %rbp
nop
nop
nop
sub %r14, %r14
movl $0x51525354, (%rbp)
nop
nop
xor $12587, %rsi
// Store
lea addresses_normal+0x5ba9, %rcx
nop
nop
and $39653, %r11
movl $0x51525354, (%rcx)
// Exception!!!
nop
nop
nop
mov (0), %r14
nop
nop
inc %r9
// Store
mov $0x3106910000000fb9, %r11
nop
nop
nop
nop
and %r9, %r9
movl $0x51525354, (%r11)
add %rsi, %rsi
// Store
mov $0x243f600000000871, %rsi
and $54798, %r9
mov $0x5152535455565758, %r14
movq %r14, %xmm6
vmovntdq %ymm6, (%rsi)
nop
nop
nop
nop
and %r14, %r14
// Faulty Load
lea addresses_WT+0x1b0a1, %r14
nop
nop
xor %rsi, %rsi
mov (%r14), %cx
lea oracles, %rbp
and $0xff, %rcx
shlq $12, %rcx
mov (%rbp,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_normal', 'AVXalign': True, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_NC', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 2, 'type': 'addresses_NC', 'AVXalign': False, 'size': 32}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 4}}
{'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 8, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 8}}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'src': {'NT': True, 'same': False, 'congruent': 2, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': True, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 6, 'type': 'addresses_WT_ht'}}
{'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
*/
|
BigNum/Mod/Base/_bn_square_basecase.asm | FloydZ/Crypto-Hash | 11 | 92012 | <reponame>FloydZ/Crypto-Hash
.686
.model flat,stdcall
option casemap:none
include .\bnlib.inc
include .\bignum.inc
.code
;; esi=bnX
;; edi=Prod
;; School boy
_bn_square_basecase proc c; uses all
push ebp
xor ebx,ebx
.repeat
mov eax,[esi].BN.dwArray[ebx*4-4+4]
mul eax
xor ebp,ebp
add [edi].BN.dwArray[ebx*4-4+4],eax
adc [edi].BN.dwArray[ebx*4-4+8],edx
adc [edi].BN.dwArray[ebx*4-4+12],ebp
lea ecx,[ebx+1]
jmp @F
.repeat
mov eax,[esi].BN.dwArray[ebx*4-4+4]
xor ebp,ebp
mul [esi].BN.dwArray[ecx*4-4+4]
add eax,eax
adc edx,edx
adc ebp,ebp
add [edi].BN.dwArray[ecx*4-4+4],eax
adc [edi].BN.dwArray[ecx*4-4+8],edx
adc [edi].BN.dwArray[ecx*4-4+12],ebp
inc ecx
@@: .until ecx >= [esi].BN.dwSize
add edi,4
inc ebx
.until ebx >= [esi].BN.dwSize
pop ebp
ret
_bn_square_basecase endp
end |
src/grammars/Pre.g4 | CorvusPrudens/Corax | 0 | 2478 | grammar Pre;
parse : anything* EOF?;
anything : directive #topDirective
| anything_else+ #topAny
;
directive : include_
| if_
| ifdef_
| ifndef_
| define_
| undef_
| line_
| error_
| empty_
;
include_ : INCLUDE STRING NEWLINE #string
| INCLUDE LIBRARY NEWLINE #library
;
if_ : IF anything_expr NEWLINE anything* elif_* else_? endif_;
elif_ : ELIF anything_expr NEWLINE anything*;
ifdef_ : IFDEF NAME NEWLINE anything* else_? endif_;
ifndef_ : IFNDEF NAME NEWLINE anything* else_? endif_;
else_ : ELSE NEWLINE anything*;
endif_ : ENDIF end;
define_ : DEFINE NAME anything_expr? end #object
| DEFINE NAME LP NAME (COMMA NAME)* COMMA? RP anything_expr? end #function
;
undef_ : UNDEF NAME end;
line_ : LINE number end;
error_ : ERROR STRING end;
pragma_ : PRAGMA anything* end;
empty_ : HASH end;
// These should be converted into simply
// decimal ints and floats for easy compilation
number : DEC #dec
| BIN #bin
| HEX #hex
| OCT #oct
| FLT #flt
| SCI #sci
;
anything_expr : anything_opt+;
anything_opt : DEFINED NAME #anyPass
| DEFINED LP NAME RP #anyPass
| NAME #anyName
| LP #anyPass
| RP #anyPass
| PP #anyPass
| number #anyNum
| STRING #anyPass
| HASH #anyPass
| HASH_DOUBLE #anyPass
| COMMA #anyPass
;
anything_else : anything_expr? NEWLINE #anyNewline
| anything_expr #anyEof
;
end : NEWLINE | EOF;
// lexy
ESCAPED_NEW : '\\' '\r'? '\n' -> skip;
NEWLINE : '\r'? '\n';
STRING : '"' (~["\r\n] | '""' | '\\"')* '"';
LIBRARY : '<' [a-zA-Z_0-9./\-]+ '>';
COMMENT : '//' ~[\n\r]* [\n\r] -> channel(HIDDEN);
COMMENT_BLOCK : '/*' .*? '*/' -> channel(HIDDEN);
TEST_BLOCK : '$' .*? '$end' -> skip;
INCLUDE : '#include';
IF : '#if';
IFDEF : '#ifdef';
IFNDEF : '#ifndef';
ELSE : '#else';
ENDIF : '#endif';
DEFINE : '#define';
ERROR : '#error';
ELIF : '#elif';
UNDEF : '#undef';
LINE : '#line';
PRAGMA : '#pragma';
HASH : '#';
HASH_DOUBLE : '##';
DEFINED : 'defined';
LP : '(';
RP : ')';
COMMA : ',';
NAME : [a-zA-Z_][a-zA-Z_0-9]*;
DEC : [1-9][0-9_]* | '0';
HEX : '0x'[0-9A-Fa-f][0-9A-Fa-f_]*;
BIN : '0b'[0-1][0-1_]*;
OCT : '0'[0-7]+;
FLT : ([1-9][0-9_]* | '0') '.' ([1-9][0-9_]* | '0');
fragment FD : ([1-9][0-9]* | '0') '.'?
| ([1-9][0-9]* | '0') '.' ([1-9][0-9]* | '0')
| '.' ([1-9][0-9]* | '0')
;
SCI : FD 'e' '-'? [0-9]+;
WHITESPACE : [ \t]+ -> channel(HIDDEN);
PP : .+?; |
FormalAnalyzer/models/apps/ReadyForRain.als | Mohannadcse/IoTCOM_BehavioralRuleExtractor | 0 | 3629 | module app_ReadyForRain
open IoTBottomUp as base
open cap_contactSensor
one sig app_ReadyForRain extends IoTApp {
state : one cap_state,
sensors : some cap_contactSensor,
} {
rules = r
}
one sig cap_state extends Capability {} {
attributes = cap_state_attr
}
abstract sig cap_state_attr extends Attribute {}
one sig cap_state_attr_lastMessage extends cap_state_attr {} {
values = cap_state_attr_lastMessage_val
}
abstract sig cap_state_attr_lastMessage_val extends AttrValue {}
one sig cap_state_attr_lastMessage_val_0 extends cap_state_attr_lastMessage_val {}
one sig cap_state_attr_lastCheck extends cap_state_attr {} {
values = cap_state_attr_lastMessage_val
}
abstract sig cap_state_attr_lastCheck_val extends AttrValue {}
one sig cap_state_attr_lastCheck_val_result extends cap_state_attr_lastCheck_val {}
// application rules base class
abstract sig r extends Rule {}
one sig r0 extends r {}{
triggers = r0_trig
conditions = r0_cond
commands = r0_comm
}
abstract sig r0_trig extends Trigger {}
one sig r0_trig0 extends r0_trig {} {
capabilities = app_ReadyForRain.sensors
attribute = cap_contactSensor_attr_contact
value = cap_contactSensor_attr_contact_val_open
}
abstract sig r0_cond extends Condition {}
abstract sig r0_comm extends Command {}
one sig r0_comm0 extends r0_comm {} {
capability = app_ReadyForRain.state
attribute = cap_state_attr_lastMessage
value = cap_state_attr_lastMessage_val
}
one sig r1 extends r {}{
triggers = r1_trig
conditions = r1_cond
commands = r1_comm
}
abstract sig r1_trig extends Trigger {}
one sig r1_trig0 extends r1_trig {} {
capabilities = app_ReadyForRain.sensors
attribute = cap_contactSensor_attr_contact
value = cap_contactSensor_attr_contact_val_open
}
abstract sig r1_cond extends Condition {}
one sig r1_cond0 extends r1_cond {} {
capabilities = app_ReadyForRain.state
attribute = cap_state_attr_lastCheck
value = cap_state_attr_lastCheck_val_result
}
abstract sig r1_comm extends Command {}
one sig r1_comm0 extends r1_comm {} {
capability = app_ReadyForRain.state
attribute = cap_state_attr_lastMessage
value = cap_state_attr_lastMessage_val
}
|
u7-common/constants.asm | JohnGlassmyer/UltimaHacks | 68 | 243895 | <reponame>JohnGlassmyer/UltimaHacks
; =============================================================================
; enumerations
; -----------------------------------------------------------------------------
%assign FindItemFlagBit_1 1
%assign FindItemFlagBit_2 2
%assign FindItemFlagBit_ONLY_NPCS 4
%assign FindItemFlagBit_ONLY_ALIVE_NPCS 8
%assign FindItemFlagBit_INCLUDE_EGGS 16
%assign FindItemFlagBit_NO_NPCS 32
%assign FindItemFlagBit_64 64
%assign FindItemFlagBit_128 128
%assign Font_YELLOW 0
%assign Font_WOODEN_RUNIC 1
%assign Font_SMALL_BLACK 2
%assign Font_WHITE_RUNIC_OUTLINE 3
%assign Font_TINY_BLACK 4
%assign Font_TINY_GLOWING_BLUE 5
%assign Font_YELLOW_RUNIC_OUTLINE 6
%assign Font_RED 7
%assign ItemLabelType_NAME 0
%assign ItemLabelType_WEIGHT 1
%assign ItemLabelType_BULK 2
%assign ItemClassBit_NPC 0x100
%assign KeyboardShiftBit_RIGHT_SHIFT 1
%assign KeyboardShiftBit_LEFT_SHIFT 2
%assign KeyboardShiftBit_CTRL 4
%assign KeyboardShiftBit_ALT 8
%assign KeyboardShiftBit_SCROLL_LOCK 16
%assign KeyboardShiftBit_NUM_LOCK 32
%assign KeyboardShiftBit_CAPS_LOCK 64
%assign KeyboardShiftBit_INSERT 128
%assign MouseAction_NONE 0
%assign MouseAction_PRESS 1
%assign MouseAction_DOUBLE_CLICK 2
%assign MouseAction_RELEASE 3
%assign MouseAction_MOVE 4
%assign MouseRawAction_NONE 0
%assign MouseRawAction_PRESS 1
%assign MouseRawAction_RELEASE 2
%assign TextAlignment_LEFT 0
%assign TextAlignment_TOP 0
%assign TextAlignment_HORIZONTAL_CENTER 1
%assign TextAlignment_VERTICAL_CENTER 2
%assign TextAlignment_RIGHT 4
%assign TextAlignment_BOTTOM 8
; =============================================================================
; structure offsets
; -----------------------------------------------------------------------------
%assign BarkText_timeCounter 0x16
%assign Camera_isViewDarkened 1
%assign CastByKey_isCastingInProgress 0x00
%assign CastByKey_pn_timer 0x02
%assign CastByKey_selectedRuneCount 0x04
%assign CastByKey_selectedRunes 0x08
%assign CastByKey_runeStrings 0x10
%assign CastByKey_spellRunes CastByKey_runeStrings + 30 * 8
%assign CastByKey_SIZE CastByKey_spellRunes + 100 * 8
%assign ConversationGump_optionsGump 0x0E
%assign ConversationOptions_head 0x0E
%assign ConversationOptions_SIZE 0x12
%assign ConversationOptionsGump_xyBounds 0x0E
%assign ConversationOptionCoords_x 0
%assign ConversationOptionCoords_line 1
%assign FindItemQuery_ibo 0x00
%assign FindItemQuery_SIZE 0x2A
%assign InventoryArea_ibo 0x000
%assign InventoryArea_draggedIbo 0x002
%assign InventoryArea_worldX 0x004
%assign InventoryArea_worldY 0x006
%assign InventoryArea_worldZ 0x008
%assign InventoryArea_pn_vtable 0x00C
%assign InventoryArea_setByDropDraggedItem 0x00E
%assign InventoryArea_vtable 0x010
%assign InventoryArea_f00_drawTree 0x049
%assign InventoryArea_f04_getIbo 0x050
%assign InventoryArea_f05_tryToAccept 0x060
%assign InventoryArea_f06_getDraggedIbo 0x0F0
%assign InventoryArea_f07_getX1 0x110
%assign InventoryArea_f08_getY1 0x110
%assign InventoryArea_f09_getX2 0x110
%assign InventoryArea_f10_getY2 0x110
%assign InventoryArea_f11_recordXOffset 0x110
%assign InventoryArea_f12_recordYOffset 0x110
%assign InventoryArea_SIZE 0x120
%assign List_pn_head 0
%assign List_pn_tail 2
%assign List_SIZE 4
%assign ListNode_pn_next 0
%assign ListNode_pn_prev 2
%assign ListNode_payload 6
%assign MouseState_rawAction 0 ; db
%assign MouseState_button 1 ; db
%assign MouseState_xx 2 ; dw
%assign MouseState_y 4 ; dw
%assign MouseState_buttonBits 6 ; db
%assign MouseState_action 7 ; db
%assign MouseState_time 8 ; dd
%assign ShapeBark_shape 0x00
%assign ShapeBark_frame 0x02
%assign ShapeBark_x 0x04
%assign ShapeBark_y 0x06
%assign ShapeBark_pn_vtableA 0x08
%assign ShapeBark_pn_vtableB 0x0C
%assign ShapeBark_field0E 0x0E
%assign ShapeBark_stringWithLength 0x12
%assign ShapeBark_timer 0x16
%assign ShapeBark_vtableA 0x1E
%assign ShapeBark_vtableB 0x22
%assign ShapeBark_a00_destroy 0x26
%assign ShapeBark_b00_drawTree 0x27
%assign ShapeBark_SIZE 0x60
%assign ShapeGump_x 0x0E
%assign ShapeGump_y 0x10
%assign ShapeGump_shape 0x12
%assign ShapeGump_frame 0x14
%assign Sprite_ibo 0x0B
%assign TextPrinter_x 0x0
%assign TextPrinter_y 0x2
%assign TextPrinter_charSpacing 0x4
%assign TextPrinter_lineSpacing 0x6
%assign TextPrinter_pn_viewport 0x8
%assign TextPrinter_pn_vtable 0xA
%assign TextPrinter_field_0C 0xC
%assign TextPrinter_field_0E 0xE
%assign XyBounds_minX 0
%assign XyBounds_minY 2
%assign XyBounds_maxX 4
%assign XyBounds_maxY 6
; =============================================================================
; other constants
; -----------------------------------------------------------------------------
%assign VOODOO_SELECTOR 0
|
labcodes/lab1/obj/kernel.asm | linfan255/os_dev | 0 | 164830 |
bin/kernel: 文件格式 elf32-i386
Disassembly of section .text:
00100000 <kern_init>:
int kern_init(void) __attribute__((noreturn));
void grade_backtrace(void);
static void lab1_switch_test(void);
int
kern_init(void) {
100000: 55 push %ebp
100001: 89 e5 mov %esp,%ebp
100003: 83 ec 28 sub $0x28,%esp
extern char edata[], end[];
memset(edata, 0, end - edata);
100006: ba 20 fd 10 00 mov $0x10fd20,%edx
10000b: b8 16 ea 10 00 mov $0x10ea16,%eax
100010: 29 c2 sub %eax,%edx
100012: 89 d0 mov %edx,%eax
100014: 89 44 24 08 mov %eax,0x8(%esp)
100018: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
10001f: 00
100020: c7 04 24 16 ea 10 00 movl $0x10ea16,(%esp)
100027: e8 49 32 00 00 call 103275 <memset>
cons_init(); // init the console
10002c: e8 3f 15 00 00 call 101570 <cons_init>
const char *message = "(THU.CST) os is loading ...";
100031: c7 45 f4 00 34 10 00 movl $0x103400,-0xc(%ebp)
cprintf("%s\n\n", message);
100038: 8b 45 f4 mov -0xc(%ebp),%eax
10003b: 89 44 24 04 mov %eax,0x4(%esp)
10003f: c7 04 24 1c 34 10 00 movl $0x10341c,(%esp)
100046: e8 c7 02 00 00 call 100312 <cprintf>
print_kerninfo();
10004b: e8 f6 07 00 00 call 100846 <print_kerninfo>
grade_backtrace();
100050: e8 86 00 00 00 call 1000db <grade_backtrace>
pmm_init(); // init physical memory management
100055: e8 61 28 00 00 call 1028bb <pmm_init>
pic_init(); // init interrupt controller
10005a: e8 54 16 00 00 call 1016b3 <pic_init>
idt_init(); // init interrupt descriptor table
10005f: e8 a6 17 00 00 call 10180a <idt_init>
clock_init(); // init clock interrupt
100064: e8 fa 0c 00 00 call 100d63 <clock_init>
intr_enable(); // enable irq interrupt
100069: e8 b3 15 00 00 call 101621 <intr_enable>
//LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
// user/kernel mode switch test
//lab1_switch_test();
/* do nothing */
while (1);
10006e: eb fe jmp 10006e <kern_init+0x6e>
00100070 <grade_backtrace2>:
}
void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
100070: 55 push %ebp
100071: 89 e5 mov %esp,%ebp
100073: 83 ec 18 sub $0x18,%esp
mon_backtrace(0, NULL, NULL);
100076: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
10007d: 00
10007e: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
100085: 00
100086: c7 04 24 00 00 00 00 movl $0x0,(%esp)
10008d: e8 03 0c 00 00 call 100c95 <mon_backtrace>
}
100092: c9 leave
100093: c3 ret
00100094 <grade_backtrace1>:
void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
100094: 55 push %ebp
100095: 89 e5 mov %esp,%ebp
100097: 53 push %ebx
100098: 83 ec 14 sub $0x14,%esp
grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
10009b: 8d 5d 0c lea 0xc(%ebp),%ebx
10009e: 8b 4d 0c mov 0xc(%ebp),%ecx
1000a1: 8d 55 08 lea 0x8(%ebp),%edx
1000a4: 8b 45 08 mov 0x8(%ebp),%eax
1000a7: 89 5c 24 0c mov %ebx,0xc(%esp)
1000ab: 89 4c 24 08 mov %ecx,0x8(%esp)
1000af: 89 54 24 04 mov %edx,0x4(%esp)
1000b3: 89 04 24 mov %eax,(%esp)
1000b6: e8 b5 ff ff ff call 100070 <grade_backtrace2>
}
1000bb: 83 c4 14 add $0x14,%esp
1000be: 5b pop %ebx
1000bf: 5d pop %ebp
1000c0: c3 ret
001000c1 <grade_backtrace0>:
void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
1000c1: 55 push %ebp
1000c2: 89 e5 mov %esp,%ebp
1000c4: 83 ec 18 sub $0x18,%esp
grade_backtrace1(arg0, arg2);
1000c7: 8b 45 10 mov 0x10(%ebp),%eax
1000ca: 89 44 24 04 mov %eax,0x4(%esp)
1000ce: 8b 45 08 mov 0x8(%ebp),%eax
1000d1: 89 04 24 mov %eax,(%esp)
1000d4: e8 bb ff ff ff call 100094 <grade_backtrace1>
}
1000d9: c9 leave
1000da: c3 ret
001000db <grade_backtrace>:
void
grade_backtrace(void) {
1000db: 55 push %ebp
1000dc: 89 e5 mov %esp,%ebp
1000de: 83 ec 18 sub $0x18,%esp
grade_backtrace0(0, (int)kern_init, 0xffff0000);
1000e1: b8 00 00 10 00 mov $0x100000,%eax
1000e6: c7 44 24 08 00 00 ff movl $0xffff0000,0x8(%esp)
1000ed: ff
1000ee: 89 44 24 04 mov %eax,0x4(%esp)
1000f2: c7 04 24 00 00 00 00 movl $0x0,(%esp)
1000f9: e8 c3 ff ff ff call 1000c1 <grade_backtrace0>
}
1000fe: c9 leave
1000ff: c3 ret
00100100 <lab1_print_cur_status>:
static void
lab1_print_cur_status(void) {
100100: 55 push %ebp
100101: 89 e5 mov %esp,%ebp
100103: 83 ec 28 sub $0x28,%esp
static int round = 0;
uint16_t reg1, reg2, reg3, reg4;
asm volatile (
100106: 8c 4d f6 mov %cs,-0xa(%ebp)
100109: 8c 5d f4 mov %ds,-0xc(%ebp)
10010c: 8c 45 f2 mov %es,-0xe(%ebp)
10010f: 8c 55 f0 mov %ss,-0x10(%ebp)
"mov %%cs, %0;"
"mov %%ds, %1;"
"mov %%es, %2;"
"mov %%ss, %3;"
: "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
cprintf("%d: @ring %d\n", round, reg1 & 3);
100112: 0f b7 45 f6 movzwl -0xa(%ebp),%eax
100116: 0f b7 c0 movzwl %ax,%eax
100119: 83 e0 03 and $0x3,%eax
10011c: 89 c2 mov %eax,%edx
10011e: a1 20 ea 10 00 mov 0x10ea20,%eax
100123: 89 54 24 08 mov %edx,0x8(%esp)
100127: 89 44 24 04 mov %eax,0x4(%esp)
10012b: c7 04 24 21 34 10 00 movl $0x103421,(%esp)
100132: e8 db 01 00 00 call 100312 <cprintf>
cprintf("%d: cs = %x\n", round, reg1);
100137: 0f b7 45 f6 movzwl -0xa(%ebp),%eax
10013b: 0f b7 d0 movzwl %ax,%edx
10013e: a1 20 ea 10 00 mov 0x10ea20,%eax
100143: 89 54 24 08 mov %edx,0x8(%esp)
100147: 89 44 24 04 mov %eax,0x4(%esp)
10014b: c7 04 24 2f 34 10 00 movl $0x10342f,(%esp)
100152: e8 bb 01 00 00 call 100312 <cprintf>
cprintf("%d: ds = %x\n", round, reg2);
100157: 0f b7 45 f4 movzwl -0xc(%ebp),%eax
10015b: 0f b7 d0 movzwl %ax,%edx
10015e: a1 20 ea 10 00 mov 0x10ea20,%eax
100163: 89 54 24 08 mov %edx,0x8(%esp)
100167: 89 44 24 04 mov %eax,0x4(%esp)
10016b: c7 04 24 3d 34 10 00 movl $0x10343d,(%esp)
100172: e8 9b 01 00 00 call 100312 <cprintf>
cprintf("%d: es = %x\n", round, reg3);
100177: 0f b7 45 f2 movzwl -0xe(%ebp),%eax
10017b: 0f b7 d0 movzwl %ax,%edx
10017e: a1 20 ea 10 00 mov 0x10ea20,%eax
100183: 89 54 24 08 mov %edx,0x8(%esp)
100187: 89 44 24 04 mov %eax,0x4(%esp)
10018b: c7 04 24 4b 34 10 00 movl $0x10344b,(%esp)
100192: e8 7b 01 00 00 call 100312 <cprintf>
cprintf("%d: ss = %x\n", round, reg4);
100197: 0f b7 45 f0 movzwl -0x10(%ebp),%eax
10019b: 0f b7 d0 movzwl %ax,%edx
10019e: a1 20 ea 10 00 mov 0x10ea20,%eax
1001a3: 89 54 24 08 mov %edx,0x8(%esp)
1001a7: 89 44 24 04 mov %eax,0x4(%esp)
1001ab: c7 04 24 59 34 10 00 movl $0x103459,(%esp)
1001b2: e8 5b 01 00 00 call 100312 <cprintf>
round ++;
1001b7: a1 20 ea 10 00 mov 0x10ea20,%eax
1001bc: 83 c0 01 add $0x1,%eax
1001bf: a3 20 ea 10 00 mov %eax,0x10ea20
}
1001c4: c9 leave
1001c5: c3 ret
001001c6 <lab1_switch_to_user>:
static void
lab1_switch_to_user(void) {
1001c6: 55 push %ebp
1001c7: 89 e5 mov %esp,%ebp
//LAB1 CHALLENGE 1 : TODO
}
1001c9: 5d pop %ebp
1001ca: c3 ret
001001cb <lab1_switch_to_kernel>:
static void
lab1_switch_to_kernel(void) {
1001cb: 55 push %ebp
1001cc: 89 e5 mov %esp,%ebp
//LAB1 CHALLENGE 1 : TODO
}
1001ce: 5d pop %ebp
1001cf: c3 ret
001001d0 <lab1_switch_test>:
static void
lab1_switch_test(void) {
1001d0: 55 push %ebp
1001d1: 89 e5 mov %esp,%ebp
1001d3: 83 ec 18 sub $0x18,%esp
lab1_print_cur_status();
1001d6: e8 25 ff ff ff call 100100 <lab1_print_cur_status>
cprintf("+++ switch to user mode +++\n");
1001db: c7 04 24 68 34 10 00 movl $0x103468,(%esp)
1001e2: e8 2b 01 00 00 call 100312 <cprintf>
lab1_switch_to_user();
1001e7: e8 da ff ff ff call 1001c6 <lab1_switch_to_user>
lab1_print_cur_status();
1001ec: e8 0f ff ff ff call 100100 <lab1_print_cur_status>
cprintf("+++ switch to kernel mode +++\n");
1001f1: c7 04 24 88 34 10 00 movl $0x103488,(%esp)
1001f8: e8 15 01 00 00 call 100312 <cprintf>
lab1_switch_to_kernel();
1001fd: e8 c9 ff ff ff call 1001cb <lab1_switch_to_kernel>
lab1_print_cur_status();
100202: e8 f9 fe ff ff call 100100 <lab1_print_cur_status>
}
100207: c9 leave
100208: c3 ret
00100209 <readline>:
* The readline() function returns the text of the line read. If some errors
* are happened, NULL is returned. The return value is a global variable,
* thus it should be copied before it is used.
* */
char *
readline(const char *prompt) {
100209: 55 push %ebp
10020a: 89 e5 mov %esp,%ebp
10020c: 83 ec 28 sub $0x28,%esp
if (prompt != NULL) {
10020f: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
100213: 74 13 je 100228 <readline+0x1f>
cprintf("%s", prompt);
100215: 8b 45 08 mov 0x8(%ebp),%eax
100218: 89 44 24 04 mov %eax,0x4(%esp)
10021c: c7 04 24 a7 34 10 00 movl $0x1034a7,(%esp)
100223: e8 ea 00 00 00 call 100312 <cprintf>
}
int i = 0, c;
100228: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
while (1) {
c = getchar();
10022f: e8 66 01 00 00 call 10039a <getchar>
100234: 89 45 f0 mov %eax,-0x10(%ebp)
if (c < 0) {
100237: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
10023b: 79 07 jns 100244 <readline+0x3b>
return NULL;
10023d: b8 00 00 00 00 mov $0x0,%eax
100242: eb 79 jmp 1002bd <readline+0xb4>
}
else if (c >= ' ' && i < BUFSIZE - 1) {
100244: 83 7d f0 1f cmpl $0x1f,-0x10(%ebp)
100248: 7e 28 jle 100272 <readline+0x69>
10024a: 81 7d f4 fe 03 00 00 cmpl $0x3fe,-0xc(%ebp)
100251: 7f 1f jg 100272 <readline+0x69>
cputchar(c);
100253: 8b 45 f0 mov -0x10(%ebp),%eax
100256: 89 04 24 mov %eax,(%esp)
100259: e8 da 00 00 00 call 100338 <cputchar>
buf[i ++] = c;
10025e: 8b 45 f4 mov -0xc(%ebp),%eax
100261: 8d 50 01 lea 0x1(%eax),%edx
100264: 89 55 f4 mov %edx,-0xc(%ebp)
100267: 8b 55 f0 mov -0x10(%ebp),%edx
10026a: 88 90 40 ea 10 00 mov %dl,0x10ea40(%eax)
100270: eb 46 jmp 1002b8 <readline+0xaf>
}
else if (c == '\b' && i > 0) {
100272: 83 7d f0 08 cmpl $0x8,-0x10(%ebp)
100276: 75 17 jne 10028f <readline+0x86>
100278: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
10027c: 7e 11 jle 10028f <readline+0x86>
cputchar(c);
10027e: 8b 45 f0 mov -0x10(%ebp),%eax
100281: 89 04 24 mov %eax,(%esp)
100284: e8 af 00 00 00 call 100338 <cputchar>
i --;
100289: 83 6d f4 01 subl $0x1,-0xc(%ebp)
10028d: eb 29 jmp 1002b8 <readline+0xaf>
}
else if (c == '\n' || c == '\r') {
10028f: 83 7d f0 0a cmpl $0xa,-0x10(%ebp)
100293: 74 06 je 10029b <readline+0x92>
100295: 83 7d f0 0d cmpl $0xd,-0x10(%ebp)
100299: 75 1d jne 1002b8 <readline+0xaf>
cputchar(c);
10029b: 8b 45 f0 mov -0x10(%ebp),%eax
10029e: 89 04 24 mov %eax,(%esp)
1002a1: e8 92 00 00 00 call 100338 <cputchar>
buf[i] = '\0';
1002a6: 8b 45 f4 mov -0xc(%ebp),%eax
1002a9: 05 40 ea 10 00 add $0x10ea40,%eax
1002ae: c6 00 00 movb $0x0,(%eax)
return buf;
1002b1: b8 40 ea 10 00 mov $0x10ea40,%eax
1002b6: eb 05 jmp 1002bd <readline+0xb4>
}
}
1002b8: e9 72 ff ff ff jmp 10022f <readline+0x26>
}
1002bd: c9 leave
1002be: c3 ret
001002bf <cputch>:
/* *
* cputch - writes a single character @c to stdout, and it will
* increace the value of counter pointed by @cnt.
* */
static void
cputch(int c, int *cnt) {
1002bf: 55 push %ebp
1002c0: 89 e5 mov %esp,%ebp
1002c2: 83 ec 18 sub $0x18,%esp
cons_putc(c);
1002c5: 8b 45 08 mov 0x8(%ebp),%eax
1002c8: 89 04 24 mov %eax,(%esp)
1002cb: e8 cc 12 00 00 call 10159c <cons_putc>
(*cnt) ++;
1002d0: 8b 45 0c mov 0xc(%ebp),%eax
1002d3: 8b 00 mov (%eax),%eax
1002d5: 8d 50 01 lea 0x1(%eax),%edx
1002d8: 8b 45 0c mov 0xc(%ebp),%eax
1002db: 89 10 mov %edx,(%eax)
}
1002dd: c9 leave
1002de: c3 ret
001002df <vcprintf>:
*
* Call this function if you are already dealing with a va_list.
* Or you probably want cprintf() instead.
* */
int
vcprintf(const char *fmt, va_list ap) {
1002df: 55 push %ebp
1002e0: 89 e5 mov %esp,%ebp
1002e2: 83 ec 28 sub $0x28,%esp
int cnt = 0;
1002e5: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
vprintfmt((void*)cputch, &cnt, fmt, ap);
1002ec: 8b 45 0c mov 0xc(%ebp),%eax
1002ef: 89 44 24 0c mov %eax,0xc(%esp)
1002f3: 8b 45 08 mov 0x8(%ebp),%eax
1002f6: 89 44 24 08 mov %eax,0x8(%esp)
1002fa: 8d 45 f4 lea -0xc(%ebp),%eax
1002fd: 89 44 24 04 mov %eax,0x4(%esp)
100301: c7 04 24 bf 02 10 00 movl $0x1002bf,(%esp)
100308: e8 81 27 00 00 call 102a8e <vprintfmt>
return cnt;
10030d: 8b 45 f4 mov -0xc(%ebp),%eax
}
100310: c9 leave
100311: c3 ret
00100312 <cprintf>:
*
* The return value is the number of characters which would be
* written to stdout.
* */
int
cprintf(const char *fmt, ...) {
100312: 55 push %ebp
100313: 89 e5 mov %esp,%ebp
100315: 83 ec 28 sub $0x28,%esp
va_list ap;
int cnt;
va_start(ap, fmt);
100318: 8d 45 0c lea 0xc(%ebp),%eax
10031b: 89 45 f0 mov %eax,-0x10(%ebp)
cnt = vcprintf(fmt, ap);
10031e: 8b 45 f0 mov -0x10(%ebp),%eax
100321: 89 44 24 04 mov %eax,0x4(%esp)
100325: 8b 45 08 mov 0x8(%ebp),%eax
100328: 89 04 24 mov %eax,(%esp)
10032b: e8 af ff ff ff call 1002df <vcprintf>
100330: 89 45 f4 mov %eax,-0xc(%ebp)
va_end(ap);
return cnt;
100333: 8b 45 f4 mov -0xc(%ebp),%eax
}
100336: c9 leave
100337: c3 ret
00100338 <cputchar>:
/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
100338: 55 push %ebp
100339: 89 e5 mov %esp,%ebp
10033b: 83 ec 18 sub $0x18,%esp
cons_putc(c);
10033e: 8b 45 08 mov 0x8(%ebp),%eax
100341: 89 04 24 mov %eax,(%esp)
100344: e8 53 12 00 00 call 10159c <cons_putc>
}
100349: c9 leave
10034a: c3 ret
0010034b <cputs>:
/* *
* cputs- writes the string pointed by @str to stdout and
* appends a newline character.
* */
int
cputs(const char *str) {
10034b: 55 push %ebp
10034c: 89 e5 mov %esp,%ebp
10034e: 83 ec 28 sub $0x28,%esp
int cnt = 0;
100351: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
char c;
while ((c = *str ++) != '\0') {
100358: eb 13 jmp 10036d <cputs+0x22>
cputch(c, &cnt);
10035a: 0f be 45 f7 movsbl -0x9(%ebp),%eax
10035e: 8d 55 f0 lea -0x10(%ebp),%edx
100361: 89 54 24 04 mov %edx,0x4(%esp)
100365: 89 04 24 mov %eax,(%esp)
100368: e8 52 ff ff ff call 1002bf <cputch>
* */
int
cputs(const char *str) {
int cnt = 0;
char c;
while ((c = *str ++) != '\0') {
10036d: 8b 45 08 mov 0x8(%ebp),%eax
100370: 8d 50 01 lea 0x1(%eax),%edx
100373: 89 55 08 mov %edx,0x8(%ebp)
100376: 0f b6 00 movzbl (%eax),%eax
100379: 88 45 f7 mov %al,-0x9(%ebp)
10037c: 80 7d f7 00 cmpb $0x0,-0x9(%ebp)
100380: 75 d8 jne 10035a <cputs+0xf>
cputch(c, &cnt);
}
cputch('\n', &cnt);
100382: 8d 45 f0 lea -0x10(%ebp),%eax
100385: 89 44 24 04 mov %eax,0x4(%esp)
100389: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
100390: e8 2a ff ff ff call 1002bf <cputch>
return cnt;
100395: 8b 45 f0 mov -0x10(%ebp),%eax
}
100398: c9 leave
100399: c3 ret
0010039a <getchar>:
/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
10039a: 55 push %ebp
10039b: 89 e5 mov %esp,%ebp
10039d: 83 ec 18 sub $0x18,%esp
int c;
while ((c = cons_getc()) == 0)
1003a0: e8 20 12 00 00 call 1015c5 <cons_getc>
1003a5: 89 45 f4 mov %eax,-0xc(%ebp)
1003a8: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1003ac: 74 f2 je 1003a0 <getchar+0x6>
/* do nothing */;
return c;
1003ae: 8b 45 f4 mov -0xc(%ebp),%eax
}
1003b1: c9 leave
1003b2: c3 ret
001003b3 <stab_binsearch>:
* stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
* will exit setting left = 118, right = 554.
* */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
int type, uintptr_t addr) {
1003b3: 55 push %ebp
1003b4: 89 e5 mov %esp,%ebp
1003b6: 83 ec 20 sub $0x20,%esp
int l = *region_left, r = *region_right, any_matches = 0;
1003b9: 8b 45 0c mov 0xc(%ebp),%eax
1003bc: 8b 00 mov (%eax),%eax
1003be: 89 45 fc mov %eax,-0x4(%ebp)
1003c1: 8b 45 10 mov 0x10(%ebp),%eax
1003c4: 8b 00 mov (%eax),%eax
1003c6: 89 45 f8 mov %eax,-0x8(%ebp)
1003c9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
while (l <= r) {
1003d0: e9 d2 00 00 00 jmp 1004a7 <stab_binsearch+0xf4>
int true_m = (l + r) / 2, m = true_m;
1003d5: 8b 45 f8 mov -0x8(%ebp),%eax
1003d8: 8b 55 fc mov -0x4(%ebp),%edx
1003db: 01 d0 add %edx,%eax
1003dd: 89 c2 mov %eax,%edx
1003df: c1 ea 1f shr $0x1f,%edx
1003e2: 01 d0 add %edx,%eax
1003e4: d1 f8 sar %eax
1003e6: 89 45 ec mov %eax,-0x14(%ebp)
1003e9: 8b 45 ec mov -0x14(%ebp),%eax
1003ec: 89 45 f0 mov %eax,-0x10(%ebp)
// search for earliest stab with right type
while (m >= l && stabs[m].n_type != type) {
1003ef: eb 04 jmp 1003f5 <stab_binsearch+0x42>
m --;
1003f1: 83 6d f0 01 subl $0x1,-0x10(%ebp)
while (l <= r) {
int true_m = (l + r) / 2, m = true_m;
// search for earliest stab with right type
while (m >= l && stabs[m].n_type != type) {
1003f5: 8b 45 f0 mov -0x10(%ebp),%eax
1003f8: 3b 45 fc cmp -0x4(%ebp),%eax
1003fb: 7c 1f jl 10041c <stab_binsearch+0x69>
1003fd: 8b 55 f0 mov -0x10(%ebp),%edx
100400: 89 d0 mov %edx,%eax
100402: 01 c0 add %eax,%eax
100404: 01 d0 add %edx,%eax
100406: c1 e0 02 shl $0x2,%eax
100409: 89 c2 mov %eax,%edx
10040b: 8b 45 08 mov 0x8(%ebp),%eax
10040e: 01 d0 add %edx,%eax
100410: 0f b6 40 04 movzbl 0x4(%eax),%eax
100414: 0f b6 c0 movzbl %al,%eax
100417: 3b 45 14 cmp 0x14(%ebp),%eax
10041a: 75 d5 jne 1003f1 <stab_binsearch+0x3e>
m --;
}
if (m < l) { // no match in [l, m]
10041c: 8b 45 f0 mov -0x10(%ebp),%eax
10041f: 3b 45 fc cmp -0x4(%ebp),%eax
100422: 7d 0b jge 10042f <stab_binsearch+0x7c>
l = true_m + 1;
100424: 8b 45 ec mov -0x14(%ebp),%eax
100427: 83 c0 01 add $0x1,%eax
10042a: 89 45 fc mov %eax,-0x4(%ebp)
continue;
10042d: eb 78 jmp 1004a7 <stab_binsearch+0xf4>
}
// actual binary search
any_matches = 1;
10042f: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp)
if (stabs[m].n_value < addr) {
100436: 8b 55 f0 mov -0x10(%ebp),%edx
100439: 89 d0 mov %edx,%eax
10043b: 01 c0 add %eax,%eax
10043d: 01 d0 add %edx,%eax
10043f: c1 e0 02 shl $0x2,%eax
100442: 89 c2 mov %eax,%edx
100444: 8b 45 08 mov 0x8(%ebp),%eax
100447: 01 d0 add %edx,%eax
100449: 8b 40 08 mov 0x8(%eax),%eax
10044c: 3b 45 18 cmp 0x18(%ebp),%eax
10044f: 73 13 jae 100464 <stab_binsearch+0xb1>
*region_left = m;
100451: 8b 45 0c mov 0xc(%ebp),%eax
100454: 8b 55 f0 mov -0x10(%ebp),%edx
100457: 89 10 mov %edx,(%eax)
l = true_m + 1;
100459: 8b 45 ec mov -0x14(%ebp),%eax
10045c: 83 c0 01 add $0x1,%eax
10045f: 89 45 fc mov %eax,-0x4(%ebp)
100462: eb 43 jmp 1004a7 <stab_binsearch+0xf4>
} else if (stabs[m].n_value > addr) {
100464: 8b 55 f0 mov -0x10(%ebp),%edx
100467: 89 d0 mov %edx,%eax
100469: 01 c0 add %eax,%eax
10046b: 01 d0 add %edx,%eax
10046d: c1 e0 02 shl $0x2,%eax
100470: 89 c2 mov %eax,%edx
100472: 8b 45 08 mov 0x8(%ebp),%eax
100475: 01 d0 add %edx,%eax
100477: 8b 40 08 mov 0x8(%eax),%eax
10047a: 3b 45 18 cmp 0x18(%ebp),%eax
10047d: 76 16 jbe 100495 <stab_binsearch+0xe2>
*region_right = m - 1;
10047f: 8b 45 f0 mov -0x10(%ebp),%eax
100482: 8d 50 ff lea -0x1(%eax),%edx
100485: 8b 45 10 mov 0x10(%ebp),%eax
100488: 89 10 mov %edx,(%eax)
r = m - 1;
10048a: 8b 45 f0 mov -0x10(%ebp),%eax
10048d: 83 e8 01 sub $0x1,%eax
100490: 89 45 f8 mov %eax,-0x8(%ebp)
100493: eb 12 jmp 1004a7 <stab_binsearch+0xf4>
} else {
// exact match for 'addr', but continue loop to find
// *region_right
*region_left = m;
100495: 8b 45 0c mov 0xc(%ebp),%eax
100498: 8b 55 f0 mov -0x10(%ebp),%edx
10049b: 89 10 mov %edx,(%eax)
l = m;
10049d: 8b 45 f0 mov -0x10(%ebp),%eax
1004a0: 89 45 fc mov %eax,-0x4(%ebp)
addr ++;
1004a3: 83 45 18 01 addl $0x1,0x18(%ebp)
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
int type, uintptr_t addr) {
int l = *region_left, r = *region_right, any_matches = 0;
while (l <= r) {
1004a7: 8b 45 fc mov -0x4(%ebp),%eax
1004aa: 3b 45 f8 cmp -0x8(%ebp),%eax
1004ad: 0f 8e 22 ff ff ff jle 1003d5 <stab_binsearch+0x22>
l = m;
addr ++;
}
}
if (!any_matches) {
1004b3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
1004b7: 75 0f jne 1004c8 <stab_binsearch+0x115>
*region_right = *region_left - 1;
1004b9: 8b 45 0c mov 0xc(%ebp),%eax
1004bc: 8b 00 mov (%eax),%eax
1004be: 8d 50 ff lea -0x1(%eax),%edx
1004c1: 8b 45 10 mov 0x10(%ebp),%eax
1004c4: 89 10 mov %edx,(%eax)
1004c6: eb 3f jmp 100507 <stab_binsearch+0x154>
}
else {
// find rightmost region containing 'addr'
l = *region_right;
1004c8: 8b 45 10 mov 0x10(%ebp),%eax
1004cb: 8b 00 mov (%eax),%eax
1004cd: 89 45 fc mov %eax,-0x4(%ebp)
for (; l > *region_left && stabs[l].n_type != type; l --)
1004d0: eb 04 jmp 1004d6 <stab_binsearch+0x123>
1004d2: 83 6d fc 01 subl $0x1,-0x4(%ebp)
1004d6: 8b 45 0c mov 0xc(%ebp),%eax
1004d9: 8b 00 mov (%eax),%eax
1004db: 3b 45 fc cmp -0x4(%ebp),%eax
1004de: 7d 1f jge 1004ff <stab_binsearch+0x14c>
1004e0: 8b 55 fc mov -0x4(%ebp),%edx
1004e3: 89 d0 mov %edx,%eax
1004e5: 01 c0 add %eax,%eax
1004e7: 01 d0 add %edx,%eax
1004e9: c1 e0 02 shl $0x2,%eax
1004ec: 89 c2 mov %eax,%edx
1004ee: 8b 45 08 mov 0x8(%ebp),%eax
1004f1: 01 d0 add %edx,%eax
1004f3: 0f b6 40 04 movzbl 0x4(%eax),%eax
1004f7: 0f b6 c0 movzbl %al,%eax
1004fa: 3b 45 14 cmp 0x14(%ebp),%eax
1004fd: 75 d3 jne 1004d2 <stab_binsearch+0x11f>
/* do nothing */;
*region_left = l;
1004ff: 8b 45 0c mov 0xc(%ebp),%eax
100502: 8b 55 fc mov -0x4(%ebp),%edx
100505: 89 10 mov %edx,(%eax)
}
}
100507: c9 leave
100508: c3 ret
00100509 <debuginfo_eip>:
* the specified instruction address, @addr. Returns 0 if information
* was found, and negative if not. But even if it returns negative it
* has stored some information into '*info'.
* */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
100509: 55 push %ebp
10050a: 89 e5 mov %esp,%ebp
10050c: 83 ec 58 sub $0x58,%esp
const struct stab *stabs, *stab_end;
const char *stabstr, *stabstr_end;
info->eip_file = "<unknown>";
10050f: 8b 45 0c mov 0xc(%ebp),%eax
100512: c7 00 ac 34 10 00 movl $0x1034ac,(%eax)
info->eip_line = 0;
100518: 8b 45 0c mov 0xc(%ebp),%eax
10051b: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
info->eip_fn_name = "<unknown>";
100522: 8b 45 0c mov 0xc(%ebp),%eax
100525: c7 40 08 ac 34 10 00 movl $0x1034ac,0x8(%eax)
info->eip_fn_namelen = 9;
10052c: 8b 45 0c mov 0xc(%ebp),%eax
10052f: c7 40 0c 09 00 00 00 movl $0x9,0xc(%eax)
info->eip_fn_addr = addr;
100536: 8b 45 0c mov 0xc(%ebp),%eax
100539: 8b 55 08 mov 0x8(%ebp),%edx
10053c: 89 50 10 mov %edx,0x10(%eax)
info->eip_fn_narg = 0;
10053f: 8b 45 0c mov 0xc(%ebp),%eax
100542: c7 40 14 00 00 00 00 movl $0x0,0x14(%eax)
stabs = __STAB_BEGIN__;
100549: c7 45 f4 0c 3d 10 00 movl $0x103d0c,-0xc(%ebp)
stab_end = __STAB_END__;
100550: c7 45 f0 34 b4 10 00 movl $0x10b434,-0x10(%ebp)
stabstr = __STABSTR_BEGIN__;
100557: c7 45 ec 35 b4 10 00 movl $0x10b435,-0x14(%ebp)
stabstr_end = __STABSTR_END__;
10055e: c7 45 e8 45 d4 10 00 movl $0x10d445,-0x18(%ebp)
// String table validity checks
if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
100565: 8b 45 e8 mov -0x18(%ebp),%eax
100568: 3b 45 ec cmp -0x14(%ebp),%eax
10056b: 76 0d jbe 10057a <debuginfo_eip+0x71>
10056d: 8b 45 e8 mov -0x18(%ebp),%eax
100570: 83 e8 01 sub $0x1,%eax
100573: 0f b6 00 movzbl (%eax),%eax
100576: 84 c0 test %al,%al
100578: 74 0a je 100584 <debuginfo_eip+0x7b>
return -1;
10057a: b8 ff ff ff ff mov $0xffffffff,%eax
10057f: e9 c0 02 00 00 jmp 100844 <debuginfo_eip+0x33b>
// 'eip'. First, we find the basic source file containing 'eip'.
// Then, we look in that source file for the function. Then we look
// for the line number.
// Search the entire set of stabs for the source file (type N_SO).
int lfile = 0, rfile = (stab_end - stabs) - 1;
100584: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
10058b: 8b 55 f0 mov -0x10(%ebp),%edx
10058e: 8b 45 f4 mov -0xc(%ebp),%eax
100591: 29 c2 sub %eax,%edx
100593: 89 d0 mov %edx,%eax
100595: c1 f8 02 sar $0x2,%eax
100598: 69 c0 ab aa aa aa imul $0xaaaaaaab,%eax,%eax
10059e: 83 e8 01 sub $0x1,%eax
1005a1: 89 45 e0 mov %eax,-0x20(%ebp)
stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
1005a4: 8b 45 08 mov 0x8(%ebp),%eax
1005a7: 89 44 24 10 mov %eax,0x10(%esp)
1005ab: c7 44 24 0c 64 00 00 movl $0x64,0xc(%esp)
1005b2: 00
1005b3: 8d 45 e0 lea -0x20(%ebp),%eax
1005b6: 89 44 24 08 mov %eax,0x8(%esp)
1005ba: 8d 45 e4 lea -0x1c(%ebp),%eax
1005bd: 89 44 24 04 mov %eax,0x4(%esp)
1005c1: 8b 45 f4 mov -0xc(%ebp),%eax
1005c4: 89 04 24 mov %eax,(%esp)
1005c7: e8 e7 fd ff ff call 1003b3 <stab_binsearch>
if (lfile == 0)
1005cc: 8b 45 e4 mov -0x1c(%ebp),%eax
1005cf: 85 c0 test %eax,%eax
1005d1: 75 0a jne 1005dd <debuginfo_eip+0xd4>
return -1;
1005d3: b8 ff ff ff ff mov $0xffffffff,%eax
1005d8: e9 67 02 00 00 jmp 100844 <debuginfo_eip+0x33b>
// Search within that file's stabs for the function definition
// (N_FUN).
int lfun = lfile, rfun = rfile;
1005dd: 8b 45 e4 mov -0x1c(%ebp),%eax
1005e0: 89 45 dc mov %eax,-0x24(%ebp)
1005e3: 8b 45 e0 mov -0x20(%ebp),%eax
1005e6: 89 45 d8 mov %eax,-0x28(%ebp)
int lline, rline;
stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
1005e9: 8b 45 08 mov 0x8(%ebp),%eax
1005ec: 89 44 24 10 mov %eax,0x10(%esp)
1005f0: c7 44 24 0c 24 00 00 movl $0x24,0xc(%esp)
1005f7: 00
1005f8: 8d 45 d8 lea -0x28(%ebp),%eax
1005fb: 89 44 24 08 mov %eax,0x8(%esp)
1005ff: 8d 45 dc lea -0x24(%ebp),%eax
100602: 89 44 24 04 mov %eax,0x4(%esp)
100606: 8b 45 f4 mov -0xc(%ebp),%eax
100609: 89 04 24 mov %eax,(%esp)
10060c: e8 a2 fd ff ff call 1003b3 <stab_binsearch>
if (lfun <= rfun) {
100611: 8b 55 dc mov -0x24(%ebp),%edx
100614: 8b 45 d8 mov -0x28(%ebp),%eax
100617: 39 c2 cmp %eax,%edx
100619: 7f 7c jg 100697 <debuginfo_eip+0x18e>
// stabs[lfun] points to the function name
// in the string table, but check bounds just in case.
if (stabs[lfun].n_strx < stabstr_end - stabstr) {
10061b: 8b 45 dc mov -0x24(%ebp),%eax
10061e: 89 c2 mov %eax,%edx
100620: 89 d0 mov %edx,%eax
100622: 01 c0 add %eax,%eax
100624: 01 d0 add %edx,%eax
100626: c1 e0 02 shl $0x2,%eax
100629: 89 c2 mov %eax,%edx
10062b: 8b 45 f4 mov -0xc(%ebp),%eax
10062e: 01 d0 add %edx,%eax
100630: 8b 10 mov (%eax),%edx
100632: 8b 4d e8 mov -0x18(%ebp),%ecx
100635: 8b 45 ec mov -0x14(%ebp),%eax
100638: 29 c1 sub %eax,%ecx
10063a: 89 c8 mov %ecx,%eax
10063c: 39 c2 cmp %eax,%edx
10063e: 73 22 jae 100662 <debuginfo_eip+0x159>
info->eip_fn_name = stabstr + stabs[lfun].n_strx;
100640: 8b 45 dc mov -0x24(%ebp),%eax
100643: 89 c2 mov %eax,%edx
100645: 89 d0 mov %edx,%eax
100647: 01 c0 add %eax,%eax
100649: 01 d0 add %edx,%eax
10064b: c1 e0 02 shl $0x2,%eax
10064e: 89 c2 mov %eax,%edx
100650: 8b 45 f4 mov -0xc(%ebp),%eax
100653: 01 d0 add %edx,%eax
100655: 8b 10 mov (%eax),%edx
100657: 8b 45 ec mov -0x14(%ebp),%eax
10065a: 01 c2 add %eax,%edx
10065c: 8b 45 0c mov 0xc(%ebp),%eax
10065f: 89 50 08 mov %edx,0x8(%eax)
}
info->eip_fn_addr = stabs[lfun].n_value;
100662: 8b 45 dc mov -0x24(%ebp),%eax
100665: 89 c2 mov %eax,%edx
100667: 89 d0 mov %edx,%eax
100669: 01 c0 add %eax,%eax
10066b: 01 d0 add %edx,%eax
10066d: c1 e0 02 shl $0x2,%eax
100670: 89 c2 mov %eax,%edx
100672: 8b 45 f4 mov -0xc(%ebp),%eax
100675: 01 d0 add %edx,%eax
100677: 8b 50 08 mov 0x8(%eax),%edx
10067a: 8b 45 0c mov 0xc(%ebp),%eax
10067d: 89 50 10 mov %edx,0x10(%eax)
addr -= info->eip_fn_addr;
100680: 8b 45 0c mov 0xc(%ebp),%eax
100683: 8b 40 10 mov 0x10(%eax),%eax
100686: 29 45 08 sub %eax,0x8(%ebp)
// Search within the function definition for the line number.
lline = lfun;
100689: 8b 45 dc mov -0x24(%ebp),%eax
10068c: 89 45 d4 mov %eax,-0x2c(%ebp)
rline = rfun;
10068f: 8b 45 d8 mov -0x28(%ebp),%eax
100692: 89 45 d0 mov %eax,-0x30(%ebp)
100695: eb 15 jmp 1006ac <debuginfo_eip+0x1a3>
} else {
// Couldn't find function stab! Maybe we're in an assembly
// file. Search the whole file for the line number.
info->eip_fn_addr = addr;
100697: 8b 45 0c mov 0xc(%ebp),%eax
10069a: 8b 55 08 mov 0x8(%ebp),%edx
10069d: 89 50 10 mov %edx,0x10(%eax)
lline = lfile;
1006a0: 8b 45 e4 mov -0x1c(%ebp),%eax
1006a3: 89 45 d4 mov %eax,-0x2c(%ebp)
rline = rfile;
1006a6: 8b 45 e0 mov -0x20(%ebp),%eax
1006a9: 89 45 d0 mov %eax,-0x30(%ebp)
}
info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
1006ac: 8b 45 0c mov 0xc(%ebp),%eax
1006af: 8b 40 08 mov 0x8(%eax),%eax
1006b2: c7 44 24 04 3a 00 00 movl $0x3a,0x4(%esp)
1006b9: 00
1006ba: 89 04 24 mov %eax,(%esp)
1006bd: e8 27 2a 00 00 call 1030e9 <strfind>
1006c2: 89 c2 mov %eax,%edx
1006c4: 8b 45 0c mov 0xc(%ebp),%eax
1006c7: 8b 40 08 mov 0x8(%eax),%eax
1006ca: 29 c2 sub %eax,%edx
1006cc: 8b 45 0c mov 0xc(%ebp),%eax
1006cf: 89 50 0c mov %edx,0xc(%eax)
// Search within [lline, rline] for the line number stab.
// If found, set info->eip_line to the right line number.
// If not found, return -1.
stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
1006d2: 8b 45 08 mov 0x8(%ebp),%eax
1006d5: 89 44 24 10 mov %eax,0x10(%esp)
1006d9: c7 44 24 0c 44 00 00 movl $0x44,0xc(%esp)
1006e0: 00
1006e1: 8d 45 d0 lea -0x30(%ebp),%eax
1006e4: 89 44 24 08 mov %eax,0x8(%esp)
1006e8: 8d 45 d4 lea -0x2c(%ebp),%eax
1006eb: 89 44 24 04 mov %eax,0x4(%esp)
1006ef: 8b 45 f4 mov -0xc(%ebp),%eax
1006f2: 89 04 24 mov %eax,(%esp)
1006f5: e8 b9 fc ff ff call 1003b3 <stab_binsearch>
if (lline <= rline) {
1006fa: 8b 55 d4 mov -0x2c(%ebp),%edx
1006fd: 8b 45 d0 mov -0x30(%ebp),%eax
100700: 39 c2 cmp %eax,%edx
100702: 7f 24 jg 100728 <debuginfo_eip+0x21f>
info->eip_line = stabs[rline].n_desc;
100704: 8b 45 d0 mov -0x30(%ebp),%eax
100707: 89 c2 mov %eax,%edx
100709: 89 d0 mov %edx,%eax
10070b: 01 c0 add %eax,%eax
10070d: 01 d0 add %edx,%eax
10070f: c1 e0 02 shl $0x2,%eax
100712: 89 c2 mov %eax,%edx
100714: 8b 45 f4 mov -0xc(%ebp),%eax
100717: 01 d0 add %edx,%eax
100719: 0f b7 40 06 movzwl 0x6(%eax),%eax
10071d: 0f b7 d0 movzwl %ax,%edx
100720: 8b 45 0c mov 0xc(%ebp),%eax
100723: 89 50 04 mov %edx,0x4(%eax)
// Search backwards from the line number for the relevant filename stab.
// We can't just use the "lfile" stab because inlined functions
// can interpolate code from a different file!
// Such included source files use the N_SOL stab type.
while (lline >= lfile
100726: eb 13 jmp 10073b <debuginfo_eip+0x232>
// If not found, return -1.
stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
if (lline <= rline) {
info->eip_line = stabs[rline].n_desc;
} else {
return -1;
100728: b8 ff ff ff ff mov $0xffffffff,%eax
10072d: e9 12 01 00 00 jmp 100844 <debuginfo_eip+0x33b>
// can interpolate code from a different file!
// Such included source files use the N_SOL stab type.
while (lline >= lfile
&& stabs[lline].n_type != N_SOL
&& (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
lline --;
100732: 8b 45 d4 mov -0x2c(%ebp),%eax
100735: 83 e8 01 sub $0x1,%eax
100738: 89 45 d4 mov %eax,-0x2c(%ebp)
// Search backwards from the line number for the relevant filename stab.
// We can't just use the "lfile" stab because inlined functions
// can interpolate code from a different file!
// Such included source files use the N_SOL stab type.
while (lline >= lfile
10073b: 8b 55 d4 mov -0x2c(%ebp),%edx
10073e: 8b 45 e4 mov -0x1c(%ebp),%eax
100741: 39 c2 cmp %eax,%edx
100743: 7c 56 jl 10079b <debuginfo_eip+0x292>
&& stabs[lline].n_type != N_SOL
100745: 8b 45 d4 mov -0x2c(%ebp),%eax
100748: 89 c2 mov %eax,%edx
10074a: 89 d0 mov %edx,%eax
10074c: 01 c0 add %eax,%eax
10074e: 01 d0 add %edx,%eax
100750: c1 e0 02 shl $0x2,%eax
100753: 89 c2 mov %eax,%edx
100755: 8b 45 f4 mov -0xc(%ebp),%eax
100758: 01 d0 add %edx,%eax
10075a: 0f b6 40 04 movzbl 0x4(%eax),%eax
10075e: 3c 84 cmp $0x84,%al
100760: 74 39 je 10079b <debuginfo_eip+0x292>
&& (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
100762: 8b 45 d4 mov -0x2c(%ebp),%eax
100765: 89 c2 mov %eax,%edx
100767: 89 d0 mov %edx,%eax
100769: 01 c0 add %eax,%eax
10076b: 01 d0 add %edx,%eax
10076d: c1 e0 02 shl $0x2,%eax
100770: 89 c2 mov %eax,%edx
100772: 8b 45 f4 mov -0xc(%ebp),%eax
100775: 01 d0 add %edx,%eax
100777: 0f b6 40 04 movzbl 0x4(%eax),%eax
10077b: 3c 64 cmp $0x64,%al
10077d: 75 b3 jne 100732 <debuginfo_eip+0x229>
10077f: 8b 45 d4 mov -0x2c(%ebp),%eax
100782: 89 c2 mov %eax,%edx
100784: 89 d0 mov %edx,%eax
100786: 01 c0 add %eax,%eax
100788: 01 d0 add %edx,%eax
10078a: c1 e0 02 shl $0x2,%eax
10078d: 89 c2 mov %eax,%edx
10078f: 8b 45 f4 mov -0xc(%ebp),%eax
100792: 01 d0 add %edx,%eax
100794: 8b 40 08 mov 0x8(%eax),%eax
100797: 85 c0 test %eax,%eax
100799: 74 97 je 100732 <debuginfo_eip+0x229>
lline --;
}
if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
10079b: 8b 55 d4 mov -0x2c(%ebp),%edx
10079e: 8b 45 e4 mov -0x1c(%ebp),%eax
1007a1: 39 c2 cmp %eax,%edx
1007a3: 7c 46 jl 1007eb <debuginfo_eip+0x2e2>
1007a5: 8b 45 d4 mov -0x2c(%ebp),%eax
1007a8: 89 c2 mov %eax,%edx
1007aa: 89 d0 mov %edx,%eax
1007ac: 01 c0 add %eax,%eax
1007ae: 01 d0 add %edx,%eax
1007b0: c1 e0 02 shl $0x2,%eax
1007b3: 89 c2 mov %eax,%edx
1007b5: 8b 45 f4 mov -0xc(%ebp),%eax
1007b8: 01 d0 add %edx,%eax
1007ba: 8b 10 mov (%eax),%edx
1007bc: 8b 4d e8 mov -0x18(%ebp),%ecx
1007bf: 8b 45 ec mov -0x14(%ebp),%eax
1007c2: 29 c1 sub %eax,%ecx
1007c4: 89 c8 mov %ecx,%eax
1007c6: 39 c2 cmp %eax,%edx
1007c8: 73 21 jae 1007eb <debuginfo_eip+0x2e2>
info->eip_file = stabstr + stabs[lline].n_strx;
1007ca: 8b 45 d4 mov -0x2c(%ebp),%eax
1007cd: 89 c2 mov %eax,%edx
1007cf: 89 d0 mov %edx,%eax
1007d1: 01 c0 add %eax,%eax
1007d3: 01 d0 add %edx,%eax
1007d5: c1 e0 02 shl $0x2,%eax
1007d8: 89 c2 mov %eax,%edx
1007da: 8b 45 f4 mov -0xc(%ebp),%eax
1007dd: 01 d0 add %edx,%eax
1007df: 8b 10 mov (%eax),%edx
1007e1: 8b 45 ec mov -0x14(%ebp),%eax
1007e4: 01 c2 add %eax,%edx
1007e6: 8b 45 0c mov 0xc(%ebp),%eax
1007e9: 89 10 mov %edx,(%eax)
}
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun) {
1007eb: 8b 55 dc mov -0x24(%ebp),%edx
1007ee: 8b 45 d8 mov -0x28(%ebp),%eax
1007f1: 39 c2 cmp %eax,%edx
1007f3: 7d 4a jge 10083f <debuginfo_eip+0x336>
for (lline = lfun + 1;
1007f5: 8b 45 dc mov -0x24(%ebp),%eax
1007f8: 83 c0 01 add $0x1,%eax
1007fb: 89 45 d4 mov %eax,-0x2c(%ebp)
1007fe: eb 18 jmp 100818 <debuginfo_eip+0x30f>
lline < rfun && stabs[lline].n_type == N_PSYM;
lline ++) {
info->eip_fn_narg ++;
100800: 8b 45 0c mov 0xc(%ebp),%eax
100803: 8b 40 14 mov 0x14(%eax),%eax
100806: 8d 50 01 lea 0x1(%eax),%edx
100809: 8b 45 0c mov 0xc(%ebp),%eax
10080c: 89 50 14 mov %edx,0x14(%eax)
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun) {
for (lline = lfun + 1;
lline < rfun && stabs[lline].n_type == N_PSYM;
lline ++) {
10080f: 8b 45 d4 mov -0x2c(%ebp),%eax
100812: 83 c0 01 add $0x1,%eax
100815: 89 45 d4 mov %eax,-0x2c(%ebp)
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun) {
for (lline = lfun + 1;
lline < rfun && stabs[lline].n_type == N_PSYM;
100818: 8b 55 d4 mov -0x2c(%ebp),%edx
10081b: 8b 45 d8 mov -0x28(%ebp),%eax
}
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun) {
for (lline = lfun + 1;
10081e: 39 c2 cmp %eax,%edx
100820: 7d 1d jge 10083f <debuginfo_eip+0x336>
lline < rfun && stabs[lline].n_type == N_PSYM;
100822: 8b 45 d4 mov -0x2c(%ebp),%eax
100825: 89 c2 mov %eax,%edx
100827: 89 d0 mov %edx,%eax
100829: 01 c0 add %eax,%eax
10082b: 01 d0 add %edx,%eax
10082d: c1 e0 02 shl $0x2,%eax
100830: 89 c2 mov %eax,%edx
100832: 8b 45 f4 mov -0xc(%ebp),%eax
100835: 01 d0 add %edx,%eax
100837: 0f b6 40 04 movzbl 0x4(%eax),%eax
10083b: 3c a0 cmp $0xa0,%al
10083d: 74 c1 je 100800 <debuginfo_eip+0x2f7>
lline ++) {
info->eip_fn_narg ++;
}
}
return 0;
10083f: b8 00 00 00 00 mov $0x0,%eax
}
100844: c9 leave
100845: c3 ret
00100846 <print_kerninfo>:
* print_kerninfo - print the information about kernel, including the location
* of kernel entry, the start addresses of data and text segements, the start
* address of free memory and how many memory that kernel has used.
* */
void
print_kerninfo(void) {
100846: 55 push %ebp
100847: 89 e5 mov %esp,%ebp
100849: 83 ec 18 sub $0x18,%esp
extern char etext[], edata[], end[], kern_init[];
cprintf("Special kernel symbols:\n");
10084c: c7 04 24 b6 34 10 00 movl $0x1034b6,(%esp)
100853: e8 ba fa ff ff call 100312 <cprintf>
cprintf(" entry 0x%08x (phys)\n", kern_init);
100858: c7 44 24 04 00 00 10 movl $0x100000,0x4(%esp)
10085f: 00
100860: c7 04 24 cf 34 10 00 movl $0x1034cf,(%esp)
100867: e8 a6 fa ff ff call 100312 <cprintf>
cprintf(" etext 0x%08x (phys)\n", etext);
10086c: c7 44 24 04 fe 33 10 movl $0x1033fe,0x4(%esp)
100873: 00
100874: c7 04 24 e7 34 10 00 movl $0x1034e7,(%esp)
10087b: e8 92 fa ff ff call 100312 <cprintf>
cprintf(" edata 0x%08x (phys)\n", edata);
100880: c7 44 24 04 16 ea 10 movl $0x10ea16,0x4(%esp)
100887: 00
100888: c7 04 24 ff 34 10 00 movl $0x1034ff,(%esp)
10088f: e8 7e fa ff ff call 100312 <cprintf>
cprintf(" end 0x%08x (phys)\n", end);
100894: c7 44 24 04 20 fd 10 movl $0x10fd20,0x4(%esp)
10089b: 00
10089c: c7 04 24 17 35 10 00 movl $0x103517,(%esp)
1008a3: e8 6a fa ff ff call 100312 <cprintf>
cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
1008a8: b8 20 fd 10 00 mov $0x10fd20,%eax
1008ad: 8d 90 ff 03 00 00 lea 0x3ff(%eax),%edx
1008b3: b8 00 00 10 00 mov $0x100000,%eax
1008b8: 29 c2 sub %eax,%edx
1008ba: 89 d0 mov %edx,%eax
1008bc: 8d 90 ff 03 00 00 lea 0x3ff(%eax),%edx
1008c2: 85 c0 test %eax,%eax
1008c4: 0f 48 c2 cmovs %edx,%eax
1008c7: c1 f8 0a sar $0xa,%eax
1008ca: 89 44 24 04 mov %eax,0x4(%esp)
1008ce: c7 04 24 30 35 10 00 movl $0x103530,(%esp)
1008d5: e8 38 fa ff ff call 100312 <cprintf>
}
1008da: c9 leave
1008db: c3 ret
001008dc <print_debuginfo>:
/* *
* print_debuginfo - read and print the stat information for the address @eip,
* and info.eip_fn_addr should be the first address of the related function.
* */
void
print_debuginfo(uintptr_t eip) {
1008dc: 55 push %ebp
1008dd: 89 e5 mov %esp,%ebp
1008df: 81 ec 48 01 00 00 sub $0x148,%esp
struct eipdebuginfo info;
if (debuginfo_eip(eip, &info) != 0) {
1008e5: 8d 45 dc lea -0x24(%ebp),%eax
1008e8: 89 44 24 04 mov %eax,0x4(%esp)
1008ec: 8b 45 08 mov 0x8(%ebp),%eax
1008ef: 89 04 24 mov %eax,(%esp)
1008f2: e8 12 fc ff ff call 100509 <debuginfo_eip>
1008f7: 85 c0 test %eax,%eax
1008f9: 74 15 je 100910 <print_debuginfo+0x34>
cprintf(" <unknow>: -- 0x%08x --\n", eip);
1008fb: 8b 45 08 mov 0x8(%ebp),%eax
1008fe: 89 44 24 04 mov %eax,0x4(%esp)
100902: c7 04 24 5a 35 10 00 movl $0x10355a,(%esp)
100909: e8 04 fa ff ff call 100312 <cprintf>
10090e: eb 6d jmp 10097d <print_debuginfo+0xa1>
}
else {
char fnname[256];
int j;
for (j = 0; j < info.eip_fn_namelen; j ++) {
100910: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
100917: eb 1c jmp 100935 <print_debuginfo+0x59>
fnname[j] = info.eip_fn_name[j];
100919: 8b 55 e4 mov -0x1c(%ebp),%edx
10091c: 8b 45 f4 mov -0xc(%ebp),%eax
10091f: 01 d0 add %edx,%eax
100921: 0f b6 00 movzbl (%eax),%eax
100924: 8d 8d dc fe ff ff lea -0x124(%ebp),%ecx
10092a: 8b 55 f4 mov -0xc(%ebp),%edx
10092d: 01 ca add %ecx,%edx
10092f: 88 02 mov %al,(%edx)
cprintf(" <unknow>: -- 0x%08x --\n", eip);
}
else {
char fnname[256];
int j;
for (j = 0; j < info.eip_fn_namelen; j ++) {
100931: 83 45 f4 01 addl $0x1,-0xc(%ebp)
100935: 8b 45 e8 mov -0x18(%ebp),%eax
100938: 3b 45 f4 cmp -0xc(%ebp),%eax
10093b: 7f dc jg 100919 <print_debuginfo+0x3d>
fnname[j] = info.eip_fn_name[j];
}
fnname[j] = '\0';
10093d: 8d 95 dc fe ff ff lea -0x124(%ebp),%edx
100943: 8b 45 f4 mov -0xc(%ebp),%eax
100946: 01 d0 add %edx,%eax
100948: c6 00 00 movb $0x0,(%eax)
cprintf(" %s:%d: %s+%d\n", info.eip_file, info.eip_line,
fnname, eip - info.eip_fn_addr);
10094b: 8b 45 ec mov -0x14(%ebp),%eax
int j;
for (j = 0; j < info.eip_fn_namelen; j ++) {
fnname[j] = info.eip_fn_name[j];
}
fnname[j] = '\0';
cprintf(" %s:%d: %s+%d\n", info.eip_file, info.eip_line,
10094e: 8b 55 08 mov 0x8(%ebp),%edx
100951: 89 d1 mov %edx,%ecx
100953: 29 c1 sub %eax,%ecx
100955: 8b 55 e0 mov -0x20(%ebp),%edx
100958: 8b 45 dc mov -0x24(%ebp),%eax
10095b: 89 4c 24 10 mov %ecx,0x10(%esp)
10095f: 8d 8d dc fe ff ff lea -0x124(%ebp),%ecx
100965: 89 4c 24 0c mov %ecx,0xc(%esp)
100969: 89 54 24 08 mov %edx,0x8(%esp)
10096d: 89 44 24 04 mov %eax,0x4(%esp)
100971: c7 04 24 76 35 10 00 movl $0x103576,(%esp)
100978: e8 95 f9 ff ff call 100312 <cprintf>
fnname, eip - info.eip_fn_addr);
}
}
10097d: c9 leave
10097e: c3 ret
0010097f <read_eip>:
static __noinline uint32_t
read_eip(void) {
10097f: 55 push %ebp
100980: 89 e5 mov %esp,%ebp
100982: 83 ec 10 sub $0x10,%esp
uint32_t eip;
asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
100985: 8b 45 04 mov 0x4(%ebp),%eax
100988: 89 45 fc mov %eax,-0x4(%ebp)
return eip;
10098b: 8b 45 fc mov -0x4(%ebp),%eax
}
10098e: c9 leave
10098f: c3 ret
00100990 <print_stackframe>:
*
* Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
* to the kernel entry, the value of ebp has been set to zero, that's the boundary.
* */
void
print_stackframe(void) {
100990: 55 push %ebp
100991: 89 e5 mov %esp,%ebp
100993: 83 ec 48 sub $0x48,%esp
}
static inline uint32_t
read_ebp(void) {
uint32_t ebp;
asm volatile ("movl %%ebp, %0" : "=r" (ebp));
100996: 89 e8 mov %ebp,%eax
100998: 89 45 d8 mov %eax,-0x28(%ebp)
return ebp;
10099b: 8b 45 d8 mov -0x28(%ebp),%eax
* (3.5) popup a calling stackframe
* NOTICE: the calling funciton's return addr eip = ss:[ebp+4]
* the calling funciton's ebp = ss:[ebp]
*/
int depth;
uint32_t ebp = read_ebp();
10099e: 89 45 f0 mov %eax,-0x10(%ebp)
uint32_t eip = read_eip();
1009a1: e8 d9 ff ff ff call 10097f <read_eip>
1009a6: 89 45 ec mov %eax,-0x14(%ebp)
for (depth = 0; ebp != 0 && depth < STACKFRAME_DEPTH; ++depth) {
1009a9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1009b0: e9 93 00 00 00 jmp 100a48 <print_stackframe+0xb8>
cprintf("ebp:0x%x eip:0x%x", ebp, eip);
1009b5: 8b 45 ec mov -0x14(%ebp),%eax
1009b8: 89 44 24 08 mov %eax,0x8(%esp)
1009bc: 8b 45 f0 mov -0x10(%ebp),%eax
1009bf: 89 44 24 04 mov %eax,0x4(%esp)
1009c3: c7 04 24 88 35 10 00 movl $0x103588,(%esp)
1009ca: e8 43 f9 ff ff call 100312 <cprintf>
uint32_t arg1 = *((uint32_t *)ebp + 2);
1009cf: 8b 45 f0 mov -0x10(%ebp),%eax
1009d2: 83 c0 08 add $0x8,%eax
1009d5: 8b 00 mov (%eax),%eax
1009d7: 89 45 e8 mov %eax,-0x18(%ebp)
uint32_t arg2 = *((uint32_t *)ebp + 3);
1009da: 8b 45 f0 mov -0x10(%ebp),%eax
1009dd: 83 c0 0c add $0xc,%eax
1009e0: 8b 00 mov (%eax),%eax
1009e2: 89 45 e4 mov %eax,-0x1c(%ebp)
uint32_t arg3 = *((uint32_t *)ebp + 4);
1009e5: 8b 45 f0 mov -0x10(%ebp),%eax
1009e8: 83 c0 10 add $0x10,%eax
1009eb: 8b 00 mov (%eax),%eax
1009ed: 89 45 e0 mov %eax,-0x20(%ebp)
uint32_t arg4 = *((uint32_t *)ebp + 5);
1009f0: 8b 45 f0 mov -0x10(%ebp),%eax
1009f3: 83 c0 14 add $0x14,%eax
1009f6: 8b 00 mov (%eax),%eax
1009f8: 89 45 dc mov %eax,-0x24(%ebp)
cprintf(" arg1:0x%x arg2:0x%x arg3:0x%x arg4:0x%x\n", arg1, arg2, arg3, arg4);
1009fb: 8b 45 dc mov -0x24(%ebp),%eax
1009fe: 89 44 24 10 mov %eax,0x10(%esp)
100a02: 8b 45 e0 mov -0x20(%ebp),%eax
100a05: 89 44 24 0c mov %eax,0xc(%esp)
100a09: 8b 45 e4 mov -0x1c(%ebp),%eax
100a0c: 89 44 24 08 mov %eax,0x8(%esp)
100a10: 8b 45 e8 mov -0x18(%ebp),%eax
100a13: 89 44 24 04 mov %eax,0x4(%esp)
100a17: c7 04 24 9c 35 10 00 movl $0x10359c,(%esp)
100a1e: e8 ef f8 ff ff call 100312 <cprintf>
// because eip point to the "next" instruction
print_debuginfo(eip - 1);
100a23: 8b 45 ec mov -0x14(%ebp),%eax
100a26: 83 e8 01 sub $0x1,%eax
100a29: 89 04 24 mov %eax,(%esp)
100a2c: e8 ab fe ff ff call 1008dc <print_debuginfo>
eip = *((uint32_t *)ebp + 1);
100a31: 8b 45 f0 mov -0x10(%ebp),%eax
100a34: 83 c0 04 add $0x4,%eax
100a37: 8b 00 mov (%eax),%eax
100a39: 89 45 ec mov %eax,-0x14(%ebp)
ebp = *((uint32_t *)ebp);
100a3c: 8b 45 f0 mov -0x10(%ebp),%eax
100a3f: 8b 00 mov (%eax),%eax
100a41: 89 45 f0 mov %eax,-0x10(%ebp)
*/
int depth;
uint32_t ebp = read_ebp();
uint32_t eip = read_eip();
for (depth = 0; ebp != 0 && depth < STACKFRAME_DEPTH; ++depth) {
100a44: 83 45 f4 01 addl $0x1,-0xc(%ebp)
100a48: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
100a4c: 74 0a je 100a58 <print_stackframe+0xc8>
100a4e: 83 7d f4 13 cmpl $0x13,-0xc(%ebp)
100a52: 0f 8e 5d ff ff ff jle 1009b5 <print_stackframe+0x25>
print_debuginfo(eip - 1);
eip = *((uint32_t *)ebp + 1);
ebp = *((uint32_t *)ebp);
}
}
100a58: c9 leave
100a59: c3 ret
00100a5a <parse>:
#define MAXARGS 16
#define WHITESPACE " \t\n\r"
/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
100a5a: 55 push %ebp
100a5b: 89 e5 mov %esp,%ebp
100a5d: 83 ec 28 sub $0x28,%esp
int argc = 0;
100a60: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
while (1) {
// find global whitespace
while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
100a67: eb 0c jmp 100a75 <parse+0x1b>
*buf ++ = '\0';
100a69: 8b 45 08 mov 0x8(%ebp),%eax
100a6c: 8d 50 01 lea 0x1(%eax),%edx
100a6f: 89 55 08 mov %edx,0x8(%ebp)
100a72: c6 00 00 movb $0x0,(%eax)
static int
parse(char *buf, char **argv) {
int argc = 0;
while (1) {
// find global whitespace
while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
100a75: 8b 45 08 mov 0x8(%ebp),%eax
100a78: 0f b6 00 movzbl (%eax),%eax
100a7b: 84 c0 test %al,%al
100a7d: 74 1d je 100a9c <parse+0x42>
100a7f: 8b 45 08 mov 0x8(%ebp),%eax
100a82: 0f b6 00 movzbl (%eax),%eax
100a85: 0f be c0 movsbl %al,%eax
100a88: 89 44 24 04 mov %eax,0x4(%esp)
100a8c: c7 04 24 48 36 10 00 movl $0x103648,(%esp)
100a93: e8 1e 26 00 00 call 1030b6 <strchr>
100a98: 85 c0 test %eax,%eax
100a9a: 75 cd jne 100a69 <parse+0xf>
*buf ++ = '\0';
}
if (*buf == '\0') {
100a9c: 8b 45 08 mov 0x8(%ebp),%eax
100a9f: 0f b6 00 movzbl (%eax),%eax
100aa2: 84 c0 test %al,%al
100aa4: 75 02 jne 100aa8 <parse+0x4e>
break;
100aa6: eb 67 jmp 100b0f <parse+0xb5>
}
// save and scan past next arg
if (argc == MAXARGS - 1) {
100aa8: 83 7d f4 0f cmpl $0xf,-0xc(%ebp)
100aac: 75 14 jne 100ac2 <parse+0x68>
cprintf("Too many arguments (max %d).\n", MAXARGS);
100aae: c7 44 24 04 10 00 00 movl $0x10,0x4(%esp)
100ab5: 00
100ab6: c7 04 24 4d 36 10 00 movl $0x10364d,(%esp)
100abd: e8 50 f8 ff ff call 100312 <cprintf>
}
argv[argc ++] = buf;
100ac2: 8b 45 f4 mov -0xc(%ebp),%eax
100ac5: 8d 50 01 lea 0x1(%eax),%edx
100ac8: 89 55 f4 mov %edx,-0xc(%ebp)
100acb: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
100ad2: 8b 45 0c mov 0xc(%ebp),%eax
100ad5: 01 c2 add %eax,%edx
100ad7: 8b 45 08 mov 0x8(%ebp),%eax
100ada: 89 02 mov %eax,(%edx)
while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
100adc: eb 04 jmp 100ae2 <parse+0x88>
buf ++;
100ade: 83 45 08 01 addl $0x1,0x8(%ebp)
// save and scan past next arg
if (argc == MAXARGS - 1) {
cprintf("Too many arguments (max %d).\n", MAXARGS);
}
argv[argc ++] = buf;
while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
100ae2: 8b 45 08 mov 0x8(%ebp),%eax
100ae5: 0f b6 00 movzbl (%eax),%eax
100ae8: 84 c0 test %al,%al
100aea: 74 1d je 100b09 <parse+0xaf>
100aec: 8b 45 08 mov 0x8(%ebp),%eax
100aef: 0f b6 00 movzbl (%eax),%eax
100af2: 0f be c0 movsbl %al,%eax
100af5: 89 44 24 04 mov %eax,0x4(%esp)
100af9: c7 04 24 48 36 10 00 movl $0x103648,(%esp)
100b00: e8 b1 25 00 00 call 1030b6 <strchr>
100b05: 85 c0 test %eax,%eax
100b07: 74 d5 je 100ade <parse+0x84>
buf ++;
}
}
100b09: 90 nop
static int
parse(char *buf, char **argv) {
int argc = 0;
while (1) {
// find global whitespace
while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
100b0a: e9 66 ff ff ff jmp 100a75 <parse+0x1b>
argv[argc ++] = buf;
while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
buf ++;
}
}
return argc;
100b0f: 8b 45 f4 mov -0xc(%ebp),%eax
}
100b12: c9 leave
100b13: c3 ret
00100b14 <runcmd>:
/* *
* runcmd - parse the input string, split it into separated arguments
* and then lookup and invoke some related commands/
* */
static int
runcmd(char *buf, struct trapframe *tf) {
100b14: 55 push %ebp
100b15: 89 e5 mov %esp,%ebp
100b17: 83 ec 68 sub $0x68,%esp
char *argv[MAXARGS];
int argc = parse(buf, argv);
100b1a: 8d 45 b0 lea -0x50(%ebp),%eax
100b1d: 89 44 24 04 mov %eax,0x4(%esp)
100b21: 8b 45 08 mov 0x8(%ebp),%eax
100b24: 89 04 24 mov %eax,(%esp)
100b27: e8 2e ff ff ff call 100a5a <parse>
100b2c: 89 45 f0 mov %eax,-0x10(%ebp)
if (argc == 0) {
100b2f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
100b33: 75 0a jne 100b3f <runcmd+0x2b>
return 0;
100b35: b8 00 00 00 00 mov $0x0,%eax
100b3a: e9 85 00 00 00 jmp 100bc4 <runcmd+0xb0>
}
int i;
for (i = 0; i < NCOMMANDS; i ++) {
100b3f: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
100b46: eb 5c jmp 100ba4 <runcmd+0x90>
if (strcmp(commands[i].name, argv[0]) == 0) {
100b48: 8b 4d b0 mov -0x50(%ebp),%ecx
100b4b: 8b 55 f4 mov -0xc(%ebp),%edx
100b4e: 89 d0 mov %edx,%eax
100b50: 01 c0 add %eax,%eax
100b52: 01 d0 add %edx,%eax
100b54: c1 e0 02 shl $0x2,%eax
100b57: 05 00 e0 10 00 add $0x10e000,%eax
100b5c: 8b 00 mov (%eax),%eax
100b5e: 89 4c 24 04 mov %ecx,0x4(%esp)
100b62: 89 04 24 mov %eax,(%esp)
100b65: e8 ad 24 00 00 call 103017 <strcmp>
100b6a: 85 c0 test %eax,%eax
100b6c: 75 32 jne 100ba0 <runcmd+0x8c>
return commands[i].func(argc - 1, argv + 1, tf);
100b6e: 8b 55 f4 mov -0xc(%ebp),%edx
100b71: 89 d0 mov %edx,%eax
100b73: 01 c0 add %eax,%eax
100b75: 01 d0 add %edx,%eax
100b77: c1 e0 02 shl $0x2,%eax
100b7a: 05 00 e0 10 00 add $0x10e000,%eax
100b7f: 8b 40 08 mov 0x8(%eax),%eax
100b82: 8b 55 f0 mov -0x10(%ebp),%edx
100b85: 8d 4a ff lea -0x1(%edx),%ecx
100b88: 8b 55 0c mov 0xc(%ebp),%edx
100b8b: 89 54 24 08 mov %edx,0x8(%esp)
100b8f: 8d 55 b0 lea -0x50(%ebp),%edx
100b92: 83 c2 04 add $0x4,%edx
100b95: 89 54 24 04 mov %edx,0x4(%esp)
100b99: 89 0c 24 mov %ecx,(%esp)
100b9c: ff d0 call *%eax
100b9e: eb 24 jmp 100bc4 <runcmd+0xb0>
int argc = parse(buf, argv);
if (argc == 0) {
return 0;
}
int i;
for (i = 0; i < NCOMMANDS; i ++) {
100ba0: 83 45 f4 01 addl $0x1,-0xc(%ebp)
100ba4: 8b 45 f4 mov -0xc(%ebp),%eax
100ba7: 83 f8 02 cmp $0x2,%eax
100baa: 76 9c jbe 100b48 <runcmd+0x34>
if (strcmp(commands[i].name, argv[0]) == 0) {
return commands[i].func(argc - 1, argv + 1, tf);
}
}
cprintf("Unknown command '%s'\n", argv[0]);
100bac: 8b 45 b0 mov -0x50(%ebp),%eax
100baf: 89 44 24 04 mov %eax,0x4(%esp)
100bb3: c7 04 24 6b 36 10 00 movl $0x10366b,(%esp)
100bba: e8 53 f7 ff ff call 100312 <cprintf>
return 0;
100bbf: b8 00 00 00 00 mov $0x0,%eax
}
100bc4: c9 leave
100bc5: c3 ret
00100bc6 <kmonitor>:
/***** Implementations of basic kernel monitor commands *****/
void
kmonitor(struct trapframe *tf) {
100bc6: 55 push %ebp
100bc7: 89 e5 mov %esp,%ebp
100bc9: 83 ec 28 sub $0x28,%esp
cprintf("Welcome to the kernel debug monitor!!\n");
100bcc: c7 04 24 84 36 10 00 movl $0x103684,(%esp)
100bd3: e8 3a f7 ff ff call 100312 <cprintf>
cprintf("Type 'help' for a list of commands.\n");
100bd8: c7 04 24 ac 36 10 00 movl $0x1036ac,(%esp)
100bdf: e8 2e f7 ff ff call 100312 <cprintf>
if (tf != NULL) {
100be4: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
100be8: 74 0b je 100bf5 <kmonitor+0x2f>
print_trapframe(tf);
100bea: 8b 45 08 mov 0x8(%ebp),%eax
100bed: 89 04 24 mov %eax,(%esp)
100bf0: e8 4d 0d 00 00 call 101942 <print_trapframe>
}
char *buf;
while (1) {
if ((buf = readline("K> ")) != NULL) {
100bf5: c7 04 24 d1 36 10 00 movl $0x1036d1,(%esp)
100bfc: e8 08 f6 ff ff call 100209 <readline>
100c01: 89 45 f4 mov %eax,-0xc(%ebp)
100c04: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
100c08: 74 18 je 100c22 <kmonitor+0x5c>
if (runcmd(buf, tf) < 0) {
100c0a: 8b 45 08 mov 0x8(%ebp),%eax
100c0d: 89 44 24 04 mov %eax,0x4(%esp)
100c11: 8b 45 f4 mov -0xc(%ebp),%eax
100c14: 89 04 24 mov %eax,(%esp)
100c17: e8 f8 fe ff ff call 100b14 <runcmd>
100c1c: 85 c0 test %eax,%eax
100c1e: 79 02 jns 100c22 <kmonitor+0x5c>
break;
100c20: eb 02 jmp 100c24 <kmonitor+0x5e>
}
}
}
100c22: eb d1 jmp 100bf5 <kmonitor+0x2f>
}
100c24: c9 leave
100c25: c3 ret
00100c26 <mon_help>:
/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
100c26: 55 push %ebp
100c27: 89 e5 mov %esp,%ebp
100c29: 83 ec 28 sub $0x28,%esp
int i;
for (i = 0; i < NCOMMANDS; i ++) {
100c2c: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
100c33: eb 3f jmp 100c74 <mon_help+0x4e>
cprintf("%s - %s\n", commands[i].name, commands[i].desc);
100c35: 8b 55 f4 mov -0xc(%ebp),%edx
100c38: 89 d0 mov %edx,%eax
100c3a: 01 c0 add %eax,%eax
100c3c: 01 d0 add %edx,%eax
100c3e: c1 e0 02 shl $0x2,%eax
100c41: 05 00 e0 10 00 add $0x10e000,%eax
100c46: 8b 48 04 mov 0x4(%eax),%ecx
100c49: 8b 55 f4 mov -0xc(%ebp),%edx
100c4c: 89 d0 mov %edx,%eax
100c4e: 01 c0 add %eax,%eax
100c50: 01 d0 add %edx,%eax
100c52: c1 e0 02 shl $0x2,%eax
100c55: 05 00 e0 10 00 add $0x10e000,%eax
100c5a: 8b 00 mov (%eax),%eax
100c5c: 89 4c 24 08 mov %ecx,0x8(%esp)
100c60: 89 44 24 04 mov %eax,0x4(%esp)
100c64: c7 04 24 d5 36 10 00 movl $0x1036d5,(%esp)
100c6b: e8 a2 f6 ff ff call 100312 <cprintf>
/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
int i;
for (i = 0; i < NCOMMANDS; i ++) {
100c70: 83 45 f4 01 addl $0x1,-0xc(%ebp)
100c74: 8b 45 f4 mov -0xc(%ebp),%eax
100c77: 83 f8 02 cmp $0x2,%eax
100c7a: 76 b9 jbe 100c35 <mon_help+0xf>
cprintf("%s - %s\n", commands[i].name, commands[i].desc);
}
return 0;
100c7c: b8 00 00 00 00 mov $0x0,%eax
}
100c81: c9 leave
100c82: c3 ret
00100c83 <mon_kerninfo>:
/* *
* mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
* print the memory occupancy in kernel.
* */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
100c83: 55 push %ebp
100c84: 89 e5 mov %esp,%ebp
100c86: 83 ec 08 sub $0x8,%esp
print_kerninfo();
100c89: e8 b8 fb ff ff call 100846 <print_kerninfo>
return 0;
100c8e: b8 00 00 00 00 mov $0x0,%eax
}
100c93: c9 leave
100c94: c3 ret
00100c95 <mon_backtrace>:
/* *
* mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
* print a backtrace of the stack.
* */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
100c95: 55 push %ebp
100c96: 89 e5 mov %esp,%ebp
100c98: 83 ec 08 sub $0x8,%esp
print_stackframe();
100c9b: e8 f0 fc ff ff call 100990 <print_stackframe>
return 0;
100ca0: b8 00 00 00 00 mov $0x0,%eax
}
100ca5: c9 leave
100ca6: c3 ret
00100ca7 <__panic>:
/* *
* __panic - __panic is called on unresolvable fatal errors. it prints
* "panic: 'message'", and then enters the kernel monitor.
* */
void
__panic(const char *file, int line, const char *fmt, ...) {
100ca7: 55 push %ebp
100ca8: 89 e5 mov %esp,%ebp
100caa: 83 ec 28 sub $0x28,%esp
if (is_panic) {
100cad: a1 40 ee 10 00 mov 0x10ee40,%eax
100cb2: 85 c0 test %eax,%eax
100cb4: 74 02 je 100cb8 <__panic+0x11>
goto panic_dead;
100cb6: eb 48 jmp 100d00 <__panic+0x59>
}
is_panic = 1;
100cb8: c7 05 40 ee 10 00 01 movl $0x1,0x10ee40
100cbf: 00 00 00
// print the 'message'
va_list ap;
va_start(ap, fmt);
100cc2: 8d 45 14 lea 0x14(%ebp),%eax
100cc5: 89 45 f4 mov %eax,-0xc(%ebp)
cprintf("kernel panic at %s:%d:\n ", file, line);
100cc8: 8b 45 0c mov 0xc(%ebp),%eax
100ccb: 89 44 24 08 mov %eax,0x8(%esp)
100ccf: 8b 45 08 mov 0x8(%ebp),%eax
100cd2: 89 44 24 04 mov %eax,0x4(%esp)
100cd6: c7 04 24 de 36 10 00 movl $0x1036de,(%esp)
100cdd: e8 30 f6 ff ff call 100312 <cprintf>
vcprintf(fmt, ap);
100ce2: 8b 45 f4 mov -0xc(%ebp),%eax
100ce5: 89 44 24 04 mov %eax,0x4(%esp)
100ce9: 8b 45 10 mov 0x10(%ebp),%eax
100cec: 89 04 24 mov %eax,(%esp)
100cef: e8 eb f5 ff ff call 1002df <vcprintf>
cprintf("\n");
100cf4: c7 04 24 fa 36 10 00 movl $0x1036fa,(%esp)
100cfb: e8 12 f6 ff ff call 100312 <cprintf>
va_end(ap);
panic_dead:
intr_disable();
100d00: e8 22 09 00 00 call 101627 <intr_disable>
while (1) {
kmonitor(NULL);
100d05: c7 04 24 00 00 00 00 movl $0x0,(%esp)
100d0c: e8 b5 fe ff ff call 100bc6 <kmonitor>
}
100d11: eb f2 jmp 100d05 <__panic+0x5e>
00100d13 <__warn>:
}
/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
100d13: 55 push %ebp
100d14: 89 e5 mov %esp,%ebp
100d16: 83 ec 28 sub $0x28,%esp
va_list ap;
va_start(ap, fmt);
100d19: 8d 45 14 lea 0x14(%ebp),%eax
100d1c: 89 45 f4 mov %eax,-0xc(%ebp)
cprintf("kernel warning at %s:%d:\n ", file, line);
100d1f: 8b 45 0c mov 0xc(%ebp),%eax
100d22: 89 44 24 08 mov %eax,0x8(%esp)
100d26: 8b 45 08 mov 0x8(%ebp),%eax
100d29: 89 44 24 04 mov %eax,0x4(%esp)
100d2d: c7 04 24 fc 36 10 00 movl $0x1036fc,(%esp)
100d34: e8 d9 f5 ff ff call 100312 <cprintf>
vcprintf(fmt, ap);
100d39: 8b 45 f4 mov -0xc(%ebp),%eax
100d3c: 89 44 24 04 mov %eax,0x4(%esp)
100d40: 8b 45 10 mov 0x10(%ebp),%eax
100d43: 89 04 24 mov %eax,(%esp)
100d46: e8 94 f5 ff ff call 1002df <vcprintf>
cprintf("\n");
100d4b: c7 04 24 fa 36 10 00 movl $0x1036fa,(%esp)
100d52: e8 bb f5 ff ff call 100312 <cprintf>
va_end(ap);
}
100d57: c9 leave
100d58: c3 ret
00100d59 <is_kernel_panic>:
bool
is_kernel_panic(void) {
100d59: 55 push %ebp
100d5a: 89 e5 mov %esp,%ebp
return is_panic;
100d5c: a1 40 ee 10 00 mov 0x10ee40,%eax
}
100d61: 5d pop %ebp
100d62: c3 ret
00100d63 <clock_init>:
/* *
* clock_init - initialize 8253 clock to interrupt 100 times per second,
* and then enable IRQ_TIMER.
* */
void
clock_init(void) {
100d63: 55 push %ebp
100d64: 89 e5 mov %esp,%ebp
100d66: 83 ec 28 sub $0x28,%esp
100d69: 66 c7 45 f6 43 00 movw $0x43,-0xa(%ebp)
100d6f: c6 45 f5 34 movb $0x34,-0xb(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
100d73: 0f b6 45 f5 movzbl -0xb(%ebp),%eax
100d77: 0f b7 55 f6 movzwl -0xa(%ebp),%edx
100d7b: ee out %al,(%dx)
100d7c: 66 c7 45 f2 40 00 movw $0x40,-0xe(%ebp)
100d82: c6 45 f1 9c movb $0x9c,-0xf(%ebp)
100d86: 0f b6 45 f1 movzbl -0xf(%ebp),%eax
100d8a: 0f b7 55 f2 movzwl -0xe(%ebp),%edx
100d8e: ee out %al,(%dx)
100d8f: 66 c7 45 ee 40 00 movw $0x40,-0x12(%ebp)
100d95: c6 45 ed 2e movb $0x2e,-0x13(%ebp)
100d99: 0f b6 45 ed movzbl -0x13(%ebp),%eax
100d9d: 0f b7 55 ee movzwl -0x12(%ebp),%edx
100da1: ee out %al,(%dx)
outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
outb(IO_TIMER1, TIMER_DIV(100) % 256);
outb(IO_TIMER1, TIMER_DIV(100) / 256);
// initialize time counter 'ticks' to zero
ticks = 0;
100da2: c7 05 08 f9 10 00 00 movl $0x0,0x10f908
100da9: 00 00 00
cprintf("++ setup timer interrupts\n");
100dac: c7 04 24 1a 37 10 00 movl $0x10371a,(%esp)
100db3: e8 5a f5 ff ff call 100312 <cprintf>
pic_enable(IRQ_TIMER);
100db8: c7 04 24 00 00 00 00 movl $0x0,(%esp)
100dbf: e8 c1 08 00 00 call 101685 <pic_enable>
}
100dc4: c9 leave
100dc5: c3 ret
00100dc6 <delay>:
#include <picirq.h>
#include <trap.h>
/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
100dc6: 55 push %ebp
100dc7: 89 e5 mov %esp,%ebp
100dc9: 83 ec 10 sub $0x10,%esp
100dcc: 66 c7 45 fe 84 00 movw $0x84,-0x2(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
100dd2: 0f b7 45 fe movzwl -0x2(%ebp),%eax
100dd6: 89 c2 mov %eax,%edx
100dd8: ec in (%dx),%al
100dd9: 88 45 fd mov %al,-0x3(%ebp)
100ddc: 66 c7 45 fa 84 00 movw $0x84,-0x6(%ebp)
100de2: 0f b7 45 fa movzwl -0x6(%ebp),%eax
100de6: 89 c2 mov %eax,%edx
100de8: ec in (%dx),%al
100de9: 88 45 f9 mov %al,-0x7(%ebp)
100dec: 66 c7 45 f6 84 00 movw $0x84,-0xa(%ebp)
100df2: 0f b7 45 f6 movzwl -0xa(%ebp),%eax
100df6: 89 c2 mov %eax,%edx
100df8: ec in (%dx),%al
100df9: 88 45 f5 mov %al,-0xb(%ebp)
100dfc: 66 c7 45 f2 84 00 movw $0x84,-0xe(%ebp)
100e02: 0f b7 45 f2 movzwl -0xe(%ebp),%eax
100e06: 89 c2 mov %eax,%edx
100e08: ec in (%dx),%al
100e09: 88 45 f1 mov %al,-0xf(%ebp)
inb(0x84);
inb(0x84);
inb(0x84);
inb(0x84);
}
100e0c: c9 leave
100e0d: c3 ret
00100e0e <cga_init>:
// -- 数据寄存器 映射 到 端口 0x3D5或0x3B5
// -- 索引寄存器 0x3D4或0x3B4,决定在数据寄存器中的数据表示什么。
/* TEXT-mode CGA/VGA display output */
static void
cga_init(void) {
100e0e: 55 push %ebp
100e0f: 89 e5 mov %esp,%ebp
100e11: 83 ec 20 sub $0x20,%esp
volatile uint16_t *cp = (uint16_t *)CGA_BUF; //CGA_BUF: 0xB8000 (彩色显示的显存物理基址)
100e14: c7 45 fc 00 80 0b 00 movl $0xb8000,-0x4(%ebp)
uint16_t was = *cp; //保存当前显存0xB8000处的值
100e1b: 8b 45 fc mov -0x4(%ebp),%eax
100e1e: 0f b7 00 movzwl (%eax),%eax
100e21: 66 89 45 fa mov %ax,-0x6(%ebp)
*cp = (uint16_t) 0xA55A; // 给这个地址随便写个值,看看能否再读出同样的值
100e25: 8b 45 fc mov -0x4(%ebp),%eax
100e28: 66 c7 00 5a a5 movw $0xa55a,(%eax)
if (*cp != 0xA55A) { // 如果读不出来,说明没有这块显存,即是单显配置
100e2d: 8b 45 fc mov -0x4(%ebp),%eax
100e30: 0f b7 00 movzwl (%eax),%eax
100e33: 66 3d 5a a5 cmp $0xa55a,%ax
100e37: 74 12 je 100e4b <cga_init+0x3d>
cp = (uint16_t*)MONO_BUF; //设置为单显的显存基址 MONO_BUF: 0xB0000
100e39: c7 45 fc 00 00 0b 00 movl $0xb0000,-0x4(%ebp)
addr_6845 = MONO_BASE; //设置为单显控制的IO地址,MONO_BASE: 0x3B4
100e40: 66 c7 05 66 ee 10 00 movw $0x3b4,0x10ee66
100e47: b4 03
100e49: eb 13 jmp 100e5e <cga_init+0x50>
} else { // 如果读出来了,有这块显存,即是彩显配置
*cp = was; //还原原来显存位置的值
100e4b: 8b 45 fc mov -0x4(%ebp),%eax
100e4e: 0f b7 55 fa movzwl -0x6(%ebp),%edx
100e52: 66 89 10 mov %dx,(%eax)
addr_6845 = CGA_BASE; // 设置为彩显控制的IO地址,CGA_BASE: 0x3D4
100e55: 66 c7 05 66 ee 10 00 movw $0x3d4,0x10ee66
100e5c: d4 03
// Extract cursor location
// 6845索引寄存器的index 0x0E(及十进制的14)== 光标位置(高位)
// 6845索引寄存器的index 0x0F(及十进制的15)== 光标位置(低位)
// 6845 reg 15 : Cursor Address (Low Byte)
uint32_t pos;
outb(addr_6845, 14);
100e5e: 0f b7 05 66 ee 10 00 movzwl 0x10ee66,%eax
100e65: 0f b7 c0 movzwl %ax,%eax
100e68: 66 89 45 f2 mov %ax,-0xe(%ebp)
100e6c: c6 45 f1 0e movb $0xe,-0xf(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
100e70: 0f b6 45 f1 movzbl -0xf(%ebp),%eax
100e74: 0f b7 55 f2 movzwl -0xe(%ebp),%edx
100e78: ee out %al,(%dx)
pos = inb(addr_6845 + 1) << 8; //读出了光标位置(高位)
100e79: 0f b7 05 66 ee 10 00 movzwl 0x10ee66,%eax
100e80: 83 c0 01 add $0x1,%eax
100e83: 0f b7 c0 movzwl %ax,%eax
100e86: 66 89 45 ee mov %ax,-0x12(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
100e8a: 0f b7 45 ee movzwl -0x12(%ebp),%eax
100e8e: 89 c2 mov %eax,%edx
100e90: ec in (%dx),%al
100e91: 88 45 ed mov %al,-0x13(%ebp)
return data;
100e94: 0f b6 45 ed movzbl -0x13(%ebp),%eax
100e98: 0f b6 c0 movzbl %al,%eax
100e9b: c1 e0 08 shl $0x8,%eax
100e9e: 89 45 f4 mov %eax,-0xc(%ebp)
outb(addr_6845, 15);
100ea1: 0f b7 05 66 ee 10 00 movzwl 0x10ee66,%eax
100ea8: 0f b7 c0 movzwl %ax,%eax
100eab: 66 89 45 ea mov %ax,-0x16(%ebp)
100eaf: c6 45 e9 0f movb $0xf,-0x17(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
100eb3: 0f b6 45 e9 movzbl -0x17(%ebp),%eax
100eb7: 0f b7 55 ea movzwl -0x16(%ebp),%edx
100ebb: ee out %al,(%dx)
pos |= inb(addr_6845 + 1); //读出了光标位置(低位)
100ebc: 0f b7 05 66 ee 10 00 movzwl 0x10ee66,%eax
100ec3: 83 c0 01 add $0x1,%eax
100ec6: 0f b7 c0 movzwl %ax,%eax
100ec9: 66 89 45 e6 mov %ax,-0x1a(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
100ecd: 0f b7 45 e6 movzwl -0x1a(%ebp),%eax
100ed1: 89 c2 mov %eax,%edx
100ed3: ec in (%dx),%al
100ed4: 88 45 e5 mov %al,-0x1b(%ebp)
return data;
100ed7: 0f b6 45 e5 movzbl -0x1b(%ebp),%eax
100edb: 0f b6 c0 movzbl %al,%eax
100ede: 09 45 f4 or %eax,-0xc(%ebp)
crt_buf = (uint16_t*) cp; //crt_buf是CGA显存起始地址
100ee1: 8b 45 fc mov -0x4(%ebp),%eax
100ee4: a3 60 ee 10 00 mov %eax,0x10ee60
crt_pos = pos; //crt_pos是CGA当前光标位置
100ee9: 8b 45 f4 mov -0xc(%ebp),%eax
100eec: 66 a3 64 ee 10 00 mov %ax,0x10ee64
}
100ef2: c9 leave
100ef3: c3 ret
00100ef4 <serial_init>:
static bool serial_exists = 0;
static void
serial_init(void) {
100ef4: 55 push %ebp
100ef5: 89 e5 mov %esp,%ebp
100ef7: 83 ec 48 sub $0x48,%esp
100efa: 66 c7 45 f6 fa 03 movw $0x3fa,-0xa(%ebp)
100f00: c6 45 f5 00 movb $0x0,-0xb(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
100f04: 0f b6 45 f5 movzbl -0xb(%ebp),%eax
100f08: 0f b7 55 f6 movzwl -0xa(%ebp),%edx
100f0c: ee out %al,(%dx)
100f0d: 66 c7 45 f2 fb 03 movw $0x3fb,-0xe(%ebp)
100f13: c6 45 f1 80 movb $0x80,-0xf(%ebp)
100f17: 0f b6 45 f1 movzbl -0xf(%ebp),%eax
100f1b: 0f b7 55 f2 movzwl -0xe(%ebp),%edx
100f1f: ee out %al,(%dx)
100f20: 66 c7 45 ee f8 03 movw $0x3f8,-0x12(%ebp)
100f26: c6 45 ed 0c movb $0xc,-0x13(%ebp)
100f2a: 0f b6 45 ed movzbl -0x13(%ebp),%eax
100f2e: 0f b7 55 ee movzwl -0x12(%ebp),%edx
100f32: ee out %al,(%dx)
100f33: 66 c7 45 ea f9 03 movw $0x3f9,-0x16(%ebp)
100f39: c6 45 e9 00 movb $0x0,-0x17(%ebp)
100f3d: 0f b6 45 e9 movzbl -0x17(%ebp),%eax
100f41: 0f b7 55 ea movzwl -0x16(%ebp),%edx
100f45: ee out %al,(%dx)
100f46: 66 c7 45 e6 fb 03 movw $0x3fb,-0x1a(%ebp)
100f4c: c6 45 e5 03 movb $0x3,-0x1b(%ebp)
100f50: 0f b6 45 e5 movzbl -0x1b(%ebp),%eax
100f54: 0f b7 55 e6 movzwl -0x1a(%ebp),%edx
100f58: ee out %al,(%dx)
100f59: 66 c7 45 e2 fc 03 movw $0x3fc,-0x1e(%ebp)
100f5f: c6 45 e1 00 movb $0x0,-0x1f(%ebp)
100f63: 0f b6 45 e1 movzbl -0x1f(%ebp),%eax
100f67: 0f b7 55 e2 movzwl -0x1e(%ebp),%edx
100f6b: ee out %al,(%dx)
100f6c: 66 c7 45 de f9 03 movw $0x3f9,-0x22(%ebp)
100f72: c6 45 dd 01 movb $0x1,-0x23(%ebp)
100f76: 0f b6 45 dd movzbl -0x23(%ebp),%eax
100f7a: 0f b7 55 de movzwl -0x22(%ebp),%edx
100f7e: ee out %al,(%dx)
100f7f: 66 c7 45 da fd 03 movw $0x3fd,-0x26(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
100f85: 0f b7 45 da movzwl -0x26(%ebp),%eax
100f89: 89 c2 mov %eax,%edx
100f8b: ec in (%dx),%al
100f8c: 88 45 d9 mov %al,-0x27(%ebp)
return data;
100f8f: 0f b6 45 d9 movzbl -0x27(%ebp),%eax
// Enable rcv interrupts
outb(COM1 + COM_IER, COM_IER_RDI);
// Clear any preexisting overrun indications and interrupts
// Serial port doesn't exist if COM_LSR returns 0xFF
serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
100f93: 3c ff cmp $0xff,%al
100f95: 0f 95 c0 setne %al
100f98: 0f b6 c0 movzbl %al,%eax
100f9b: a3 68 ee 10 00 mov %eax,0x10ee68
100fa0: 66 c7 45 d6 fa 03 movw $0x3fa,-0x2a(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
100fa6: 0f b7 45 d6 movzwl -0x2a(%ebp),%eax
100faa: 89 c2 mov %eax,%edx
100fac: ec in (%dx),%al
100fad: 88 45 d5 mov %al,-0x2b(%ebp)
100fb0: 66 c7 45 d2 f8 03 movw $0x3f8,-0x2e(%ebp)
100fb6: 0f b7 45 d2 movzwl -0x2e(%ebp),%eax
100fba: 89 c2 mov %eax,%edx
100fbc: ec in (%dx),%al
100fbd: 88 45 d1 mov %al,-0x2f(%ebp)
(void) inb(COM1+COM_IIR);
(void) inb(COM1+COM_RX);
if (serial_exists) {
100fc0: a1 68 ee 10 00 mov 0x10ee68,%eax
100fc5: 85 c0 test %eax,%eax
100fc7: 74 0c je 100fd5 <serial_init+0xe1>
pic_enable(IRQ_COM1);
100fc9: c7 04 24 04 00 00 00 movl $0x4,(%esp)
100fd0: e8 b0 06 00 00 call 101685 <pic_enable>
}
}
100fd5: c9 leave
100fd6: c3 ret
00100fd7 <lpt_putc_sub>:
static void
lpt_putc_sub(int c) {
100fd7: 55 push %ebp
100fd8: 89 e5 mov %esp,%ebp
100fda: 83 ec 20 sub $0x20,%esp
int i;
for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
100fdd: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
100fe4: eb 09 jmp 100fef <lpt_putc_sub+0x18>
delay();
100fe6: e8 db fd ff ff call 100dc6 <delay>
}
static void
lpt_putc_sub(int c) {
int i;
for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
100feb: 83 45 fc 01 addl $0x1,-0x4(%ebp)
100fef: 66 c7 45 fa 79 03 movw $0x379,-0x6(%ebp)
100ff5: 0f b7 45 fa movzwl -0x6(%ebp),%eax
100ff9: 89 c2 mov %eax,%edx
100ffb: ec in (%dx),%al
100ffc: 88 45 f9 mov %al,-0x7(%ebp)
return data;
100fff: 0f b6 45 f9 movzbl -0x7(%ebp),%eax
101003: 84 c0 test %al,%al
101005: 78 09 js 101010 <lpt_putc_sub+0x39>
101007: 81 7d fc ff 31 00 00 cmpl $0x31ff,-0x4(%ebp)
10100e: 7e d6 jle 100fe6 <lpt_putc_sub+0xf>
delay();
}
outb(LPTPORT + 0, c);
101010: 8b 45 08 mov 0x8(%ebp),%eax
101013: 0f b6 c0 movzbl %al,%eax
101016: 66 c7 45 f6 78 03 movw $0x378,-0xa(%ebp)
10101c: 88 45 f5 mov %al,-0xb(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
10101f: 0f b6 45 f5 movzbl -0xb(%ebp),%eax
101023: 0f b7 55 f6 movzwl -0xa(%ebp),%edx
101027: ee out %al,(%dx)
101028: 66 c7 45 f2 7a 03 movw $0x37a,-0xe(%ebp)
10102e: c6 45 f1 0d movb $0xd,-0xf(%ebp)
101032: 0f b6 45 f1 movzbl -0xf(%ebp),%eax
101036: 0f b7 55 f2 movzwl -0xe(%ebp),%edx
10103a: ee out %al,(%dx)
10103b: 66 c7 45 ee 7a 03 movw $0x37a,-0x12(%ebp)
101041: c6 45 ed 08 movb $0x8,-0x13(%ebp)
101045: 0f b6 45 ed movzbl -0x13(%ebp),%eax
101049: 0f b7 55 ee movzwl -0x12(%ebp),%edx
10104d: ee out %al,(%dx)
outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
outb(LPTPORT + 2, 0x08);
}
10104e: c9 leave
10104f: c3 ret
00101050 <lpt_putc>:
/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
101050: 55 push %ebp
101051: 89 e5 mov %esp,%ebp
101053: 83 ec 04 sub $0x4,%esp
if (c != '\b') {
101056: 83 7d 08 08 cmpl $0x8,0x8(%ebp)
10105a: 74 0d je 101069 <lpt_putc+0x19>
lpt_putc_sub(c);
10105c: 8b 45 08 mov 0x8(%ebp),%eax
10105f: 89 04 24 mov %eax,(%esp)
101062: e8 70 ff ff ff call 100fd7 <lpt_putc_sub>
101067: eb 24 jmp 10108d <lpt_putc+0x3d>
}
else {
lpt_putc_sub('\b');
101069: c7 04 24 08 00 00 00 movl $0x8,(%esp)
101070: e8 62 ff ff ff call 100fd7 <lpt_putc_sub>
lpt_putc_sub(' ');
101075: c7 04 24 20 00 00 00 movl $0x20,(%esp)
10107c: e8 56 ff ff ff call 100fd7 <lpt_putc_sub>
lpt_putc_sub('\b');
101081: c7 04 24 08 00 00 00 movl $0x8,(%esp)
101088: e8 4a ff ff ff call 100fd7 <lpt_putc_sub>
}
}
10108d: c9 leave
10108e: c3 ret
0010108f <cga_putc>:
/* cga_putc - print character to console */
static void
cga_putc(int c) {
10108f: 55 push %ebp
101090: 89 e5 mov %esp,%ebp
101092: 53 push %ebx
101093: 83 ec 34 sub $0x34,%esp
// set black on white
if (!(c & ~0xFF)) {
101096: 8b 45 08 mov 0x8(%ebp),%eax
101099: b0 00 mov $0x0,%al
10109b: 85 c0 test %eax,%eax
10109d: 75 07 jne 1010a6 <cga_putc+0x17>
c |= 0x0700;
10109f: 81 4d 08 00 07 00 00 orl $0x700,0x8(%ebp)
}
switch (c & 0xff) {
1010a6: 8b 45 08 mov 0x8(%ebp),%eax
1010a9: 0f b6 c0 movzbl %al,%eax
1010ac: 83 f8 0a cmp $0xa,%eax
1010af: 74 4c je 1010fd <cga_putc+0x6e>
1010b1: 83 f8 0d cmp $0xd,%eax
1010b4: 74 57 je 10110d <cga_putc+0x7e>
1010b6: 83 f8 08 cmp $0x8,%eax
1010b9: 0f 85 88 00 00 00 jne 101147 <cga_putc+0xb8>
case '\b':
if (crt_pos > 0) {
1010bf: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
1010c6: 66 85 c0 test %ax,%ax
1010c9: 74 30 je 1010fb <cga_putc+0x6c>
crt_pos --;
1010cb: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
1010d2: 83 e8 01 sub $0x1,%eax
1010d5: 66 a3 64 ee 10 00 mov %ax,0x10ee64
crt_buf[crt_pos] = (c & ~0xff) | ' ';
1010db: a1 60 ee 10 00 mov 0x10ee60,%eax
1010e0: 0f b7 15 64 ee 10 00 movzwl 0x10ee64,%edx
1010e7: 0f b7 d2 movzwl %dx,%edx
1010ea: 01 d2 add %edx,%edx
1010ec: 01 c2 add %eax,%edx
1010ee: 8b 45 08 mov 0x8(%ebp),%eax
1010f1: b0 00 mov $0x0,%al
1010f3: 83 c8 20 or $0x20,%eax
1010f6: 66 89 02 mov %ax,(%edx)
}
break;
1010f9: eb 72 jmp 10116d <cga_putc+0xde>
1010fb: eb 70 jmp 10116d <cga_putc+0xde>
case '\n':
crt_pos += CRT_COLS;
1010fd: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
101104: 83 c0 50 add $0x50,%eax
101107: 66 a3 64 ee 10 00 mov %ax,0x10ee64
case '\r':
crt_pos -= (crt_pos % CRT_COLS);
10110d: 0f b7 1d 64 ee 10 00 movzwl 0x10ee64,%ebx
101114: 0f b7 0d 64 ee 10 00 movzwl 0x10ee64,%ecx
10111b: 0f b7 c1 movzwl %cx,%eax
10111e: 69 c0 cd cc 00 00 imul $0xcccd,%eax,%eax
101124: c1 e8 10 shr $0x10,%eax
101127: 89 c2 mov %eax,%edx
101129: 66 c1 ea 06 shr $0x6,%dx
10112d: 89 d0 mov %edx,%eax
10112f: c1 e0 02 shl $0x2,%eax
101132: 01 d0 add %edx,%eax
101134: c1 e0 04 shl $0x4,%eax
101137: 29 c1 sub %eax,%ecx
101139: 89 ca mov %ecx,%edx
10113b: 89 d8 mov %ebx,%eax
10113d: 29 d0 sub %edx,%eax
10113f: 66 a3 64 ee 10 00 mov %ax,0x10ee64
break;
101145: eb 26 jmp 10116d <cga_putc+0xde>
default:
crt_buf[crt_pos ++] = c; // write the character
101147: 8b 0d 60 ee 10 00 mov 0x10ee60,%ecx
10114d: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
101154: 8d 50 01 lea 0x1(%eax),%edx
101157: 66 89 15 64 ee 10 00 mov %dx,0x10ee64
10115e: 0f b7 c0 movzwl %ax,%eax
101161: 01 c0 add %eax,%eax
101163: 8d 14 01 lea (%ecx,%eax,1),%edx
101166: 8b 45 08 mov 0x8(%ebp),%eax
101169: 66 89 02 mov %ax,(%edx)
break;
10116c: 90 nop
}
// What is the purpose of this?
if (crt_pos >= CRT_SIZE) {
10116d: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
101174: 66 3d cf 07 cmp $0x7cf,%ax
101178: 76 5b jbe 1011d5 <cga_putc+0x146>
int i;
memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
10117a: a1 60 ee 10 00 mov 0x10ee60,%eax
10117f: 8d 90 a0 00 00 00 lea 0xa0(%eax),%edx
101185: a1 60 ee 10 00 mov 0x10ee60,%eax
10118a: c7 44 24 08 00 0f 00 movl $0xf00,0x8(%esp)
101191: 00
101192: 89 54 24 04 mov %edx,0x4(%esp)
101196: 89 04 24 mov %eax,(%esp)
101199: e8 16 21 00 00 call 1032b4 <memmove>
for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
10119e: c7 45 f4 80 07 00 00 movl $0x780,-0xc(%ebp)
1011a5: eb 15 jmp 1011bc <cga_putc+0x12d>
crt_buf[i] = 0x0700 | ' ';
1011a7: a1 60 ee 10 00 mov 0x10ee60,%eax
1011ac: 8b 55 f4 mov -0xc(%ebp),%edx
1011af: 01 d2 add %edx,%edx
1011b1: 01 d0 add %edx,%eax
1011b3: 66 c7 00 20 07 movw $0x720,(%eax)
// What is the purpose of this?
if (crt_pos >= CRT_SIZE) {
int i;
memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
1011b8: 83 45 f4 01 addl $0x1,-0xc(%ebp)
1011bc: 81 7d f4 cf 07 00 00 cmpl $0x7cf,-0xc(%ebp)
1011c3: 7e e2 jle 1011a7 <cga_putc+0x118>
crt_buf[i] = 0x0700 | ' ';
}
crt_pos -= CRT_COLS;
1011c5: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
1011cc: 83 e8 50 sub $0x50,%eax
1011cf: 66 a3 64 ee 10 00 mov %ax,0x10ee64
}
// move that little blinky thing
outb(addr_6845, 14);
1011d5: 0f b7 05 66 ee 10 00 movzwl 0x10ee66,%eax
1011dc: 0f b7 c0 movzwl %ax,%eax
1011df: 66 89 45 f2 mov %ax,-0xe(%ebp)
1011e3: c6 45 f1 0e movb $0xe,-0xf(%ebp)
1011e7: 0f b6 45 f1 movzbl -0xf(%ebp),%eax
1011eb: 0f b7 55 f2 movzwl -0xe(%ebp),%edx
1011ef: ee out %al,(%dx)
outb(addr_6845 + 1, crt_pos >> 8);
1011f0: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
1011f7: 66 c1 e8 08 shr $0x8,%ax
1011fb: 0f b6 c0 movzbl %al,%eax
1011fe: 0f b7 15 66 ee 10 00 movzwl 0x10ee66,%edx
101205: 83 c2 01 add $0x1,%edx
101208: 0f b7 d2 movzwl %dx,%edx
10120b: 66 89 55 ee mov %dx,-0x12(%ebp)
10120f: 88 45 ed mov %al,-0x13(%ebp)
101212: 0f b6 45 ed movzbl -0x13(%ebp),%eax
101216: 0f b7 55 ee movzwl -0x12(%ebp),%edx
10121a: ee out %al,(%dx)
outb(addr_6845, 15);
10121b: 0f b7 05 66 ee 10 00 movzwl 0x10ee66,%eax
101222: 0f b7 c0 movzwl %ax,%eax
101225: 66 89 45 ea mov %ax,-0x16(%ebp)
101229: c6 45 e9 0f movb $0xf,-0x17(%ebp)
10122d: 0f b6 45 e9 movzbl -0x17(%ebp),%eax
101231: 0f b7 55 ea movzwl -0x16(%ebp),%edx
101235: ee out %al,(%dx)
outb(addr_6845 + 1, crt_pos);
101236: 0f b7 05 64 ee 10 00 movzwl 0x10ee64,%eax
10123d: 0f b6 c0 movzbl %al,%eax
101240: 0f b7 15 66 ee 10 00 movzwl 0x10ee66,%edx
101247: 83 c2 01 add $0x1,%edx
10124a: 0f b7 d2 movzwl %dx,%edx
10124d: 66 89 55 e6 mov %dx,-0x1a(%ebp)
101251: 88 45 e5 mov %al,-0x1b(%ebp)
101254: 0f b6 45 e5 movzbl -0x1b(%ebp),%eax
101258: 0f b7 55 e6 movzwl -0x1a(%ebp),%edx
10125c: ee out %al,(%dx)
}
10125d: 83 c4 34 add $0x34,%esp
101260: 5b pop %ebx
101261: 5d pop %ebp
101262: c3 ret
00101263 <serial_putc_sub>:
static void
serial_putc_sub(int c) {
101263: 55 push %ebp
101264: 89 e5 mov %esp,%ebp
101266: 83 ec 10 sub $0x10,%esp
int i;
for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
101269: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
101270: eb 09 jmp 10127b <serial_putc_sub+0x18>
delay();
101272: e8 4f fb ff ff call 100dc6 <delay>
}
static void
serial_putc_sub(int c) {
int i;
for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
101277: 83 45 fc 01 addl $0x1,-0x4(%ebp)
10127b: 66 c7 45 fa fd 03 movw $0x3fd,-0x6(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
101281: 0f b7 45 fa movzwl -0x6(%ebp),%eax
101285: 89 c2 mov %eax,%edx
101287: ec in (%dx),%al
101288: 88 45 f9 mov %al,-0x7(%ebp)
return data;
10128b: 0f b6 45 f9 movzbl -0x7(%ebp),%eax
10128f: 0f b6 c0 movzbl %al,%eax
101292: 83 e0 20 and $0x20,%eax
101295: 85 c0 test %eax,%eax
101297: 75 09 jne 1012a2 <serial_putc_sub+0x3f>
101299: 81 7d fc ff 31 00 00 cmpl $0x31ff,-0x4(%ebp)
1012a0: 7e d0 jle 101272 <serial_putc_sub+0xf>
delay();
}
outb(COM1 + COM_TX, c);
1012a2: 8b 45 08 mov 0x8(%ebp),%eax
1012a5: 0f b6 c0 movzbl %al,%eax
1012a8: 66 c7 45 f6 f8 03 movw $0x3f8,-0xa(%ebp)
1012ae: 88 45 f5 mov %al,-0xb(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
1012b1: 0f b6 45 f5 movzbl -0xb(%ebp),%eax
1012b5: 0f b7 55 f6 movzwl -0xa(%ebp),%edx
1012b9: ee out %al,(%dx)
}
1012ba: c9 leave
1012bb: c3 ret
001012bc <serial_putc>:
/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
1012bc: 55 push %ebp
1012bd: 89 e5 mov %esp,%ebp
1012bf: 83 ec 04 sub $0x4,%esp
if (c != '\b') {
1012c2: 83 7d 08 08 cmpl $0x8,0x8(%ebp)
1012c6: 74 0d je 1012d5 <serial_putc+0x19>
serial_putc_sub(c);
1012c8: 8b 45 08 mov 0x8(%ebp),%eax
1012cb: 89 04 24 mov %eax,(%esp)
1012ce: e8 90 ff ff ff call 101263 <serial_putc_sub>
1012d3: eb 24 jmp 1012f9 <serial_putc+0x3d>
}
else {
serial_putc_sub('\b');
1012d5: c7 04 24 08 00 00 00 movl $0x8,(%esp)
1012dc: e8 82 ff ff ff call 101263 <serial_putc_sub>
serial_putc_sub(' ');
1012e1: c7 04 24 20 00 00 00 movl $0x20,(%esp)
1012e8: e8 76 ff ff ff call 101263 <serial_putc_sub>
serial_putc_sub('\b');
1012ed: c7 04 24 08 00 00 00 movl $0x8,(%esp)
1012f4: e8 6a ff ff ff call 101263 <serial_putc_sub>
}
}
1012f9: c9 leave
1012fa: c3 ret
001012fb <cons_intr>:
/* *
* cons_intr - called by device interrupt routines to feed input
* characters into the circular console input buffer.
* */
static void
cons_intr(int (*proc)(void)) {
1012fb: 55 push %ebp
1012fc: 89 e5 mov %esp,%ebp
1012fe: 83 ec 18 sub $0x18,%esp
int c;
while ((c = (*proc)()) != -1) {
101301: eb 33 jmp 101336 <cons_intr+0x3b>
if (c != 0) {
101303: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
101307: 74 2d je 101336 <cons_intr+0x3b>
cons.buf[cons.wpos ++] = c;
101309: a1 84 f0 10 00 mov 0x10f084,%eax
10130e: 8d 50 01 lea 0x1(%eax),%edx
101311: 89 15 84 f0 10 00 mov %edx,0x10f084
101317: 8b 55 f4 mov -0xc(%ebp),%edx
10131a: 88 90 80 ee 10 00 mov %dl,0x10ee80(%eax)
if (cons.wpos == CONSBUFSIZE) {
101320: a1 84 f0 10 00 mov 0x10f084,%eax
101325: 3d 00 02 00 00 cmp $0x200,%eax
10132a: 75 0a jne 101336 <cons_intr+0x3b>
cons.wpos = 0;
10132c: c7 05 84 f0 10 00 00 movl $0x0,0x10f084
101333: 00 00 00
* characters into the circular console input buffer.
* */
static void
cons_intr(int (*proc)(void)) {
int c;
while ((c = (*proc)()) != -1) {
101336: 8b 45 08 mov 0x8(%ebp),%eax
101339: ff d0 call *%eax
10133b: 89 45 f4 mov %eax,-0xc(%ebp)
10133e: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
101342: 75 bf jne 101303 <cons_intr+0x8>
if (cons.wpos == CONSBUFSIZE) {
cons.wpos = 0;
}
}
}
}
101344: c9 leave
101345: c3 ret
00101346 <serial_proc_data>:
/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
101346: 55 push %ebp
101347: 89 e5 mov %esp,%ebp
101349: 83 ec 10 sub $0x10,%esp
10134c: 66 c7 45 fa fd 03 movw $0x3fd,-0x6(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
101352: 0f b7 45 fa movzwl -0x6(%ebp),%eax
101356: 89 c2 mov %eax,%edx
101358: ec in (%dx),%al
101359: 88 45 f9 mov %al,-0x7(%ebp)
return data;
10135c: 0f b6 45 f9 movzbl -0x7(%ebp),%eax
if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
101360: 0f b6 c0 movzbl %al,%eax
101363: 83 e0 01 and $0x1,%eax
101366: 85 c0 test %eax,%eax
101368: 75 07 jne 101371 <serial_proc_data+0x2b>
return -1;
10136a: b8 ff ff ff ff mov $0xffffffff,%eax
10136f: eb 2a jmp 10139b <serial_proc_data+0x55>
101371: 66 c7 45 f6 f8 03 movw $0x3f8,-0xa(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
101377: 0f b7 45 f6 movzwl -0xa(%ebp),%eax
10137b: 89 c2 mov %eax,%edx
10137d: ec in (%dx),%al
10137e: 88 45 f5 mov %al,-0xb(%ebp)
return data;
101381: 0f b6 45 f5 movzbl -0xb(%ebp),%eax
}
int c = inb(COM1 + COM_RX);
101385: 0f b6 c0 movzbl %al,%eax
101388: 89 45 fc mov %eax,-0x4(%ebp)
if (c == 127) {
10138b: 83 7d fc 7f cmpl $0x7f,-0x4(%ebp)
10138f: 75 07 jne 101398 <serial_proc_data+0x52>
c = '\b';
101391: c7 45 fc 08 00 00 00 movl $0x8,-0x4(%ebp)
}
return c;
101398: 8b 45 fc mov -0x4(%ebp),%eax
}
10139b: c9 leave
10139c: c3 ret
0010139d <serial_intr>:
/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
10139d: 55 push %ebp
10139e: 89 e5 mov %esp,%ebp
1013a0: 83 ec 18 sub $0x18,%esp
if (serial_exists) {
1013a3: a1 68 ee 10 00 mov 0x10ee68,%eax
1013a8: 85 c0 test %eax,%eax
1013aa: 74 0c je 1013b8 <serial_intr+0x1b>
cons_intr(serial_proc_data);
1013ac: c7 04 24 46 13 10 00 movl $0x101346,(%esp)
1013b3: e8 43 ff ff ff call 1012fb <cons_intr>
}
}
1013b8: c9 leave
1013b9: c3 ret
001013ba <kbd_proc_data>:
*
* The kbd_proc_data() function gets data from the keyboard.
* If we finish a character, return it, else 0. And return -1 if no data.
* */
static int
kbd_proc_data(void) {
1013ba: 55 push %ebp
1013bb: 89 e5 mov %esp,%ebp
1013bd: 83 ec 38 sub $0x38,%esp
1013c0: 66 c7 45 f0 64 00 movw $0x64,-0x10(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
1013c6: 0f b7 45 f0 movzwl -0x10(%ebp),%eax
1013ca: 89 c2 mov %eax,%edx
1013cc: ec in (%dx),%al
1013cd: 88 45 ef mov %al,-0x11(%ebp)
return data;
1013d0: 0f b6 45 ef movzbl -0x11(%ebp),%eax
int c;
uint8_t data;
static uint32_t shift;
if ((inb(KBSTATP) & KBS_DIB) == 0) {
1013d4: 0f b6 c0 movzbl %al,%eax
1013d7: 83 e0 01 and $0x1,%eax
1013da: 85 c0 test %eax,%eax
1013dc: 75 0a jne 1013e8 <kbd_proc_data+0x2e>
return -1;
1013de: b8 ff ff ff ff mov $0xffffffff,%eax
1013e3: e9 59 01 00 00 jmp 101541 <kbd_proc_data+0x187>
1013e8: 66 c7 45 ec 60 00 movw $0x60,-0x14(%ebp)
static inline void ltr(uint16_t sel) __attribute__((always_inline));
static inline uint8_t
inb(uint16_t port) {
uint8_t data;
asm volatile ("inb %1, %0" : "=a" (data) : "d" (port));
1013ee: 0f b7 45 ec movzwl -0x14(%ebp),%eax
1013f2: 89 c2 mov %eax,%edx
1013f4: ec in (%dx),%al
1013f5: 88 45 eb mov %al,-0x15(%ebp)
return data;
1013f8: 0f b6 45 eb movzbl -0x15(%ebp),%eax
}
data = inb(KBDATAP);
1013fc: 88 45 f3 mov %al,-0xd(%ebp)
if (data == 0xE0) {
1013ff: 80 7d f3 e0 cmpb $0xe0,-0xd(%ebp)
101403: 75 17 jne 10141c <kbd_proc_data+0x62>
// E0 escape character
shift |= E0ESC;
101405: a1 88 f0 10 00 mov 0x10f088,%eax
10140a: 83 c8 40 or $0x40,%eax
10140d: a3 88 f0 10 00 mov %eax,0x10f088
return 0;
101412: b8 00 00 00 00 mov $0x0,%eax
101417: e9 25 01 00 00 jmp 101541 <kbd_proc_data+0x187>
} else if (data & 0x80) {
10141c: 0f b6 45 f3 movzbl -0xd(%ebp),%eax
101420: 84 c0 test %al,%al
101422: 79 47 jns 10146b <kbd_proc_data+0xb1>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
101424: a1 88 f0 10 00 mov 0x10f088,%eax
101429: 83 e0 40 and $0x40,%eax
10142c: 85 c0 test %eax,%eax
10142e: 75 09 jne 101439 <kbd_proc_data+0x7f>
101430: 0f b6 45 f3 movzbl -0xd(%ebp),%eax
101434: 83 e0 7f and $0x7f,%eax
101437: eb 04 jmp 10143d <kbd_proc_data+0x83>
101439: 0f b6 45 f3 movzbl -0xd(%ebp),%eax
10143d: 88 45 f3 mov %al,-0xd(%ebp)
shift &= ~(shiftcode[data] | E0ESC);
101440: 0f b6 45 f3 movzbl -0xd(%ebp),%eax
101444: 0f b6 80 40 e0 10 00 movzbl 0x10e040(%eax),%eax
10144b: 83 c8 40 or $0x40,%eax
10144e: 0f b6 c0 movzbl %al,%eax
101451: f7 d0 not %eax
101453: 89 c2 mov %eax,%edx
101455: a1 88 f0 10 00 mov 0x10f088,%eax
10145a: 21 d0 and %edx,%eax
10145c: a3 88 f0 10 00 mov %eax,0x10f088
return 0;
101461: b8 00 00 00 00 mov $0x0,%eax
101466: e9 d6 00 00 00 jmp 101541 <kbd_proc_data+0x187>
} else if (shift & E0ESC) {
10146b: a1 88 f0 10 00 mov 0x10f088,%eax
101470: 83 e0 40 and $0x40,%eax
101473: 85 c0 test %eax,%eax
101475: 74 11 je 101488 <kbd_proc_data+0xce>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
101477: 80 4d f3 80 orb $0x80,-0xd(%ebp)
shift &= ~E0ESC;
10147b: a1 88 f0 10 00 mov 0x10f088,%eax
101480: 83 e0 bf and $0xffffffbf,%eax
101483: a3 88 f0 10 00 mov %eax,0x10f088
}
shift |= shiftcode[data];
101488: 0f b6 45 f3 movzbl -0xd(%ebp),%eax
10148c: 0f b6 80 40 e0 10 00 movzbl 0x10e040(%eax),%eax
101493: 0f b6 d0 movzbl %al,%edx
101496: a1 88 f0 10 00 mov 0x10f088,%eax
10149b: 09 d0 or %edx,%eax
10149d: a3 88 f0 10 00 mov %eax,0x10f088
shift ^= togglecode[data];
1014a2: 0f b6 45 f3 movzbl -0xd(%ebp),%eax
1014a6: 0f b6 80 40 e1 10 00 movzbl 0x10e140(%eax),%eax
1014ad: 0f b6 d0 movzbl %al,%edx
1014b0: a1 88 f0 10 00 mov 0x10f088,%eax
1014b5: 31 d0 xor %edx,%eax
1014b7: a3 88 f0 10 00 mov %eax,0x10f088
c = charcode[shift & (CTL | SHIFT)][data];
1014bc: a1 88 f0 10 00 mov 0x10f088,%eax
1014c1: 83 e0 03 and $0x3,%eax
1014c4: 8b 14 85 40 e5 10 00 mov 0x10e540(,%eax,4),%edx
1014cb: 0f b6 45 f3 movzbl -0xd(%ebp),%eax
1014cf: 01 d0 add %edx,%eax
1014d1: 0f b6 00 movzbl (%eax),%eax
1014d4: 0f b6 c0 movzbl %al,%eax
1014d7: 89 45 f4 mov %eax,-0xc(%ebp)
if (shift & CAPSLOCK) {
1014da: a1 88 f0 10 00 mov 0x10f088,%eax
1014df: 83 e0 08 and $0x8,%eax
1014e2: 85 c0 test %eax,%eax
1014e4: 74 22 je 101508 <kbd_proc_data+0x14e>
if ('a' <= c && c <= 'z')
1014e6: 83 7d f4 60 cmpl $0x60,-0xc(%ebp)
1014ea: 7e 0c jle 1014f8 <kbd_proc_data+0x13e>
1014ec: 83 7d f4 7a cmpl $0x7a,-0xc(%ebp)
1014f0: 7f 06 jg 1014f8 <kbd_proc_data+0x13e>
c += 'A' - 'a';
1014f2: 83 6d f4 20 subl $0x20,-0xc(%ebp)
1014f6: eb 10 jmp 101508 <kbd_proc_data+0x14e>
else if ('A' <= c && c <= 'Z')
1014f8: 83 7d f4 40 cmpl $0x40,-0xc(%ebp)
1014fc: 7e 0a jle 101508 <kbd_proc_data+0x14e>
1014fe: 83 7d f4 5a cmpl $0x5a,-0xc(%ebp)
101502: 7f 04 jg 101508 <kbd_proc_data+0x14e>
c += 'a' - 'A';
101504: 83 45 f4 20 addl $0x20,-0xc(%ebp)
}
// Process special keys
// Ctrl-Alt-Del: reboot
if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
101508: a1 88 f0 10 00 mov 0x10f088,%eax
10150d: f7 d0 not %eax
10150f: 83 e0 06 and $0x6,%eax
101512: 85 c0 test %eax,%eax
101514: 75 28 jne 10153e <kbd_proc_data+0x184>
101516: 81 7d f4 e9 00 00 00 cmpl $0xe9,-0xc(%ebp)
10151d: 75 1f jne 10153e <kbd_proc_data+0x184>
cprintf("Rebooting!\n");
10151f: c7 04 24 35 37 10 00 movl $0x103735,(%esp)
101526: e8 e7 ed ff ff call 100312 <cprintf>
10152b: 66 c7 45 e8 92 00 movw $0x92,-0x18(%ebp)
101531: c6 45 e7 03 movb $0x3,-0x19(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
101535: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
101539: 0f b7 55 e8 movzwl -0x18(%ebp),%edx
10153d: ee out %al,(%dx)
outb(0x92, 0x3); // courtesy of <NAME>
}
return c;
10153e: 8b 45 f4 mov -0xc(%ebp),%eax
}
101541: c9 leave
101542: c3 ret
00101543 <kbd_intr>:
/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
101543: 55 push %ebp
101544: 89 e5 mov %esp,%ebp
101546: 83 ec 18 sub $0x18,%esp
cons_intr(kbd_proc_data);
101549: c7 04 24 ba 13 10 00 movl $0x1013ba,(%esp)
101550: e8 a6 fd ff ff call 1012fb <cons_intr>
}
101555: c9 leave
101556: c3 ret
00101557 <kbd_init>:
static void
kbd_init(void) {
101557: 55 push %ebp
101558: 89 e5 mov %esp,%ebp
10155a: 83 ec 18 sub $0x18,%esp
// drain the kbd buffer
kbd_intr();
10155d: e8 e1 ff ff ff call 101543 <kbd_intr>
pic_enable(IRQ_KBD);
101562: c7 04 24 01 00 00 00 movl $0x1,(%esp)
101569: e8 17 01 00 00 call 101685 <pic_enable>
}
10156e: c9 leave
10156f: c3 ret
00101570 <cons_init>:
/* cons_init - initializes the console devices */
void
cons_init(void) {
101570: 55 push %ebp
101571: 89 e5 mov %esp,%ebp
101573: 83 ec 18 sub $0x18,%esp
cga_init();
101576: e8 93 f8 ff ff call 100e0e <cga_init>
serial_init();
10157b: e8 74 f9 ff ff call 100ef4 <serial_init>
kbd_init();
101580: e8 d2 ff ff ff call 101557 <kbd_init>
if (!serial_exists) {
101585: a1 68 ee 10 00 mov 0x10ee68,%eax
10158a: 85 c0 test %eax,%eax
10158c: 75 0c jne 10159a <cons_init+0x2a>
cprintf("serial port does not exist!!\n");
10158e: c7 04 24 41 37 10 00 movl $0x103741,(%esp)
101595: e8 78 ed ff ff call 100312 <cprintf>
}
}
10159a: c9 leave
10159b: c3 ret
0010159c <cons_putc>:
/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
10159c: 55 push %ebp
10159d: 89 e5 mov %esp,%ebp
10159f: 83 ec 18 sub $0x18,%esp
lpt_putc(c);
1015a2: 8b 45 08 mov 0x8(%ebp),%eax
1015a5: 89 04 24 mov %eax,(%esp)
1015a8: e8 a3 fa ff ff call 101050 <lpt_putc>
cga_putc(c);
1015ad: 8b 45 08 mov 0x8(%ebp),%eax
1015b0: 89 04 24 mov %eax,(%esp)
1015b3: e8 d7 fa ff ff call 10108f <cga_putc>
serial_putc(c);
1015b8: 8b 45 08 mov 0x8(%ebp),%eax
1015bb: 89 04 24 mov %eax,(%esp)
1015be: e8 f9 fc ff ff call 1012bc <serial_putc>
}
1015c3: c9 leave
1015c4: c3 ret
001015c5 <cons_getc>:
/* *
* cons_getc - return the next input character from console,
* or 0 if none waiting.
* */
int
cons_getc(void) {
1015c5: 55 push %ebp
1015c6: 89 e5 mov %esp,%ebp
1015c8: 83 ec 18 sub $0x18,%esp
int c;
// poll for any pending input characters,
// so that this function works even when interrupts are disabled
// (e.g., when called from the kernel monitor).
serial_intr();
1015cb: e8 cd fd ff ff call 10139d <serial_intr>
kbd_intr();
1015d0: e8 6e ff ff ff call 101543 <kbd_intr>
// grab the next character from the input buffer.
if (cons.rpos != cons.wpos) {
1015d5: 8b 15 80 f0 10 00 mov 0x10f080,%edx
1015db: a1 84 f0 10 00 mov 0x10f084,%eax
1015e0: 39 c2 cmp %eax,%edx
1015e2: 74 36 je 10161a <cons_getc+0x55>
c = cons.buf[cons.rpos ++];
1015e4: a1 80 f0 10 00 mov 0x10f080,%eax
1015e9: 8d 50 01 lea 0x1(%eax),%edx
1015ec: 89 15 80 f0 10 00 mov %edx,0x10f080
1015f2: 0f b6 80 80 ee 10 00 movzbl 0x10ee80(%eax),%eax
1015f9: 0f b6 c0 movzbl %al,%eax
1015fc: 89 45 f4 mov %eax,-0xc(%ebp)
if (cons.rpos == CONSBUFSIZE) {
1015ff: a1 80 f0 10 00 mov 0x10f080,%eax
101604: 3d 00 02 00 00 cmp $0x200,%eax
101609: 75 0a jne 101615 <cons_getc+0x50>
cons.rpos = 0;
10160b: c7 05 80 f0 10 00 00 movl $0x0,0x10f080
101612: 00 00 00
}
return c;
101615: 8b 45 f4 mov -0xc(%ebp),%eax
101618: eb 05 jmp 10161f <cons_getc+0x5a>
}
return 0;
10161a: b8 00 00 00 00 mov $0x0,%eax
}
10161f: c9 leave
101620: c3 ret
00101621 <intr_enable>:
#include <x86.h>
#include <intr.h>
/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
101621: 55 push %ebp
101622: 89 e5 mov %esp,%ebp
asm volatile ("lidt (%0)" :: "r" (pd));
}
static inline void
sti(void) {
asm volatile ("sti");
101624: fb sti
sti();
}
101625: 5d pop %ebp
101626: c3 ret
00101627 <intr_disable>:
/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
101627: 55 push %ebp
101628: 89 e5 mov %esp,%ebp
}
static inline void
cli(void) {
asm volatile ("cli");
10162a: fa cli
cli();
}
10162b: 5d pop %ebp
10162c: c3 ret
0010162d <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;
static void
pic_setmask(uint16_t mask) {
10162d: 55 push %ebp
10162e: 89 e5 mov %esp,%ebp
101630: 83 ec 14 sub $0x14,%esp
101633: 8b 45 08 mov 0x8(%ebp),%eax
101636: 66 89 45 ec mov %ax,-0x14(%ebp)
irq_mask = mask;
10163a: 0f b7 45 ec movzwl -0x14(%ebp),%eax
10163e: 66 a3 50 e5 10 00 mov %ax,0x10e550
if (did_init) {
101644: a1 8c f0 10 00 mov 0x10f08c,%eax
101649: 85 c0 test %eax,%eax
10164b: 74 36 je 101683 <pic_setmask+0x56>
outb(IO_PIC1 + 1, mask);
10164d: 0f b7 45 ec movzwl -0x14(%ebp),%eax
101651: 0f b6 c0 movzbl %al,%eax
101654: 66 c7 45 fe 21 00 movw $0x21,-0x2(%ebp)
10165a: 88 45 fd mov %al,-0x3(%ebp)
: "memory", "cc");
}
static inline void
outb(uint16_t port, uint8_t data) {
asm volatile ("outb %0, %1" :: "a" (data), "d" (port));
10165d: 0f b6 45 fd movzbl -0x3(%ebp),%eax
101661: 0f b7 55 fe movzwl -0x2(%ebp),%edx
101665: ee out %al,(%dx)
outb(IO_PIC2 + 1, mask >> 8);
101666: 0f b7 45 ec movzwl -0x14(%ebp),%eax
10166a: 66 c1 e8 08 shr $0x8,%ax
10166e: 0f b6 c0 movzbl %al,%eax
101671: 66 c7 45 fa a1 00 movw $0xa1,-0x6(%ebp)
101677: 88 45 f9 mov %al,-0x7(%ebp)
10167a: 0f b6 45 f9 movzbl -0x7(%ebp),%eax
10167e: 0f b7 55 fa movzwl -0x6(%ebp),%edx
101682: ee out %al,(%dx)
}
}
101683: c9 leave
101684: c3 ret
00101685 <pic_enable>:
void
pic_enable(unsigned int irq) {
101685: 55 push %ebp
101686: 89 e5 mov %esp,%ebp
101688: 83 ec 04 sub $0x4,%esp
pic_setmask(irq_mask & ~(1 << irq));
10168b: 8b 45 08 mov 0x8(%ebp),%eax
10168e: ba 01 00 00 00 mov $0x1,%edx
101693: 89 c1 mov %eax,%ecx
101695: d3 e2 shl %cl,%edx
101697: 89 d0 mov %edx,%eax
101699: f7 d0 not %eax
10169b: 89 c2 mov %eax,%edx
10169d: 0f b7 05 50 e5 10 00 movzwl 0x10e550,%eax
1016a4: 21 d0 and %edx,%eax
1016a6: 0f b7 c0 movzwl %ax,%eax
1016a9: 89 04 24 mov %eax,(%esp)
1016ac: e8 7c ff ff ff call 10162d <pic_setmask>
}
1016b1: c9 leave
1016b2: c3 ret
001016b3 <pic_init>:
/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
1016b3: 55 push %ebp
1016b4: 89 e5 mov %esp,%ebp
1016b6: 83 ec 44 sub $0x44,%esp
did_init = 1;
1016b9: c7 05 8c f0 10 00 01 movl $0x1,0x10f08c
1016c0: 00 00 00
1016c3: 66 c7 45 fe 21 00 movw $0x21,-0x2(%ebp)
1016c9: c6 45 fd ff movb $0xff,-0x3(%ebp)
1016cd: 0f b6 45 fd movzbl -0x3(%ebp),%eax
1016d1: 0f b7 55 fe movzwl -0x2(%ebp),%edx
1016d5: ee out %al,(%dx)
1016d6: 66 c7 45 fa a1 00 movw $0xa1,-0x6(%ebp)
1016dc: c6 45 f9 ff movb $0xff,-0x7(%ebp)
1016e0: 0f b6 45 f9 movzbl -0x7(%ebp),%eax
1016e4: 0f b7 55 fa movzwl -0x6(%ebp),%edx
1016e8: ee out %al,(%dx)
1016e9: 66 c7 45 f6 20 00 movw $0x20,-0xa(%ebp)
1016ef: c6 45 f5 11 movb $0x11,-0xb(%ebp)
1016f3: 0f b6 45 f5 movzbl -0xb(%ebp),%eax
1016f7: 0f b7 55 f6 movzwl -0xa(%ebp),%edx
1016fb: ee out %al,(%dx)
1016fc: 66 c7 45 f2 21 00 movw $0x21,-0xe(%ebp)
101702: c6 45 f1 20 movb $0x20,-0xf(%ebp)
101706: 0f b6 45 f1 movzbl -0xf(%ebp),%eax
10170a: 0f b7 55 f2 movzwl -0xe(%ebp),%edx
10170e: ee out %al,(%dx)
10170f: 66 c7 45 ee 21 00 movw $0x21,-0x12(%ebp)
101715: c6 45 ed 04 movb $0x4,-0x13(%ebp)
101719: 0f b6 45 ed movzbl -0x13(%ebp),%eax
10171d: 0f b7 55 ee movzwl -0x12(%ebp),%edx
101721: ee out %al,(%dx)
101722: 66 c7 45 ea 21 00 movw $0x21,-0x16(%ebp)
101728: c6 45 e9 03 movb $0x3,-0x17(%ebp)
10172c: 0f b6 45 e9 movzbl -0x17(%ebp),%eax
101730: 0f b7 55 ea movzwl -0x16(%ebp),%edx
101734: ee out %al,(%dx)
101735: 66 c7 45 e6 a0 00 movw $0xa0,-0x1a(%ebp)
10173b: c6 45 e5 11 movb $0x11,-0x1b(%ebp)
10173f: 0f b6 45 e5 movzbl -0x1b(%ebp),%eax
101743: 0f b7 55 e6 movzwl -0x1a(%ebp),%edx
101747: ee out %al,(%dx)
101748: 66 c7 45 e2 a1 00 movw $0xa1,-0x1e(%ebp)
10174e: c6 45 e1 28 movb $0x28,-0x1f(%ebp)
101752: 0f b6 45 e1 movzbl -0x1f(%ebp),%eax
101756: 0f b7 55 e2 movzwl -0x1e(%ebp),%edx
10175a: ee out %al,(%dx)
10175b: 66 c7 45 de a1 00 movw $0xa1,-0x22(%ebp)
101761: c6 45 dd 02 movb $0x2,-0x23(%ebp)
101765: 0f b6 45 dd movzbl -0x23(%ebp),%eax
101769: 0f b7 55 de movzwl -0x22(%ebp),%edx
10176d: ee out %al,(%dx)
10176e: 66 c7 45 da a1 00 movw $0xa1,-0x26(%ebp)
101774: c6 45 d9 03 movb $0x3,-0x27(%ebp)
101778: 0f b6 45 d9 movzbl -0x27(%ebp),%eax
10177c: 0f b7 55 da movzwl -0x26(%ebp),%edx
101780: ee out %al,(%dx)
101781: 66 c7 45 d6 20 00 movw $0x20,-0x2a(%ebp)
101787: c6 45 d5 68 movb $0x68,-0x2b(%ebp)
10178b: 0f b6 45 d5 movzbl -0x2b(%ebp),%eax
10178f: 0f b7 55 d6 movzwl -0x2a(%ebp),%edx
101793: ee out %al,(%dx)
101794: 66 c7 45 d2 20 00 movw $0x20,-0x2e(%ebp)
10179a: c6 45 d1 0a movb $0xa,-0x2f(%ebp)
10179e: 0f b6 45 d1 movzbl -0x2f(%ebp),%eax
1017a2: 0f b7 55 d2 movzwl -0x2e(%ebp),%edx
1017a6: ee out %al,(%dx)
1017a7: 66 c7 45 ce a0 00 movw $0xa0,-0x32(%ebp)
1017ad: c6 45 cd 68 movb $0x68,-0x33(%ebp)
1017b1: 0f b6 45 cd movzbl -0x33(%ebp),%eax
1017b5: 0f b7 55 ce movzwl -0x32(%ebp),%edx
1017b9: ee out %al,(%dx)
1017ba: 66 c7 45 ca a0 00 movw $0xa0,-0x36(%ebp)
1017c0: c6 45 c9 0a movb $0xa,-0x37(%ebp)
1017c4: 0f b6 45 c9 movzbl -0x37(%ebp),%eax
1017c8: 0f b7 55 ca movzwl -0x36(%ebp),%edx
1017cc: ee out %al,(%dx)
outb(IO_PIC1, 0x0a); // read IRR by default
outb(IO_PIC2, 0x68); // OCW3
outb(IO_PIC2, 0x0a); // OCW3
if (irq_mask != 0xFFFF) {
1017cd: 0f b7 05 50 e5 10 00 movzwl 0x10e550,%eax
1017d4: 66 83 f8 ff cmp $0xffff,%ax
1017d8: 74 12 je 1017ec <pic_init+0x139>
pic_setmask(irq_mask);
1017da: 0f b7 05 50 e5 10 00 movzwl 0x10e550,%eax
1017e1: 0f b7 c0 movzwl %ax,%eax
1017e4: 89 04 24 mov %eax,(%esp)
1017e7: e8 41 fe ff ff call 10162d <pic_setmask>
}
}
1017ec: c9 leave
1017ed: c3 ret
001017ee <print_ticks>:
#include <console.h>
#include <kdebug.h>
#define TICK_NUM 100
static void print_ticks() {
1017ee: 55 push %ebp
1017ef: 89 e5 mov %esp,%ebp
1017f1: 83 ec 18 sub $0x18,%esp
cprintf("%d ticks\n",TICK_NUM);
1017f4: c7 44 24 04 64 00 00 movl $0x64,0x4(%esp)
1017fb: 00
1017fc: c7 04 24 60 37 10 00 movl $0x103760,(%esp)
101803: e8 0a eb ff ff call 100312 <cprintf>
#ifdef DEBUG_GRADE
cprintf("End of Test.\n");
panic("EOT: kernel seems ok.");
#endif
}
101808: c9 leave
101809: c3 ret
0010180a <idt_init>:
sizeof(idt) - 1, (uintptr_t)idt
};
/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
10180a: 55 push %ebp
10180b: 89 e5 mov %esp,%ebp
10180d: 83 ec 10 sub $0x10,%esp
* Notice: the argument of lidt is idt_pd. try to find it!
*/
extern uintptr_t __vectors[];
int i;
for (i = 0; i < 256; ++i) {
101810: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
101817: e9 c3 00 00 00 jmp 1018df <idt_init+0xd5>
SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
10181c: 8b 45 fc mov -0x4(%ebp),%eax
10181f: 8b 04 85 e0 e5 10 00 mov 0x10e5e0(,%eax,4),%eax
101826: 89 c2 mov %eax,%edx
101828: 8b 45 fc mov -0x4(%ebp),%eax
10182b: 66 89 14 c5 a0 f0 10 mov %dx,0x10f0a0(,%eax,8)
101832: 00
101833: 8b 45 fc mov -0x4(%ebp),%eax
101836: 66 c7 04 c5 a2 f0 10 movw $0x8,0x10f0a2(,%eax,8)
10183d: 00 08 00
101840: 8b 45 fc mov -0x4(%ebp),%eax
101843: 0f b6 14 c5 a4 f0 10 movzbl 0x10f0a4(,%eax,8),%edx
10184a: 00
10184b: 83 e2 e0 and $0xffffffe0,%edx
10184e: 88 14 c5 a4 f0 10 00 mov %dl,0x10f0a4(,%eax,8)
101855: 8b 45 fc mov -0x4(%ebp),%eax
101858: 0f b6 14 c5 a4 f0 10 movzbl 0x10f0a4(,%eax,8),%edx
10185f: 00
101860: 83 e2 1f and $0x1f,%edx
101863: 88 14 c5 a4 f0 10 00 mov %dl,0x10f0a4(,%eax,8)
10186a: 8b 45 fc mov -0x4(%ebp),%eax
10186d: 0f b6 14 c5 a5 f0 10 movzbl 0x10f0a5(,%eax,8),%edx
101874: 00
101875: 83 e2 f0 and $0xfffffff0,%edx
101878: 83 ca 0e or $0xe,%edx
10187b: 88 14 c5 a5 f0 10 00 mov %dl,0x10f0a5(,%eax,8)
101882: 8b 45 fc mov -0x4(%ebp),%eax
101885: 0f b6 14 c5 a5 f0 10 movzbl 0x10f0a5(,%eax,8),%edx
10188c: 00
10188d: 83 e2 ef and $0xffffffef,%edx
101890: 88 14 c5 a5 f0 10 00 mov %dl,0x10f0a5(,%eax,8)
101897: 8b 45 fc mov -0x4(%ebp),%eax
10189a: 0f b6 14 c5 a5 f0 10 movzbl 0x10f0a5(,%eax,8),%edx
1018a1: 00
1018a2: 83 e2 9f and $0xffffff9f,%edx
1018a5: 88 14 c5 a5 f0 10 00 mov %dl,0x10f0a5(,%eax,8)
1018ac: 8b 45 fc mov -0x4(%ebp),%eax
1018af: 0f b6 14 c5 a5 f0 10 movzbl 0x10f0a5(,%eax,8),%edx
1018b6: 00
1018b7: 83 ca 80 or $0xffffff80,%edx
1018ba: 88 14 c5 a5 f0 10 00 mov %dl,0x10f0a5(,%eax,8)
1018c1: 8b 45 fc mov -0x4(%ebp),%eax
1018c4: 8b 04 85 e0 e5 10 00 mov 0x10e5e0(,%eax,4),%eax
1018cb: c1 e8 10 shr $0x10,%eax
1018ce: 89 c2 mov %eax,%edx
1018d0: 8b 45 fc mov -0x4(%ebp),%eax
1018d3: 66 89 14 c5 a6 f0 10 mov %dx,0x10f0a6(,%eax,8)
1018da: 00
* Notice: the argument of lidt is idt_pd. try to find it!
*/
extern uintptr_t __vectors[];
int i;
for (i = 0; i < 256; ++i) {
1018db: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1018df: 81 7d fc ff 00 00 00 cmpl $0xff,-0x4(%ebp)
1018e6: 0f 8e 30 ff ff ff jle 10181c <idt_init+0x12>
1018ec: c7 45 f8 60 e5 10 00 movl $0x10e560,-0x8(%ebp)
return ebp;
}
static inline void
lidt(struct pseudodesc *pd) {
asm volatile ("lidt (%0)" :: "r" (pd));
1018f3: 8b 45 f8 mov -0x8(%ebp),%eax
1018f6: 0f 01 18 lidtl (%eax)
SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
}
lidt(&idt_pd);
}
1018f9: c9 leave
1018fa: c3 ret
001018fb <trapname>:
static const char *
trapname(int trapno) {
1018fb: 55 push %ebp
1018fc: 89 e5 mov %esp,%ebp
"Alignment Check",
"Machine-Check",
"SIMD Floating-Point Exception"
};
if (trapno < sizeof(excnames)/sizeof(const char * const)) {
1018fe: 8b 45 08 mov 0x8(%ebp),%eax
101901: 83 f8 13 cmp $0x13,%eax
101904: 77 0c ja 101912 <trapname+0x17>
return excnames[trapno];
101906: 8b 45 08 mov 0x8(%ebp),%eax
101909: 8b 04 85 c0 3a 10 00 mov 0x103ac0(,%eax,4),%eax
101910: eb 18 jmp 10192a <trapname+0x2f>
}
if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
101912: 83 7d 08 1f cmpl $0x1f,0x8(%ebp)
101916: 7e 0d jle 101925 <trapname+0x2a>
101918: 83 7d 08 2f cmpl $0x2f,0x8(%ebp)
10191c: 7f 07 jg 101925 <trapname+0x2a>
return "Hardware Interrupt";
10191e: b8 6a 37 10 00 mov $0x10376a,%eax
101923: eb 05 jmp 10192a <trapname+0x2f>
}
return "(unknown trap)";
101925: b8 7d 37 10 00 mov $0x10377d,%eax
}
10192a: 5d pop %ebp
10192b: c3 ret
0010192c <trap_in_kernel>:
/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
10192c: 55 push %ebp
10192d: 89 e5 mov %esp,%ebp
return (tf->tf_cs == (uint16_t)KERNEL_CS);
10192f: 8b 45 08 mov 0x8(%ebp),%eax
101932: 0f b7 40 3c movzwl 0x3c(%eax),%eax
101936: 66 83 f8 08 cmp $0x8,%ax
10193a: 0f 94 c0 sete %al
10193d: 0f b6 c0 movzbl %al,%eax
}
101940: 5d pop %ebp
101941: c3 ret
00101942 <print_trapframe>:
"TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
"RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};
void
print_trapframe(struct trapframe *tf) {
101942: 55 push %ebp
101943: 89 e5 mov %esp,%ebp
101945: 83 ec 28 sub $0x28,%esp
cprintf("trapframe at %p\n", tf);
101948: 8b 45 08 mov 0x8(%ebp),%eax
10194b: 89 44 24 04 mov %eax,0x4(%esp)
10194f: c7 04 24 be 37 10 00 movl $0x1037be,(%esp)
101956: e8 b7 e9 ff ff call 100312 <cprintf>
print_regs(&tf->tf_regs);
10195b: 8b 45 08 mov 0x8(%ebp),%eax
10195e: 89 04 24 mov %eax,(%esp)
101961: e8 a1 01 00 00 call 101b07 <print_regs>
cprintf(" ds 0x----%04x\n", tf->tf_ds);
101966: 8b 45 08 mov 0x8(%ebp),%eax
101969: 0f b7 40 2c movzwl 0x2c(%eax),%eax
10196d: 0f b7 c0 movzwl %ax,%eax
101970: 89 44 24 04 mov %eax,0x4(%esp)
101974: c7 04 24 cf 37 10 00 movl $0x1037cf,(%esp)
10197b: e8 92 e9 ff ff call 100312 <cprintf>
cprintf(" es 0x----%04x\n", tf->tf_es);
101980: 8b 45 08 mov 0x8(%ebp),%eax
101983: 0f b7 40 28 movzwl 0x28(%eax),%eax
101987: 0f b7 c0 movzwl %ax,%eax
10198a: 89 44 24 04 mov %eax,0x4(%esp)
10198e: c7 04 24 e2 37 10 00 movl $0x1037e2,(%esp)
101995: e8 78 e9 ff ff call 100312 <cprintf>
cprintf(" fs 0x----%04x\n", tf->tf_fs);
10199a: 8b 45 08 mov 0x8(%ebp),%eax
10199d: 0f b7 40 24 movzwl 0x24(%eax),%eax
1019a1: 0f b7 c0 movzwl %ax,%eax
1019a4: 89 44 24 04 mov %eax,0x4(%esp)
1019a8: c7 04 24 f5 37 10 00 movl $0x1037f5,(%esp)
1019af: e8 5e e9 ff ff call 100312 <cprintf>
cprintf(" gs 0x----%04x\n", tf->tf_gs);
1019b4: 8b 45 08 mov 0x8(%ebp),%eax
1019b7: 0f b7 40 20 movzwl 0x20(%eax),%eax
1019bb: 0f b7 c0 movzwl %ax,%eax
1019be: 89 44 24 04 mov %eax,0x4(%esp)
1019c2: c7 04 24 08 38 10 00 movl $0x103808,(%esp)
1019c9: e8 44 e9 ff ff call 100312 <cprintf>
cprintf(" trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
1019ce: 8b 45 08 mov 0x8(%ebp),%eax
1019d1: 8b 40 30 mov 0x30(%eax),%eax
1019d4: 89 04 24 mov %eax,(%esp)
1019d7: e8 1f ff ff ff call 1018fb <trapname>
1019dc: 8b 55 08 mov 0x8(%ebp),%edx
1019df: 8b 52 30 mov 0x30(%edx),%edx
1019e2: 89 44 24 08 mov %eax,0x8(%esp)
1019e6: 89 54 24 04 mov %edx,0x4(%esp)
1019ea: c7 04 24 1b 38 10 00 movl $0x10381b,(%esp)
1019f1: e8 1c e9 ff ff call 100312 <cprintf>
cprintf(" err 0x%08x\n", tf->tf_err);
1019f6: 8b 45 08 mov 0x8(%ebp),%eax
1019f9: 8b 40 34 mov 0x34(%eax),%eax
1019fc: 89 44 24 04 mov %eax,0x4(%esp)
101a00: c7 04 24 2d 38 10 00 movl $0x10382d,(%esp)
101a07: e8 06 e9 ff ff call 100312 <cprintf>
cprintf(" eip 0x%08x\n", tf->tf_eip);
101a0c: 8b 45 08 mov 0x8(%ebp),%eax
101a0f: 8b 40 38 mov 0x38(%eax),%eax
101a12: 89 44 24 04 mov %eax,0x4(%esp)
101a16: c7 04 24 3c 38 10 00 movl $0x10383c,(%esp)
101a1d: e8 f0 e8 ff ff call 100312 <cprintf>
cprintf(" cs 0x----%04x\n", tf->tf_cs);
101a22: 8b 45 08 mov 0x8(%ebp),%eax
101a25: 0f b7 40 3c movzwl 0x3c(%eax),%eax
101a29: 0f b7 c0 movzwl %ax,%eax
101a2c: 89 44 24 04 mov %eax,0x4(%esp)
101a30: c7 04 24 4b 38 10 00 movl $0x10384b,(%esp)
101a37: e8 d6 e8 ff ff call 100312 <cprintf>
cprintf(" flag 0x%08x ", tf->tf_eflags);
101a3c: 8b 45 08 mov 0x8(%ebp),%eax
101a3f: 8b 40 40 mov 0x40(%eax),%eax
101a42: 89 44 24 04 mov %eax,0x4(%esp)
101a46: c7 04 24 5e 38 10 00 movl $0x10385e,(%esp)
101a4d: e8 c0 e8 ff ff call 100312 <cprintf>
int i, j;
for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
101a52: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
101a59: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
101a60: eb 3e jmp 101aa0 <print_trapframe+0x15e>
if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
101a62: 8b 45 08 mov 0x8(%ebp),%eax
101a65: 8b 50 40 mov 0x40(%eax),%edx
101a68: 8b 45 f0 mov -0x10(%ebp),%eax
101a6b: 21 d0 and %edx,%eax
101a6d: 85 c0 test %eax,%eax
101a6f: 74 28 je 101a99 <print_trapframe+0x157>
101a71: 8b 45 f4 mov -0xc(%ebp),%eax
101a74: 8b 04 85 80 e5 10 00 mov 0x10e580(,%eax,4),%eax
101a7b: 85 c0 test %eax,%eax
101a7d: 74 1a je 101a99 <print_trapframe+0x157>
cprintf("%s,", IA32flags[i]);
101a7f: 8b 45 f4 mov -0xc(%ebp),%eax
101a82: 8b 04 85 80 e5 10 00 mov 0x10e580(,%eax,4),%eax
101a89: 89 44 24 04 mov %eax,0x4(%esp)
101a8d: c7 04 24 6d 38 10 00 movl $0x10386d,(%esp)
101a94: e8 79 e8 ff ff call 100312 <cprintf>
cprintf(" eip 0x%08x\n", tf->tf_eip);
cprintf(" cs 0x----%04x\n", tf->tf_cs);
cprintf(" flag 0x%08x ", tf->tf_eflags);
int i, j;
for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
101a99: 83 45 f4 01 addl $0x1,-0xc(%ebp)
101a9d: d1 65 f0 shll -0x10(%ebp)
101aa0: 8b 45 f4 mov -0xc(%ebp),%eax
101aa3: 83 f8 17 cmp $0x17,%eax
101aa6: 76 ba jbe 101a62 <print_trapframe+0x120>
if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
cprintf("%s,", IA32flags[i]);
}
}
cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
101aa8: 8b 45 08 mov 0x8(%ebp),%eax
101aab: 8b 40 40 mov 0x40(%eax),%eax
101aae: 25 00 30 00 00 and $0x3000,%eax
101ab3: c1 e8 0c shr $0xc,%eax
101ab6: 89 44 24 04 mov %eax,0x4(%esp)
101aba: c7 04 24 71 38 10 00 movl $0x103871,(%esp)
101ac1: e8 4c e8 ff ff call 100312 <cprintf>
if (!trap_in_kernel(tf)) {
101ac6: 8b 45 08 mov 0x8(%ebp),%eax
101ac9: 89 04 24 mov %eax,(%esp)
101acc: e8 5b fe ff ff call 10192c <trap_in_kernel>
101ad1: 85 c0 test %eax,%eax
101ad3: 75 30 jne 101b05 <print_trapframe+0x1c3>
cprintf(" esp 0x%08x\n", tf->tf_esp);
101ad5: 8b 45 08 mov 0x8(%ebp),%eax
101ad8: 8b 40 44 mov 0x44(%eax),%eax
101adb: 89 44 24 04 mov %eax,0x4(%esp)
101adf: c7 04 24 7a 38 10 00 movl $0x10387a,(%esp)
101ae6: e8 27 e8 ff ff call 100312 <cprintf>
cprintf(" ss 0x----%04x\n", tf->tf_ss);
101aeb: 8b 45 08 mov 0x8(%ebp),%eax
101aee: 0f b7 40 48 movzwl 0x48(%eax),%eax
101af2: 0f b7 c0 movzwl %ax,%eax
101af5: 89 44 24 04 mov %eax,0x4(%esp)
101af9: c7 04 24 89 38 10 00 movl $0x103889,(%esp)
101b00: e8 0d e8 ff ff call 100312 <cprintf>
}
}
101b05: c9 leave
101b06: c3 ret
00101b07 <print_regs>:
void
print_regs(struct pushregs *regs) {
101b07: 55 push %ebp
101b08: 89 e5 mov %esp,%ebp
101b0a: 83 ec 18 sub $0x18,%esp
cprintf(" edi 0x%08x\n", regs->reg_edi);
101b0d: 8b 45 08 mov 0x8(%ebp),%eax
101b10: 8b 00 mov (%eax),%eax
101b12: 89 44 24 04 mov %eax,0x4(%esp)
101b16: c7 04 24 9c 38 10 00 movl $0x10389c,(%esp)
101b1d: e8 f0 e7 ff ff call 100312 <cprintf>
cprintf(" esi 0x%08x\n", regs->reg_esi);
101b22: 8b 45 08 mov 0x8(%ebp),%eax
101b25: 8b 40 04 mov 0x4(%eax),%eax
101b28: 89 44 24 04 mov %eax,0x4(%esp)
101b2c: c7 04 24 ab 38 10 00 movl $0x1038ab,(%esp)
101b33: e8 da e7 ff ff call 100312 <cprintf>
cprintf(" ebp 0x%08x\n", regs->reg_ebp);
101b38: 8b 45 08 mov 0x8(%ebp),%eax
101b3b: 8b 40 08 mov 0x8(%eax),%eax
101b3e: 89 44 24 04 mov %eax,0x4(%esp)
101b42: c7 04 24 ba 38 10 00 movl $0x1038ba,(%esp)
101b49: e8 c4 e7 ff ff call 100312 <cprintf>
cprintf(" oesp 0x%08x\n", regs->reg_oesp);
101b4e: 8b 45 08 mov 0x8(%ebp),%eax
101b51: 8b 40 0c mov 0xc(%eax),%eax
101b54: 89 44 24 04 mov %eax,0x4(%esp)
101b58: c7 04 24 c9 38 10 00 movl $0x1038c9,(%esp)
101b5f: e8 ae e7 ff ff call 100312 <cprintf>
cprintf(" ebx 0x%08x\n", regs->reg_ebx);
101b64: 8b 45 08 mov 0x8(%ebp),%eax
101b67: 8b 40 10 mov 0x10(%eax),%eax
101b6a: 89 44 24 04 mov %eax,0x4(%esp)
101b6e: c7 04 24 d8 38 10 00 movl $0x1038d8,(%esp)
101b75: e8 98 e7 ff ff call 100312 <cprintf>
cprintf(" edx 0x%08x\n", regs->reg_edx);
101b7a: 8b 45 08 mov 0x8(%ebp),%eax
101b7d: 8b 40 14 mov 0x14(%eax),%eax
101b80: 89 44 24 04 mov %eax,0x4(%esp)
101b84: c7 04 24 e7 38 10 00 movl $0x1038e7,(%esp)
101b8b: e8 82 e7 ff ff call 100312 <cprintf>
cprintf(" ecx 0x%08x\n", regs->reg_ecx);
101b90: 8b 45 08 mov 0x8(%ebp),%eax
101b93: 8b 40 18 mov 0x18(%eax),%eax
101b96: 89 44 24 04 mov %eax,0x4(%esp)
101b9a: c7 04 24 f6 38 10 00 movl $0x1038f6,(%esp)
101ba1: e8 6c e7 ff ff call 100312 <cprintf>
cprintf(" eax 0x%08x\n", regs->reg_eax);
101ba6: 8b 45 08 mov 0x8(%ebp),%eax
101ba9: 8b 40 1c mov 0x1c(%eax),%eax
101bac: 89 44 24 04 mov %eax,0x4(%esp)
101bb0: c7 04 24 05 39 10 00 movl $0x103905,(%esp)
101bb7: e8 56 e7 ff ff call 100312 <cprintf>
}
101bbc: c9 leave
101bbd: c3 ret
00101bbe <trap_dispatch>:
/* trap_dispatch - dispatch based on what type of trap occurred */
static void
trap_dispatch(struct trapframe *tf) {
101bbe: 55 push %ebp
101bbf: 89 e5 mov %esp,%ebp
101bc1: 83 ec 28 sub $0x28,%esp
char c;
switch (tf->tf_trapno) {
101bc4: 8b 45 08 mov 0x8(%ebp),%eax
101bc7: 8b 40 30 mov 0x30(%eax),%eax
101bca: 83 f8 2f cmp $0x2f,%eax
101bcd: 77 21 ja 101bf0 <trap_dispatch+0x32>
101bcf: 83 f8 2e cmp $0x2e,%eax
101bd2: 0f 83 04 01 00 00 jae 101cdc <trap_dispatch+0x11e>
101bd8: 83 f8 21 cmp $0x21,%eax
101bdb: 0f 84 81 00 00 00 je 101c62 <trap_dispatch+0xa4>
101be1: 83 f8 24 cmp $0x24,%eax
101be4: 74 56 je 101c3c <trap_dispatch+0x7e>
101be6: 83 f8 20 cmp $0x20,%eax
101be9: 74 16 je 101c01 <trap_dispatch+0x43>
101beb: e9 b4 00 00 00 jmp 101ca4 <trap_dispatch+0xe6>
101bf0: 83 e8 78 sub $0x78,%eax
101bf3: 83 f8 01 cmp $0x1,%eax
101bf6: 0f 87 a8 00 00 00 ja 101ca4 <trap_dispatch+0xe6>
101bfc: e9 87 00 00 00 jmp 101c88 <trap_dispatch+0xca>
/* handle the timer interrupt */
/* (1) After a timer interrupt, you should record this event using a global variable (increase it), such as ticks in kern/driver/clock.c
* (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
* (3) Too Simple? Yes, I think so!
*/
++ticks;
101c01: a1 08 f9 10 00 mov 0x10f908,%eax
101c06: 83 c0 01 add $0x1,%eax
101c09: a3 08 f9 10 00 mov %eax,0x10f908
if (ticks % TICK_NUM == 0) {
101c0e: 8b 0d 08 f9 10 00 mov 0x10f908,%ecx
101c14: ba 1f 85 eb 51 mov $0x51eb851f,%edx
101c19: 89 c8 mov %ecx,%eax
101c1b: f7 e2 mul %edx
101c1d: 89 d0 mov %edx,%eax
101c1f: c1 e8 05 shr $0x5,%eax
101c22: 6b c0 64 imul $0x64,%eax,%eax
101c25: 29 c1 sub %eax,%ecx
101c27: 89 c8 mov %ecx,%eax
101c29: 85 c0 test %eax,%eax
101c2b: 75 0a jne 101c37 <trap_dispatch+0x79>
print_ticks();
101c2d: e8 bc fb ff ff call 1017ee <print_ticks>
}
break;
101c32: e9 a6 00 00 00 jmp 101cdd <trap_dispatch+0x11f>
101c37: e9 a1 00 00 00 jmp 101cdd <trap_dispatch+0x11f>
case IRQ_OFFSET + IRQ_COM1:
c = cons_getc();
101c3c: e8 84 f9 ff ff call 1015c5 <cons_getc>
101c41: 88 45 f7 mov %al,-0x9(%ebp)
cprintf("serial [%03d] %c\n", c, c);
101c44: 0f be 55 f7 movsbl -0x9(%ebp),%edx
101c48: 0f be 45 f7 movsbl -0x9(%ebp),%eax
101c4c: 89 54 24 08 mov %edx,0x8(%esp)
101c50: 89 44 24 04 mov %eax,0x4(%esp)
101c54: c7 04 24 14 39 10 00 movl $0x103914,(%esp)
101c5b: e8 b2 e6 ff ff call 100312 <cprintf>
break;
101c60: eb 7b jmp 101cdd <trap_dispatch+0x11f>
case IRQ_OFFSET + IRQ_KBD:
c = cons_getc();
101c62: e8 5e f9 ff ff call 1015c5 <cons_getc>
101c67: 88 45 f7 mov %al,-0x9(%ebp)
cprintf("kbd [%03d] %c\n", c, c);
101c6a: 0f be 55 f7 movsbl -0x9(%ebp),%edx
101c6e: 0f be 45 f7 movsbl -0x9(%ebp),%eax
101c72: 89 54 24 08 mov %edx,0x8(%esp)
101c76: 89 44 24 04 mov %eax,0x4(%esp)
101c7a: c7 04 24 26 39 10 00 movl $0x103926,(%esp)
101c81: e8 8c e6 ff ff call 100312 <cprintf>
break;
101c86: eb 55 jmp 101cdd <trap_dispatch+0x11f>
//LAB1 CHALLENGE 1 : YOUR CODE you should modify below codes.
case T_SWITCH_TOU:
case T_SWITCH_TOK:
panic("T_SWITCH_** ??\n");
101c88: c7 44 24 08 35 39 10 movl $0x103935,0x8(%esp)
101c8f: 00
101c90: c7 44 24 04 ae 00 00 movl $0xae,0x4(%esp)
101c97: 00
101c98: c7 04 24 45 39 10 00 movl $0x103945,(%esp)
101c9f: e8 03 f0 ff ff call 100ca7 <__panic>
case IRQ_OFFSET + IRQ_IDE2:
/* do nothing */
break;
default:
// in kernel, it must be a mistake
if ((tf->tf_cs & 3) == 0) {
101ca4: 8b 45 08 mov 0x8(%ebp),%eax
101ca7: 0f b7 40 3c movzwl 0x3c(%eax),%eax
101cab: 0f b7 c0 movzwl %ax,%eax
101cae: 83 e0 03 and $0x3,%eax
101cb1: 85 c0 test %eax,%eax
101cb3: 75 28 jne 101cdd <trap_dispatch+0x11f>
print_trapframe(tf);
101cb5: 8b 45 08 mov 0x8(%ebp),%eax
101cb8: 89 04 24 mov %eax,(%esp)
101cbb: e8 82 fc ff ff call 101942 <print_trapframe>
panic("unexpected trap in kernel.\n");
101cc0: c7 44 24 08 56 39 10 movl $0x103956,0x8(%esp)
101cc7: 00
101cc8: c7 44 24 04 b8 00 00 movl $0xb8,0x4(%esp)
101ccf: 00
101cd0: c7 04 24 45 39 10 00 movl $0x103945,(%esp)
101cd7: e8 cb ef ff ff call 100ca7 <__panic>
panic("T_SWITCH_** ??\n");
break;
case IRQ_OFFSET + IRQ_IDE1:
case IRQ_OFFSET + IRQ_IDE2:
/* do nothing */
break;
101cdc: 90 nop
if ((tf->tf_cs & 3) == 0) {
print_trapframe(tf);
panic("unexpected trap in kernel.\n");
}
}
}
101cdd: c9 leave
101cde: c3 ret
00101cdf <trap>:
* trap - handles or dispatches an exception/interrupt. if and when trap() returns,
* the code in kern/trap/trapentry.S restores the old CPU state saved in the
* trapframe and then uses the iret instruction to return from the exception.
* */
void
trap(struct trapframe *tf) {
101cdf: 55 push %ebp
101ce0: 89 e5 mov %esp,%ebp
101ce2: 83 ec 18 sub $0x18,%esp
// dispatch based on what type of trap occurred
trap_dispatch(tf);
101ce5: 8b 45 08 mov 0x8(%ebp),%eax
101ce8: 89 04 24 mov %eax,(%esp)
101ceb: e8 ce fe ff ff call 101bbe <trap_dispatch>
}
101cf0: c9 leave
101cf1: c3 ret
00101cf2 <__alltraps>:
.text
.globl __alltraps
__alltraps:
# push registers to build a trap frame
# therefore make the stack look like a struct trapframe
pushl %ds
101cf2: 1e push %ds
pushl %es
101cf3: 06 push %es
pushl %fs
101cf4: 0f a0 push %fs
pushl %gs
101cf6: 0f a8 push %gs
pushal
101cf8: 60 pusha
# load GD_KDATA into %ds and %es to set up data segments for kernel
movl $GD_KDATA, %eax
101cf9: b8 10 00 00 00 mov $0x10,%eax
movw %ax, %ds
101cfe: 8e d8 mov %eax,%ds
movw %ax, %es
101d00: 8e c0 mov %eax,%es
# push %esp to pass a pointer to the trapframe as an argument to trap()
pushl %esp
101d02: 54 push %esp
# call trap(tf), where tf=%esp
call trap
101d03: e8 d7 ff ff ff call 101cdf <trap>
# pop the pushed stack pointer
popl %esp
101d08: 5c pop %esp
00101d09 <__trapret>:
# return falls through to trapret...
.globl __trapret
__trapret:
# restore registers from stack
popal
101d09: 61 popa
# restore %ds, %es, %fs and %gs
popl %gs
101d0a: 0f a9 pop %gs
popl %fs
101d0c: 0f a1 pop %fs
popl %es
101d0e: 07 pop %es
popl %ds
101d0f: 1f pop %ds
# get rid of the trap number and error code
addl $0x8, %esp
101d10: 83 c4 08 add $0x8,%esp
iret
101d13: cf iret
00101d14 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
pushl $0
101d14: 6a 00 push $0x0
pushl $0
101d16: 6a 00 push $0x0
jmp __alltraps
101d18: e9 d5 ff ff ff jmp 101cf2 <__alltraps>
00101d1d <vector1>:
.globl vector1
vector1:
pushl $0
101d1d: 6a 00 push $0x0
pushl $1
101d1f: 6a 01 push $0x1
jmp __alltraps
101d21: e9 cc ff ff ff jmp 101cf2 <__alltraps>
00101d26 <vector2>:
.globl vector2
vector2:
pushl $0
101d26: 6a 00 push $0x0
pushl $2
101d28: 6a 02 push $0x2
jmp __alltraps
101d2a: e9 c3 ff ff ff jmp 101cf2 <__alltraps>
00101d2f <vector3>:
.globl vector3
vector3:
pushl $0
101d2f: 6a 00 push $0x0
pushl $3
101d31: 6a 03 push $0x3
jmp __alltraps
101d33: e9 ba ff ff ff jmp 101cf2 <__alltraps>
00101d38 <vector4>:
.globl vector4
vector4:
pushl $0
101d38: 6a 00 push $0x0
pushl $4
101d3a: 6a 04 push $0x4
jmp __alltraps
101d3c: e9 b1 ff ff ff jmp 101cf2 <__alltraps>
00101d41 <vector5>:
.globl vector5
vector5:
pushl $0
101d41: 6a 00 push $0x0
pushl $5
101d43: 6a 05 push $0x5
jmp __alltraps
101d45: e9 a8 ff ff ff jmp 101cf2 <__alltraps>
00101d4a <vector6>:
.globl vector6
vector6:
pushl $0
101d4a: 6a 00 push $0x0
pushl $6
101d4c: 6a 06 push $0x6
jmp __alltraps
101d4e: e9 9f ff ff ff jmp 101cf2 <__alltraps>
00101d53 <vector7>:
.globl vector7
vector7:
pushl $0
101d53: 6a 00 push $0x0
pushl $7
101d55: 6a 07 push $0x7
jmp __alltraps
101d57: e9 96 ff ff ff jmp 101cf2 <__alltraps>
00101d5c <vector8>:
.globl vector8
vector8:
pushl $8
101d5c: 6a 08 push $0x8
jmp __alltraps
101d5e: e9 8f ff ff ff jmp 101cf2 <__alltraps>
00101d63 <vector9>:
.globl vector9
vector9:
pushl $0
101d63: 6a 00 push $0x0
pushl $9
101d65: 6a 09 push $0x9
jmp __alltraps
101d67: e9 86 ff ff ff jmp 101cf2 <__alltraps>
00101d6c <vector10>:
.globl vector10
vector10:
pushl $10
101d6c: 6a 0a push $0xa
jmp __alltraps
101d6e: e9 7f ff ff ff jmp 101cf2 <__alltraps>
00101d73 <vector11>:
.globl vector11
vector11:
pushl $11
101d73: 6a 0b push $0xb
jmp __alltraps
101d75: e9 78 ff ff ff jmp 101cf2 <__alltraps>
00101d7a <vector12>:
.globl vector12
vector12:
pushl $12
101d7a: 6a 0c push $0xc
jmp __alltraps
101d7c: e9 71 ff ff ff jmp 101cf2 <__alltraps>
00101d81 <vector13>:
.globl vector13
vector13:
pushl $13
101d81: 6a 0d push $0xd
jmp __alltraps
101d83: e9 6a ff ff ff jmp 101cf2 <__alltraps>
00101d88 <vector14>:
.globl vector14
vector14:
pushl $14
101d88: 6a 0e push $0xe
jmp __alltraps
101d8a: e9 63 ff ff ff jmp 101cf2 <__alltraps>
00101d8f <vector15>:
.globl vector15
vector15:
pushl $0
101d8f: 6a 00 push $0x0
pushl $15
101d91: 6a 0f push $0xf
jmp __alltraps
101d93: e9 5a ff ff ff jmp 101cf2 <__alltraps>
00101d98 <vector16>:
.globl vector16
vector16:
pushl $0
101d98: 6a 00 push $0x0
pushl $16
101d9a: 6a 10 push $0x10
jmp __alltraps
101d9c: e9 51 ff ff ff jmp 101cf2 <__alltraps>
00101da1 <vector17>:
.globl vector17
vector17:
pushl $17
101da1: 6a 11 push $0x11
jmp __alltraps
101da3: e9 4a ff ff ff jmp 101cf2 <__alltraps>
00101da8 <vector18>:
.globl vector18
vector18:
pushl $0
101da8: 6a 00 push $0x0
pushl $18
101daa: 6a 12 push $0x12
jmp __alltraps
101dac: e9 41 ff ff ff jmp 101cf2 <__alltraps>
00101db1 <vector19>:
.globl vector19
vector19:
pushl $0
101db1: 6a 00 push $0x0
pushl $19
101db3: 6a 13 push $0x13
jmp __alltraps
101db5: e9 38 ff ff ff jmp 101cf2 <__alltraps>
00101dba <vector20>:
.globl vector20
vector20:
pushl $0
101dba: 6a 00 push $0x0
pushl $20
101dbc: 6a 14 push $0x14
jmp __alltraps
101dbe: e9 2f ff ff ff jmp 101cf2 <__alltraps>
00101dc3 <vector21>:
.globl vector21
vector21:
pushl $0
101dc3: 6a 00 push $0x0
pushl $21
101dc5: 6a 15 push $0x15
jmp __alltraps
101dc7: e9 26 ff ff ff jmp 101cf2 <__alltraps>
00101dcc <vector22>:
.globl vector22
vector22:
pushl $0
101dcc: 6a 00 push $0x0
pushl $22
101dce: 6a 16 push $0x16
jmp __alltraps
101dd0: e9 1d ff ff ff jmp 101cf2 <__alltraps>
00101dd5 <vector23>:
.globl vector23
vector23:
pushl $0
101dd5: 6a 00 push $0x0
pushl $23
101dd7: 6a 17 push $0x17
jmp __alltraps
101dd9: e9 14 ff ff ff jmp 101cf2 <__alltraps>
00101dde <vector24>:
.globl vector24
vector24:
pushl $0
101dde: 6a 00 push $0x0
pushl $24
101de0: 6a 18 push $0x18
jmp __alltraps
101de2: e9 0b ff ff ff jmp 101cf2 <__alltraps>
00101de7 <vector25>:
.globl vector25
vector25:
pushl $0
101de7: 6a 00 push $0x0
pushl $25
101de9: 6a 19 push $0x19
jmp __alltraps
101deb: e9 02 ff ff ff jmp 101cf2 <__alltraps>
00101df0 <vector26>:
.globl vector26
vector26:
pushl $0
101df0: 6a 00 push $0x0
pushl $26
101df2: 6a 1a push $0x1a
jmp __alltraps
101df4: e9 f9 fe ff ff jmp 101cf2 <__alltraps>
00101df9 <vector27>:
.globl vector27
vector27:
pushl $0
101df9: 6a 00 push $0x0
pushl $27
101dfb: 6a 1b push $0x1b
jmp __alltraps
101dfd: e9 f0 fe ff ff jmp 101cf2 <__alltraps>
00101e02 <vector28>:
.globl vector28
vector28:
pushl $0
101e02: 6a 00 push $0x0
pushl $28
101e04: 6a 1c push $0x1c
jmp __alltraps
101e06: e9 e7 fe ff ff jmp 101cf2 <__alltraps>
00101e0b <vector29>:
.globl vector29
vector29:
pushl $0
101e0b: 6a 00 push $0x0
pushl $29
101e0d: 6a 1d push $0x1d
jmp __alltraps
101e0f: e9 de fe ff ff jmp 101cf2 <__alltraps>
00101e14 <vector30>:
.globl vector30
vector30:
pushl $0
101e14: 6a 00 push $0x0
pushl $30
101e16: 6a 1e push $0x1e
jmp __alltraps
101e18: e9 d5 fe ff ff jmp 101cf2 <__alltraps>
00101e1d <vector31>:
.globl vector31
vector31:
pushl $0
101e1d: 6a 00 push $0x0
pushl $31
101e1f: 6a 1f push $0x1f
jmp __alltraps
101e21: e9 cc fe ff ff jmp 101cf2 <__alltraps>
00101e26 <vector32>:
.globl vector32
vector32:
pushl $0
101e26: 6a 00 push $0x0
pushl $32
101e28: 6a 20 push $0x20
jmp __alltraps
101e2a: e9 c3 fe ff ff jmp 101cf2 <__alltraps>
00101e2f <vector33>:
.globl vector33
vector33:
pushl $0
101e2f: 6a 00 push $0x0
pushl $33
101e31: 6a 21 push $0x21
jmp __alltraps
101e33: e9 ba fe ff ff jmp 101cf2 <__alltraps>
00101e38 <vector34>:
.globl vector34
vector34:
pushl $0
101e38: 6a 00 push $0x0
pushl $34
101e3a: 6a 22 push $0x22
jmp __alltraps
101e3c: e9 b1 fe ff ff jmp 101cf2 <__alltraps>
00101e41 <vector35>:
.globl vector35
vector35:
pushl $0
101e41: 6a 00 push $0x0
pushl $35
101e43: 6a 23 push $0x23
jmp __alltraps
101e45: e9 a8 fe ff ff jmp 101cf2 <__alltraps>
00101e4a <vector36>:
.globl vector36
vector36:
pushl $0
101e4a: 6a 00 push $0x0
pushl $36
101e4c: 6a 24 push $0x24
jmp __alltraps
101e4e: e9 9f fe ff ff jmp 101cf2 <__alltraps>
00101e53 <vector37>:
.globl vector37
vector37:
pushl $0
101e53: 6a 00 push $0x0
pushl $37
101e55: 6a 25 push $0x25
jmp __alltraps
101e57: e9 96 fe ff ff jmp 101cf2 <__alltraps>
00101e5c <vector38>:
.globl vector38
vector38:
pushl $0
101e5c: 6a 00 push $0x0
pushl $38
101e5e: 6a 26 push $0x26
jmp __alltraps
101e60: e9 8d fe ff ff jmp 101cf2 <__alltraps>
00101e65 <vector39>:
.globl vector39
vector39:
pushl $0
101e65: 6a 00 push $0x0
pushl $39
101e67: 6a 27 push $0x27
jmp __alltraps
101e69: e9 84 fe ff ff jmp 101cf2 <__alltraps>
00101e6e <vector40>:
.globl vector40
vector40:
pushl $0
101e6e: 6a 00 push $0x0
pushl $40
101e70: 6a 28 push $0x28
jmp __alltraps
101e72: e9 7b fe ff ff jmp 101cf2 <__alltraps>
00101e77 <vector41>:
.globl vector41
vector41:
pushl $0
101e77: 6a 00 push $0x0
pushl $41
101e79: 6a 29 push $0x29
jmp __alltraps
101e7b: e9 72 fe ff ff jmp 101cf2 <__alltraps>
00101e80 <vector42>:
.globl vector42
vector42:
pushl $0
101e80: 6a 00 push $0x0
pushl $42
101e82: 6a 2a push $0x2a
jmp __alltraps
101e84: e9 69 fe ff ff jmp 101cf2 <__alltraps>
00101e89 <vector43>:
.globl vector43
vector43:
pushl $0
101e89: 6a 00 push $0x0
pushl $43
101e8b: 6a 2b push $0x2b
jmp __alltraps
101e8d: e9 60 fe ff ff jmp 101cf2 <__alltraps>
00101e92 <vector44>:
.globl vector44
vector44:
pushl $0
101e92: 6a 00 push $0x0
pushl $44
101e94: 6a 2c push $0x2c
jmp __alltraps
101e96: e9 57 fe ff ff jmp 101cf2 <__alltraps>
00101e9b <vector45>:
.globl vector45
vector45:
pushl $0
101e9b: 6a 00 push $0x0
pushl $45
101e9d: 6a 2d push $0x2d
jmp __alltraps
101e9f: e9 4e fe ff ff jmp 101cf2 <__alltraps>
00101ea4 <vector46>:
.globl vector46
vector46:
pushl $0
101ea4: 6a 00 push $0x0
pushl $46
101ea6: 6a 2e push $0x2e
jmp __alltraps
101ea8: e9 45 fe ff ff jmp 101cf2 <__alltraps>
00101ead <vector47>:
.globl vector47
vector47:
pushl $0
101ead: 6a 00 push $0x0
pushl $47
101eaf: 6a 2f push $0x2f
jmp __alltraps
101eb1: e9 3c fe ff ff jmp 101cf2 <__alltraps>
00101eb6 <vector48>:
.globl vector48
vector48:
pushl $0
101eb6: 6a 00 push $0x0
pushl $48
101eb8: 6a 30 push $0x30
jmp __alltraps
101eba: e9 33 fe ff ff jmp 101cf2 <__alltraps>
00101ebf <vector49>:
.globl vector49
vector49:
pushl $0
101ebf: 6a 00 push $0x0
pushl $49
101ec1: 6a 31 push $0x31
jmp __alltraps
101ec3: e9 2a fe ff ff jmp 101cf2 <__alltraps>
00101ec8 <vector50>:
.globl vector50
vector50:
pushl $0
101ec8: 6a 00 push $0x0
pushl $50
101eca: 6a 32 push $0x32
jmp __alltraps
101ecc: e9 21 fe ff ff jmp 101cf2 <__alltraps>
00101ed1 <vector51>:
.globl vector51
vector51:
pushl $0
101ed1: 6a 00 push $0x0
pushl $51
101ed3: 6a 33 push $0x33
jmp __alltraps
101ed5: e9 18 fe ff ff jmp 101cf2 <__alltraps>
00101eda <vector52>:
.globl vector52
vector52:
pushl $0
101eda: 6a 00 push $0x0
pushl $52
101edc: 6a 34 push $0x34
jmp __alltraps
101ede: e9 0f fe ff ff jmp 101cf2 <__alltraps>
00101ee3 <vector53>:
.globl vector53
vector53:
pushl $0
101ee3: 6a 00 push $0x0
pushl $53
101ee5: 6a 35 push $0x35
jmp __alltraps
101ee7: e9 06 fe ff ff jmp 101cf2 <__alltraps>
00101eec <vector54>:
.globl vector54
vector54:
pushl $0
101eec: 6a 00 push $0x0
pushl $54
101eee: 6a 36 push $0x36
jmp __alltraps
101ef0: e9 fd fd ff ff jmp 101cf2 <__alltraps>
00101ef5 <vector55>:
.globl vector55
vector55:
pushl $0
101ef5: 6a 00 push $0x0
pushl $55
101ef7: 6a 37 push $0x37
jmp __alltraps
101ef9: e9 f4 fd ff ff jmp 101cf2 <__alltraps>
00101efe <vector56>:
.globl vector56
vector56:
pushl $0
101efe: 6a 00 push $0x0
pushl $56
101f00: 6a 38 push $0x38
jmp __alltraps
101f02: e9 eb fd ff ff jmp 101cf2 <__alltraps>
00101f07 <vector57>:
.globl vector57
vector57:
pushl $0
101f07: 6a 00 push $0x0
pushl $57
101f09: 6a 39 push $0x39
jmp __alltraps
101f0b: e9 e2 fd ff ff jmp 101cf2 <__alltraps>
00101f10 <vector58>:
.globl vector58
vector58:
pushl $0
101f10: 6a 00 push $0x0
pushl $58
101f12: 6a 3a push $0x3a
jmp __alltraps
101f14: e9 d9 fd ff ff jmp 101cf2 <__alltraps>
00101f19 <vector59>:
.globl vector59
vector59:
pushl $0
101f19: 6a 00 push $0x0
pushl $59
101f1b: 6a 3b push $0x3b
jmp __alltraps
101f1d: e9 d0 fd ff ff jmp 101cf2 <__alltraps>
00101f22 <vector60>:
.globl vector60
vector60:
pushl $0
101f22: 6a 00 push $0x0
pushl $60
101f24: 6a 3c push $0x3c
jmp __alltraps
101f26: e9 c7 fd ff ff jmp 101cf2 <__alltraps>
00101f2b <vector61>:
.globl vector61
vector61:
pushl $0
101f2b: 6a 00 push $0x0
pushl $61
101f2d: 6a 3d push $0x3d
jmp __alltraps
101f2f: e9 be fd ff ff jmp 101cf2 <__alltraps>
00101f34 <vector62>:
.globl vector62
vector62:
pushl $0
101f34: 6a 00 push $0x0
pushl $62
101f36: 6a 3e push $0x3e
jmp __alltraps
101f38: e9 b5 fd ff ff jmp 101cf2 <__alltraps>
00101f3d <vector63>:
.globl vector63
vector63:
pushl $0
101f3d: 6a 00 push $0x0
pushl $63
101f3f: 6a 3f push $0x3f
jmp __alltraps
101f41: e9 ac fd ff ff jmp 101cf2 <__alltraps>
00101f46 <vector64>:
.globl vector64
vector64:
pushl $0
101f46: 6a 00 push $0x0
pushl $64
101f48: 6a 40 push $0x40
jmp __alltraps
101f4a: e9 a3 fd ff ff jmp 101cf2 <__alltraps>
00101f4f <vector65>:
.globl vector65
vector65:
pushl $0
101f4f: 6a 00 push $0x0
pushl $65
101f51: 6a 41 push $0x41
jmp __alltraps
101f53: e9 9a fd ff ff jmp 101cf2 <__alltraps>
00101f58 <vector66>:
.globl vector66
vector66:
pushl $0
101f58: 6a 00 push $0x0
pushl $66
101f5a: 6a 42 push $0x42
jmp __alltraps
101f5c: e9 91 fd ff ff jmp 101cf2 <__alltraps>
00101f61 <vector67>:
.globl vector67
vector67:
pushl $0
101f61: 6a 00 push $0x0
pushl $67
101f63: 6a 43 push $0x43
jmp __alltraps
101f65: e9 88 fd ff ff jmp 101cf2 <__alltraps>
00101f6a <vector68>:
.globl vector68
vector68:
pushl $0
101f6a: 6a 00 push $0x0
pushl $68
101f6c: 6a 44 push $0x44
jmp __alltraps
101f6e: e9 7f fd ff ff jmp 101cf2 <__alltraps>
00101f73 <vector69>:
.globl vector69
vector69:
pushl $0
101f73: 6a 00 push $0x0
pushl $69
101f75: 6a 45 push $0x45
jmp __alltraps
101f77: e9 76 fd ff ff jmp 101cf2 <__alltraps>
00101f7c <vector70>:
.globl vector70
vector70:
pushl $0
101f7c: 6a 00 push $0x0
pushl $70
101f7e: 6a 46 push $0x46
jmp __alltraps
101f80: e9 6d fd ff ff jmp 101cf2 <__alltraps>
00101f85 <vector71>:
.globl vector71
vector71:
pushl $0
101f85: 6a 00 push $0x0
pushl $71
101f87: 6a 47 push $0x47
jmp __alltraps
101f89: e9 64 fd ff ff jmp 101cf2 <__alltraps>
00101f8e <vector72>:
.globl vector72
vector72:
pushl $0
101f8e: 6a 00 push $0x0
pushl $72
101f90: 6a 48 push $0x48
jmp __alltraps
101f92: e9 5b fd ff ff jmp 101cf2 <__alltraps>
00101f97 <vector73>:
.globl vector73
vector73:
pushl $0
101f97: 6a 00 push $0x0
pushl $73
101f99: 6a 49 push $0x49
jmp __alltraps
101f9b: e9 52 fd ff ff jmp 101cf2 <__alltraps>
00101fa0 <vector74>:
.globl vector74
vector74:
pushl $0
101fa0: 6a 00 push $0x0
pushl $74
101fa2: 6a 4a push $0x4a
jmp __alltraps
101fa4: e9 49 fd ff ff jmp 101cf2 <__alltraps>
00101fa9 <vector75>:
.globl vector75
vector75:
pushl $0
101fa9: 6a 00 push $0x0
pushl $75
101fab: 6a 4b push $0x4b
jmp __alltraps
101fad: e9 40 fd ff ff jmp 101cf2 <__alltraps>
00101fb2 <vector76>:
.globl vector76
vector76:
pushl $0
101fb2: 6a 00 push $0x0
pushl $76
101fb4: 6a 4c push $0x4c
jmp __alltraps
101fb6: e9 37 fd ff ff jmp 101cf2 <__alltraps>
00101fbb <vector77>:
.globl vector77
vector77:
pushl $0
101fbb: 6a 00 push $0x0
pushl $77
101fbd: 6a 4d push $0x4d
jmp __alltraps
101fbf: e9 2e fd ff ff jmp 101cf2 <__alltraps>
00101fc4 <vector78>:
.globl vector78
vector78:
pushl $0
101fc4: 6a 00 push $0x0
pushl $78
101fc6: 6a 4e push $0x4e
jmp __alltraps
101fc8: e9 25 fd ff ff jmp 101cf2 <__alltraps>
00101fcd <vector79>:
.globl vector79
vector79:
pushl $0
101fcd: 6a 00 push $0x0
pushl $79
101fcf: 6a 4f push $0x4f
jmp __alltraps
101fd1: e9 1c fd ff ff jmp 101cf2 <__alltraps>
00101fd6 <vector80>:
.globl vector80
vector80:
pushl $0
101fd6: 6a 00 push $0x0
pushl $80
101fd8: 6a 50 push $0x50
jmp __alltraps
101fda: e9 13 fd ff ff jmp 101cf2 <__alltraps>
00101fdf <vector81>:
.globl vector81
vector81:
pushl $0
101fdf: 6a 00 push $0x0
pushl $81
101fe1: 6a 51 push $0x51
jmp __alltraps
101fe3: e9 0a fd ff ff jmp 101cf2 <__alltraps>
00101fe8 <vector82>:
.globl vector82
vector82:
pushl $0
101fe8: 6a 00 push $0x0
pushl $82
101fea: 6a 52 push $0x52
jmp __alltraps
101fec: e9 01 fd ff ff jmp 101cf2 <__alltraps>
00101ff1 <vector83>:
.globl vector83
vector83:
pushl $0
101ff1: 6a 00 push $0x0
pushl $83
101ff3: 6a 53 push $0x53
jmp __alltraps
101ff5: e9 f8 fc ff ff jmp 101cf2 <__alltraps>
00101ffa <vector84>:
.globl vector84
vector84:
pushl $0
101ffa: 6a 00 push $0x0
pushl $84
101ffc: 6a 54 push $0x54
jmp __alltraps
101ffe: e9 ef fc ff ff jmp 101cf2 <__alltraps>
00102003 <vector85>:
.globl vector85
vector85:
pushl $0
102003: 6a 00 push $0x0
pushl $85
102005: 6a 55 push $0x55
jmp __alltraps
102007: e9 e6 fc ff ff jmp 101cf2 <__alltraps>
0010200c <vector86>:
.globl vector86
vector86:
pushl $0
10200c: 6a 00 push $0x0
pushl $86
10200e: 6a 56 push $0x56
jmp __alltraps
102010: e9 dd fc ff ff jmp 101cf2 <__alltraps>
00102015 <vector87>:
.globl vector87
vector87:
pushl $0
102015: 6a 00 push $0x0
pushl $87
102017: 6a 57 push $0x57
jmp __alltraps
102019: e9 d4 fc ff ff jmp 101cf2 <__alltraps>
0010201e <vector88>:
.globl vector88
vector88:
pushl $0
10201e: 6a 00 push $0x0
pushl $88
102020: 6a 58 push $0x58
jmp __alltraps
102022: e9 cb fc ff ff jmp 101cf2 <__alltraps>
00102027 <vector89>:
.globl vector89
vector89:
pushl $0
102027: 6a 00 push $0x0
pushl $89
102029: 6a 59 push $0x59
jmp __alltraps
10202b: e9 c2 fc ff ff jmp 101cf2 <__alltraps>
00102030 <vector90>:
.globl vector90
vector90:
pushl $0
102030: 6a 00 push $0x0
pushl $90
102032: 6a 5a push $0x5a
jmp __alltraps
102034: e9 b9 fc ff ff jmp 101cf2 <__alltraps>
00102039 <vector91>:
.globl vector91
vector91:
pushl $0
102039: 6a 00 push $0x0
pushl $91
10203b: 6a 5b push $0x5b
jmp __alltraps
10203d: e9 b0 fc ff ff jmp 101cf2 <__alltraps>
00102042 <vector92>:
.globl vector92
vector92:
pushl $0
102042: 6a 00 push $0x0
pushl $92
102044: 6a 5c push $0x5c
jmp __alltraps
102046: e9 a7 fc ff ff jmp 101cf2 <__alltraps>
0010204b <vector93>:
.globl vector93
vector93:
pushl $0
10204b: 6a 00 push $0x0
pushl $93
10204d: 6a 5d push $0x5d
jmp __alltraps
10204f: e9 9e fc ff ff jmp 101cf2 <__alltraps>
00102054 <vector94>:
.globl vector94
vector94:
pushl $0
102054: 6a 00 push $0x0
pushl $94
102056: 6a 5e push $0x5e
jmp __alltraps
102058: e9 95 fc ff ff jmp 101cf2 <__alltraps>
0010205d <vector95>:
.globl vector95
vector95:
pushl $0
10205d: 6a 00 push $0x0
pushl $95
10205f: 6a 5f push $0x5f
jmp __alltraps
102061: e9 8c fc ff ff jmp 101cf2 <__alltraps>
00102066 <vector96>:
.globl vector96
vector96:
pushl $0
102066: 6a 00 push $0x0
pushl $96
102068: 6a 60 push $0x60
jmp __alltraps
10206a: e9 83 fc ff ff jmp 101cf2 <__alltraps>
0010206f <vector97>:
.globl vector97
vector97:
pushl $0
10206f: 6a 00 push $0x0
pushl $97
102071: 6a 61 push $0x61
jmp __alltraps
102073: e9 7a fc ff ff jmp 101cf2 <__alltraps>
00102078 <vector98>:
.globl vector98
vector98:
pushl $0
102078: 6a 00 push $0x0
pushl $98
10207a: 6a 62 push $0x62
jmp __alltraps
10207c: e9 71 fc ff ff jmp 101cf2 <__alltraps>
00102081 <vector99>:
.globl vector99
vector99:
pushl $0
102081: 6a 00 push $0x0
pushl $99
102083: 6a 63 push $0x63
jmp __alltraps
102085: e9 68 fc ff ff jmp 101cf2 <__alltraps>
0010208a <vector100>:
.globl vector100
vector100:
pushl $0
10208a: 6a 00 push $0x0
pushl $100
10208c: 6a 64 push $0x64
jmp __alltraps
10208e: e9 5f fc ff ff jmp 101cf2 <__alltraps>
00102093 <vector101>:
.globl vector101
vector101:
pushl $0
102093: 6a 00 push $0x0
pushl $101
102095: 6a 65 push $0x65
jmp __alltraps
102097: e9 56 fc ff ff jmp 101cf2 <__alltraps>
0010209c <vector102>:
.globl vector102
vector102:
pushl $0
10209c: 6a 00 push $0x0
pushl $102
10209e: 6a 66 push $0x66
jmp __alltraps
1020a0: e9 4d fc ff ff jmp 101cf2 <__alltraps>
001020a5 <vector103>:
.globl vector103
vector103:
pushl $0
1020a5: 6a 00 push $0x0
pushl $103
1020a7: 6a 67 push $0x67
jmp __alltraps
1020a9: e9 44 fc ff ff jmp 101cf2 <__alltraps>
001020ae <vector104>:
.globl vector104
vector104:
pushl $0
1020ae: 6a 00 push $0x0
pushl $104
1020b0: 6a 68 push $0x68
jmp __alltraps
1020b2: e9 3b fc ff ff jmp 101cf2 <__alltraps>
001020b7 <vector105>:
.globl vector105
vector105:
pushl $0
1020b7: 6a 00 push $0x0
pushl $105
1020b9: 6a 69 push $0x69
jmp __alltraps
1020bb: e9 32 fc ff ff jmp 101cf2 <__alltraps>
001020c0 <vector106>:
.globl vector106
vector106:
pushl $0
1020c0: 6a 00 push $0x0
pushl $106
1020c2: 6a 6a push $0x6a
jmp __alltraps
1020c4: e9 29 fc ff ff jmp 101cf2 <__alltraps>
001020c9 <vector107>:
.globl vector107
vector107:
pushl $0
1020c9: 6a 00 push $0x0
pushl $107
1020cb: 6a 6b push $0x6b
jmp __alltraps
1020cd: e9 20 fc ff ff jmp 101cf2 <__alltraps>
001020d2 <vector108>:
.globl vector108
vector108:
pushl $0
1020d2: 6a 00 push $0x0
pushl $108
1020d4: 6a 6c push $0x6c
jmp __alltraps
1020d6: e9 17 fc ff ff jmp 101cf2 <__alltraps>
001020db <vector109>:
.globl vector109
vector109:
pushl $0
1020db: 6a 00 push $0x0
pushl $109
1020dd: 6a 6d push $0x6d
jmp __alltraps
1020df: e9 0e fc ff ff jmp 101cf2 <__alltraps>
001020e4 <vector110>:
.globl vector110
vector110:
pushl $0
1020e4: 6a 00 push $0x0
pushl $110
1020e6: 6a 6e push $0x6e
jmp __alltraps
1020e8: e9 05 fc ff ff jmp 101cf2 <__alltraps>
001020ed <vector111>:
.globl vector111
vector111:
pushl $0
1020ed: 6a 00 push $0x0
pushl $111
1020ef: 6a 6f push $0x6f
jmp __alltraps
1020f1: e9 fc fb ff ff jmp 101cf2 <__alltraps>
001020f6 <vector112>:
.globl vector112
vector112:
pushl $0
1020f6: 6a 00 push $0x0
pushl $112
1020f8: 6a 70 push $0x70
jmp __alltraps
1020fa: e9 f3 fb ff ff jmp 101cf2 <__alltraps>
001020ff <vector113>:
.globl vector113
vector113:
pushl $0
1020ff: 6a 00 push $0x0
pushl $113
102101: 6a 71 push $0x71
jmp __alltraps
102103: e9 ea fb ff ff jmp 101cf2 <__alltraps>
00102108 <vector114>:
.globl vector114
vector114:
pushl $0
102108: 6a 00 push $0x0
pushl $114
10210a: 6a 72 push $0x72
jmp __alltraps
10210c: e9 e1 fb ff ff jmp 101cf2 <__alltraps>
00102111 <vector115>:
.globl vector115
vector115:
pushl $0
102111: 6a 00 push $0x0
pushl $115
102113: 6a 73 push $0x73
jmp __alltraps
102115: e9 d8 fb ff ff jmp 101cf2 <__alltraps>
0010211a <vector116>:
.globl vector116
vector116:
pushl $0
10211a: 6a 00 push $0x0
pushl $116
10211c: 6a 74 push $0x74
jmp __alltraps
10211e: e9 cf fb ff ff jmp 101cf2 <__alltraps>
00102123 <vector117>:
.globl vector117
vector117:
pushl $0
102123: 6a 00 push $0x0
pushl $117
102125: 6a 75 push $0x75
jmp __alltraps
102127: e9 c6 fb ff ff jmp 101cf2 <__alltraps>
0010212c <vector118>:
.globl vector118
vector118:
pushl $0
10212c: 6a 00 push $0x0
pushl $118
10212e: 6a 76 push $0x76
jmp __alltraps
102130: e9 bd fb ff ff jmp 101cf2 <__alltraps>
00102135 <vector119>:
.globl vector119
vector119:
pushl $0
102135: 6a 00 push $0x0
pushl $119
102137: 6a 77 push $0x77
jmp __alltraps
102139: e9 b4 fb ff ff jmp 101cf2 <__alltraps>
0010213e <vector120>:
.globl vector120
vector120:
pushl $0
10213e: 6a 00 push $0x0
pushl $120
102140: 6a 78 push $0x78
jmp __alltraps
102142: e9 ab fb ff ff jmp 101cf2 <__alltraps>
00102147 <vector121>:
.globl vector121
vector121:
pushl $0
102147: 6a 00 push $0x0
pushl $121
102149: 6a 79 push $0x79
jmp __alltraps
10214b: e9 a2 fb ff ff jmp 101cf2 <__alltraps>
00102150 <vector122>:
.globl vector122
vector122:
pushl $0
102150: 6a 00 push $0x0
pushl $122
102152: 6a 7a push $0x7a
jmp __alltraps
102154: e9 99 fb ff ff jmp 101cf2 <__alltraps>
00102159 <vector123>:
.globl vector123
vector123:
pushl $0
102159: 6a 00 push $0x0
pushl $123
10215b: 6a 7b push $0x7b
jmp __alltraps
10215d: e9 90 fb ff ff jmp 101cf2 <__alltraps>
00102162 <vector124>:
.globl vector124
vector124:
pushl $0
102162: 6a 00 push $0x0
pushl $124
102164: 6a 7c push $0x7c
jmp __alltraps
102166: e9 87 fb ff ff jmp 101cf2 <__alltraps>
0010216b <vector125>:
.globl vector125
vector125:
pushl $0
10216b: 6a 00 push $0x0
pushl $125
10216d: 6a 7d push $0x7d
jmp __alltraps
10216f: e9 7e fb ff ff jmp 101cf2 <__alltraps>
00102174 <vector126>:
.globl vector126
vector126:
pushl $0
102174: 6a 00 push $0x0
pushl $126
102176: 6a 7e push $0x7e
jmp __alltraps
102178: e9 75 fb ff ff jmp 101cf2 <__alltraps>
0010217d <vector127>:
.globl vector127
vector127:
pushl $0
10217d: 6a 00 push $0x0
pushl $127
10217f: 6a 7f push $0x7f
jmp __alltraps
102181: e9 6c fb ff ff jmp 101cf2 <__alltraps>
00102186 <vector128>:
.globl vector128
vector128:
pushl $0
102186: 6a 00 push $0x0
pushl $128
102188: 68 80 00 00 00 push $0x80
jmp __alltraps
10218d: e9 60 fb ff ff jmp 101cf2 <__alltraps>
00102192 <vector129>:
.globl vector129
vector129:
pushl $0
102192: 6a 00 push $0x0
pushl $129
102194: 68 81 00 00 00 push $0x81
jmp __alltraps
102199: e9 54 fb ff ff jmp 101cf2 <__alltraps>
0010219e <vector130>:
.globl vector130
vector130:
pushl $0
10219e: 6a 00 push $0x0
pushl $130
1021a0: 68 82 00 00 00 push $0x82
jmp __alltraps
1021a5: e9 48 fb ff ff jmp 101cf2 <__alltraps>
001021aa <vector131>:
.globl vector131
vector131:
pushl $0
1021aa: 6a 00 push $0x0
pushl $131
1021ac: 68 83 00 00 00 push $0x83
jmp __alltraps
1021b1: e9 3c fb ff ff jmp 101cf2 <__alltraps>
001021b6 <vector132>:
.globl vector132
vector132:
pushl $0
1021b6: 6a 00 push $0x0
pushl $132
1021b8: 68 84 00 00 00 push $0x84
jmp __alltraps
1021bd: e9 30 fb ff ff jmp 101cf2 <__alltraps>
001021c2 <vector133>:
.globl vector133
vector133:
pushl $0
1021c2: 6a 00 push $0x0
pushl $133
1021c4: 68 85 00 00 00 push $0x85
jmp __alltraps
1021c9: e9 24 fb ff ff jmp 101cf2 <__alltraps>
001021ce <vector134>:
.globl vector134
vector134:
pushl $0
1021ce: 6a 00 push $0x0
pushl $134
1021d0: 68 86 00 00 00 push $0x86
jmp __alltraps
1021d5: e9 18 fb ff ff jmp 101cf2 <__alltraps>
001021da <vector135>:
.globl vector135
vector135:
pushl $0
1021da: 6a 00 push $0x0
pushl $135
1021dc: 68 87 00 00 00 push $0x87
jmp __alltraps
1021e1: e9 0c fb ff ff jmp 101cf2 <__alltraps>
001021e6 <vector136>:
.globl vector136
vector136:
pushl $0
1021e6: 6a 00 push $0x0
pushl $136
1021e8: 68 88 00 00 00 push $0x88
jmp __alltraps
1021ed: e9 00 fb ff ff jmp 101cf2 <__alltraps>
001021f2 <vector137>:
.globl vector137
vector137:
pushl $0
1021f2: 6a 00 push $0x0
pushl $137
1021f4: 68 89 00 00 00 push $0x89
jmp __alltraps
1021f9: e9 f4 fa ff ff jmp 101cf2 <__alltraps>
001021fe <vector138>:
.globl vector138
vector138:
pushl $0
1021fe: 6a 00 push $0x0
pushl $138
102200: 68 8a 00 00 00 push $0x8a
jmp __alltraps
102205: e9 e8 fa ff ff jmp 101cf2 <__alltraps>
0010220a <vector139>:
.globl vector139
vector139:
pushl $0
10220a: 6a 00 push $0x0
pushl $139
10220c: 68 8b 00 00 00 push $0x8b
jmp __alltraps
102211: e9 dc fa ff ff jmp 101cf2 <__alltraps>
00102216 <vector140>:
.globl vector140
vector140:
pushl $0
102216: 6a 00 push $0x0
pushl $140
102218: 68 8c 00 00 00 push $0x8c
jmp __alltraps
10221d: e9 d0 fa ff ff jmp 101cf2 <__alltraps>
00102222 <vector141>:
.globl vector141
vector141:
pushl $0
102222: 6a 00 push $0x0
pushl $141
102224: 68 8d 00 00 00 push $0x8d
jmp __alltraps
102229: e9 c4 fa ff ff jmp 101cf2 <__alltraps>
0010222e <vector142>:
.globl vector142
vector142:
pushl $0
10222e: 6a 00 push $0x0
pushl $142
102230: 68 8e 00 00 00 push $0x8e
jmp __alltraps
102235: e9 b8 fa ff ff jmp 101cf2 <__alltraps>
0010223a <vector143>:
.globl vector143
vector143:
pushl $0
10223a: 6a 00 push $0x0
pushl $143
10223c: 68 8f 00 00 00 push $0x8f
jmp __alltraps
102241: e9 ac fa ff ff jmp 101cf2 <__alltraps>
00102246 <vector144>:
.globl vector144
vector144:
pushl $0
102246: 6a 00 push $0x0
pushl $144
102248: 68 90 00 00 00 push $0x90
jmp __alltraps
10224d: e9 a0 fa ff ff jmp 101cf2 <__alltraps>
00102252 <vector145>:
.globl vector145
vector145:
pushl $0
102252: 6a 00 push $0x0
pushl $145
102254: 68 91 00 00 00 push $0x91
jmp __alltraps
102259: e9 94 fa ff ff jmp 101cf2 <__alltraps>
0010225e <vector146>:
.globl vector146
vector146:
pushl $0
10225e: 6a 00 push $0x0
pushl $146
102260: 68 92 00 00 00 push $0x92
jmp __alltraps
102265: e9 88 fa ff ff jmp 101cf2 <__alltraps>
0010226a <vector147>:
.globl vector147
vector147:
pushl $0
10226a: 6a 00 push $0x0
pushl $147
10226c: 68 93 00 00 00 push $0x93
jmp __alltraps
102271: e9 7c fa ff ff jmp 101cf2 <__alltraps>
00102276 <vector148>:
.globl vector148
vector148:
pushl $0
102276: 6a 00 push $0x0
pushl $148
102278: 68 94 00 00 00 push $0x94
jmp __alltraps
10227d: e9 70 fa ff ff jmp 101cf2 <__alltraps>
00102282 <vector149>:
.globl vector149
vector149:
pushl $0
102282: 6a 00 push $0x0
pushl $149
102284: 68 95 00 00 00 push $0x95
jmp __alltraps
102289: e9 64 fa ff ff jmp 101cf2 <__alltraps>
0010228e <vector150>:
.globl vector150
vector150:
pushl $0
10228e: 6a 00 push $0x0
pushl $150
102290: 68 96 00 00 00 push $0x96
jmp __alltraps
102295: e9 58 fa ff ff jmp 101cf2 <__alltraps>
0010229a <vector151>:
.globl vector151
vector151:
pushl $0
10229a: 6a 00 push $0x0
pushl $151
10229c: 68 97 00 00 00 push $0x97
jmp __alltraps
1022a1: e9 4c fa ff ff jmp 101cf2 <__alltraps>
001022a6 <vector152>:
.globl vector152
vector152:
pushl $0
1022a6: 6a 00 push $0x0
pushl $152
1022a8: 68 98 00 00 00 push $0x98
jmp __alltraps
1022ad: e9 40 fa ff ff jmp 101cf2 <__alltraps>
001022b2 <vector153>:
.globl vector153
vector153:
pushl $0
1022b2: 6a 00 push $0x0
pushl $153
1022b4: 68 99 00 00 00 push $0x99
jmp __alltraps
1022b9: e9 34 fa ff ff jmp 101cf2 <__alltraps>
001022be <vector154>:
.globl vector154
vector154:
pushl $0
1022be: 6a 00 push $0x0
pushl $154
1022c0: 68 9a 00 00 00 push $0x9a
jmp __alltraps
1022c5: e9 28 fa ff ff jmp 101cf2 <__alltraps>
001022ca <vector155>:
.globl vector155
vector155:
pushl $0
1022ca: 6a 00 push $0x0
pushl $155
1022cc: 68 9b 00 00 00 push $0x9b
jmp __alltraps
1022d1: e9 1c fa ff ff jmp 101cf2 <__alltraps>
001022d6 <vector156>:
.globl vector156
vector156:
pushl $0
1022d6: 6a 00 push $0x0
pushl $156
1022d8: 68 9c 00 00 00 push $0x9c
jmp __alltraps
1022dd: e9 10 fa ff ff jmp 101cf2 <__alltraps>
001022e2 <vector157>:
.globl vector157
vector157:
pushl $0
1022e2: 6a 00 push $0x0
pushl $157
1022e4: 68 9d 00 00 00 push $0x9d
jmp __alltraps
1022e9: e9 04 fa ff ff jmp 101cf2 <__alltraps>
001022ee <vector158>:
.globl vector158
vector158:
pushl $0
1022ee: 6a 00 push $0x0
pushl $158
1022f0: 68 9e 00 00 00 push $0x9e
jmp __alltraps
1022f5: e9 f8 f9 ff ff jmp 101cf2 <__alltraps>
001022fa <vector159>:
.globl vector159
vector159:
pushl $0
1022fa: 6a 00 push $0x0
pushl $159
1022fc: 68 9f 00 00 00 push $0x9f
jmp __alltraps
102301: e9 ec f9 ff ff jmp 101cf2 <__alltraps>
00102306 <vector160>:
.globl vector160
vector160:
pushl $0
102306: 6a 00 push $0x0
pushl $160
102308: 68 a0 00 00 00 push $0xa0
jmp __alltraps
10230d: e9 e0 f9 ff ff jmp 101cf2 <__alltraps>
00102312 <vector161>:
.globl vector161
vector161:
pushl $0
102312: 6a 00 push $0x0
pushl $161
102314: 68 a1 00 00 00 push $0xa1
jmp __alltraps
102319: e9 d4 f9 ff ff jmp 101cf2 <__alltraps>
0010231e <vector162>:
.globl vector162
vector162:
pushl $0
10231e: 6a 00 push $0x0
pushl $162
102320: 68 a2 00 00 00 push $0xa2
jmp __alltraps
102325: e9 c8 f9 ff ff jmp 101cf2 <__alltraps>
0010232a <vector163>:
.globl vector163
vector163:
pushl $0
10232a: 6a 00 push $0x0
pushl $163
10232c: 68 a3 00 00 00 push $0xa3
jmp __alltraps
102331: e9 bc f9 ff ff jmp 101cf2 <__alltraps>
00102336 <vector164>:
.globl vector164
vector164:
pushl $0
102336: 6a 00 push $0x0
pushl $164
102338: 68 a4 00 00 00 push $0xa4
jmp __alltraps
10233d: e9 b0 f9 ff ff jmp 101cf2 <__alltraps>
00102342 <vector165>:
.globl vector165
vector165:
pushl $0
102342: 6a 00 push $0x0
pushl $165
102344: 68 a5 00 00 00 push $0xa5
jmp __alltraps
102349: e9 a4 f9 ff ff jmp 101cf2 <__alltraps>
0010234e <vector166>:
.globl vector166
vector166:
pushl $0
10234e: 6a 00 push $0x0
pushl $166
102350: 68 a6 00 00 00 push $0xa6
jmp __alltraps
102355: e9 98 f9 ff ff jmp 101cf2 <__alltraps>
0010235a <vector167>:
.globl vector167
vector167:
pushl $0
10235a: 6a 00 push $0x0
pushl $167
10235c: 68 a7 00 00 00 push $0xa7
jmp __alltraps
102361: e9 8c f9 ff ff jmp 101cf2 <__alltraps>
00102366 <vector168>:
.globl vector168
vector168:
pushl $0
102366: 6a 00 push $0x0
pushl $168
102368: 68 a8 00 00 00 push $0xa8
jmp __alltraps
10236d: e9 80 f9 ff ff jmp 101cf2 <__alltraps>
00102372 <vector169>:
.globl vector169
vector169:
pushl $0
102372: 6a 00 push $0x0
pushl $169
102374: 68 a9 00 00 00 push $0xa9
jmp __alltraps
102379: e9 74 f9 ff ff jmp 101cf2 <__alltraps>
0010237e <vector170>:
.globl vector170
vector170:
pushl $0
10237e: 6a 00 push $0x0
pushl $170
102380: 68 aa 00 00 00 push $0xaa
jmp __alltraps
102385: e9 68 f9 ff ff jmp 101cf2 <__alltraps>
0010238a <vector171>:
.globl vector171
vector171:
pushl $0
10238a: 6a 00 push $0x0
pushl $171
10238c: 68 ab 00 00 00 push $0xab
jmp __alltraps
102391: e9 5c f9 ff ff jmp 101cf2 <__alltraps>
00102396 <vector172>:
.globl vector172
vector172:
pushl $0
102396: 6a 00 push $0x0
pushl $172
102398: 68 ac 00 00 00 push $0xac
jmp __alltraps
10239d: e9 50 f9 ff ff jmp 101cf2 <__alltraps>
001023a2 <vector173>:
.globl vector173
vector173:
pushl $0
1023a2: 6a 00 push $0x0
pushl $173
1023a4: 68 ad 00 00 00 push $0xad
jmp __alltraps
1023a9: e9 44 f9 ff ff jmp 101cf2 <__alltraps>
001023ae <vector174>:
.globl vector174
vector174:
pushl $0
1023ae: 6a 00 push $0x0
pushl $174
1023b0: 68 ae 00 00 00 push $0xae
jmp __alltraps
1023b5: e9 38 f9 ff ff jmp 101cf2 <__alltraps>
001023ba <vector175>:
.globl vector175
vector175:
pushl $0
1023ba: 6a 00 push $0x0
pushl $175
1023bc: 68 af 00 00 00 push $0xaf
jmp __alltraps
1023c1: e9 2c f9 ff ff jmp 101cf2 <__alltraps>
001023c6 <vector176>:
.globl vector176
vector176:
pushl $0
1023c6: 6a 00 push $0x0
pushl $176
1023c8: 68 b0 00 00 00 push $0xb0
jmp __alltraps
1023cd: e9 20 f9 ff ff jmp 101cf2 <__alltraps>
001023d2 <vector177>:
.globl vector177
vector177:
pushl $0
1023d2: 6a 00 push $0x0
pushl $177
1023d4: 68 b1 00 00 00 push $0xb1
jmp __alltraps
1023d9: e9 14 f9 ff ff jmp 101cf2 <__alltraps>
001023de <vector178>:
.globl vector178
vector178:
pushl $0
1023de: 6a 00 push $0x0
pushl $178
1023e0: 68 b2 00 00 00 push $0xb2
jmp __alltraps
1023e5: e9 08 f9 ff ff jmp 101cf2 <__alltraps>
001023ea <vector179>:
.globl vector179
vector179:
pushl $0
1023ea: 6a 00 push $0x0
pushl $179
1023ec: 68 b3 00 00 00 push $0xb3
jmp __alltraps
1023f1: e9 fc f8 ff ff jmp 101cf2 <__alltraps>
001023f6 <vector180>:
.globl vector180
vector180:
pushl $0
1023f6: 6a 00 push $0x0
pushl $180
1023f8: 68 b4 00 00 00 push $0xb4
jmp __alltraps
1023fd: e9 f0 f8 ff ff jmp 101cf2 <__alltraps>
00102402 <vector181>:
.globl vector181
vector181:
pushl $0
102402: 6a 00 push $0x0
pushl $181
102404: 68 b5 00 00 00 push $0xb5
jmp __alltraps
102409: e9 e4 f8 ff ff jmp 101cf2 <__alltraps>
0010240e <vector182>:
.globl vector182
vector182:
pushl $0
10240e: 6a 00 push $0x0
pushl $182
102410: 68 b6 00 00 00 push $0xb6
jmp __alltraps
102415: e9 d8 f8 ff ff jmp 101cf2 <__alltraps>
0010241a <vector183>:
.globl vector183
vector183:
pushl $0
10241a: 6a 00 push $0x0
pushl $183
10241c: 68 b7 00 00 00 push $0xb7
jmp __alltraps
102421: e9 cc f8 ff ff jmp 101cf2 <__alltraps>
00102426 <vector184>:
.globl vector184
vector184:
pushl $0
102426: 6a 00 push $0x0
pushl $184
102428: 68 b8 00 00 00 push $0xb8
jmp __alltraps
10242d: e9 c0 f8 ff ff jmp 101cf2 <__alltraps>
00102432 <vector185>:
.globl vector185
vector185:
pushl $0
102432: 6a 00 push $0x0
pushl $185
102434: 68 b9 00 00 00 push $0xb9
jmp __alltraps
102439: e9 b4 f8 ff ff jmp 101cf2 <__alltraps>
0010243e <vector186>:
.globl vector186
vector186:
pushl $0
10243e: 6a 00 push $0x0
pushl $186
102440: 68 ba 00 00 00 push $0xba
jmp __alltraps
102445: e9 a8 f8 ff ff jmp 101cf2 <__alltraps>
0010244a <vector187>:
.globl vector187
vector187:
pushl $0
10244a: 6a 00 push $0x0
pushl $187
10244c: 68 bb 00 00 00 push $0xbb
jmp __alltraps
102451: e9 9c f8 ff ff jmp 101cf2 <__alltraps>
00102456 <vector188>:
.globl vector188
vector188:
pushl $0
102456: 6a 00 push $0x0
pushl $188
102458: 68 bc 00 00 00 push $0xbc
jmp __alltraps
10245d: e9 90 f8 ff ff jmp 101cf2 <__alltraps>
00102462 <vector189>:
.globl vector189
vector189:
pushl $0
102462: 6a 00 push $0x0
pushl $189
102464: 68 bd 00 00 00 push $0xbd
jmp __alltraps
102469: e9 84 f8 ff ff jmp 101cf2 <__alltraps>
0010246e <vector190>:
.globl vector190
vector190:
pushl $0
10246e: 6a 00 push $0x0
pushl $190
102470: 68 be 00 00 00 push $0xbe
jmp __alltraps
102475: e9 78 f8 ff ff jmp 101cf2 <__alltraps>
0010247a <vector191>:
.globl vector191
vector191:
pushl $0
10247a: 6a 00 push $0x0
pushl $191
10247c: 68 bf 00 00 00 push $0xbf
jmp __alltraps
102481: e9 6c f8 ff ff jmp 101cf2 <__alltraps>
00102486 <vector192>:
.globl vector192
vector192:
pushl $0
102486: 6a 00 push $0x0
pushl $192
102488: 68 c0 00 00 00 push $0xc0
jmp __alltraps
10248d: e9 60 f8 ff ff jmp 101cf2 <__alltraps>
00102492 <vector193>:
.globl vector193
vector193:
pushl $0
102492: 6a 00 push $0x0
pushl $193
102494: 68 c1 00 00 00 push $0xc1
jmp __alltraps
102499: e9 54 f8 ff ff jmp 101cf2 <__alltraps>
0010249e <vector194>:
.globl vector194
vector194:
pushl $0
10249e: 6a 00 push $0x0
pushl $194
1024a0: 68 c2 00 00 00 push $0xc2
jmp __alltraps
1024a5: e9 48 f8 ff ff jmp 101cf2 <__alltraps>
001024aa <vector195>:
.globl vector195
vector195:
pushl $0
1024aa: 6a 00 push $0x0
pushl $195
1024ac: 68 c3 00 00 00 push $0xc3
jmp __alltraps
1024b1: e9 3c f8 ff ff jmp 101cf2 <__alltraps>
001024b6 <vector196>:
.globl vector196
vector196:
pushl $0
1024b6: 6a 00 push $0x0
pushl $196
1024b8: 68 c4 00 00 00 push $0xc4
jmp __alltraps
1024bd: e9 30 f8 ff ff jmp 101cf2 <__alltraps>
001024c2 <vector197>:
.globl vector197
vector197:
pushl $0
1024c2: 6a 00 push $0x0
pushl $197
1024c4: 68 c5 00 00 00 push $0xc5
jmp __alltraps
1024c9: e9 24 f8 ff ff jmp 101cf2 <__alltraps>
001024ce <vector198>:
.globl vector198
vector198:
pushl $0
1024ce: 6a 00 push $0x0
pushl $198
1024d0: 68 c6 00 00 00 push $0xc6
jmp __alltraps
1024d5: e9 18 f8 ff ff jmp 101cf2 <__alltraps>
001024da <vector199>:
.globl vector199
vector199:
pushl $0
1024da: 6a 00 push $0x0
pushl $199
1024dc: 68 c7 00 00 00 push $0xc7
jmp __alltraps
1024e1: e9 0c f8 ff ff jmp 101cf2 <__alltraps>
001024e6 <vector200>:
.globl vector200
vector200:
pushl $0
1024e6: 6a 00 push $0x0
pushl $200
1024e8: 68 c8 00 00 00 push $0xc8
jmp __alltraps
1024ed: e9 00 f8 ff ff jmp 101cf2 <__alltraps>
001024f2 <vector201>:
.globl vector201
vector201:
pushl $0
1024f2: 6a 00 push $0x0
pushl $201
1024f4: 68 c9 00 00 00 push $0xc9
jmp __alltraps
1024f9: e9 f4 f7 ff ff jmp 101cf2 <__alltraps>
001024fe <vector202>:
.globl vector202
vector202:
pushl $0
1024fe: 6a 00 push $0x0
pushl $202
102500: 68 ca 00 00 00 push $0xca
jmp __alltraps
102505: e9 e8 f7 ff ff jmp 101cf2 <__alltraps>
0010250a <vector203>:
.globl vector203
vector203:
pushl $0
10250a: 6a 00 push $0x0
pushl $203
10250c: 68 cb 00 00 00 push $0xcb
jmp __alltraps
102511: e9 dc f7 ff ff jmp 101cf2 <__alltraps>
00102516 <vector204>:
.globl vector204
vector204:
pushl $0
102516: 6a 00 push $0x0
pushl $204
102518: 68 cc 00 00 00 push $0xcc
jmp __alltraps
10251d: e9 d0 f7 ff ff jmp 101cf2 <__alltraps>
00102522 <vector205>:
.globl vector205
vector205:
pushl $0
102522: 6a 00 push $0x0
pushl $205
102524: 68 cd 00 00 00 push $0xcd
jmp __alltraps
102529: e9 c4 f7 ff ff jmp 101cf2 <__alltraps>
0010252e <vector206>:
.globl vector206
vector206:
pushl $0
10252e: 6a 00 push $0x0
pushl $206
102530: 68 ce 00 00 00 push $0xce
jmp __alltraps
102535: e9 b8 f7 ff ff jmp 101cf2 <__alltraps>
0010253a <vector207>:
.globl vector207
vector207:
pushl $0
10253a: 6a 00 push $0x0
pushl $207
10253c: 68 cf 00 00 00 push $0xcf
jmp __alltraps
102541: e9 ac f7 ff ff jmp 101cf2 <__alltraps>
00102546 <vector208>:
.globl vector208
vector208:
pushl $0
102546: 6a 00 push $0x0
pushl $208
102548: 68 d0 00 00 00 push $0xd0
jmp __alltraps
10254d: e9 a0 f7 ff ff jmp 101cf2 <__alltraps>
00102552 <vector209>:
.globl vector209
vector209:
pushl $0
102552: 6a 00 push $0x0
pushl $209
102554: 68 d1 00 00 00 push $0xd1
jmp __alltraps
102559: e9 94 f7 ff ff jmp 101cf2 <__alltraps>
0010255e <vector210>:
.globl vector210
vector210:
pushl $0
10255e: 6a 00 push $0x0
pushl $210
102560: 68 d2 00 00 00 push $0xd2
jmp __alltraps
102565: e9 88 f7 ff ff jmp 101cf2 <__alltraps>
0010256a <vector211>:
.globl vector211
vector211:
pushl $0
10256a: 6a 00 push $0x0
pushl $211
10256c: 68 d3 00 00 00 push $0xd3
jmp __alltraps
102571: e9 7c f7 ff ff jmp 101cf2 <__alltraps>
00102576 <vector212>:
.globl vector212
vector212:
pushl $0
102576: 6a 00 push $0x0
pushl $212
102578: 68 d4 00 00 00 push $0xd4
jmp __alltraps
10257d: e9 70 f7 ff ff jmp 101cf2 <__alltraps>
00102582 <vector213>:
.globl vector213
vector213:
pushl $0
102582: 6a 00 push $0x0
pushl $213
102584: 68 d5 00 00 00 push $0xd5
jmp __alltraps
102589: e9 64 f7 ff ff jmp 101cf2 <__alltraps>
0010258e <vector214>:
.globl vector214
vector214:
pushl $0
10258e: 6a 00 push $0x0
pushl $214
102590: 68 d6 00 00 00 push $0xd6
jmp __alltraps
102595: e9 58 f7 ff ff jmp 101cf2 <__alltraps>
0010259a <vector215>:
.globl vector215
vector215:
pushl $0
10259a: 6a 00 push $0x0
pushl $215
10259c: 68 d7 00 00 00 push $0xd7
jmp __alltraps
1025a1: e9 4c f7 ff ff jmp 101cf2 <__alltraps>
001025a6 <vector216>:
.globl vector216
vector216:
pushl $0
1025a6: 6a 00 push $0x0
pushl $216
1025a8: 68 d8 00 00 00 push $0xd8
jmp __alltraps
1025ad: e9 40 f7 ff ff jmp 101cf2 <__alltraps>
001025b2 <vector217>:
.globl vector217
vector217:
pushl $0
1025b2: 6a 00 push $0x0
pushl $217
1025b4: 68 d9 00 00 00 push $0xd9
jmp __alltraps
1025b9: e9 34 f7 ff ff jmp 101cf2 <__alltraps>
001025be <vector218>:
.globl vector218
vector218:
pushl $0
1025be: 6a 00 push $0x0
pushl $218
1025c0: 68 da 00 00 00 push $0xda
jmp __alltraps
1025c5: e9 28 f7 ff ff jmp 101cf2 <__alltraps>
001025ca <vector219>:
.globl vector219
vector219:
pushl $0
1025ca: 6a 00 push $0x0
pushl $219
1025cc: 68 db 00 00 00 push $0xdb
jmp __alltraps
1025d1: e9 1c f7 ff ff jmp 101cf2 <__alltraps>
001025d6 <vector220>:
.globl vector220
vector220:
pushl $0
1025d6: 6a 00 push $0x0
pushl $220
1025d8: 68 dc 00 00 00 push $0xdc
jmp __alltraps
1025dd: e9 10 f7 ff ff jmp 101cf2 <__alltraps>
001025e2 <vector221>:
.globl vector221
vector221:
pushl $0
1025e2: 6a 00 push $0x0
pushl $221
1025e4: 68 dd 00 00 00 push $0xdd
jmp __alltraps
1025e9: e9 04 f7 ff ff jmp 101cf2 <__alltraps>
001025ee <vector222>:
.globl vector222
vector222:
pushl $0
1025ee: 6a 00 push $0x0
pushl $222
1025f0: 68 de 00 00 00 push $0xde
jmp __alltraps
1025f5: e9 f8 f6 ff ff jmp 101cf2 <__alltraps>
001025fa <vector223>:
.globl vector223
vector223:
pushl $0
1025fa: 6a 00 push $0x0
pushl $223
1025fc: 68 df 00 00 00 push $0xdf
jmp __alltraps
102601: e9 ec f6 ff ff jmp 101cf2 <__alltraps>
00102606 <vector224>:
.globl vector224
vector224:
pushl $0
102606: 6a 00 push $0x0
pushl $224
102608: 68 e0 00 00 00 push $0xe0
jmp __alltraps
10260d: e9 e0 f6 ff ff jmp 101cf2 <__alltraps>
00102612 <vector225>:
.globl vector225
vector225:
pushl $0
102612: 6a 00 push $0x0
pushl $225
102614: 68 e1 00 00 00 push $0xe1
jmp __alltraps
102619: e9 d4 f6 ff ff jmp 101cf2 <__alltraps>
0010261e <vector226>:
.globl vector226
vector226:
pushl $0
10261e: 6a 00 push $0x0
pushl $226
102620: 68 e2 00 00 00 push $0xe2
jmp __alltraps
102625: e9 c8 f6 ff ff jmp 101cf2 <__alltraps>
0010262a <vector227>:
.globl vector227
vector227:
pushl $0
10262a: 6a 00 push $0x0
pushl $227
10262c: 68 e3 00 00 00 push $0xe3
jmp __alltraps
102631: e9 bc f6 ff ff jmp 101cf2 <__alltraps>
00102636 <vector228>:
.globl vector228
vector228:
pushl $0
102636: 6a 00 push $0x0
pushl $228
102638: 68 e4 00 00 00 push $0xe4
jmp __alltraps
10263d: e9 b0 f6 ff ff jmp 101cf2 <__alltraps>
00102642 <vector229>:
.globl vector229
vector229:
pushl $0
102642: 6a 00 push $0x0
pushl $229
102644: 68 e5 00 00 00 push $0xe5
jmp __alltraps
102649: e9 a4 f6 ff ff jmp 101cf2 <__alltraps>
0010264e <vector230>:
.globl vector230
vector230:
pushl $0
10264e: 6a 00 push $0x0
pushl $230
102650: 68 e6 00 00 00 push $0xe6
jmp __alltraps
102655: e9 98 f6 ff ff jmp 101cf2 <__alltraps>
0010265a <vector231>:
.globl vector231
vector231:
pushl $0
10265a: 6a 00 push $0x0
pushl $231
10265c: 68 e7 00 00 00 push $0xe7
jmp __alltraps
102661: e9 8c f6 ff ff jmp 101cf2 <__alltraps>
00102666 <vector232>:
.globl vector232
vector232:
pushl $0
102666: 6a 00 push $0x0
pushl $232
102668: 68 e8 00 00 00 push $0xe8
jmp __alltraps
10266d: e9 80 f6 ff ff jmp 101cf2 <__alltraps>
00102672 <vector233>:
.globl vector233
vector233:
pushl $0
102672: 6a 00 push $0x0
pushl $233
102674: 68 e9 00 00 00 push $0xe9
jmp __alltraps
102679: e9 74 f6 ff ff jmp 101cf2 <__alltraps>
0010267e <vector234>:
.globl vector234
vector234:
pushl $0
10267e: 6a 00 push $0x0
pushl $234
102680: 68 ea 00 00 00 push $0xea
jmp __alltraps
102685: e9 68 f6 ff ff jmp 101cf2 <__alltraps>
0010268a <vector235>:
.globl vector235
vector235:
pushl $0
10268a: 6a 00 push $0x0
pushl $235
10268c: 68 eb 00 00 00 push $0xeb
jmp __alltraps
102691: e9 5c f6 ff ff jmp 101cf2 <__alltraps>
00102696 <vector236>:
.globl vector236
vector236:
pushl $0
102696: 6a 00 push $0x0
pushl $236
102698: 68 ec 00 00 00 push $0xec
jmp __alltraps
10269d: e9 50 f6 ff ff jmp 101cf2 <__alltraps>
001026a2 <vector237>:
.globl vector237
vector237:
pushl $0
1026a2: 6a 00 push $0x0
pushl $237
1026a4: 68 ed 00 00 00 push $0xed
jmp __alltraps
1026a9: e9 44 f6 ff ff jmp 101cf2 <__alltraps>
001026ae <vector238>:
.globl vector238
vector238:
pushl $0
1026ae: 6a 00 push $0x0
pushl $238
1026b0: 68 ee 00 00 00 push $0xee
jmp __alltraps
1026b5: e9 38 f6 ff ff jmp 101cf2 <__alltraps>
001026ba <vector239>:
.globl vector239
vector239:
pushl $0
1026ba: 6a 00 push $0x0
pushl $239
1026bc: 68 ef 00 00 00 push $0xef
jmp __alltraps
1026c1: e9 2c f6 ff ff jmp 101cf2 <__alltraps>
001026c6 <vector240>:
.globl vector240
vector240:
pushl $0
1026c6: 6a 00 push $0x0
pushl $240
1026c8: 68 f0 00 00 00 push $0xf0
jmp __alltraps
1026cd: e9 20 f6 ff ff jmp 101cf2 <__alltraps>
001026d2 <vector241>:
.globl vector241
vector241:
pushl $0
1026d2: 6a 00 push $0x0
pushl $241
1026d4: 68 f1 00 00 00 push $0xf1
jmp __alltraps
1026d9: e9 14 f6 ff ff jmp 101cf2 <__alltraps>
001026de <vector242>:
.globl vector242
vector242:
pushl $0
1026de: 6a 00 push $0x0
pushl $242
1026e0: 68 f2 00 00 00 push $0xf2
jmp __alltraps
1026e5: e9 08 f6 ff ff jmp 101cf2 <__alltraps>
001026ea <vector243>:
.globl vector243
vector243:
pushl $0
1026ea: 6a 00 push $0x0
pushl $243
1026ec: 68 f3 00 00 00 push $0xf3
jmp __alltraps
1026f1: e9 fc f5 ff ff jmp 101cf2 <__alltraps>
001026f6 <vector244>:
.globl vector244
vector244:
pushl $0
1026f6: 6a 00 push $0x0
pushl $244
1026f8: 68 f4 00 00 00 push $0xf4
jmp __alltraps
1026fd: e9 f0 f5 ff ff jmp 101cf2 <__alltraps>
00102702 <vector245>:
.globl vector245
vector245:
pushl $0
102702: 6a 00 push $0x0
pushl $245
102704: 68 f5 00 00 00 push $0xf5
jmp __alltraps
102709: e9 e4 f5 ff ff jmp 101cf2 <__alltraps>
0010270e <vector246>:
.globl vector246
vector246:
pushl $0
10270e: 6a 00 push $0x0
pushl $246
102710: 68 f6 00 00 00 push $0xf6
jmp __alltraps
102715: e9 d8 f5 ff ff jmp 101cf2 <__alltraps>
0010271a <vector247>:
.globl vector247
vector247:
pushl $0
10271a: 6a 00 push $0x0
pushl $247
10271c: 68 f7 00 00 00 push $0xf7
jmp __alltraps
102721: e9 cc f5 ff ff jmp 101cf2 <__alltraps>
00102726 <vector248>:
.globl vector248
vector248:
pushl $0
102726: 6a 00 push $0x0
pushl $248
102728: 68 f8 00 00 00 push $0xf8
jmp __alltraps
10272d: e9 c0 f5 ff ff jmp 101cf2 <__alltraps>
00102732 <vector249>:
.globl vector249
vector249:
pushl $0
102732: 6a 00 push $0x0
pushl $249
102734: 68 f9 00 00 00 push $0xf9
jmp __alltraps
102739: e9 b4 f5 ff ff jmp 101cf2 <__alltraps>
0010273e <vector250>:
.globl vector250
vector250:
pushl $0
10273e: 6a 00 push $0x0
pushl $250
102740: 68 fa 00 00 00 push $0xfa
jmp __alltraps
102745: e9 a8 f5 ff ff jmp 101cf2 <__alltraps>
0010274a <vector251>:
.globl vector251
vector251:
pushl $0
10274a: 6a 00 push $0x0
pushl $251
10274c: 68 fb 00 00 00 push $0xfb
jmp __alltraps
102751: e9 9c f5 ff ff jmp 101cf2 <__alltraps>
00102756 <vector252>:
.globl vector252
vector252:
pushl $0
102756: 6a 00 push $0x0
pushl $252
102758: 68 fc 00 00 00 push $0xfc
jmp __alltraps
10275d: e9 90 f5 ff ff jmp 101cf2 <__alltraps>
00102762 <vector253>:
.globl vector253
vector253:
pushl $0
102762: 6a 00 push $0x0
pushl $253
102764: 68 fd 00 00 00 push $0xfd
jmp __alltraps
102769: e9 84 f5 ff ff jmp 101cf2 <__alltraps>
0010276e <vector254>:
.globl vector254
vector254:
pushl $0
10276e: 6a 00 push $0x0
pushl $254
102770: 68 fe 00 00 00 push $0xfe
jmp __alltraps
102775: e9 78 f5 ff ff jmp 101cf2 <__alltraps>
0010277a <vector255>:
.globl vector255
vector255:
pushl $0
10277a: 6a 00 push $0x0
pushl $255
10277c: 68 ff 00 00 00 push $0xff
jmp __alltraps
102781: e9 6c f5 ff ff jmp 101cf2 <__alltraps>
00102786 <lgdt>:
/* *
* lgdt - load the global descriptor table register and reset the
* data/code segement registers for kernel.
* */
static inline void
lgdt(struct pseudodesc *pd) {
102786: 55 push %ebp
102787: 89 e5 mov %esp,%ebp
asm volatile ("lgdt (%0)" :: "r" (pd));
102789: 8b 45 08 mov 0x8(%ebp),%eax
10278c: 0f 01 10 lgdtl (%eax)
asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
10278f: b8 23 00 00 00 mov $0x23,%eax
102794: 8e e8 mov %eax,%gs
asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
102796: b8 23 00 00 00 mov $0x23,%eax
10279b: 8e e0 mov %eax,%fs
asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
10279d: b8 10 00 00 00 mov $0x10,%eax
1027a2: 8e c0 mov %eax,%es
asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
1027a4: b8 10 00 00 00 mov $0x10,%eax
1027a9: 8e d8 mov %eax,%ds
asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
1027ab: b8 10 00 00 00 mov $0x10,%eax
1027b0: 8e d0 mov %eax,%ss
// reload cs
asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
1027b2: ea b9 27 10 00 08 00 ljmp $0x8,$0x1027b9
}
1027b9: 5d pop %ebp
1027ba: c3 ret
001027bb <gdt_init>:
/* temporary kernel stack */
uint8_t stack0[1024];
/* gdt_init - initialize the default GDT and TSS */
static void
gdt_init(void) {
1027bb: 55 push %ebp
1027bc: 89 e5 mov %esp,%ebp
1027be: 83 ec 14 sub $0x14,%esp
// Setup a TSS so that we can get the right stack when we trap from
// user to the kernel. But not safe here, it's only a temporary value,
// it will be set to KSTACKTOP in lab2.
ts.ts_esp0 = (uint32_t)&stack0 + sizeof(stack0);
1027c1: b8 20 f9 10 00 mov $0x10f920,%eax
1027c6: 05 00 04 00 00 add $0x400,%eax
1027cb: a3 a4 f8 10 00 mov %eax,0x10f8a4
ts.ts_ss0 = KERNEL_DS;
1027d0: 66 c7 05 a8 f8 10 00 movw $0x10,0x10f8a8
1027d7: 10 00
// initialize the TSS filed of the gdt
gdt[SEG_TSS] = SEG16(STS_T32A, (uint32_t)&ts, sizeof(ts), DPL_KERNEL);
1027d9: 66 c7 05 08 ea 10 00 movw $0x68,0x10ea08
1027e0: 68 00
1027e2: b8 a0 f8 10 00 mov $0x10f8a0,%eax
1027e7: 66 a3 0a ea 10 00 mov %ax,0x10ea0a
1027ed: b8 a0 f8 10 00 mov $0x10f8a0,%eax
1027f2: c1 e8 10 shr $0x10,%eax
1027f5: a2 0c ea 10 00 mov %al,0x10ea0c
1027fa: 0f b6 05 0d ea 10 00 movzbl 0x10ea0d,%eax
102801: 83 e0 f0 and $0xfffffff0,%eax
102804: 83 c8 09 or $0x9,%eax
102807: a2 0d ea 10 00 mov %al,0x10ea0d
10280c: 0f b6 05 0d ea 10 00 movzbl 0x10ea0d,%eax
102813: 83 c8 10 or $0x10,%eax
102816: a2 0d ea 10 00 mov %al,0x10ea0d
10281b: 0f b6 05 0d ea 10 00 movzbl 0x10ea0d,%eax
102822: 83 e0 9f and $0xffffff9f,%eax
102825: a2 0d ea 10 00 mov %al,0x10ea0d
10282a: 0f b6 05 0d ea 10 00 movzbl 0x10ea0d,%eax
102831: 83 c8 80 or $0xffffff80,%eax
102834: a2 0d ea 10 00 mov %al,0x10ea0d
102839: 0f b6 05 0e ea 10 00 movzbl 0x10ea0e,%eax
102840: 83 e0 f0 and $0xfffffff0,%eax
102843: a2 0e ea 10 00 mov %al,0x10ea0e
102848: 0f b6 05 0e ea 10 00 movzbl 0x10ea0e,%eax
10284f: 83 e0 ef and $0xffffffef,%eax
102852: a2 0e ea 10 00 mov %al,0x10ea0e
102857: 0f b6 05 0e ea 10 00 movzbl 0x10ea0e,%eax
10285e: 83 e0 df and $0xffffffdf,%eax
102861: a2 0e ea 10 00 mov %al,0x10ea0e
102866: 0f b6 05 0e ea 10 00 movzbl 0x10ea0e,%eax
10286d: 83 c8 40 or $0x40,%eax
102870: a2 0e ea 10 00 mov %al,0x10ea0e
102875: 0f b6 05 0e ea 10 00 movzbl 0x10ea0e,%eax
10287c: 83 e0 7f and $0x7f,%eax
10287f: a2 0e ea 10 00 mov %al,0x10ea0e
102884: b8 a0 f8 10 00 mov $0x10f8a0,%eax
102889: c1 e8 18 shr $0x18,%eax
10288c: a2 0f ea 10 00 mov %al,0x10ea0f
gdt[SEG_TSS].sd_s = 0;
102891: 0f b6 05 0d ea 10 00 movzbl 0x10ea0d,%eax
102898: 83 e0 ef and $0xffffffef,%eax
10289b: a2 0d ea 10 00 mov %al,0x10ea0d
// reload all segment registers
lgdt(&gdt_pd);
1028a0: c7 04 24 10 ea 10 00 movl $0x10ea10,(%esp)
1028a7: e8 da fe ff ff call 102786 <lgdt>
1028ac: 66 c7 45 fe 28 00 movw $0x28,-0x2(%ebp)
asm volatile ("cli");
}
static inline void
ltr(uint16_t sel) {
asm volatile ("ltr %0" :: "r" (sel));
1028b2: 0f b7 45 fe movzwl -0x2(%ebp),%eax
1028b6: 0f 00 d8 ltr %ax
// load the TSS
ltr(GD_TSS);
}
1028b9: c9 leave
1028ba: c3 ret
001028bb <pmm_init>:
/* pmm_init - initialize the physical memory management */
void
pmm_init(void) {
1028bb: 55 push %ebp
1028bc: 89 e5 mov %esp,%ebp
gdt_init();
1028be: e8 f8 fe ff ff call 1027bb <gdt_init>
}
1028c3: 5d pop %ebp
1028c4: c3 ret
001028c5 <printnum>:
* @width: maximum number of digits, if the actual width is less than @width, use @padc instead
* @padc: character that padded on the left if the actual width is less than @width
* */
static void
printnum(void (*putch)(int, void*), void *putdat,
unsigned long long num, unsigned base, int width, int padc) {
1028c5: 55 push %ebp
1028c6: 89 e5 mov %esp,%ebp
1028c8: 83 ec 58 sub $0x58,%esp
1028cb: 8b 45 10 mov 0x10(%ebp),%eax
1028ce: 89 45 d0 mov %eax,-0x30(%ebp)
1028d1: 8b 45 14 mov 0x14(%ebp),%eax
1028d4: 89 45 d4 mov %eax,-0x2c(%ebp)
unsigned long long result = num;
1028d7: 8b 45 d0 mov -0x30(%ebp),%eax
1028da: 8b 55 d4 mov -0x2c(%ebp),%edx
1028dd: 89 45 e8 mov %eax,-0x18(%ebp)
1028e0: 89 55 ec mov %edx,-0x14(%ebp)
unsigned mod = do_div(result, base);
1028e3: 8b 45 18 mov 0x18(%ebp),%eax
1028e6: 89 45 e4 mov %eax,-0x1c(%ebp)
1028e9: 8b 45 e8 mov -0x18(%ebp),%eax
1028ec: 8b 55 ec mov -0x14(%ebp),%edx
1028ef: 89 45 e0 mov %eax,-0x20(%ebp)
1028f2: 89 55 f0 mov %edx,-0x10(%ebp)
1028f5: 8b 45 f0 mov -0x10(%ebp),%eax
1028f8: 89 45 f4 mov %eax,-0xc(%ebp)
1028fb: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
1028ff: 74 1c je 10291d <printnum+0x58>
102901: 8b 45 f0 mov -0x10(%ebp),%eax
102904: ba 00 00 00 00 mov $0x0,%edx
102909: f7 75 e4 divl -0x1c(%ebp)
10290c: 89 55 f4 mov %edx,-0xc(%ebp)
10290f: 8b 45 f0 mov -0x10(%ebp),%eax
102912: ba 00 00 00 00 mov $0x0,%edx
102917: f7 75 e4 divl -0x1c(%ebp)
10291a: 89 45 f0 mov %eax,-0x10(%ebp)
10291d: 8b 45 e0 mov -0x20(%ebp),%eax
102920: 8b 55 f4 mov -0xc(%ebp),%edx
102923: f7 75 e4 divl -0x1c(%ebp)
102926: 89 45 e0 mov %eax,-0x20(%ebp)
102929: 89 55 dc mov %edx,-0x24(%ebp)
10292c: 8b 45 e0 mov -0x20(%ebp),%eax
10292f: 8b 55 f0 mov -0x10(%ebp),%edx
102932: 89 45 e8 mov %eax,-0x18(%ebp)
102935: 89 55 ec mov %edx,-0x14(%ebp)
102938: 8b 45 dc mov -0x24(%ebp),%eax
10293b: 89 45 d8 mov %eax,-0x28(%ebp)
// first recursively print all preceding (more significant) digits
if (num >= base) {
10293e: 8b 45 18 mov 0x18(%ebp),%eax
102941: ba 00 00 00 00 mov $0x0,%edx
102946: 3b 55 d4 cmp -0x2c(%ebp),%edx
102949: 77 56 ja 1029a1 <printnum+0xdc>
10294b: 3b 55 d4 cmp -0x2c(%ebp),%edx
10294e: 72 05 jb 102955 <printnum+0x90>
102950: 3b 45 d0 cmp -0x30(%ebp),%eax
102953: 77 4c ja 1029a1 <printnum+0xdc>
printnum(putch, putdat, result, base, width - 1, padc);
102955: 8b 45 1c mov 0x1c(%ebp),%eax
102958: 8d 50 ff lea -0x1(%eax),%edx
10295b: 8b 45 20 mov 0x20(%ebp),%eax
10295e: 89 44 24 18 mov %eax,0x18(%esp)
102962: 89 54 24 14 mov %edx,0x14(%esp)
102966: 8b 45 18 mov 0x18(%ebp),%eax
102969: 89 44 24 10 mov %eax,0x10(%esp)
10296d: 8b 45 e8 mov -0x18(%ebp),%eax
102970: 8b 55 ec mov -0x14(%ebp),%edx
102973: 89 44 24 08 mov %eax,0x8(%esp)
102977: 89 54 24 0c mov %edx,0xc(%esp)
10297b: 8b 45 0c mov 0xc(%ebp),%eax
10297e: 89 44 24 04 mov %eax,0x4(%esp)
102982: 8b 45 08 mov 0x8(%ebp),%eax
102985: 89 04 24 mov %eax,(%esp)
102988: e8 38 ff ff ff call 1028c5 <printnum>
10298d: eb 1c jmp 1029ab <printnum+0xe6>
} else {
// print any needed pad characters before first digit
while (-- width > 0)
putch(padc, putdat);
10298f: 8b 45 0c mov 0xc(%ebp),%eax
102992: 89 44 24 04 mov %eax,0x4(%esp)
102996: 8b 45 20 mov 0x20(%ebp),%eax
102999: 89 04 24 mov %eax,(%esp)
10299c: 8b 45 08 mov 0x8(%ebp),%eax
10299f: ff d0 call *%eax
// first recursively print all preceding (more significant) digits
if (num >= base) {
printnum(putch, putdat, result, base, width - 1, padc);
} else {
// print any needed pad characters before first digit
while (-- width > 0)
1029a1: 83 6d 1c 01 subl $0x1,0x1c(%ebp)
1029a5: 83 7d 1c 00 cmpl $0x0,0x1c(%ebp)
1029a9: 7f e4 jg 10298f <printnum+0xca>
putch(padc, putdat);
}
// then print this (the least significant) digit
putch("0123456789abcdef"[mod], putdat);
1029ab: 8b 45 d8 mov -0x28(%ebp),%eax
1029ae: 05 90 3b 10 00 add $0x103b90,%eax
1029b3: 0f b6 00 movzbl (%eax),%eax
1029b6: 0f be c0 movsbl %al,%eax
1029b9: 8b 55 0c mov 0xc(%ebp),%edx
1029bc: 89 54 24 04 mov %edx,0x4(%esp)
1029c0: 89 04 24 mov %eax,(%esp)
1029c3: 8b 45 08 mov 0x8(%ebp),%eax
1029c6: ff d0 call *%eax
}
1029c8: c9 leave
1029c9: c3 ret
001029ca <getuint>:
* getuint - get an unsigned int of various possible sizes from a varargs list
* @ap: a varargs list pointer
* @lflag: determines the size of the vararg that @ap points to
* */
static unsigned long long
getuint(va_list *ap, int lflag) {
1029ca: 55 push %ebp
1029cb: 89 e5 mov %esp,%ebp
if (lflag >= 2) {
1029cd: 83 7d 0c 01 cmpl $0x1,0xc(%ebp)
1029d1: 7e 14 jle 1029e7 <getuint+0x1d>
return va_arg(*ap, unsigned long long);
1029d3: 8b 45 08 mov 0x8(%ebp),%eax
1029d6: 8b 00 mov (%eax),%eax
1029d8: 8d 48 08 lea 0x8(%eax),%ecx
1029db: 8b 55 08 mov 0x8(%ebp),%edx
1029de: 89 0a mov %ecx,(%edx)
1029e0: 8b 50 04 mov 0x4(%eax),%edx
1029e3: 8b 00 mov (%eax),%eax
1029e5: eb 30 jmp 102a17 <getuint+0x4d>
}
else if (lflag) {
1029e7: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
1029eb: 74 16 je 102a03 <getuint+0x39>
return va_arg(*ap, unsigned long);
1029ed: 8b 45 08 mov 0x8(%ebp),%eax
1029f0: 8b 00 mov (%eax),%eax
1029f2: 8d 48 04 lea 0x4(%eax),%ecx
1029f5: 8b 55 08 mov 0x8(%ebp),%edx
1029f8: 89 0a mov %ecx,(%edx)
1029fa: 8b 00 mov (%eax),%eax
1029fc: ba 00 00 00 00 mov $0x0,%edx
102a01: eb 14 jmp 102a17 <getuint+0x4d>
}
else {
return va_arg(*ap, unsigned int);
102a03: 8b 45 08 mov 0x8(%ebp),%eax
102a06: 8b 00 mov (%eax),%eax
102a08: 8d 48 04 lea 0x4(%eax),%ecx
102a0b: 8b 55 08 mov 0x8(%ebp),%edx
102a0e: 89 0a mov %ecx,(%edx)
102a10: 8b 00 mov (%eax),%eax
102a12: ba 00 00 00 00 mov $0x0,%edx
}
}
102a17: 5d pop %ebp
102a18: c3 ret
00102a19 <getint>:
* getint - same as getuint but signed, we can't use getuint because of sign extension
* @ap: a varargs list pointer
* @lflag: determines the size of the vararg that @ap points to
* */
static long long
getint(va_list *ap, int lflag) {
102a19: 55 push %ebp
102a1a: 89 e5 mov %esp,%ebp
if (lflag >= 2) {
102a1c: 83 7d 0c 01 cmpl $0x1,0xc(%ebp)
102a20: 7e 14 jle 102a36 <getint+0x1d>
return va_arg(*ap, long long);
102a22: 8b 45 08 mov 0x8(%ebp),%eax
102a25: 8b 00 mov (%eax),%eax
102a27: 8d 48 08 lea 0x8(%eax),%ecx
102a2a: 8b 55 08 mov 0x8(%ebp),%edx
102a2d: 89 0a mov %ecx,(%edx)
102a2f: 8b 50 04 mov 0x4(%eax),%edx
102a32: 8b 00 mov (%eax),%eax
102a34: eb 28 jmp 102a5e <getint+0x45>
}
else if (lflag) {
102a36: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
102a3a: 74 12 je 102a4e <getint+0x35>
return va_arg(*ap, long);
102a3c: 8b 45 08 mov 0x8(%ebp),%eax
102a3f: 8b 00 mov (%eax),%eax
102a41: 8d 48 04 lea 0x4(%eax),%ecx
102a44: 8b 55 08 mov 0x8(%ebp),%edx
102a47: 89 0a mov %ecx,(%edx)
102a49: 8b 00 mov (%eax),%eax
102a4b: 99 cltd
102a4c: eb 10 jmp 102a5e <getint+0x45>
}
else {
return va_arg(*ap, int);
102a4e: 8b 45 08 mov 0x8(%ebp),%eax
102a51: 8b 00 mov (%eax),%eax
102a53: 8d 48 04 lea 0x4(%eax),%ecx
102a56: 8b 55 08 mov 0x8(%ebp),%edx
102a59: 89 0a mov %ecx,(%edx)
102a5b: 8b 00 mov (%eax),%eax
102a5d: 99 cltd
}
}
102a5e: 5d pop %ebp
102a5f: c3 ret
00102a60 <printfmt>:
* @putch: specified putch function, print a single character
* @putdat: used by @putch function
* @fmt: the format string to use
* */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
102a60: 55 push %ebp
102a61: 89 e5 mov %esp,%ebp
102a63: 83 ec 28 sub $0x28,%esp
va_list ap;
va_start(ap, fmt);
102a66: 8d 45 14 lea 0x14(%ebp),%eax
102a69: 89 45 f4 mov %eax,-0xc(%ebp)
vprintfmt(putch, putdat, fmt, ap);
102a6c: 8b 45 f4 mov -0xc(%ebp),%eax
102a6f: 89 44 24 0c mov %eax,0xc(%esp)
102a73: 8b 45 10 mov 0x10(%ebp),%eax
102a76: 89 44 24 08 mov %eax,0x8(%esp)
102a7a: 8b 45 0c mov 0xc(%ebp),%eax
102a7d: 89 44 24 04 mov %eax,0x4(%esp)
102a81: 8b 45 08 mov 0x8(%ebp),%eax
102a84: 89 04 24 mov %eax,(%esp)
102a87: e8 02 00 00 00 call 102a8e <vprintfmt>
va_end(ap);
}
102a8c: c9 leave
102a8d: c3 ret
00102a8e <vprintfmt>:
*
* Call this function if you are already dealing with a va_list.
* Or you probably want printfmt() instead.
* */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
102a8e: 55 push %ebp
102a8f: 89 e5 mov %esp,%ebp
102a91: 56 push %esi
102a92: 53 push %ebx
102a93: 83 ec 40 sub $0x40,%esp
register int ch, err;
unsigned long long num;
int base, width, precision, lflag, altflag;
while (1) {
while ((ch = *(unsigned char *)fmt ++) != '%') {
102a96: eb 18 jmp 102ab0 <vprintfmt+0x22>
if (ch == '\0') {
102a98: 85 db test %ebx,%ebx
102a9a: 75 05 jne 102aa1 <vprintfmt+0x13>
return;
102a9c: e9 d1 03 00 00 jmp 102e72 <vprintfmt+0x3e4>
}
putch(ch, putdat);
102aa1: 8b 45 0c mov 0xc(%ebp),%eax
102aa4: 89 44 24 04 mov %eax,0x4(%esp)
102aa8: 89 1c 24 mov %ebx,(%esp)
102aab: 8b 45 08 mov 0x8(%ebp),%eax
102aae: ff d0 call *%eax
register int ch, err;
unsigned long long num;
int base, width, precision, lflag, altflag;
while (1) {
while ((ch = *(unsigned char *)fmt ++) != '%') {
102ab0: 8b 45 10 mov 0x10(%ebp),%eax
102ab3: 8d 50 01 lea 0x1(%eax),%edx
102ab6: 89 55 10 mov %edx,0x10(%ebp)
102ab9: 0f b6 00 movzbl (%eax),%eax
102abc: 0f b6 d8 movzbl %al,%ebx
102abf: 83 fb 25 cmp $0x25,%ebx
102ac2: 75 d4 jne 102a98 <vprintfmt+0xa>
}
putch(ch, putdat);
}
// Process a %-escape sequence
char padc = ' ';
102ac4: c6 45 db 20 movb $0x20,-0x25(%ebp)
width = precision = -1;
102ac8: c7 45 e4 ff ff ff ff movl $0xffffffff,-0x1c(%ebp)
102acf: 8b 45 e4 mov -0x1c(%ebp),%eax
102ad2: 89 45 e8 mov %eax,-0x18(%ebp)
lflag = altflag = 0;
102ad5: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
102adc: 8b 45 dc mov -0x24(%ebp),%eax
102adf: 89 45 e0 mov %eax,-0x20(%ebp)
reswitch:
switch (ch = *(unsigned char *)fmt ++) {
102ae2: 8b 45 10 mov 0x10(%ebp),%eax
102ae5: 8d 50 01 lea 0x1(%eax),%edx
102ae8: 89 55 10 mov %edx,0x10(%ebp)
102aeb: 0f b6 00 movzbl (%eax),%eax
102aee: 0f b6 d8 movzbl %al,%ebx
102af1: 8d 43 dd lea -0x23(%ebx),%eax
102af4: 83 f8 55 cmp $0x55,%eax
102af7: 0f 87 44 03 00 00 ja 102e41 <vprintfmt+0x3b3>
102afd: 8b 04 85 b4 3b 10 00 mov 0x103bb4(,%eax,4),%eax
102b04: ff e0 jmp *%eax
// flag to pad on the right
case '-':
padc = '-';
102b06: c6 45 db 2d movb $0x2d,-0x25(%ebp)
goto reswitch;
102b0a: eb d6 jmp 102ae2 <vprintfmt+0x54>
// flag to pad with 0's instead of spaces
case '0':
padc = '0';
102b0c: c6 45 db 30 movb $0x30,-0x25(%ebp)
goto reswitch;
102b10: eb d0 jmp 102ae2 <vprintfmt+0x54>
// width field
case '1' ... '9':
for (precision = 0; ; ++ fmt) {
102b12: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
precision = precision * 10 + ch - '0';
102b19: 8b 55 e4 mov -0x1c(%ebp),%edx
102b1c: 89 d0 mov %edx,%eax
102b1e: c1 e0 02 shl $0x2,%eax
102b21: 01 d0 add %edx,%eax
102b23: 01 c0 add %eax,%eax
102b25: 01 d8 add %ebx,%eax
102b27: 83 e8 30 sub $0x30,%eax
102b2a: 89 45 e4 mov %eax,-0x1c(%ebp)
ch = *fmt;
102b2d: 8b 45 10 mov 0x10(%ebp),%eax
102b30: 0f b6 00 movzbl (%eax),%eax
102b33: 0f be d8 movsbl %al,%ebx
if (ch < '0' || ch > '9') {
102b36: 83 fb 2f cmp $0x2f,%ebx
102b39: 7e 0b jle 102b46 <vprintfmt+0xb8>
102b3b: 83 fb 39 cmp $0x39,%ebx
102b3e: 7f 06 jg 102b46 <vprintfmt+0xb8>
padc = '0';
goto reswitch;
// width field
case '1' ... '9':
for (precision = 0; ; ++ fmt) {
102b40: 83 45 10 01 addl $0x1,0x10(%ebp)
precision = precision * 10 + ch - '0';
ch = *fmt;
if (ch < '0' || ch > '9') {
break;
}
}
102b44: eb d3 jmp 102b19 <vprintfmt+0x8b>
goto process_precision;
102b46: eb 33 jmp 102b7b <vprintfmt+0xed>
case '*':
precision = va_arg(ap, int);
102b48: 8b 45 14 mov 0x14(%ebp),%eax
102b4b: 8d 50 04 lea 0x4(%eax),%edx
102b4e: 89 55 14 mov %edx,0x14(%ebp)
102b51: 8b 00 mov (%eax),%eax
102b53: 89 45 e4 mov %eax,-0x1c(%ebp)
goto process_precision;
102b56: eb 23 jmp 102b7b <vprintfmt+0xed>
case '.':
if (width < 0)
102b58: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
102b5c: 79 0c jns 102b6a <vprintfmt+0xdc>
width = 0;
102b5e: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp)
goto reswitch;
102b65: e9 78 ff ff ff jmp 102ae2 <vprintfmt+0x54>
102b6a: e9 73 ff ff ff jmp 102ae2 <vprintfmt+0x54>
case '#':
altflag = 1;
102b6f: c7 45 dc 01 00 00 00 movl $0x1,-0x24(%ebp)
goto reswitch;
102b76: e9 67 ff ff ff jmp 102ae2 <vprintfmt+0x54>
process_precision:
if (width < 0)
102b7b: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
102b7f: 79 12 jns 102b93 <vprintfmt+0x105>
width = precision, precision = -1;
102b81: 8b 45 e4 mov -0x1c(%ebp),%eax
102b84: 89 45 e8 mov %eax,-0x18(%ebp)
102b87: c7 45 e4 ff ff ff ff movl $0xffffffff,-0x1c(%ebp)
goto reswitch;
102b8e: e9 4f ff ff ff jmp 102ae2 <vprintfmt+0x54>
102b93: e9 4a ff ff ff jmp 102ae2 <vprintfmt+0x54>
// long flag (doubled for long long)
case 'l':
lflag ++;
102b98: 83 45 e0 01 addl $0x1,-0x20(%ebp)
goto reswitch;
102b9c: e9 41 ff ff ff jmp 102ae2 <vprintfmt+0x54>
// character
case 'c':
putch(va_arg(ap, int), putdat);
102ba1: 8b 45 14 mov 0x14(%ebp),%eax
102ba4: 8d 50 04 lea 0x4(%eax),%edx
102ba7: 89 55 14 mov %edx,0x14(%ebp)
102baa: 8b 00 mov (%eax),%eax
102bac: 8b 55 0c mov 0xc(%ebp),%edx
102baf: 89 54 24 04 mov %edx,0x4(%esp)
102bb3: 89 04 24 mov %eax,(%esp)
102bb6: 8b 45 08 mov 0x8(%ebp),%eax
102bb9: ff d0 call *%eax
break;
102bbb: e9 ac 02 00 00 jmp 102e6c <vprintfmt+0x3de>
// error message
case 'e':
err = va_arg(ap, int);
102bc0: 8b 45 14 mov 0x14(%ebp),%eax
102bc3: 8d 50 04 lea 0x4(%eax),%edx
102bc6: 89 55 14 mov %edx,0x14(%ebp)
102bc9: 8b 18 mov (%eax),%ebx
if (err < 0) {
102bcb: 85 db test %ebx,%ebx
102bcd: 79 02 jns 102bd1 <vprintfmt+0x143>
err = -err;
102bcf: f7 db neg %ebx
}
if (err > MAXERROR || (p = error_string[err]) == NULL) {
102bd1: 83 fb 06 cmp $0x6,%ebx
102bd4: 7f 0b jg 102be1 <vprintfmt+0x153>
102bd6: 8b 34 9d 74 3b 10 00 mov 0x103b74(,%ebx,4),%esi
102bdd: 85 f6 test %esi,%esi
102bdf: 75 23 jne 102c04 <vprintfmt+0x176>
printfmt(putch, putdat, "error %d", err);
102be1: 89 5c 24 0c mov %ebx,0xc(%esp)
102be5: c7 44 24 08 a1 3b 10 movl $0x103ba1,0x8(%esp)
102bec: 00
102bed: 8b 45 0c mov 0xc(%ebp),%eax
102bf0: 89 44 24 04 mov %eax,0x4(%esp)
102bf4: 8b 45 08 mov 0x8(%ebp),%eax
102bf7: 89 04 24 mov %eax,(%esp)
102bfa: e8 61 fe ff ff call 102a60 <printfmt>
}
else {
printfmt(putch, putdat, "%s", p);
}
break;
102bff: e9 68 02 00 00 jmp 102e6c <vprintfmt+0x3de>
}
if (err > MAXERROR || (p = error_string[err]) == NULL) {
printfmt(putch, putdat, "error %d", err);
}
else {
printfmt(putch, putdat, "%s", p);
102c04: 89 74 24 0c mov %esi,0xc(%esp)
102c08: c7 44 24 08 aa 3b 10 movl $0x103baa,0x8(%esp)
102c0f: 00
102c10: 8b 45 0c mov 0xc(%ebp),%eax
102c13: 89 44 24 04 mov %eax,0x4(%esp)
102c17: 8b 45 08 mov 0x8(%ebp),%eax
102c1a: 89 04 24 mov %eax,(%esp)
102c1d: e8 3e fe ff ff call 102a60 <printfmt>
}
break;
102c22: e9 45 02 00 00 jmp 102e6c <vprintfmt+0x3de>
// string
case 's':
if ((p = va_arg(ap, char *)) == NULL) {
102c27: 8b 45 14 mov 0x14(%ebp),%eax
102c2a: 8d 50 04 lea 0x4(%eax),%edx
102c2d: 89 55 14 mov %edx,0x14(%ebp)
102c30: 8b 30 mov (%eax),%esi
102c32: 85 f6 test %esi,%esi
102c34: 75 05 jne 102c3b <vprintfmt+0x1ad>
p = "(null)";
102c36: be ad 3b 10 00 mov $0x103bad,%esi
}
if (width > 0 && padc != '-') {
102c3b: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
102c3f: 7e 3e jle 102c7f <vprintfmt+0x1f1>
102c41: 80 7d db 2d cmpb $0x2d,-0x25(%ebp)
102c45: 74 38 je 102c7f <vprintfmt+0x1f1>
for (width -= strnlen(p, precision); width > 0; width --) {
102c47: 8b 5d e8 mov -0x18(%ebp),%ebx
102c4a: 8b 45 e4 mov -0x1c(%ebp),%eax
102c4d: 89 44 24 04 mov %eax,0x4(%esp)
102c51: 89 34 24 mov %esi,(%esp)
102c54: e8 15 03 00 00 call 102f6e <strnlen>
102c59: 29 c3 sub %eax,%ebx
102c5b: 89 d8 mov %ebx,%eax
102c5d: 89 45 e8 mov %eax,-0x18(%ebp)
102c60: eb 17 jmp 102c79 <vprintfmt+0x1eb>
putch(padc, putdat);
102c62: 0f be 45 db movsbl -0x25(%ebp),%eax
102c66: 8b 55 0c mov 0xc(%ebp),%edx
102c69: 89 54 24 04 mov %edx,0x4(%esp)
102c6d: 89 04 24 mov %eax,(%esp)
102c70: 8b 45 08 mov 0x8(%ebp),%eax
102c73: ff d0 call *%eax
case 's':
if ((p = va_arg(ap, char *)) == NULL) {
p = "(null)";
}
if (width > 0 && padc != '-') {
for (width -= strnlen(p, precision); width > 0; width --) {
102c75: 83 6d e8 01 subl $0x1,-0x18(%ebp)
102c79: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
102c7d: 7f e3 jg 102c62 <vprintfmt+0x1d4>
putch(padc, putdat);
}
}
for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
102c7f: eb 38 jmp 102cb9 <vprintfmt+0x22b>
if (altflag && (ch < ' ' || ch > '~')) {
102c81: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
102c85: 74 1f je 102ca6 <vprintfmt+0x218>
102c87: 83 fb 1f cmp $0x1f,%ebx
102c8a: 7e 05 jle 102c91 <vprintfmt+0x203>
102c8c: 83 fb 7e cmp $0x7e,%ebx
102c8f: 7e 15 jle 102ca6 <vprintfmt+0x218>
putch('?', putdat);
102c91: 8b 45 0c mov 0xc(%ebp),%eax
102c94: 89 44 24 04 mov %eax,0x4(%esp)
102c98: c7 04 24 3f 00 00 00 movl $0x3f,(%esp)
102c9f: 8b 45 08 mov 0x8(%ebp),%eax
102ca2: ff d0 call *%eax
102ca4: eb 0f jmp 102cb5 <vprintfmt+0x227>
}
else {
putch(ch, putdat);
102ca6: 8b 45 0c mov 0xc(%ebp),%eax
102ca9: 89 44 24 04 mov %eax,0x4(%esp)
102cad: 89 1c 24 mov %ebx,(%esp)
102cb0: 8b 45 08 mov 0x8(%ebp),%eax
102cb3: ff d0 call *%eax
if (width > 0 && padc != '-') {
for (width -= strnlen(p, precision); width > 0; width --) {
putch(padc, putdat);
}
}
for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
102cb5: 83 6d e8 01 subl $0x1,-0x18(%ebp)
102cb9: 89 f0 mov %esi,%eax
102cbb: 8d 70 01 lea 0x1(%eax),%esi
102cbe: 0f b6 00 movzbl (%eax),%eax
102cc1: 0f be d8 movsbl %al,%ebx
102cc4: 85 db test %ebx,%ebx
102cc6: 74 10 je 102cd8 <vprintfmt+0x24a>
102cc8: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
102ccc: 78 b3 js 102c81 <vprintfmt+0x1f3>
102cce: 83 6d e4 01 subl $0x1,-0x1c(%ebp)
102cd2: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
102cd6: 79 a9 jns 102c81 <vprintfmt+0x1f3>
}
else {
putch(ch, putdat);
}
}
for (; width > 0; width --) {
102cd8: eb 17 jmp 102cf1 <vprintfmt+0x263>
putch(' ', putdat);
102cda: 8b 45 0c mov 0xc(%ebp),%eax
102cdd: 89 44 24 04 mov %eax,0x4(%esp)
102ce1: c7 04 24 20 00 00 00 movl $0x20,(%esp)
102ce8: 8b 45 08 mov 0x8(%ebp),%eax
102ceb: ff d0 call *%eax
}
else {
putch(ch, putdat);
}
}
for (; width > 0; width --) {
102ced: 83 6d e8 01 subl $0x1,-0x18(%ebp)
102cf1: 83 7d e8 00 cmpl $0x0,-0x18(%ebp)
102cf5: 7f e3 jg 102cda <vprintfmt+0x24c>
putch(' ', putdat);
}
break;
102cf7: e9 70 01 00 00 jmp 102e6c <vprintfmt+0x3de>
// (signed) decimal
case 'd':
num = getint(&ap, lflag);
102cfc: 8b 45 e0 mov -0x20(%ebp),%eax
102cff: 89 44 24 04 mov %eax,0x4(%esp)
102d03: 8d 45 14 lea 0x14(%ebp),%eax
102d06: 89 04 24 mov %eax,(%esp)
102d09: e8 0b fd ff ff call 102a19 <getint>
102d0e: 89 45 f0 mov %eax,-0x10(%ebp)
102d11: 89 55 f4 mov %edx,-0xc(%ebp)
if ((long long)num < 0) {
102d14: 8b 45 f0 mov -0x10(%ebp),%eax
102d17: 8b 55 f4 mov -0xc(%ebp),%edx
102d1a: 85 d2 test %edx,%edx
102d1c: 79 26 jns 102d44 <vprintfmt+0x2b6>
putch('-', putdat);
102d1e: 8b 45 0c mov 0xc(%ebp),%eax
102d21: 89 44 24 04 mov %eax,0x4(%esp)
102d25: c7 04 24 2d 00 00 00 movl $0x2d,(%esp)
102d2c: 8b 45 08 mov 0x8(%ebp),%eax
102d2f: ff d0 call *%eax
num = -(long long)num;
102d31: 8b 45 f0 mov -0x10(%ebp),%eax
102d34: 8b 55 f4 mov -0xc(%ebp),%edx
102d37: f7 d8 neg %eax
102d39: 83 d2 00 adc $0x0,%edx
102d3c: f7 da neg %edx
102d3e: 89 45 f0 mov %eax,-0x10(%ebp)
102d41: 89 55 f4 mov %edx,-0xc(%ebp)
}
base = 10;
102d44: c7 45 ec 0a 00 00 00 movl $0xa,-0x14(%ebp)
goto number;
102d4b: e9 a8 00 00 00 jmp 102df8 <vprintfmt+0x36a>
// unsigned decimal
case 'u':
num = getuint(&ap, lflag);
102d50: 8b 45 e0 mov -0x20(%ebp),%eax
102d53: 89 44 24 04 mov %eax,0x4(%esp)
102d57: 8d 45 14 lea 0x14(%ebp),%eax
102d5a: 89 04 24 mov %eax,(%esp)
102d5d: e8 68 fc ff ff call 1029ca <getuint>
102d62: 89 45 f0 mov %eax,-0x10(%ebp)
102d65: 89 55 f4 mov %edx,-0xc(%ebp)
base = 10;
102d68: c7 45 ec 0a 00 00 00 movl $0xa,-0x14(%ebp)
goto number;
102d6f: e9 84 00 00 00 jmp 102df8 <vprintfmt+0x36a>
// (unsigned) octal
case 'o':
num = getuint(&ap, lflag);
102d74: 8b 45 e0 mov -0x20(%ebp),%eax
102d77: 89 44 24 04 mov %eax,0x4(%esp)
102d7b: 8d 45 14 lea 0x14(%ebp),%eax
102d7e: 89 04 24 mov %eax,(%esp)
102d81: e8 44 fc ff ff call 1029ca <getuint>
102d86: 89 45 f0 mov %eax,-0x10(%ebp)
102d89: 89 55 f4 mov %edx,-0xc(%ebp)
base = 8;
102d8c: c7 45 ec 08 00 00 00 movl $0x8,-0x14(%ebp)
goto number;
102d93: eb 63 jmp 102df8 <vprintfmt+0x36a>
// pointer
case 'p':
putch('0', putdat);
102d95: 8b 45 0c mov 0xc(%ebp),%eax
102d98: 89 44 24 04 mov %eax,0x4(%esp)
102d9c: c7 04 24 30 00 00 00 movl $0x30,(%esp)
102da3: 8b 45 08 mov 0x8(%ebp),%eax
102da6: ff d0 call *%eax
putch('x', putdat);
102da8: 8b 45 0c mov 0xc(%ebp),%eax
102dab: 89 44 24 04 mov %eax,0x4(%esp)
102daf: c7 04 24 78 00 00 00 movl $0x78,(%esp)
102db6: 8b 45 08 mov 0x8(%ebp),%eax
102db9: ff d0 call *%eax
num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
102dbb: 8b 45 14 mov 0x14(%ebp),%eax
102dbe: 8d 50 04 lea 0x4(%eax),%edx
102dc1: 89 55 14 mov %edx,0x14(%ebp)
102dc4: 8b 00 mov (%eax),%eax
102dc6: 89 45 f0 mov %eax,-0x10(%ebp)
102dc9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
base = 16;
102dd0: c7 45 ec 10 00 00 00 movl $0x10,-0x14(%ebp)
goto number;
102dd7: eb 1f jmp 102df8 <vprintfmt+0x36a>
// (unsigned) hexadecimal
case 'x':
num = getuint(&ap, lflag);
102dd9: 8b 45 e0 mov -0x20(%ebp),%eax
102ddc: 89 44 24 04 mov %eax,0x4(%esp)
102de0: 8d 45 14 lea 0x14(%ebp),%eax
102de3: 89 04 24 mov %eax,(%esp)
102de6: e8 df fb ff ff call 1029ca <getuint>
102deb: 89 45 f0 mov %eax,-0x10(%ebp)
102dee: 89 55 f4 mov %edx,-0xc(%ebp)
base = 16;
102df1: c7 45 ec 10 00 00 00 movl $0x10,-0x14(%ebp)
number:
printnum(putch, putdat, num, base, width, padc);
102df8: 0f be 55 db movsbl -0x25(%ebp),%edx
102dfc: 8b 45 ec mov -0x14(%ebp),%eax
102dff: 89 54 24 18 mov %edx,0x18(%esp)
102e03: 8b 55 e8 mov -0x18(%ebp),%edx
102e06: 89 54 24 14 mov %edx,0x14(%esp)
102e0a: 89 44 24 10 mov %eax,0x10(%esp)
102e0e: 8b 45 f0 mov -0x10(%ebp),%eax
102e11: 8b 55 f4 mov -0xc(%ebp),%edx
102e14: 89 44 24 08 mov %eax,0x8(%esp)
102e18: 89 54 24 0c mov %edx,0xc(%esp)
102e1c: 8b 45 0c mov 0xc(%ebp),%eax
102e1f: 89 44 24 04 mov %eax,0x4(%esp)
102e23: 8b 45 08 mov 0x8(%ebp),%eax
102e26: 89 04 24 mov %eax,(%esp)
102e29: e8 97 fa ff ff call 1028c5 <printnum>
break;
102e2e: eb 3c jmp 102e6c <vprintfmt+0x3de>
// escaped '%' character
case '%':
putch(ch, putdat);
102e30: 8b 45 0c mov 0xc(%ebp),%eax
102e33: 89 44 24 04 mov %eax,0x4(%esp)
102e37: 89 1c 24 mov %ebx,(%esp)
102e3a: 8b 45 08 mov 0x8(%ebp),%eax
102e3d: ff d0 call *%eax
break;
102e3f: eb 2b jmp 102e6c <vprintfmt+0x3de>
// unrecognized escape sequence - just print it literally
default:
putch('%', putdat);
102e41: 8b 45 0c mov 0xc(%ebp),%eax
102e44: 89 44 24 04 mov %eax,0x4(%esp)
102e48: c7 04 24 25 00 00 00 movl $0x25,(%esp)
102e4f: 8b 45 08 mov 0x8(%ebp),%eax
102e52: ff d0 call *%eax
for (fmt --; fmt[-1] != '%'; fmt --)
102e54: 83 6d 10 01 subl $0x1,0x10(%ebp)
102e58: eb 04 jmp 102e5e <vprintfmt+0x3d0>
102e5a: 83 6d 10 01 subl $0x1,0x10(%ebp)
102e5e: 8b 45 10 mov 0x10(%ebp),%eax
102e61: 83 e8 01 sub $0x1,%eax
102e64: 0f b6 00 movzbl (%eax),%eax
102e67: 3c 25 cmp $0x25,%al
102e69: 75 ef jne 102e5a <vprintfmt+0x3cc>
/* do nothing */;
break;
102e6b: 90 nop
}
}
102e6c: 90 nop
register int ch, err;
unsigned long long num;
int base, width, precision, lflag, altflag;
while (1) {
while ((ch = *(unsigned char *)fmt ++) != '%') {
102e6d: e9 3e fc ff ff jmp 102ab0 <vprintfmt+0x22>
for (fmt --; fmt[-1] != '%'; fmt --)
/* do nothing */;
break;
}
}
}
102e72: 83 c4 40 add $0x40,%esp
102e75: 5b pop %ebx
102e76: 5e pop %esi
102e77: 5d pop %ebp
102e78: c3 ret
00102e79 <sprintputch>:
* sprintputch - 'print' a single character in a buffer
* @ch: the character will be printed
* @b: the buffer to place the character @ch
* */
static void
sprintputch(int ch, struct sprintbuf *b) {
102e79: 55 push %ebp
102e7a: 89 e5 mov %esp,%ebp
b->cnt ++;
102e7c: 8b 45 0c mov 0xc(%ebp),%eax
102e7f: 8b 40 08 mov 0x8(%eax),%eax
102e82: 8d 50 01 lea 0x1(%eax),%edx
102e85: 8b 45 0c mov 0xc(%ebp),%eax
102e88: 89 50 08 mov %edx,0x8(%eax)
if (b->buf < b->ebuf) {
102e8b: 8b 45 0c mov 0xc(%ebp),%eax
102e8e: 8b 10 mov (%eax),%edx
102e90: 8b 45 0c mov 0xc(%ebp),%eax
102e93: 8b 40 04 mov 0x4(%eax),%eax
102e96: 39 c2 cmp %eax,%edx
102e98: 73 12 jae 102eac <sprintputch+0x33>
*b->buf ++ = ch;
102e9a: 8b 45 0c mov 0xc(%ebp),%eax
102e9d: 8b 00 mov (%eax),%eax
102e9f: 8d 48 01 lea 0x1(%eax),%ecx
102ea2: 8b 55 0c mov 0xc(%ebp),%edx
102ea5: 89 0a mov %ecx,(%edx)
102ea7: 8b 55 08 mov 0x8(%ebp),%edx
102eaa: 88 10 mov %dl,(%eax)
}
}
102eac: 5d pop %ebp
102ead: c3 ret
00102eae <snprintf>:
* @str: the buffer to place the result into
* @size: the size of buffer, including the trailing null space
* @fmt: the format string to use
* */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
102eae: 55 push %ebp
102eaf: 89 e5 mov %esp,%ebp
102eb1: 83 ec 28 sub $0x28,%esp
va_list ap;
int cnt;
va_start(ap, fmt);
102eb4: 8d 45 14 lea 0x14(%ebp),%eax
102eb7: 89 45 f0 mov %eax,-0x10(%ebp)
cnt = vsnprintf(str, size, fmt, ap);
102eba: 8b 45 f0 mov -0x10(%ebp),%eax
102ebd: 89 44 24 0c mov %eax,0xc(%esp)
102ec1: 8b 45 10 mov 0x10(%ebp),%eax
102ec4: 89 44 24 08 mov %eax,0x8(%esp)
102ec8: 8b 45 0c mov 0xc(%ebp),%eax
102ecb: 89 44 24 04 mov %eax,0x4(%esp)
102ecf: 8b 45 08 mov 0x8(%ebp),%eax
102ed2: 89 04 24 mov %eax,(%esp)
102ed5: e8 08 00 00 00 call 102ee2 <vsnprintf>
102eda: 89 45 f4 mov %eax,-0xc(%ebp)
va_end(ap);
return cnt;
102edd: 8b 45 f4 mov -0xc(%ebp),%eax
}
102ee0: c9 leave
102ee1: c3 ret
00102ee2 <vsnprintf>:
*
* Call this function if you are already dealing with a va_list.
* Or you probably want snprintf() instead.
* */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
102ee2: 55 push %ebp
102ee3: 89 e5 mov %esp,%ebp
102ee5: 83 ec 28 sub $0x28,%esp
struct sprintbuf b = {str, str + size - 1, 0};
102ee8: 8b 45 08 mov 0x8(%ebp),%eax
102eeb: 89 45 ec mov %eax,-0x14(%ebp)
102eee: 8b 45 0c mov 0xc(%ebp),%eax
102ef1: 8d 50 ff lea -0x1(%eax),%edx
102ef4: 8b 45 08 mov 0x8(%ebp),%eax
102ef7: 01 d0 add %edx,%eax
102ef9: 89 45 f0 mov %eax,-0x10(%ebp)
102efc: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if (str == NULL || b.buf > b.ebuf) {
102f03: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
102f07: 74 0a je 102f13 <vsnprintf+0x31>
102f09: 8b 55 ec mov -0x14(%ebp),%edx
102f0c: 8b 45 f0 mov -0x10(%ebp),%eax
102f0f: 39 c2 cmp %eax,%edx
102f11: 76 07 jbe 102f1a <vsnprintf+0x38>
return -E_INVAL;
102f13: b8 fd ff ff ff mov $0xfffffffd,%eax
102f18: eb 2a jmp 102f44 <vsnprintf+0x62>
}
// print the string to the buffer
vprintfmt((void*)sprintputch, &b, fmt, ap);
102f1a: 8b 45 14 mov 0x14(%ebp),%eax
102f1d: 89 44 24 0c mov %eax,0xc(%esp)
102f21: 8b 45 10 mov 0x10(%ebp),%eax
102f24: 89 44 24 08 mov %eax,0x8(%esp)
102f28: 8d 45 ec lea -0x14(%ebp),%eax
102f2b: 89 44 24 04 mov %eax,0x4(%esp)
102f2f: c7 04 24 79 2e 10 00 movl $0x102e79,(%esp)
102f36: e8 53 fb ff ff call 102a8e <vprintfmt>
// null terminate the buffer
*b.buf = '\0';
102f3b: 8b 45 ec mov -0x14(%ebp),%eax
102f3e: c6 00 00 movb $0x0,(%eax)
return b.cnt;
102f41: 8b 45 f4 mov -0xc(%ebp),%eax
}
102f44: c9 leave
102f45: c3 ret
00102f46 <strlen>:
* @s: the input string
*
* The strlen() function returns the length of string @s.
* */
size_t
strlen(const char *s) {
102f46: 55 push %ebp
102f47: 89 e5 mov %esp,%ebp
102f49: 83 ec 10 sub $0x10,%esp
size_t cnt = 0;
102f4c: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while (*s ++ != '\0') {
102f53: eb 04 jmp 102f59 <strlen+0x13>
cnt ++;
102f55: 83 45 fc 01 addl $0x1,-0x4(%ebp)
* The strlen() function returns the length of string @s.
* */
size_t
strlen(const char *s) {
size_t cnt = 0;
while (*s ++ != '\0') {
102f59: 8b 45 08 mov 0x8(%ebp),%eax
102f5c: 8d 50 01 lea 0x1(%eax),%edx
102f5f: 89 55 08 mov %edx,0x8(%ebp)
102f62: 0f b6 00 movzbl (%eax),%eax
102f65: 84 c0 test %al,%al
102f67: 75 ec jne 102f55 <strlen+0xf>
cnt ++;
}
return cnt;
102f69: 8b 45 fc mov -0x4(%ebp),%eax
}
102f6c: c9 leave
102f6d: c3 ret
00102f6e <strnlen>:
* The return value is strlen(s), if that is less than @len, or
* @len if there is no '\0' character among the first @len characters
* pointed by @s.
* */
size_t
strnlen(const char *s, size_t len) {
102f6e: 55 push %ebp
102f6f: 89 e5 mov %esp,%ebp
102f71: 83 ec 10 sub $0x10,%esp
size_t cnt = 0;
102f74: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while (cnt < len && *s ++ != '\0') {
102f7b: eb 04 jmp 102f81 <strnlen+0x13>
cnt ++;
102f7d: 83 45 fc 01 addl $0x1,-0x4(%ebp)
* pointed by @s.
* */
size_t
strnlen(const char *s, size_t len) {
size_t cnt = 0;
while (cnt < len && *s ++ != '\0') {
102f81: 8b 45 fc mov -0x4(%ebp),%eax
102f84: 3b 45 0c cmp 0xc(%ebp),%eax
102f87: 73 10 jae 102f99 <strnlen+0x2b>
102f89: 8b 45 08 mov 0x8(%ebp),%eax
102f8c: 8d 50 01 lea 0x1(%eax),%edx
102f8f: 89 55 08 mov %edx,0x8(%ebp)
102f92: 0f b6 00 movzbl (%eax),%eax
102f95: 84 c0 test %al,%al
102f97: 75 e4 jne 102f7d <strnlen+0xf>
cnt ++;
}
return cnt;
102f99: 8b 45 fc mov -0x4(%ebp),%eax
}
102f9c: c9 leave
102f9d: c3 ret
00102f9e <strcpy>:
* To avoid overflows, the size of array pointed by @dst should be long enough to
* contain the same string as @src (including the terminating null character), and
* should not overlap in memory with @src.
* */
char *
strcpy(char *dst, const char *src) {
102f9e: 55 push %ebp
102f9f: 89 e5 mov %esp,%ebp
102fa1: 57 push %edi
102fa2: 56 push %esi
102fa3: 83 ec 20 sub $0x20,%esp
102fa6: 8b 45 08 mov 0x8(%ebp),%eax
102fa9: 89 45 f4 mov %eax,-0xc(%ebp)
102fac: 8b 45 0c mov 0xc(%ebp),%eax
102faf: 89 45 f0 mov %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
int d0, d1, d2;
asm volatile (
102fb2: 8b 55 f0 mov -0x10(%ebp),%edx
102fb5: 8b 45 f4 mov -0xc(%ebp),%eax
102fb8: 89 d1 mov %edx,%ecx
102fba: 89 c2 mov %eax,%edx
102fbc: 89 ce mov %ecx,%esi
102fbe: 89 d7 mov %edx,%edi
102fc0: ac lods %ds:(%esi),%al
102fc1: aa stos %al,%es:(%edi)
102fc2: 84 c0 test %al,%al
102fc4: 75 fa jne 102fc0 <strcpy+0x22>
102fc6: 89 fa mov %edi,%edx
102fc8: 89 f1 mov %esi,%ecx
102fca: 89 4d ec mov %ecx,-0x14(%ebp)
102fcd: 89 55 e8 mov %edx,-0x18(%ebp)
102fd0: 89 45 e4 mov %eax,-0x1c(%ebp)
"stosb;"
"testb %%al, %%al;"
"jne 1b;"
: "=&S" (d0), "=&D" (d1), "=&a" (d2)
: "0" (src), "1" (dst) : "memory");
return dst;
102fd3: 8b 45 f4 mov -0xc(%ebp),%eax
char *p = dst;
while ((*p ++ = *src ++) != '\0')
/* nothing */;
return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
102fd6: 83 c4 20 add $0x20,%esp
102fd9: 5e pop %esi
102fda: 5f pop %edi
102fdb: 5d pop %ebp
102fdc: c3 ret
00102fdd <strncpy>:
* @len: maximum number of characters to be copied from @src
*
* The return value is @dst
* */
char *
strncpy(char *dst, const char *src, size_t len) {
102fdd: 55 push %ebp
102fde: 89 e5 mov %esp,%ebp
102fe0: 83 ec 10 sub $0x10,%esp
char *p = dst;
102fe3: 8b 45 08 mov 0x8(%ebp),%eax
102fe6: 89 45 fc mov %eax,-0x4(%ebp)
while (len > 0) {
102fe9: eb 21 jmp 10300c <strncpy+0x2f>
if ((*p = *src) != '\0') {
102feb: 8b 45 0c mov 0xc(%ebp),%eax
102fee: 0f b6 10 movzbl (%eax),%edx
102ff1: 8b 45 fc mov -0x4(%ebp),%eax
102ff4: 88 10 mov %dl,(%eax)
102ff6: 8b 45 fc mov -0x4(%ebp),%eax
102ff9: 0f b6 00 movzbl (%eax),%eax
102ffc: 84 c0 test %al,%al
102ffe: 74 04 je 103004 <strncpy+0x27>
src ++;
103000: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
p ++, len --;
103004: 83 45 fc 01 addl $0x1,-0x4(%ebp)
103008: 83 6d 10 01 subl $0x1,0x10(%ebp)
* The return value is @dst
* */
char *
strncpy(char *dst, const char *src, size_t len) {
char *p = dst;
while (len > 0) {
10300c: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
103010: 75 d9 jne 102feb <strncpy+0xe>
if ((*p = *src) != '\0') {
src ++;
}
p ++, len --;
}
return dst;
103012: 8b 45 08 mov 0x8(%ebp),%eax
}
103015: c9 leave
103016: c3 ret
00103017 <strcmp>:
* - A value greater than zero indicates that the first character that does
* not match has a greater value in @s1 than in @s2;
* - And a value less than zero indicates the opposite.
* */
int
strcmp(const char *s1, const char *s2) {
103017: 55 push %ebp
103018: 89 e5 mov %esp,%ebp
10301a: 57 push %edi
10301b: 56 push %esi
10301c: 83 ec 20 sub $0x20,%esp
10301f: 8b 45 08 mov 0x8(%ebp),%eax
103022: 89 45 f4 mov %eax,-0xc(%ebp)
103025: 8b 45 0c mov 0xc(%ebp),%eax
103028: 89 45 f0 mov %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCMP
#define __HAVE_ARCH_STRCMP
static inline int
__strcmp(const char *s1, const char *s2) {
int d0, d1, ret;
asm volatile (
10302b: 8b 55 f4 mov -0xc(%ebp),%edx
10302e: 8b 45 f0 mov -0x10(%ebp),%eax
103031: 89 d1 mov %edx,%ecx
103033: 89 c2 mov %eax,%edx
103035: 89 ce mov %ecx,%esi
103037: 89 d7 mov %edx,%edi
103039: ac lods %ds:(%esi),%al
10303a: ae scas %es:(%edi),%al
10303b: 75 08 jne 103045 <strcmp+0x2e>
10303d: 84 c0 test %al,%al
10303f: 75 f8 jne 103039 <strcmp+0x22>
103041: 31 c0 xor %eax,%eax
103043: eb 04 jmp 103049 <strcmp+0x32>
103045: 19 c0 sbb %eax,%eax
103047: 0c 01 or $0x1,%al
103049: 89 fa mov %edi,%edx
10304b: 89 f1 mov %esi,%ecx
10304d: 89 45 ec mov %eax,-0x14(%ebp)
103050: 89 4d e8 mov %ecx,-0x18(%ebp)
103053: 89 55 e4 mov %edx,-0x1c(%ebp)
"orb $1, %%al;"
"3:"
: "=a" (ret), "=&S" (d0), "=&D" (d1)
: "1" (s1), "2" (s2)
: "memory");
return ret;
103056: 8b 45 ec mov -0x14(%ebp),%eax
while (*s1 != '\0' && *s1 == *s2) {
s1 ++, s2 ++;
}
return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
103059: 83 c4 20 add $0x20,%esp
10305c: 5e pop %esi
10305d: 5f pop %edi
10305e: 5d pop %ebp
10305f: c3 ret
00103060 <strncmp>:
* they are equal to each other, it continues with the following pairs until
* the characters differ, until a terminating null-character is reached, or
* until @n characters match in both strings, whichever happens first.
* */
int
strncmp(const char *s1, const char *s2, size_t n) {
103060: 55 push %ebp
103061: 89 e5 mov %esp,%ebp
while (n > 0 && *s1 != '\0' && *s1 == *s2) {
103063: eb 0c jmp 103071 <strncmp+0x11>
n --, s1 ++, s2 ++;
103065: 83 6d 10 01 subl $0x1,0x10(%ebp)
103069: 83 45 08 01 addl $0x1,0x8(%ebp)
10306d: 83 45 0c 01 addl $0x1,0xc(%ebp)
* the characters differ, until a terminating null-character is reached, or
* until @n characters match in both strings, whichever happens first.
* */
int
strncmp(const char *s1, const char *s2, size_t n) {
while (n > 0 && *s1 != '\0' && *s1 == *s2) {
103071: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
103075: 74 1a je 103091 <strncmp+0x31>
103077: 8b 45 08 mov 0x8(%ebp),%eax
10307a: 0f b6 00 movzbl (%eax),%eax
10307d: 84 c0 test %al,%al
10307f: 74 10 je 103091 <strncmp+0x31>
103081: 8b 45 08 mov 0x8(%ebp),%eax
103084: 0f b6 10 movzbl (%eax),%edx
103087: 8b 45 0c mov 0xc(%ebp),%eax
10308a: 0f b6 00 movzbl (%eax),%eax
10308d: 38 c2 cmp %al,%dl
10308f: 74 d4 je 103065 <strncmp+0x5>
n --, s1 ++, s2 ++;
}
return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
103091: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
103095: 74 18 je 1030af <strncmp+0x4f>
103097: 8b 45 08 mov 0x8(%ebp),%eax
10309a: 0f b6 00 movzbl (%eax),%eax
10309d: 0f b6 d0 movzbl %al,%edx
1030a0: 8b 45 0c mov 0xc(%ebp),%eax
1030a3: 0f b6 00 movzbl (%eax),%eax
1030a6: 0f b6 c0 movzbl %al,%eax
1030a9: 29 c2 sub %eax,%edx
1030ab: 89 d0 mov %edx,%eax
1030ad: eb 05 jmp 1030b4 <strncmp+0x54>
1030af: b8 00 00 00 00 mov $0x0,%eax
}
1030b4: 5d pop %ebp
1030b5: c3 ret
001030b6 <strchr>:
*
* The strchr() function returns a pointer to the first occurrence of
* character in @s. If the value is not found, the function returns 'NULL'.
* */
char *
strchr(const char *s, char c) {
1030b6: 55 push %ebp
1030b7: 89 e5 mov %esp,%ebp
1030b9: 83 ec 04 sub $0x4,%esp
1030bc: 8b 45 0c mov 0xc(%ebp),%eax
1030bf: 88 45 fc mov %al,-0x4(%ebp)
while (*s != '\0') {
1030c2: eb 14 jmp 1030d8 <strchr+0x22>
if (*s == c) {
1030c4: 8b 45 08 mov 0x8(%ebp),%eax
1030c7: 0f b6 00 movzbl (%eax),%eax
1030ca: 3a 45 fc cmp -0x4(%ebp),%al
1030cd: 75 05 jne 1030d4 <strchr+0x1e>
return (char *)s;
1030cf: 8b 45 08 mov 0x8(%ebp),%eax
1030d2: eb 13 jmp 1030e7 <strchr+0x31>
}
s ++;
1030d4: 83 45 08 01 addl $0x1,0x8(%ebp)
* The strchr() function returns a pointer to the first occurrence of
* character in @s. If the value is not found, the function returns 'NULL'.
* */
char *
strchr(const char *s, char c) {
while (*s != '\0') {
1030d8: 8b 45 08 mov 0x8(%ebp),%eax
1030db: 0f b6 00 movzbl (%eax),%eax
1030de: 84 c0 test %al,%al
1030e0: 75 e2 jne 1030c4 <strchr+0xe>
if (*s == c) {
return (char *)s;
}
s ++;
}
return NULL;
1030e2: b8 00 00 00 00 mov $0x0,%eax
}
1030e7: c9 leave
1030e8: c3 ret
001030e9 <strfind>:
* The strfind() function is like strchr() except that if @c is
* not found in @s, then it returns a pointer to the null byte at the
* end of @s, rather than 'NULL'.
* */
char *
strfind(const char *s, char c) {
1030e9: 55 push %ebp
1030ea: 89 e5 mov %esp,%ebp
1030ec: 83 ec 04 sub $0x4,%esp
1030ef: 8b 45 0c mov 0xc(%ebp),%eax
1030f2: 88 45 fc mov %al,-0x4(%ebp)
while (*s != '\0') {
1030f5: eb 11 jmp 103108 <strfind+0x1f>
if (*s == c) {
1030f7: 8b 45 08 mov 0x8(%ebp),%eax
1030fa: 0f b6 00 movzbl (%eax),%eax
1030fd: 3a 45 fc cmp -0x4(%ebp),%al
103100: 75 02 jne 103104 <strfind+0x1b>
break;
103102: eb 0e jmp 103112 <strfind+0x29>
}
s ++;
103104: 83 45 08 01 addl $0x1,0x8(%ebp)
* not found in @s, then it returns a pointer to the null byte at the
* end of @s, rather than 'NULL'.
* */
char *
strfind(const char *s, char c) {
while (*s != '\0') {
103108: 8b 45 08 mov 0x8(%ebp),%eax
10310b: 0f b6 00 movzbl (%eax),%eax
10310e: 84 c0 test %al,%al
103110: 75 e5 jne 1030f7 <strfind+0xe>
if (*s == c) {
break;
}
s ++;
}
return (char *)s;
103112: 8b 45 08 mov 0x8(%ebp),%eax
}
103115: c9 leave
103116: c3 ret
00103117 <strtol>:
* an optional "0x" or "0X" prefix.
*
* The strtol() function returns the converted integral number as a long int value.
* */
long
strtol(const char *s, char **endptr, int base) {
103117: 55 push %ebp
103118: 89 e5 mov %esp,%ebp
10311a: 83 ec 10 sub $0x10,%esp
int neg = 0;
10311d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
long val = 0;
103124: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp)
// gobble initial whitespace
while (*s == ' ' || *s == '\t') {
10312b: eb 04 jmp 103131 <strtol+0x1a>
s ++;
10312d: 83 45 08 01 addl $0x1,0x8(%ebp)
strtol(const char *s, char **endptr, int base) {
int neg = 0;
long val = 0;
// gobble initial whitespace
while (*s == ' ' || *s == '\t') {
103131: 8b 45 08 mov 0x8(%ebp),%eax
103134: 0f b6 00 movzbl (%eax),%eax
103137: 3c 20 cmp $0x20,%al
103139: 74 f2 je 10312d <strtol+0x16>
10313b: 8b 45 08 mov 0x8(%ebp),%eax
10313e: 0f b6 00 movzbl (%eax),%eax
103141: 3c 09 cmp $0x9,%al
103143: 74 e8 je 10312d <strtol+0x16>
s ++;
}
// plus/minus sign
if (*s == '+') {
103145: 8b 45 08 mov 0x8(%ebp),%eax
103148: 0f b6 00 movzbl (%eax),%eax
10314b: 3c 2b cmp $0x2b,%al
10314d: 75 06 jne 103155 <strtol+0x3e>
s ++;
10314f: 83 45 08 01 addl $0x1,0x8(%ebp)
103153: eb 15 jmp 10316a <strtol+0x53>
}
else if (*s == '-') {
103155: 8b 45 08 mov 0x8(%ebp),%eax
103158: 0f b6 00 movzbl (%eax),%eax
10315b: 3c 2d cmp $0x2d,%al
10315d: 75 0b jne 10316a <strtol+0x53>
s ++, neg = 1;
10315f: 83 45 08 01 addl $0x1,0x8(%ebp)
103163: c7 45 fc 01 00 00 00 movl $0x1,-0x4(%ebp)
}
// hex or octal base prefix
if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
10316a: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
10316e: 74 06 je 103176 <strtol+0x5f>
103170: 83 7d 10 10 cmpl $0x10,0x10(%ebp)
103174: 75 24 jne 10319a <strtol+0x83>
103176: 8b 45 08 mov 0x8(%ebp),%eax
103179: 0f b6 00 movzbl (%eax),%eax
10317c: 3c 30 cmp $0x30,%al
10317e: 75 1a jne 10319a <strtol+0x83>
103180: 8b 45 08 mov 0x8(%ebp),%eax
103183: 83 c0 01 add $0x1,%eax
103186: 0f b6 00 movzbl (%eax),%eax
103189: 3c 78 cmp $0x78,%al
10318b: 75 0d jne 10319a <strtol+0x83>
s += 2, base = 16;
10318d: 83 45 08 02 addl $0x2,0x8(%ebp)
103191: c7 45 10 10 00 00 00 movl $0x10,0x10(%ebp)
103198: eb 2a jmp 1031c4 <strtol+0xad>
}
else if (base == 0 && s[0] == '0') {
10319a: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
10319e: 75 17 jne 1031b7 <strtol+0xa0>
1031a0: 8b 45 08 mov 0x8(%ebp),%eax
1031a3: 0f b6 00 movzbl (%eax),%eax
1031a6: 3c 30 cmp $0x30,%al
1031a8: 75 0d jne 1031b7 <strtol+0xa0>
s ++, base = 8;
1031aa: 83 45 08 01 addl $0x1,0x8(%ebp)
1031ae: c7 45 10 08 00 00 00 movl $0x8,0x10(%ebp)
1031b5: eb 0d jmp 1031c4 <strtol+0xad>
}
else if (base == 0) {
1031b7: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
1031bb: 75 07 jne 1031c4 <strtol+0xad>
base = 10;
1031bd: c7 45 10 0a 00 00 00 movl $0xa,0x10(%ebp)
// digits
while (1) {
int dig;
if (*s >= '0' && *s <= '9') {
1031c4: 8b 45 08 mov 0x8(%ebp),%eax
1031c7: 0f b6 00 movzbl (%eax),%eax
1031ca: 3c 2f cmp $0x2f,%al
1031cc: 7e 1b jle 1031e9 <strtol+0xd2>
1031ce: 8b 45 08 mov 0x8(%ebp),%eax
1031d1: 0f b6 00 movzbl (%eax),%eax
1031d4: 3c 39 cmp $0x39,%al
1031d6: 7f 11 jg 1031e9 <strtol+0xd2>
dig = *s - '0';
1031d8: 8b 45 08 mov 0x8(%ebp),%eax
1031db: 0f b6 00 movzbl (%eax),%eax
1031de: 0f be c0 movsbl %al,%eax
1031e1: 83 e8 30 sub $0x30,%eax
1031e4: 89 45 f4 mov %eax,-0xc(%ebp)
1031e7: eb 48 jmp 103231 <strtol+0x11a>
}
else if (*s >= 'a' && *s <= 'z') {
1031e9: 8b 45 08 mov 0x8(%ebp),%eax
1031ec: 0f b6 00 movzbl (%eax),%eax
1031ef: 3c 60 cmp $0x60,%al
1031f1: 7e 1b jle 10320e <strtol+0xf7>
1031f3: 8b 45 08 mov 0x8(%ebp),%eax
1031f6: 0f b6 00 movzbl (%eax),%eax
1031f9: 3c 7a cmp $0x7a,%al
1031fb: 7f 11 jg 10320e <strtol+0xf7>
dig = *s - 'a' + 10;
1031fd: 8b 45 08 mov 0x8(%ebp),%eax
103200: 0f b6 00 movzbl (%eax),%eax
103203: 0f be c0 movsbl %al,%eax
103206: 83 e8 57 sub $0x57,%eax
103209: 89 45 f4 mov %eax,-0xc(%ebp)
10320c: eb 23 jmp 103231 <strtol+0x11a>
}
else if (*s >= 'A' && *s <= 'Z') {
10320e: 8b 45 08 mov 0x8(%ebp),%eax
103211: 0f b6 00 movzbl (%eax),%eax
103214: 3c 40 cmp $0x40,%al
103216: 7e 3d jle 103255 <strtol+0x13e>
103218: 8b 45 08 mov 0x8(%ebp),%eax
10321b: 0f b6 00 movzbl (%eax),%eax
10321e: 3c 5a cmp $0x5a,%al
103220: 7f 33 jg 103255 <strtol+0x13e>
dig = *s - 'A' + 10;
103222: 8b 45 08 mov 0x8(%ebp),%eax
103225: 0f b6 00 movzbl (%eax),%eax
103228: 0f be c0 movsbl %al,%eax
10322b: 83 e8 37 sub $0x37,%eax
10322e: 89 45 f4 mov %eax,-0xc(%ebp)
}
else {
break;
}
if (dig >= base) {
103231: 8b 45 f4 mov -0xc(%ebp),%eax
103234: 3b 45 10 cmp 0x10(%ebp),%eax
103237: 7c 02 jl 10323b <strtol+0x124>
break;
103239: eb 1a jmp 103255 <strtol+0x13e>
}
s ++, val = (val * base) + dig;
10323b: 83 45 08 01 addl $0x1,0x8(%ebp)
10323f: 8b 45 f8 mov -0x8(%ebp),%eax
103242: 0f af 45 10 imul 0x10(%ebp),%eax
103246: 89 c2 mov %eax,%edx
103248: 8b 45 f4 mov -0xc(%ebp),%eax
10324b: 01 d0 add %edx,%eax
10324d: 89 45 f8 mov %eax,-0x8(%ebp)
// we don't properly detect overflow!
}
103250: e9 6f ff ff ff jmp 1031c4 <strtol+0xad>
if (endptr) {
103255: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
103259: 74 08 je 103263 <strtol+0x14c>
*endptr = (char *) s;
10325b: 8b 45 0c mov 0xc(%ebp),%eax
10325e: 8b 55 08 mov 0x8(%ebp),%edx
103261: 89 10 mov %edx,(%eax)
}
return (neg ? -val : val);
103263: 83 7d fc 00 cmpl $0x0,-0x4(%ebp)
103267: 74 07 je 103270 <strtol+0x159>
103269: 8b 45 f8 mov -0x8(%ebp),%eax
10326c: f7 d8 neg %eax
10326e: eb 03 jmp 103273 <strtol+0x15c>
103270: 8b 45 f8 mov -0x8(%ebp),%eax
}
103273: c9 leave
103274: c3 ret
00103275 <memset>:
* @n: number of bytes to be set to the value
*
* The memset() function returns @s.
* */
void *
memset(void *s, char c, size_t n) {
103275: 55 push %ebp
103276: 89 e5 mov %esp,%ebp
103278: 57 push %edi
103279: 83 ec 24 sub $0x24,%esp
10327c: 8b 45 0c mov 0xc(%ebp),%eax
10327f: 88 45 d8 mov %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
return __memset(s, c, n);
103282: 0f be 45 d8 movsbl -0x28(%ebp),%eax
103286: 8b 55 08 mov 0x8(%ebp),%edx
103289: 89 55 f8 mov %edx,-0x8(%ebp)
10328c: 88 45 f7 mov %al,-0x9(%ebp)
10328f: 8b 45 10 mov 0x10(%ebp),%eax
103292: 89 45 f0 mov %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
int d0, d1;
asm volatile (
103295: 8b 4d f0 mov -0x10(%ebp),%ecx
103298: 0f b6 45 f7 movzbl -0x9(%ebp),%eax
10329c: 8b 55 f8 mov -0x8(%ebp),%edx
10329f: 89 d7 mov %edx,%edi
1032a1: f3 aa rep stos %al,%es:(%edi)
1032a3: 89 fa mov %edi,%edx
1032a5: 89 4d ec mov %ecx,-0x14(%ebp)
1032a8: 89 55 e8 mov %edx,-0x18(%ebp)
"rep; stosb;"
: "=&c" (d0), "=&D" (d1)
: "0" (n), "a" (c), "1" (s)
: "memory");
return s;
1032ab: 8b 45 f8 mov -0x8(%ebp),%eax
while (n -- > 0) {
*p ++ = c;
}
return s;
#endif /* __HAVE_ARCH_MEMSET */
}
1032ae: 83 c4 24 add $0x24,%esp
1032b1: 5f pop %edi
1032b2: 5d pop %ebp
1032b3: c3 ret
001032b4 <memmove>:
* @n: number of bytes to copy
*
* The memmove() function returns @dst.
* */
void *
memmove(void *dst, const void *src, size_t n) {
1032b4: 55 push %ebp
1032b5: 89 e5 mov %esp,%ebp
1032b7: 57 push %edi
1032b8: 56 push %esi
1032b9: 53 push %ebx
1032ba: 83 ec 30 sub $0x30,%esp
1032bd: 8b 45 08 mov 0x8(%ebp),%eax
1032c0: 89 45 f0 mov %eax,-0x10(%ebp)
1032c3: 8b 45 0c mov 0xc(%ebp),%eax
1032c6: 89 45 ec mov %eax,-0x14(%ebp)
1032c9: 8b 45 10 mov 0x10(%ebp),%eax
1032cc: 89 45 e8 mov %eax,-0x18(%ebp)
#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
if (dst < src) {
1032cf: 8b 45 f0 mov -0x10(%ebp),%eax
1032d2: 3b 45 ec cmp -0x14(%ebp),%eax
1032d5: 73 42 jae 103319 <memmove+0x65>
1032d7: 8b 45 f0 mov -0x10(%ebp),%eax
1032da: 89 45 e4 mov %eax,-0x1c(%ebp)
1032dd: 8b 45 ec mov -0x14(%ebp),%eax
1032e0: 89 45 e0 mov %eax,-0x20(%ebp)
1032e3: 8b 45 e8 mov -0x18(%ebp),%eax
1032e6: 89 45 dc mov %eax,-0x24(%ebp)
"andl $3, %%ecx;"
"jz 1f;"
"rep; movsb;"
"1:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
1032e9: 8b 45 dc mov -0x24(%ebp),%eax
1032ec: c1 e8 02 shr $0x2,%eax
1032ef: 89 c1 mov %eax,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
int d0, d1, d2;
asm volatile (
1032f1: 8b 55 e4 mov -0x1c(%ebp),%edx
1032f4: 8b 45 e0 mov -0x20(%ebp),%eax
1032f7: 89 d7 mov %edx,%edi
1032f9: 89 c6 mov %eax,%esi
1032fb: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
1032fd: 8b 4d dc mov -0x24(%ebp),%ecx
103300: 83 e1 03 and $0x3,%ecx
103303: 74 02 je 103307 <memmove+0x53>
103305: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
103307: 89 f0 mov %esi,%eax
103309: 89 fa mov %edi,%edx
10330b: 89 4d d8 mov %ecx,-0x28(%ebp)
10330e: 89 55 d4 mov %edx,-0x2c(%ebp)
103311: 89 45 d0 mov %eax,-0x30(%ebp)
"rep; movsb;"
"1:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
: "memory");
return dst;
103314: 8b 45 e4 mov -0x1c(%ebp),%eax
103317: eb 36 jmp 10334f <memmove+0x9b>
asm volatile (
"std;"
"rep; movsb;"
"cld;"
: "=&c" (d0), "=&S" (d1), "=&D" (d2)
: "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
103319: 8b 45 e8 mov -0x18(%ebp),%eax
10331c: 8d 50 ff lea -0x1(%eax),%edx
10331f: 8b 45 ec mov -0x14(%ebp),%eax
103322: 01 c2 add %eax,%edx
103324: 8b 45 e8 mov -0x18(%ebp),%eax
103327: 8d 48 ff lea -0x1(%eax),%ecx
10332a: 8b 45 f0 mov -0x10(%ebp),%eax
10332d: 8d 1c 01 lea (%ecx,%eax,1),%ebx
__memmove(void *dst, const void *src, size_t n) {
if (dst < src) {
return __memcpy(dst, src, n);
}
int d0, d1, d2;
asm volatile (
103330: 8b 45 e8 mov -0x18(%ebp),%eax
103333: 89 c1 mov %eax,%ecx
103335: 89 d8 mov %ebx,%eax
103337: 89 d6 mov %edx,%esi
103339: 89 c7 mov %eax,%edi
10333b: fd std
10333c: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
10333e: fc cld
10333f: 89 f8 mov %edi,%eax
103341: 89 f2 mov %esi,%edx
103343: 89 4d cc mov %ecx,-0x34(%ebp)
103346: 89 55 c8 mov %edx,-0x38(%ebp)
103349: 89 45 c4 mov %eax,-0x3c(%ebp)
"rep; movsb;"
"cld;"
: "=&c" (d0), "=&S" (d1), "=&D" (d2)
: "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
: "memory");
return dst;
10334c: 8b 45 f0 mov -0x10(%ebp),%eax
*d ++ = *s ++;
}
}
return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
10334f: 83 c4 30 add $0x30,%esp
103352: 5b pop %ebx
103353: 5e pop %esi
103354: 5f pop %edi
103355: 5d pop %ebp
103356: c3 ret
00103357 <memcpy>:
* it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
* by both @src and @dst, should be at least @n bytes, and should not overlap
* (for overlapping memory area, memmove is a safer approach).
* */
void *
memcpy(void *dst, const void *src, size_t n) {
103357: 55 push %ebp
103358: 89 e5 mov %esp,%ebp
10335a: 57 push %edi
10335b: 56 push %esi
10335c: 83 ec 20 sub $0x20,%esp
10335f: 8b 45 08 mov 0x8(%ebp),%eax
103362: 89 45 f4 mov %eax,-0xc(%ebp)
103365: 8b 45 0c mov 0xc(%ebp),%eax
103368: 89 45 f0 mov %eax,-0x10(%ebp)
10336b: 8b 45 10 mov 0x10(%ebp),%eax
10336e: 89 45 ec mov %eax,-0x14(%ebp)
"andl $3, %%ecx;"
"jz 1f;"
"rep; movsb;"
"1:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
103371: 8b 45 ec mov -0x14(%ebp),%eax
103374: c1 e8 02 shr $0x2,%eax
103377: 89 c1 mov %eax,%ecx
#ifndef __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMCPY
static inline void *
__memcpy(void *dst, const void *src, size_t n) {
int d0, d1, d2;
asm volatile (
103379: 8b 55 f4 mov -0xc(%ebp),%edx
10337c: 8b 45 f0 mov -0x10(%ebp),%eax
10337f: 89 d7 mov %edx,%edi
103381: 89 c6 mov %eax,%esi
103383: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
103385: 8b 4d ec mov -0x14(%ebp),%ecx
103388: 83 e1 03 and $0x3,%ecx
10338b: 74 02 je 10338f <memcpy+0x38>
10338d: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
10338f: 89 f0 mov %esi,%eax
103391: 89 fa mov %edi,%edx
103393: 89 4d e8 mov %ecx,-0x18(%ebp)
103396: 89 55 e4 mov %edx,-0x1c(%ebp)
103399: 89 45 e0 mov %eax,-0x20(%ebp)
"rep; movsb;"
"1:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
: "0" (n / 4), "g" (n), "1" (dst), "2" (src)
: "memory");
return dst;
10339c: 8b 45 f4 mov -0xc(%ebp),%eax
while (n -- > 0) {
*d ++ = *s ++;
}
return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
10339f: 83 c4 20 add $0x20,%esp
1033a2: 5e pop %esi
1033a3: 5f pop %edi
1033a4: 5d pop %ebp
1033a5: c3 ret
001033a6 <memcmp>:
* match in both memory blocks has a greater value in @v1 than in @v2
* as if evaluated as unsigned char values;
* - And a value less than zero indicates the opposite.
* */
int
memcmp(const void *v1, const void *v2, size_t n) {
1033a6: 55 push %ebp
1033a7: 89 e5 mov %esp,%ebp
1033a9: 83 ec 10 sub $0x10,%esp
const char *s1 = (const char *)v1;
1033ac: 8b 45 08 mov 0x8(%ebp),%eax
1033af: 89 45 fc mov %eax,-0x4(%ebp)
const char *s2 = (const char *)v2;
1033b2: 8b 45 0c mov 0xc(%ebp),%eax
1033b5: 89 45 f8 mov %eax,-0x8(%ebp)
while (n -- > 0) {
1033b8: eb 30 jmp 1033ea <memcmp+0x44>
if (*s1 != *s2) {
1033ba: 8b 45 fc mov -0x4(%ebp),%eax
1033bd: 0f b6 10 movzbl (%eax),%edx
1033c0: 8b 45 f8 mov -0x8(%ebp),%eax
1033c3: 0f b6 00 movzbl (%eax),%eax
1033c6: 38 c2 cmp %al,%dl
1033c8: 74 18 je 1033e2 <memcmp+0x3c>
return (int)((unsigned char)*s1 - (unsigned char)*s2);
1033ca: 8b 45 fc mov -0x4(%ebp),%eax
1033cd: 0f b6 00 movzbl (%eax),%eax
1033d0: 0f b6 d0 movzbl %al,%edx
1033d3: 8b 45 f8 mov -0x8(%ebp),%eax
1033d6: 0f b6 00 movzbl (%eax),%eax
1033d9: 0f b6 c0 movzbl %al,%eax
1033dc: 29 c2 sub %eax,%edx
1033de: 89 d0 mov %edx,%eax
1033e0: eb 1a jmp 1033fc <memcmp+0x56>
}
s1 ++, s2 ++;
1033e2: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1033e6: 83 45 f8 01 addl $0x1,-0x8(%ebp)
* */
int
memcmp(const void *v1, const void *v2, size_t n) {
const char *s1 = (const char *)v1;
const char *s2 = (const char *)v2;
while (n -- > 0) {
1033ea: 8b 45 10 mov 0x10(%ebp),%eax
1033ed: 8d 50 ff lea -0x1(%eax),%edx
1033f0: 89 55 10 mov %edx,0x10(%ebp)
1033f3: 85 c0 test %eax,%eax
1033f5: 75 c3 jne 1033ba <memcmp+0x14>
if (*s1 != *s2) {
return (int)((unsigned char)*s1 - (unsigned char)*s2);
}
s1 ++, s2 ++;
}
return 0;
1033f7: b8 00 00 00 00 mov $0x0,%eax
}
1033fc: c9 leave
1033fd: c3 ret
|
oeis/159/A159076.asm | neoneye/loda-programs | 11 | 91017 | <gh_stars>10-100
; A159076: A008474(n) + 2.
; Submitted by <NAME>
; 2,5,6,6,8,9,10,7,7,11,14,10,16,13,12,8,20,10,22,12,14,17,26,11,9,19,8,14,32,15,34,9,18,23,16,11,40,25,20,13,44,17,46,18,13,29,50,12,11,12,24,20,56,11,20,15,26,35,62,16,64,37,15,10,22,21,70,24,30,19,74,12,76,43
add $0,1
mov $2,2
mov $3,$0
mov $4,$0
mov $8,1
lpb $3
mov $5,$4
mov $6,0
lpb $5
add $1,2
sub $3,$8
mov $6,2
mul $6,$2
mov $7,$0
div $0,$2
mod $7,$2
cmp $7,0
sub $5,$7
lpe
add $1,$6
add $2,1
mov $7,$0
cmp $7,1
cmp $7,0
sub $3,$7
lpe
mov $0,$1
div $0,2
add $0,2
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_25.asm | ljhsiun2/medusa | 9 | 170568 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r15
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x8b1b, %rcx
nop
nop
nop
nop
nop
xor %rbx, %rbx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm6
movups %xmm6, (%rcx)
nop
nop
nop
xor %rbx, %rbx
lea addresses_A_ht+0x13d9b, %rdi
nop
nop
nop
dec %rsi
and $0xffffffffffffffc0, %rdi
movaps (%rdi), %xmm7
vpextrq $0, %xmm7, %rax
nop
dec %rbx
lea addresses_WT_ht+0xfa7b, %rsi
lea addresses_D_ht+0x11d1b, %rdi
nop
nop
nop
nop
cmp $14516, %r15
mov $5, %rcx
rep movsq
nop
nop
nop
nop
add $7337, %rbx
lea addresses_WC_ht+0x18994, %rax
xor $56767, %rbp
movw $0x6162, (%rax)
add %rbx, %rbx
lea addresses_WC_ht+0x19a1b, %rdi
nop
nop
nop
nop
cmp %rcx, %rcx
movb (%rdi), %bl
xor %r15, %r15
lea addresses_D_ht+0x1587b, %r15
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
movups %xmm4, (%r15)
nop
nop
nop
add $16034, %rbp
lea addresses_WC_ht+0x1c3fb, %r15
cmp %rcx, %rcx
movb $0x61, (%r15)
nop
nop
nop
nop
nop
xor $18227, %rsi
lea addresses_A_ht+0x7bc3, %rsi
lea addresses_WT_ht+0x9773, %rdi
nop
nop
inc %rdx
mov $31, %rcx
rep movsq
add %rbx, %rbx
lea addresses_A_ht+0x16a7b, %rsi
nop
nop
nop
nop
cmp %rbx, %rbx
mov (%rsi), %eax
nop
nop
nop
nop
nop
sub $17451, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
// Load
lea addresses_D+0xa07b, %rcx
nop
nop
nop
and %r15, %r15
vmovups (%rcx), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r11
nop
and $63037, %r11
// REPMOV
lea addresses_PSE+0x1c27b, %rsi
lea addresses_normal+0x38bb, %rdi
nop
nop
nop
xor $29139, %r8
mov $117, %rcx
rep movsb
nop
nop
xor $57476, %r12
// Load
lea addresses_PSE+0x13a7b, %rsi
nop
sub %r12, %r12
movups (%rsi), %xmm6
vpextrq $0, %xmm6, %r8
// Exception!!!
nop
mov (0), %rsi
and $40589, %r8
// Load
lea addresses_A+0x306b, %rsi
nop
nop
nop
xor %rdi, %rdi
movups (%rsi), %xmm5
vpextrq $0, %xmm5, %rcx
add %r11, %r11
// Store
lea addresses_UC+0x192d9, %rdi
nop
nop
sub %r15, %r15
movw $0x5152, (%rdi)
add %r15, %r15
// Store
lea addresses_WC+0x5b5b, %r8
nop
nop
nop
nop
and $38754, %rsi
movl $0x51525354, (%r8)
nop
nop
nop
add %rax, %rax
// Store
lea addresses_PSE+0x1ea7b, %rdi
nop
nop
and $62965, %r12
movl $0x51525354, (%rdi)
xor $49825, %rcx
// Faulty Load
lea addresses_PSE+0x1c27b, %r8
nop
and $49945, %rdi
vmovups (%r8), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r12
lea oracles, %rsi
and $0xff, %r12
shlq $12, %r12
mov (%rsi,%r12,1), %r12
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 0, 'type': 'addresses_PSE'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': True, 'size': 16, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 10, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 11}}
{'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
*/
|
kernel/loader.asm | gitter-badger/DepthOS | 0 | 89446 | <reponame>gitter-badger/DepthOS
STACK_SIZE equ 64
align 4
section .bss
ss_end:
resb STACK_SIZE ; reserve stack
ss_begin:
section .text
global _loadkernel
extern _kmain ; kmain in another file
_loadkernel:
; extern loadGRUB ; loadGRUB in another file
; call loadGRUB ; call loadGRUB function
finit ; init FPU ( math coprocessor )
mov esp, ss_begin ; use stack
; push ebx ; multiboot ptr
; push eax ; magic number
; load kernel main function
call _kmain
; halt CPU and disable interrputs
cli ; disable interrputs
hlt ; CPU halt
; section .end
|
src/el-functions-namespaces.adb | jquorning/ada-el | 6 | 5671 | -----------------------------------------------------------------------
-- el-functions-namespaces -- Namespace function mapper
-- Copyright (C) 2011 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Log.Loggers;
package body EL.Functions.Namespaces is
use Util.Log;
-- The logger
Log : constant Loggers.Logger := Loggers.Create ("EL.Functions.Namespaces");
-- ------------------------------
-- Find the function knowing its name.
-- ------------------------------
overriding
function Get_Function (Mapper : in NS_Function_Mapper;
Namespace : in String;
Name : in String) return Function_Access is
use Util.Strings.Maps;
Pos : constant Cursor := Mapper.Mapping.Find (Namespace);
begin
if Has_Element (Pos) then
return Mapper.Mapper.Get_Function (Element (Pos), Name);
end if;
raise No_Function with "Function '" & Namespace & ':' & Name & "' not found";
end Get_Function;
-- ------------------------------
-- Bind a name to a function in the given namespace.
-- ------------------------------
overriding
procedure Set_Function (Mapper : in out NS_Function_Mapper;
Namespace : in String;
Name : in String;
Func : in Function_Access) is
begin
null;
end Set_Function;
-- ------------------------------
-- Associate the <b>Prefix</b> with the givien <b>URI</b> building a new namespace.
-- ------------------------------
procedure Set_Namespace (Mapper : in out NS_Function_Mapper;
Prefix : in String;
URI : in String) is
begin
Log.Debug ("Add namespace {0}:{1}", Prefix, URI);
Mapper.Mapping.Include (Prefix, URI);
end Set_Namespace;
-- ------------------------------
-- Remove the namespace prefix binding.
-- ------------------------------
procedure Remove_Namespace (Mapper : in out NS_Function_Mapper;
Prefix : in String) is
use Util.Strings.Maps;
Pos : Cursor := Mapper.Mapping.Find (Prefix);
begin
Log.Debug ("Remove namespace {0}", Prefix);
if Has_Element (Pos) then
Mapper.Mapping.Delete (Pos);
end if;
end Remove_Namespace;
-- ------------------------------
-- Set the delegate function mapper.
-- ------------------------------
procedure Set_Function_Mapper (Mapper : in out NS_Function_Mapper;
Delegate : in Function_Mapper_Access) is
begin
Mapper.Mapper := Delegate;
end Set_Function_Mapper;
end EL.Functions.Namespaces;
|
tests/src/test_parsers.adb | onox/json-ada | 28 | 28485 | <reponame>onox/json-ada<gh_stars>10-100
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with AUnit.Assertions;
with AUnit.Test_Caller;
with JSON.Parsers;
with JSON.Streams;
with JSON.Types;
package body Test_Parsers is
package Types is new JSON.Types (Long_Integer, Long_Float);
package Parsers is new JSON.Parsers (Types, Check_Duplicate_Keys => True);
use AUnit.Assertions;
package Caller is new AUnit.Test_Caller (Test);
Test_Suite : aliased AUnit.Test_Suites.Test_Suite;
function Suite return AUnit.Test_Suites.Access_Test_Suite is
Name : constant String := "(Parsers) ";
begin
Test_Suite.Add_Test (Caller.Create (Name & "Parse text 'true'", Test_True_Text'Access));
Test_Suite.Add_Test (Caller.Create (Name & "Parse text 'false'", Test_False_Text'Access));
Test_Suite.Add_Test (Caller.Create (Name & "Parse text 'null'", Test_Null_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '""""'", Test_Empty_String_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '""test""'", Test_Non_Empty_String_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '""12.34""'", Test_Number_String_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '42'", Test_Integer_Number_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '42' as float", Test_Integer_Number_To_Float_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '3.14'", Test_Float_Number_Text'Access));
Test_Suite.Add_Test (Caller.Create (Name & "Parse text '[]'", Test_Empty_Array_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '[""test""]'", Test_One_Element_Array_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '[3.14, true]'", Test_Multiple_Elements_Array_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Iterate over '[false, ""test"", 0.271e1]'", Test_Array_Iterable'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Iterate over '{""foo"":[1, ""2""],""bar"":[0.271e1]}'",
Test_Multiple_Array_Iterable'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '{}'", Test_Empty_Object_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '{""foo"":""bar""}'", Test_One_Member_Object_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '{""foo"":1,""bar"":2}'", Test_Multiple_Members_Object_Text'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Iterate over '{""foo"":1,""bar"":2}'", Test_Object_Iterable'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '[{""foo"":[true, 42]}]'", Test_Array_Object_Array'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Parse text '{""foo"":[null, {""bar"": 42}]}'", Test_Object_Array_Object'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Test getting array from text '{}'", Test_Object_No_Array'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Test getting object from text '{}'", Test_Object_No_Object'Access));
-- Exceptions
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '[3.14""test""]'", Test_Array_No_Value_Separator_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '[true'", Test_Array_No_End_Array_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '[1]2'", Test_No_EOF_After_Array_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text ''", Test_Empty_Text_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{""foo"":1""bar"":2}'",
Test_Object_No_Value_Separator_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{""foo"",true}'", Test_Object_No_Name_Separator_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{42:true}'", Test_Object_Key_No_String_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{""foo"":true,}'", Test_Object_No_Second_Member_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{""foo"":1,""foo"":2}'",
Test_Object_Duplicate_Keys_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{""foo"":}'", Test_Object_No_Value_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{""foo"":true'", Test_Object_No_End_Object_Exception'Access));
Test_Suite.Add_Test (Caller.Create
(Name & "Reject text '{""foo"":true}[true]'", Test_No_EOF_After_Object_Exception'Access));
return Test_Suite'Access;
end Suite;
use Types;
procedure Fail (Message : String) is
begin
Assert (False, Message);
end Fail;
procedure Test_True_Text (Object : in out Test) is
Text : constant String := "true";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Boolean_Kind, "Not a boolean");
Assert (Value.Value, "Expected boolean value to be True");
end Test_True_Text;
procedure Test_False_Text (Object : in out Test) is
Text : constant String := "false";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Boolean_Kind, "Not a boolean");
Assert (not Value.Value, "Expected boolean value to be False");
end Test_False_Text;
procedure Test_Null_Text (Object : in out Test) is
Text : constant String := "null";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Null_Kind, "Not a null");
end Test_Null_Text;
procedure Test_Empty_String_Text (Object : in out Test) is
Text : constant String := """""";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = String_Kind, "Not a string");
Assert (Value.Value = "", "String value not empty");
end Test_Empty_String_Text;
procedure Test_Non_Empty_String_Text (Object : in out Test) is
Text : constant String := """test""";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = String_Kind, "Not a string");
Assert (Value.Value = "test", "String value not equal to 'test'");
end Test_Non_Empty_String_Text;
procedure Test_Number_String_Text (Object : in out Test) is
Text : constant String := """12.34""";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = String_Kind, "Not a string");
Assert (Value.Value = "12.34", "String value not equal to 12.34''");
end Test_Number_String_Text;
procedure Test_Integer_Number_Text (Object : in out Test) is
Text : constant String := "42";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Integer_Kind, "Not an integer");
Assert (Value.Value = 42, "Integer value not equal to 42");
end Test_Integer_Number_Text;
procedure Test_Integer_Number_To_Float_Text (Object : in out Test) is
Text : constant String := "42";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Integer_Kind, "Not an integer");
Assert (Value.Value = 42.0, "Integer value not equal to 42.0");
end Test_Integer_Number_To_Float_Text;
procedure Test_Float_Number_Text (Object : in out Test) is
Text : constant String := "3.14";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Float_Kind, "Not a float");
Assert (Value.Value = 3.14, "Float value not equal to 3.14");
end Test_Float_Number_Text;
procedure Test_Empty_Array_Text (Object : in out Test) is
Text : constant String := "[]";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Array_Kind, "Not an array");
Assert (Value.Length = 0, "Expected array to be empty");
end Test_Empty_Array_Text;
procedure Test_One_Element_Array_Text (Object : in out Test) is
Text : constant String := "[""test""]";
String_Value_Message : constant String := "Expected string at index 1 to be equal to 'test'";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Array_Kind, "Not an array");
Assert (Value.Length = 1, "Expected length of array to be 1, got " & Value.Length'Image);
begin
Assert (Value.Get (1).Value = "test", String_Value_Message);
exception
when Constraint_Error =>
Fail ("Could not get string value at index 1");
end;
end Test_One_Element_Array_Text;
procedure Test_Multiple_Elements_Array_Text (Object : in out Test) is
Text : constant String := "[3.14, true]";
Float_Value_Message : constant String := "Expected float at index 1 to be equal to 3.14";
Boolean_Value_Message : constant String := "Expected boolean at index 2 to be True";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Array_Kind, "Not an array");
Assert (Value.Length = 2, "Expected length of array to be 2");
begin
Assert (Value.Get (1).Value = 3.14, Float_Value_Message);
exception
when Constraint_Error =>
Fail ("Could not get float value at index 1");
end;
begin
Assert (Value.Get (2).Value, Boolean_Value_Message);
exception
when Constraint_Error =>
Fail ("Could not get boolean value at index 2");
end;
end Test_Multiple_Elements_Array_Text;
procedure Test_Array_Iterable (Object : in out Test) is
Text : constant String := "[false, ""test"", 0.271e1]";
Iterations_Message : constant String := "Unexpected number of iterations";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Array_Kind, "Not an array");
Assert (Value.Length = 3, "Expected length of array to be 3");
declare
Iterations : Natural := 0;
begin
for Element of Value loop
Iterations := Iterations + 1;
if Iterations = 1 then
Assert (Element.Kind = Boolean_Kind, "Not a boolean");
Assert (not Element.Value, "Expected boolean value to be False");
elsif Iterations = 2 then
Assert (Element.Kind = String_Kind, "Not a string");
Assert (Element.Value = "test", "Expected string value to be 'test'");
elsif Iterations = 3 then
Assert (Element.Kind = Float_Kind, "Not a float");
Assert (Element.Value = 2.71, "Expected float value to be 2.71");
end if;
end loop;
Assert (Iterations = Value.Length, Iterations_Message);
end;
end Test_Array_Iterable;
procedure Test_Multiple_Array_Iterable (Object : in out Test) is
Text : constant String := "{""foo"":[1, ""2""],""bar"":[0.271e1]}";
Iterations_Message : constant String := "Unexpected number of iterations";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Object_Kind, "Not an object");
Assert (Value.Length = 2, "Expected length of object to be 2");
declare
Iterations : Natural := 0;
begin
for Element of Value.Get ("foo") loop
Iterations := Iterations + 1;
if Iterations = 1 then
Assert (Element.Kind = Integer_Kind, "Not an integer");
Assert (Element.Value = 1, "Expected integer value to be 1");
elsif Iterations = 2 then
Assert (Element.Kind = String_Kind, "Not a string");
Assert (Element.Value = "2", "Expected string value to be '2'");
end if;
end loop;
Assert (Iterations = Value.Get ("foo").Length, Iterations_Message);
end;
declare
Iterations : Natural := 0;
begin
for Element of Value.Get ("bar") loop
Iterations := Iterations + 1;
if Iterations = 1 then
Assert (Element.Kind = Float_Kind, "Not a float");
Assert (Element.Value = 2.71, "Expected float value to be 2.71");
end if;
end loop;
Assert (Iterations = Value.Get ("bar").Length, Iterations_Message);
end;
end Test_Multiple_Array_Iterable;
procedure Test_Empty_Object_Text (Object : in out Test) is
Text : constant String := "{}";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Object_Kind, "Not an object");
Assert (Value.Length = 0, "Expected object to be empty");
end Test_Empty_Object_Text;
procedure Test_One_Member_Object_Text (Object : in out Test) is
Text : constant String := "{""foo"":""bar""}";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Object_Kind, "Not an object");
Assert (Value.Length = 1, "Expected length of object to be 1");
Assert (Value.Get ("foo").Value = "bar", "Expected string value of 'foo' to be 'bar'");
end Test_One_Member_Object_Text;
procedure Test_Multiple_Members_Object_Text (Object : in out Test) is
Text : constant String := "{""foo"":1,""bar"":2}";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Object_Kind, "Not an object");
Assert (Value.Length = 2, "Expected length of object to be 2");
Assert (Value.Get ("foo").Value = 1, "Expected integer value of 'foo' to be 1");
Assert (Value.Get ("bar").Value = 2, "Expected integer value of 'bar' to be 2");
end Test_Multiple_Members_Object_Text;
procedure Test_Object_Iterable (Object : in out Test) is
Text : constant String := "{""foo"":1,""bar"":2}";
Iterations_Message : constant String := "Unexpected number of iterations";
All_Keys_Message : constant String := "Did not iterate over all expected keys";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Object_Kind, "Not an object");
Assert (Value.Length = 2, "Expected length of object to be 2");
declare
Iterations : Natural := 0;
Retrieved_Foo : Boolean := False;
Retrieved_Bar : Boolean := False;
begin
for Key of Value loop
Iterations := Iterations + 1;
if Iterations in 1 .. 2 then
Assert (Key.Kind = String_Kind, "Not String");
Assert (Key.Value in "foo" | "bar",
"Expected string value to be equal to 'foo' or 'bar'");
Retrieved_Foo := Retrieved_Foo or Key.Value = "foo";
Retrieved_Bar := Retrieved_Bar or Key.Value = "bar";
end if;
end loop;
Assert (Iterations = Value.Length, Iterations_Message);
Assert (Retrieved_Foo and Retrieved_Bar, All_Keys_Message);
end;
end Test_Object_Iterable;
procedure Test_Array_Object_Array (Object : in out Test) is
Text : constant String := "[{""foo"":[true, 42]}]";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Array_Kind, "Not an array");
Assert (Value.Length = 1, "Expected length of array to be 1");
begin
declare
Object : constant JSON_Value := Value.Get (1);
begin
Assert (Object.Length = 1, "Expected length of object to be 1");
declare
Array_Value : constant JSON_Value := Object.Get ("foo");
begin
Assert (Array_Value.Length = 2, "Expected length of array 'foo' to be 2");
Assert (Array_Value.Get (2).Value = 42,
"Expected integer value at index 2 to be 42");
end;
exception
when Constraint_Error =>
Fail ("Value of 'foo' not an array");
end;
exception
when Constraint_Error =>
Fail ("First element in array not an object");
end;
end Test_Array_Object_Array;
procedure Test_Object_Array_Object (Object : in out Test) is
Text : constant String := "{""foo"":[null, {""bar"": 42}]}";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
Assert (Value.Kind = Object_Kind, "Not an object");
Assert (Value.Length = 1, "Expected length of object to be 1");
begin
declare
Array_Value : constant JSON_Value := Value.Get ("foo");
begin
Assert (Array_Value.Length = 2, "Expected length of array 'foo' to be 2");
declare
Object : constant JSON_Value := Array_Value.Get (2);
begin
Assert (Object.Length = 1, "Expected length of object to be 1");
declare
Integer_Value : constant JSON_Value := Object.Get ("bar");
begin
Assert (Integer_Value.Value = 42, "Expected integer value of 'bar' to be 42");
end;
exception
when Constraint_Error =>
Fail ("Element 'bar' in object not an integer");
end;
exception
when Constraint_Error =>
Fail ("Value of index 2 not an object");
end;
exception
when Constraint_Error =>
Fail ("Element 'foo' in object not an array");
end;
end Test_Object_Array_Object;
procedure Test_Object_No_Array (Object : in out Test) is
Text : constant String := "{}";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
begin
declare
Object : JSON_Value := Value.Get ("foo");
pragma Unreferenced (Object);
begin
Fail ("Expected Constraint_Error");
end;
exception
when Constraint_Error =>
null;
end;
begin
declare
Object : constant JSON_Value := Value.Get_Array_Or_Empty ("foo");
begin
Assert (Object.Length = 0, "Expected empty array");
end;
exception
when Constraint_Error =>
Fail ("Unexpected Constraint_Error");
end;
end Test_Object_No_Array;
procedure Test_Object_No_Object (Object : in out Test) is
Text : constant String := "{}";
Parser : Parsers.Parser := Parsers.Create (Text);
Value : constant JSON_Value := Parser.Parse;
begin
begin
declare
Object : JSON_Value := Value.Get ("foo");
pragma Unreferenced (Object);
begin
Fail ("Expected Constraint_Error");
end;
exception
when Constraint_Error =>
null;
end;
begin
declare
Object : constant JSON_Value := Value.Get_Object_Or_Empty ("foo");
begin
Assert (Object.Length = 0, "Expected empty object");
end;
exception
when Constraint_Error =>
Fail ("Unexpected Constraint_Error");
end;
end Test_Object_No_Object;
procedure Test_Empty_Text_Exception (Object : in out Test) is
Text : constant String := "";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Empty_Text_Exception;
procedure Test_Array_No_Value_Separator_Exception (Object : in out Test) is
Text : constant String := "[3.14""test""]";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Array_No_Value_Separator_Exception;
procedure Test_Array_No_End_Array_Exception (Object : in out Test) is
Text : constant String := "[true";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Array_No_End_Array_Exception;
procedure Test_No_EOF_After_Array_Exception (Object : in out Test) is
Text : constant String := "[1]2";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_No_EOF_After_Array_Exception;
procedure Test_Object_No_Value_Separator_Exception (Object : in out Test) is
Text : constant String := "{""foo"":1""bar"":2}";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Object_No_Value_Separator_Exception;
procedure Test_Object_No_Name_Separator_Exception (Object : in out Test) is
Text : constant String := "{""foo"",true}";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Object_No_Name_Separator_Exception;
procedure Test_Object_Key_No_String_Exception (Object : in out Test) is
Text : constant String := "{42:true}";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Object_Key_No_String_Exception;
procedure Test_Object_No_Second_Member_Exception (Object : in out Test) is
Text : constant String := "{""foo"":true,}";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Object_No_Second_Member_Exception;
procedure Test_Object_Duplicate_Keys_Exception (Object : in out Test) is
Text : constant String := "{""foo"":1,""foo"":2}";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Constraint_Error");
end;
exception
when Constraint_Error =>
null;
end Test_Object_Duplicate_Keys_Exception;
procedure Test_Object_No_Value_Exception (Object : in out Test) is
Text : constant String := "{""foo"":}";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Object_No_Value_Exception;
procedure Test_Object_No_End_Object_Exception (Object : in out Test) is
Text : constant String := "{""foo"":true";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_Object_No_End_Object_Exception;
procedure Test_No_EOF_After_Object_Exception (Object : in out Test) is
Text : constant String := "{""foo"":true}[true]";
Parser : Parsers.Parser := Parsers.Create (Text);
begin
declare
Value : JSON_Value := Parser.Parse;
pragma Unreferenced (Value);
begin
Fail ("Expected Parse_Error");
end;
exception
when Parsers.Parse_Error =>
null;
end Test_No_EOF_After_Object_Exception;
end Test_Parsers;
|
agda/Cardinality/Finite/ManifestBishop/Isomorphism.agda | oisdk/combinatorics-paper | 4 | 8505 | {-# OPTIONS --cubical --safe #-}
module Cardinality.Finite.ManifestBishop.Isomorphism where
open import Prelude
open import Data.Fin
open import Data.Fin.Properties
open import Container.List.Isomorphism
import Cardinality.Finite.ManifestBishop.Inductive as 𝕃
import Cardinality.Finite.ManifestBishop.Container as ℒ
open import Cardinality.Finite.SplitEnumerable.Isomorphism
open import Data.Nat.Properties
∈!ℒ⇒∈!𝕃 : ∀ (x : A) l (xs : Fin l → A) → x ℒ.∈! (l , xs) → x 𝕃.∈! ℒ→𝕃 (l , xs)
∈!ℒ⇒∈!𝕃 x (suc l) xs ((f0 , p) , u) = (f0 , p) , lemma
where
lemma : (y : x 𝕃.∈ ℒ→𝕃 (suc l , xs)) → (f0 , p) ≡ y
lemma (f0 , q) = cong (∈ℒ⇒∈𝕃 x (suc l , xs)) (u (f0 , q))
lemma (fs m , q) =
let o , r = subst (x ℒ.∈_) (ℒ→𝕃→ℒ l (xs ∘ fs)) (m , q)
in ⊥-elim (znots (cong (FinToℕ ∘ fst) (u (fs o , r))))
∈!ℒ⇒∈!𝕃 x (suc l) xs ((fs n , p) , u) = 𝕃.push! xs0≢x (∈!ℒ⇒∈!𝕃 x l (xs ∘ fs) ((n , p) , uxss))
where
xs0≢x : xs f0 ≢ x
xs0≢x xs0≡x = snotz (cong (FinToℕ ∘ fst) (u (f0 , xs0≡x)))
uxss : (y : x ℒ.∈ (l , xs ∘ fs)) → (n , p) ≡ y
uxss (m , q) = cong (λ { (f0 , q) → ⊥-elim (xs0≢x q) ; (fs m , q) → m , q}) (u (fs m , q))
𝕃⇔ℒ⟨ℬ⟩ : 𝕃.ℬ A ⇔ ℒ.ℬ A
𝕃⇔ℒ⟨ℬ⟩ .fun (sup , cov) = 𝕃→ℒ sup , cov
𝕃⇔ℒ⟨ℬ⟩ .inv ((l , xs) , cov) = ℒ→𝕃 (l , xs) , λ x → ∈!ℒ⇒∈!𝕃 x l xs (cov x)
𝕃⇔ℒ⟨ℬ⟩ .rightInv (sup , cov) i .fst = 𝕃⇔ℒ .rightInv sup i
𝕃⇔ℒ⟨ℬ⟩ .rightInv ((l , xs) , cov) i .snd x =
J
(λ ys ys≡ → (zs : x ℒ.∈! ys) → PathP (λ i → x ℒ.∈! sym ys≡ i) zs (cov x))
(λ _ → isPropIsContr _ _)
(sym (ℒ→𝕃→ℒ l xs))
(∈!ℒ⇒∈!𝕃 x l xs (cov x))
i
𝕃⇔ℒ⟨ℬ⟩ .leftInv (sup , cov) i .fst = 𝕃⇔ℒ .leftInv sup i
𝕃⇔ℒ⟨ℬ⟩ .leftInv (sup , cov) i .snd x =
J
(λ ys ys≡ → (zs : x 𝕃.∈! ys) → PathP (λ i → x 𝕃.∈! sym ys≡ i) zs (cov x))
(λ zs → isPropIsContr _ _)
(sym (𝕃→ℒ→𝕃 sup))
(∈!ℒ⇒∈!𝕃 x (𝕃.length sup) (sup 𝕃.!_) (cov x))
i
|
gramado/shell/tests/asmtest/appasm.asm | RC0D3/gramado | 5 | 85901 |
;[org 0x400000]
[bits 32]
;;alinhamento do entrypoint
;;não precisa o linker faz isso
;;times 0x1000 db 0
;;======================
segment .text
;; entry point
app_main:
jmp afterLibs
;;lib
%include "asm.inc"
afterLibs:
mov al, 4
call print_spaces
xor eax, eax
mov al, 0xf1
call print_hex
mov al, 4
call print_spaces
mov eax, 0xDEADBEAF
call print_hex
mov al, 4
call print_spaces
mov esi, string1
call DisplayMessage
mov eax, 0
mov ebx, 0
call asm_set_cursor
mov esi, string2
call DisplayMessage
mov eax, 10
mov ebx, 10
call asm_set_cursor
mov esi, string3
call DisplayMessage
mov eax, 20
mov ebx, 20
call asm_set_cursor
mov esi, string4
call DisplayMessage
hang9:
pause
;#todo call exit
jmp hang9
jmp $
string1 db "First app in assembly 32bit!", 13, 10, 0
string2 db "String 2", 13, 10, 0
string3 db "String 3", 13, 10, 0
string4 db "String 4", 13, 10, 0
;;======================
segment .data
testdata: dd 0
;;======================
segment .bss
;;testbss: dd 0 |
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_netbuffer_gstnetbuffer_h.ads | persan/A-gst | 1 | 6536 | pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
with glib;
with glib.Values;
with System;
with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h;
with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h;
with glib;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_netbuffer_gstnetbuffer_h is
-- unsupported macro: GST_TYPE_NETBUFFER (gst_netbuffer_get_type())
-- arg-macro: function GST_IS_NETBUFFER (obj)
-- return G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NETBUFFER);
-- arg-macro: function GST_IS_NETBUFFER_CLASS (klass)
-- return G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_NETBUFFER);
-- arg-macro: function GST_NETBUFFER_GET_CLASS (obj)
-- return G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_NETBUFFER, GstNetBufferClass);
-- arg-macro: function GST_NETBUFFER (obj)
-- return G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NETBUFFER, GstNetBuffer);
-- arg-macro: function GST_NETBUFFER_CLASS (klass)
-- return G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_NETBUFFER, GstNetBufferClass);
GST_NETADDRESS_MAX_LEN : constant := 64; -- gst/netbuffer/gstnetbuffer.h:60
-- GStreamer
-- * Copyright (C) <2005> <NAME> <<EMAIL>>
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the
-- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- * Boston, MA 02111-1307, USA.
--
type GstNetBuffer;
type u_GstNetBuffer_u_gst_reserved_array is array (0 .. 3) of System.Address;
--subtype GstNetBuffer is u_GstNetBuffer; -- gst/netbuffer/gstnetbuffer.h:27
type GstNetBufferClass;
type u_GstNetBufferClass_u_gst_reserved_array is array (0 .. 3) of System.Address;
--subtype GstNetBufferClass is u_GstNetBufferClass; -- gst/netbuffer/gstnetbuffer.h:28
type GstNetAddress;
type u_GstNetAddress_ip6_array is array (0 .. 15) of aliased GLIB.guint8;
type anon_325 (discr : unsigned := 0) is record
case discr is
when 0 =>
ip6 : aliased u_GstNetAddress_ip6_array; -- gst/netbuffer/gstnetbuffer.h:71
when others =>
ip4 : aliased GLIB.guint32; -- gst/netbuffer/gstnetbuffer.h:72
end case;
end record;
pragma Convention (C_Pass_By_Copy, anon_325);
pragma Unchecked_Union (anon_325);type u_GstNetAddress_u_gst_reserved_array is array (0 .. 3) of System.Address;
--subtype GstNetAddress is u_GstNetAddress; -- gst/netbuffer/gstnetbuffer.h:29
--*
-- * GstNetType:
-- * @GST_NET_TYPE_UNKNOWN: unknown address type
-- * @GST_NET_TYPE_IP4: an IPv4 address type
-- * @GST_NET_TYPE_IP6: and IPv6 address type
-- *
-- * The Address type used in #GstNetAddress.
--
type GstNetType is
(GST_NET_TYPE_UNKNOWN,
GST_NET_TYPE_IP4,
GST_NET_TYPE_IP6);
pragma Convention (C, GstNetType); -- gst/netbuffer/gstnetbuffer.h:50
--*
-- * GST_NETADDRESS_MAX_LEN:
-- *
-- * The maximum length of a string representation of a GstNetAddress as produced
-- * by gst_netaddress_to_string().
-- *
-- * Since: 0.10.24
--
--*
-- * GstNetAddress:
-- *
-- * An opaque network address as used in #GstNetBuffer.
--
--< private >
type GstNetAddress is record
c_type : aliased GstNetType; -- gst/netbuffer/gstnetbuffer.h:69
address : aliased anon_325; -- gst/netbuffer/gstnetbuffer.h:73
port : aliased GLIB.guint16; -- gst/netbuffer/gstnetbuffer.h:74
u_gst_reserved : u_GstNetAddress_u_gst_reserved_array; -- gst/netbuffer/gstnetbuffer.h:76
end record;
pragma Convention (C_Pass_By_Copy, GstNetAddress); -- gst/netbuffer/gstnetbuffer.h:67
--< private >
--*
-- * GstNetBuffer:
-- * @buffer: the parent #GstBuffer
-- * @from: the address where this buffer came from.
-- * @to: the address where this buffer should go to.
-- *
-- * buffer for use in network sources and sinks.
-- * It contains the source or destination address of the buffer.
--
type GstNetBuffer is record
buffer : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/netbuffer/gstnetbuffer.h:89
from : aliased GstNetAddress; -- gst/netbuffer/gstnetbuffer.h:91
to : aliased GstNetAddress; -- gst/netbuffer/gstnetbuffer.h:92
u_gst_reserved : u_GstNetBuffer_u_gst_reserved_array; -- gst/netbuffer/gstnetbuffer.h:95
end record;
pragma Convention (C_Pass_By_Copy, GstNetBuffer); -- gst/netbuffer/gstnetbuffer.h:88
--< private >
type GstNetBufferClass is record
buffer_class : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBufferClass; -- gst/netbuffer/gstnetbuffer.h:99
u_gst_reserved : u_GstNetBufferClass_u_gst_reserved_array; -- gst/netbuffer/gstnetbuffer.h:102
end record;
pragma Convention (C_Pass_By_Copy, GstNetBufferClass); -- gst/netbuffer/gstnetbuffer.h:98
--< private >
-- creating buffers
function gst_netbuffer_get_type return GLIB.GType; -- gst/netbuffer/gstnetbuffer.h:106
pragma Import (C, gst_netbuffer_get_type, "gst_netbuffer_get_type");
function gst_netbuffer_new return access GstNetBuffer; -- gst/netbuffer/gstnetbuffer.h:108
pragma Import (C, gst_netbuffer_new, "gst_netbuffer_new");
-- address operations
procedure gst_netaddress_set_ip4_address
(naddr : access GstNetAddress;
address : GLIB.guint32;
port : GLIB.guint16); -- gst/netbuffer/gstnetbuffer.h:111
pragma Import (C, gst_netaddress_set_ip4_address, "gst_netaddress_set_ip4_address");
procedure gst_netaddress_set_ip6_address
(naddr : access GstNetAddress;
address : access GLIB.guint8;
port : GLIB.guint16); -- gst/netbuffer/gstnetbuffer.h:112
pragma Import (C, gst_netaddress_set_ip6_address, "gst_netaddress_set_ip6_address");
function gst_netaddress_set_address_bytes
(naddr : access GstNetAddress;
c_type : GstNetType;
address : access GLIB.guint8;
port : GLIB.guint16) return GLIB.gint; -- gst/netbuffer/gstnetbuffer.h:113
pragma Import (C, gst_netaddress_set_address_bytes, "gst_netaddress_set_address_bytes");
function gst_netaddress_get_net_type (naddr : access constant GstNetAddress) return GstNetType; -- gst/netbuffer/gstnetbuffer.h:116
pragma Import (C, gst_netaddress_get_net_type, "gst_netaddress_get_net_type");
function gst_netaddress_get_ip4_address
(naddr : access constant GstNetAddress;
address : access GLIB.guint32;
port : access GLIB.guint16) return GLIB.gboolean; -- gst/netbuffer/gstnetbuffer.h:117
pragma Import (C, gst_netaddress_get_ip4_address, "gst_netaddress_get_ip4_address");
function gst_netaddress_get_ip6_address
(naddr : access constant GstNetAddress;
address : access GLIB.guint8;
port : access GLIB.guint16) return GLIB.gboolean; -- gst/netbuffer/gstnetbuffer.h:118
pragma Import (C, gst_netaddress_get_ip6_address, "gst_netaddress_get_ip6_address");
function gst_netaddress_get_address_bytes
(naddr : access constant GstNetAddress;
address : access GLIB.guint8;
port : access GLIB.guint16) return GLIB.gint; -- gst/netbuffer/gstnetbuffer.h:119
pragma Import (C, gst_netaddress_get_address_bytes, "gst_netaddress_get_address_bytes");
function gst_netaddress_equal (naddr1 : access constant GstNetAddress; naddr2 : access constant GstNetAddress) return GLIB.gboolean; -- gst/netbuffer/gstnetbuffer.h:121
pragma Import (C, gst_netaddress_equal, "gst_netaddress_equal");
function gst_netaddress_to_string
(naddr : access constant GstNetAddress;
dest : access GLIB.gchar;
len : GLIB.gulong) return GLIB.gint; -- gst/netbuffer/gstnetbuffer.h:124
pragma Import (C, gst_netaddress_to_string, "gst_netaddress_to_string");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_netbuffer_gstnetbuffer_h;
|
pkgs/tools/yasm/src/modules/parsers/gas/tests/bin/gas-llabel.asm | manggoguy/parsec-modified | 2,151 | 22541 | <gh_stars>1000+
# Skelix by <NAME> (<EMAIL>)
# Licence: GPLv2
.text
#.globl start
.code16
start:
jmp code
msg:
.string "Hello World!\x0"
code:
movw $0xb800,%ax
movw %ax, %es
xorw %ax, %ax
movw %ax, %ds
movw $msg, %si
xorw %di, %di
cld
movb $0x07, %al
1:
cmpw $0, (%si)
je 1f
movsb
stosb
jmp 1b
1: jmp 1b
.org 0x1fe, 0x90
.word 0xaa55
|
oeis/060/A060928.asm | neoneye/loda-programs | 11 | 91127 | ; A060928: Expansion of 1/(1 - 5*x - 4*x^3).
; Submitted by <NAME>
; 1,5,25,129,665,3425,17641,90865,468025,2410689,12416905,63956625,329425881,1696797025,8739811625,45016761649,231870996345,1194314228225,6151638187721,31685674923985,163205631532825,840634710415009,4329916251770985,22302403784986225,114874557766591161,591692453840039745,3047671884340143625,15697857652767082769,80856058079195572825,416470977933338438625,2145146320277760524201,11049155833705584912305,56911663080261278316025,293138900682417433676929,1509891126746909508033865
mov $1,1
lpb $0
sub $0,1
mul $1,2
add $2,2
mul $2,2
add $3,$1
add $3,$1
add $1,$2
add $2,$3
lpe
mov $0,$2
div $0,2
add $0,1
|
Transynther/x86/_processed/NC/_st_zr_sm_/i9-9900K_12_0xca_notsx.log_21829_583.asm | ljhsiun2/medusa | 9 | 102120 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x7efd, %rsi
lea addresses_normal_ht+0x6491, %rdi
nop
nop
dec %rbp
mov $57, %rcx
rep movsw
nop
nop
nop
cmp %rax, %rax
lea addresses_UC_ht+0x1de9, %rcx
nop
nop
nop
sub %r8, %r8
movw $0x6162, (%rcx)
nop
nop
xor $23138, %rax
lea addresses_normal_ht+0xdc99, %rsi
lea addresses_UC_ht+0xe769, %rdi
xor %rax, %rax
mov $50, %rcx
rep movsq
nop
nop
sub $64050, %rax
lea addresses_D_ht+0xa969, %rcx
nop
xor %r10, %r10
mov (%rcx), %r8w
nop
nop
nop
nop
nop
dec %r10
lea addresses_A_ht+0xb861, %rax
and %r10, %r10
mov (%rax), %edi
xor $41258, %r8
lea addresses_normal_ht+0x6af9, %rcx
clflush (%rcx)
nop
nop
add %r10, %r10
movb (%rcx), %al
nop
nop
nop
sub %r8, %r8
lea addresses_normal_ht+0x47e9, %r10
nop
nop
xor $10489, %r8
movb (%r10), %al
nop
nop
nop
nop
add %r8, %r8
lea addresses_WT_ht+0x15c69, %r10
nop
nop
nop
nop
and $4884, %rcx
movb $0x61, (%r10)
nop
nop
nop
nop
nop
sub %rbp, %rbp
lea addresses_WT_ht+0x172e9, %rax
nop
nop
and $52911, %rbp
movb (%rax), %r8b
add $51838, %r10
lea addresses_WT_ht+0x6635, %rsi
lea addresses_WT_ht+0x13869, %rdi
and $53317, %r15
mov $122, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp %r10, %r10
lea addresses_WT_ht+0xd9d5, %r10
clflush (%r10)
nop
nop
nop
nop
nop
and $45971, %rax
vmovups (%r10), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %rdi
nop
sub %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %rax
push %rbp
push %rcx
push %rdx
// Store
mov $0x6bb1090000000369, %rdx
nop
nop
nop
sub $32462, %r13
movl $0x51525354, (%rdx)
nop
nop
nop
dec %rdx
// Faulty Load
mov $0x6bb1090000000369, %rbp
nop
cmp %rcx, %rcx
mov (%rbp), %ax
lea oracles, %rdx
and $0xff, %rax
shlq $12, %rax
mov (%rdx,%rax,1), %rax
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 2}}
{'00': 9255, '54': 12574}
00 00 00 54 00 00 00 54 54 54 54 54 54 54 54 54 54 54 00 54 00 54 54 00 00 54 54 54 54 54 54 54 00 00 54 54 54 54 54 00 54 54 00 54 54 00 54 54 54 00 54 00 54 54 54 00 54 54 54 00 54 54 54 54 00 00 54 54 54 00 00 54 54 54 00 00 54 54 00 54 00 54 00 54 54 00 00 00 00 54 54 00 00 00 54 54 54 54 00 00 54 00 54 54 54 54 54 00 00 54 54 54 54 54 54 54 54 54 54 54 54 54 00 00 54 00 54 00 54 00 00 00 00 00 00 00 54 00 00 00 00 00 54 00 54 54 54 00 00 00 00 00 54 00 00 54 00 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 00 00 54 54 54 54 54 00 00 54 54 00 00 00 00 00 00 00 00 54 00 00 54 00 54 00 54 00 00 00 00 00 54 54 54 54 00 54 00 00 54 54 54 54 00 54 54 54 00 54 54 54 00 00 54 54 00 54 00 54 00 00 54 00 00 54 54 00 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 00 54 54 54 54 54 54 54 00 00 54 54 54 54 00 00 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 00 54 00 54 54 54 54 54 54 54 00 54 00 00 54 54 54 54 54 54 00 54 54 00 54 00 00 54 54 54 54 54 54 54 54 54 54 54 00 00 54 00 54 54 54 54 54 00 54 54 54 54 54 00 00 54 54 54 54 00 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 00 54 54 54 54 54 54 00 54 54 54 00 54 00 00 00 54 00 00 54 54 54 54 54 00 00 54 54 54 00 00 54 54 54 54 00 54 54 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 54 54 54 54 54 00 54 54 00 54 00 00 54 54 54 00 00 00 54 00 54 00 54 00 00 00 54 00 00 54 00 54 54 54 54 00 00 00 54 54 00 54 54 00 00 54 00 00 54 00 00 00 54 00 54 00 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 00 54 54 54 54 54 00 54 00 00 54 54 54 54 00 54 54 54 00 00 54 00 54 54 00 00 54 54 00 00 54 54 54 00 54 54 00 00 00 54 00 00 00 00 54 00 00 00 00 00 54 00 00 00 00 54 00 00 54 00 00 00 00 54 00 00 54 54 00 00 00 54 00 54 00 54 00 00 54 00 00 54 54 54 54 54 54 54 00 54 00 00 54 54 00 54 54 54 54 54 54 00 54 54 54 00 00 54 54 54 54 54 00 00 54 00 00 54 00 54 54 54 54 54 00 00 00 54 00 00 00 00 00 00 54 00 54 54 00 00 00 54 00 00 00 54 54 54 00 00 54 00 00 54 54 00 00 54 00 54 54 00 00 54 54 54 54 54 54 54 00 00 54 00 00 54 54 54 54 54 54 54 54 00 54 00 54 54 00 54 54 54 54 00 00 54 54 00 54 54 54 00 54 54 00 54 54 54 54 00 00 54 54 00 00 54 54 54 00 54 54 54 00 00 54 00 54 54 00 54 54 00 00 54 54 54 00 54 54 54 54 54 00 54 54 00 54 54 54 54 00 54 00 54 54 54 00 00 54 00 00 00 54 54 54 54 54 00 00 54 00 00 00 54 54 00 00 00 54 54 54 00 00 54 54 54 00 54 54 54 00 54 00 54 00 54 00 00 00 54 00 00 54 00 00 00 00 54 00 54 00 00 00 00 00 00 00 00 00 00 00 54 00 54 54 54 54 54 00 54 00 54 00 54 00 54 54 54 54 54 00 54 00 00 00 00 00 00 00 00 54 00 54 00 00 54 00 00 00 54 00 00 00 00 00 00 00 00 00 54 00 00 54 00 00 00 00 54 54 54 00 00 00 54 54 00 54 00 00 54 54 54 54 54 54 54 54 00 00 00 00 00 00 00 00 00 00 54 54 54 54 54 54 00 00 54 54 00 00 54 00 00 00 54 54 54 00 00 54 00 00 00 00 00 00 54 54 54 54 00 00 54 54 00 00 00 00 54 00 00 00 54 00 54 00 54 00 00 54 54 00 00 00 54 00 00 54 00 00 00 00 54 54 54 54
*/
|
libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/puts_unlocked.asm | jpoikela/z88dk | 640 | 84147 |
; int puts_unlocked(const char *s)
SECTION code_clib
SECTION code_stdio
PUBLIC _puts_unlocked
EXTERN _puts_unlocked_fastcall
_puts_unlocked:
pop af
pop hl
push hl
push af
jp _puts_unlocked_fastcall
|
src/L/Base/Core.agda | borszag/smallib | 0 | 7635 | module L.Base.Core where
-- Reexport all of the Cores
open import L.Base.Sigma.Core public
open import L.Base.Coproduct.Core public
open import L.Base.Empty.Core public
open import L.Base.Unit.Core public
open import L.Base.Nat.Core public
open import L.Base.Id.Core public
|
libsrc/_DEVELOPMENT/adt/p_forward_list/c/sdcc_iy/p_forward_list_remove_after_fastcall.asm | meesokim/z88dk | 0 | 245181 |
; void *p_forward_list_remove_after_fastcall(void *list_item)
SECTION code_adt_p_forward_list
PUBLIC _p_forward_list_remove_after_fastcall
_p_forward_list_remove_after_fastcall:
INCLUDE "adt/p_forward_list/z80/asm_p_forward_list_remove_after.asm"
|
src/hott/truncation/equality.agda | pcapriotti/agda-base | 20 | 17083 | {-# OPTIONS --without-K #-}
module hott.truncation.equality where
open import sum
open import equality
open import function.extensionality
open import function.isomorphism
open import function.overloading
open import sets.nat
open import hott.equivalence
open import hott.level.core
open import hott.level.closure
open import hott.truncation.core
module _ {i}{X : Set i}(n-1 : ℕ) where
private
n : ℕ
n = suc n-1
Trunc-dep-iso₂ : ∀ {j} (Z : Trunc n X → Trunc n X → Set j)
→ ((c c' : Trunc n X) → h n (Z c c'))
→ ((c c' : Trunc n X) → Z c c')
≅ ((x y : X) → Z [ x ] [ y ])
Trunc-dep-iso₂ Z hZ = begin
((c c' : Trunc n X) → Z c c')
≅⟨ (Π-ap-iso refl≅ λ c → Trunc-dep-iso n (Z c) (hZ c)) ⟩
((c : Trunc n X)(y : X) → Z c [ y ])
≅⟨ Trunc-dep-iso n (λ c → (y : X) → Z c [ y ]) (λ c → Π-level λ y → hZ c [ y ]) ⟩
((x y : X) → Z [ x ] [ y ])
∎
where open ≅-Reasoning
P₀ : X → X → Type i (n-1)
P₀ x y = Trunc (n-1) (x ≡ y) , Trunc-level n-1
abstract
r₀ : (x : X) → proj₁ (P₀ x x)
r₀ x = [ refl ]
abstract
P-iso' : (Trunc n X → Trunc n X → Type i (n-1))
≅ (X → X → Type i (n-1))
P-iso' = Trunc-dep-iso₂ (λ _ _ → Type i (n-1))
(λ _ _ → type-level)
P-iso-we : weak-equiv (λ (Z : Trunc n X → Trunc n X → Type i (n-1)) x y → Z [ x ] [ y ])
P-iso-we = proj₂ (≅⇒≈ P-iso')
P-iso : (Trunc n X → Trunc n X → Type i (n-1))
≅ (X → X → Type i (n-1))
P-iso = ≈⇒≅ ((λ Z x y → Z [ x ] [ y ]) , P-iso-we)
module impl (P : Trunc n X → Trunc n X → Type i (n-1))
(P-β : (x y : X) → P [ x ] [ y ] ≡ P₀ x y) where
r' : (P : Trunc n X → Trunc n X → Type i (n-1))
→ (∀ x y → P [ x ] [ y ] ≡ P₀ x y)
→ (c : Trunc n X) → proj₁ (P c c)
r' P q = Trunc-dep-elim n (λ c → proj₁ (P c c))
(λ c → h↑ (proj₂ (P c c)))
λ x → subst proj₁ (sym (q x x)) (r₀ x)
r : (c : Trunc n X) → proj₁ (P c c)
r = r' P P-β
abstract
P-elim-iso : (Z : Trunc n X → Trunc n X → Type i (n-1))
→ ((c c' : Trunc n X) → proj₁ (P c c') → proj₁ (Z c c'))
≅ ((c : Trunc n X) → proj₁ (Z c c))
P-elim-iso Z = begin
((c c' : Trunc n X) → proj₁ (P c c') → proj₁ (Z c c'))
≅⟨ Trunc-dep-iso₂ (λ c c' → proj₁ (P c c') → proj₁ (Z c c'))
(λ c c' → Π-level λ p → h↑ (proj₂ (Z c c'))) ⟩
((x y : X) → proj₁ (P [ x ] [ y ]) → proj₁ (Z [ x ] [ y ]))
≅⟨ ( Π-ap-iso refl≅ λ x
→ Π-ap-iso refl≅ λ y
→ Π-ap-iso (≡⇒≅ (ap proj₁ (P-β x y))) λ _
→ refl≅ ) ⟩
((x y : X) → Trunc (n-1) (x ≡ y) → proj₁ (Z [ x ] [ y ]))
≅⟨ ( Π-ap-iso refl≅ λ x
→ Π-ap-iso refl≅ λ y
→ Trunc-elim-iso (n-1) (x ≡ y) _ (proj₂ (Z [ x ] [ y ])) ) ⟩
((x y : X) → x ≡ y → proj₁ (Z [ x ] [ y ]))
≅⟨ ( Π-ap-iso refl≅ λ x → sym≅ J-iso ) ⟩
((x : X) → proj₁ (Z [ x ] [ x ]))
≅⟨ sym≅ (Trunc-dep-iso n (λ c → proj₁ (Z c c)) (λ c → h↑ (proj₂ (Z c c)))) ⟩
((c : Trunc n X) → proj₁ (Z c c))
∎
where open ≅-Reasoning
Eq : Trunc n X → Trunc n X → Type i (n-1)
Eq c c' = (c ≡ c') , Trunc-level n c c'
abstract
f₀ : (c c' : Trunc n X) → proj₁ (P c c') → c ≡ c'
f₀ = _≅_.from (P-elim-iso Eq) (λ _ → refl)
abstract
f : (c c' : Trunc n X) → proj₁ (P c c') → c ≡ c'
f c c' p = f₀ c c' p · sym (f₀ c' c' (r c'))
f-β : (c : Trunc n X) → f c c (r c) ≡ refl
f-β c = left-inverse (f₀ c c (r c))
g : (c c' : Trunc n X) → c ≡ c' → proj₁ (P c c')
g c .c refl = r c
-- α : (c c' : Trunc n X)(p : proj₁ (P c c')) → g c c' (f c c' p) ≡ p
-- α = _≅_.from (P-elim-dep-iso Z) λ c → ap (g c c) (f-β c)
-- where
-- Z : (c c' : Trunc n X) → proj₁ (P c c') → Type i (n-1)
-- Z c c' p = (g c c' (f c c' p) ≡ p) , h↑ (proj₂ (P c c')) _ _
β : (c c' : Trunc n X)(q : c ≡ c') → f c c' (g c c' q) ≡ q
β c .c refl = f-β c
trunc-equality : {x y : X} → _≡_ {A = Trunc n X} [ x ] [ y ] → Trunc (n-1) (x ≡ y)
trunc-equality {x}{y} p = subst (λ Z → Z) (ap proj₁ (P-β x y)) (g [ x ] [ y ] p)
P : Trunc n X → Trunc n X → Type i (n-1)
P = _≅_.from P-iso P₀
P-β' : (λ x y → P [ x ] [ y ]) ≡ P₀
P-β' = _≅_.iso₂ P-iso P₀
P-β : (x y : X) → P [ x ] [ y ] ≡ P₀ x y
P-β x y = funext-inv (funext-inv P-β' x) y
open impl P P-β using (trunc-equality) public
|
sound.asm | raphnet/super_sudoku | 6 | 25757 | .include "header.inc"
.include "snesregs.inc"
.include "misc_macros.inc"
.include "zeropage.inc"
.include "puzzles.inc"
.include "grid.inc"
.bank 0 slot 1
.ramsection "sound_variables" SLOT RAM_SLOT
kick: db
.ends
.16BIT
.section "apu_payload" FREE
apu_dst_address: .dw 200h
apu_entry_point: .dw 200h
.ends
.section "sound_code" FREE
.define APU_HANDSHAKE APUIO0
.define APU_COMMAND APUIO1
.define APU_DATA APUIO1
.define APU_DST_ADDR APUIO2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Load the APU program
;
; based on Uploader pseudo code from the fullsnes documentation
sound_loadApu:
pushall
A8
XY16
ldx #0
; Wait until Word[2140h]=BBAAh
@wait_bbaa;
ldy APU_HANDSHAKE
cpy #$BBAA
bne @wait_bbaa
; kick=CCh ;start-code for first command
lda #$cc
sta kick
@next_block:
ldy apu_dst_address
sty APU_DST_ADDR ; usually 200h or higher (above stack and I/O ports)
lda #1
sta APU_COMMAND ; command=transfer (can be any non-zero value)
lda kick
sta APU_HANDSHAKE ; start command (CCh on first block)
@wait_handshake:
lda APU_HANDSHAKE
cmp kick
bne @wait_handshake
@blockdataloop:
lda apu_payload.L, X
sta APU_DATA ; send data byte
txa
sta APU_HANDSHAKE ; send index LSB (mark data available)
@waitDataAck:
cmp APU_HANDSHAKE
bne @waitDataAck
inx
cpx #_sizeof_apu_payload
bne @blockdataloop
; kick=(index+2 AND FFh) OR 1 ;-kick for next command (must be bigger than last index+1, and must be non-zero)
txa
clc
adc #<_sizeof_apu_payload
adc #2
ora #1
sta kick
@startit:
ldy apu_entry_point
sty APU_DST_ADDR ; entrypoint, must be below FFC0h (ROM region)
stz APU_COMMAND ; command=entry (must be zero value)
lda kick
sta APU_HANDSHAKE
@waitStartAck:
cmp APU_HANDSHAKE
bne @waitStartAck
@done:
popall
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Send a command. Command in 8-bit A.
;
sound_sendCommand:
pushall
A8
sta APU_COMMAND
inc kick
lda kick
sta APU_HANDSHAKE
@waitack:
cmp APU_HANDSHAKE
bne @waitack
popall
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Request the 'error' sound to be played
;
sound_effect_error:
pushall
A8
lda #$10 ; Error
jsr sound_sendCommand
popall
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Request the 'write' sound to be played
;
sound_effect_write:
pushall
A8
lda #$11
jsr sound_sendCommand
popall
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Request the 'erase' sound to be played
;
sound_effect_erase:
pushall
A8
lda #$12
jsr sound_sendCommand
popall
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Request the 'click' sound to be played
;
sound_effect_menuselect:
sound_effect_click:
pushall
A8
lda #$13
jsr sound_sendCommand
popall
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Request the 'back' sound to be played
;
sound_effect_back:
pushall
A8
lda #$14
jsr sound_sendCommand
popall
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Request the 'solved' sound to be played
;
sound_effect_solved:
pushall
A8
lda #$15
jsr sound_sendCommand
popall
rts
.ends
.bank 5
.section "apu program" FREE
apu_payload: .incbin "sound/sndcode.bin"
apu_dummy: .db 0 ; for sizeof
.ends
|
programs/oeis/111/A111181.asm | neoneye/loda | 22 | 97690 | ; A111181: Prime(n) - Pi(n).
; 2,2,3,5,8,10,13,15,19,25,26,32,35,37,41,47,52,54,59,63,65,71,74,80,88,92,94,98,99,103,116,120,126,128,138,140,145,151,155,161,166,168,177,179,183,185,196,208,212,214,218,224,225,235,241,247,253,255,260,264,265,275,289,293,295,299,312,318,328,330,333,339,346,352,358,362,368,376,379,387,397,399,408,410,416,420,426,434,437,439,443,455,463,467,475,479,484,496,498,516
mov $1,$0
seq $0,720 ; pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159...
add $0,1
seq $1,40 ; The prime numbers.
sub $1,1
sub $1,$0
mov $0,$1
add $0,2
|
libsrc/cpc/cpc_PrintGphStrStd_callee.asm | jpoikela/z88dk | 640 | 242700 | <filename>libsrc/cpc/cpc_PrintGphStrStd_callee.asm
;
; Amstrad CPC library
;
; ******************************************************
; ** Librería de rutinas para Amstrad CPC **
; ** <NAME>, Artaburu 2009 **
; ******************************************************
;
; void cpc_PrintGphStrStd(char *color, char *text);
;
; $Id: cpc_PrintGphStrStd_callee.asm $
;
SECTION code_clib
PUBLIC cpc_PrintGphStrStd_callee
PUBLIC _cpc_PrintGphStrStd_callee
EXTERN cpc_PrintGphStrStd0
;EXTERN color_uso
.cpc_PrintGphStrStd_callee
._cpc_PrintGphStrStd_callee
;preparación datos impresión. El ancho y alto son fijos!
pop af
pop hl ; screen address
pop de ; text
pop bc ; color
push af ; ret addr
ld a,c
JP cpc_PrintGphStrStd0
|
BasicICML/Syntax/DyadicGentzen.agda | mietek/hilbert-gentzen | 29 | 13589 | <filename>BasicICML/Syntax/DyadicGentzen.agda
-- Basic intuitionistic contextual modal logic, without ∨ or ⊥.
-- Gentzen-style formalisation of syntax with context pairs, after Nanevski-Pfenning-Pientka.
-- Simple terms.
module BasicICML.Syntax.DyadicGentzen where
open import BasicICML.Syntax.Common public
-- Derivations.
-- NOTE: Only var is an instance constructor, which allows the instance argument for mvar to be automatically inferred, in many cases.
mutual
infix 3 _⊢_
data _⊢_ : Cx² Ty Box → Ty → Set where
instance
var : ∀ {A Γ Δ} → A ∈ Γ → Γ ⁏ Δ ⊢ A
lam : ∀ {A B Γ Δ} → Γ , A ⁏ Δ ⊢ B → Γ ⁏ Δ ⊢ A ▻ B
app : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ▻ B → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢ B
mvar : ∀ {Ψ A Γ Δ} → [ Ψ ] A ∈ Δ → {{_ : Γ ⁏ Δ ⊢⋆ Ψ}} → Γ ⁏ Δ ⊢ A
box : ∀ {Ψ A Γ Δ} → Ψ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢ [ Ψ ] A
unbox : ∀ {Ψ A C Γ Δ} → Γ ⁏ Δ ⊢ [ Ψ ] A → Γ ⁏ Δ , [ Ψ ] A ⊢ C → Γ ⁏ Δ ⊢ C
pair : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢ B → Γ ⁏ Δ ⊢ A ∧ B
fst : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ∧ B → Γ ⁏ Δ ⊢ A
snd : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ∧ B → Γ ⁏ Δ ⊢ B
unit : ∀ {Γ Δ} → Γ ⁏ Δ ⊢ ⊤
infix 3 _⊢⋆_
data _⊢⋆_ : Cx² Ty Box → Cx Ty → Set where
instance
∙ : ∀ {Γ Δ} → Γ ⁏ Δ ⊢⋆ ∅
_,_ : ∀ {Ξ A Γ Δ} → Γ ⁏ Δ ⊢⋆ Ξ → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢⋆ Ξ , A
-- Monotonicity with respect to context inclusion.
mutual
mono⊢ : ∀ {A Γ Γ′ Δ} → Γ ⊆ Γ′ → Γ ⁏ Δ ⊢ A → Γ′ ⁏ Δ ⊢ A
mono⊢ η (var i) = var (mono∈ η i)
mono⊢ η (lam t) = lam (mono⊢ (keep η) t)
mono⊢ η (app t u) = app (mono⊢ η t) (mono⊢ η u)
mono⊢ η (mvar i {{ts}}) = mvar i {{mono⊢⋆ η ts}}
mono⊢ η (box t) = box t
mono⊢ η (unbox t u) = unbox (mono⊢ η t) (mono⊢ η u)
mono⊢ η (pair t u) = pair (mono⊢ η t) (mono⊢ η u)
mono⊢ η (fst t) = fst (mono⊢ η t)
mono⊢ η (snd t) = snd (mono⊢ η t)
mono⊢ η unit = unit
mono⊢⋆ : ∀ {Ξ Γ Γ′ Δ} → Γ ⊆ Γ′ → Γ ⁏ Δ ⊢⋆ Ξ → Γ′ ⁏ Δ ⊢⋆ Ξ
mono⊢⋆ η ∙ = ∙
mono⊢⋆ η (ts , t) = mono⊢⋆ η ts , mono⊢ η t
-- Monotonicity with respect to modal context inclusion.
mutual
mmono⊢ : ∀ {A Γ Δ Δ′} → Δ ⊆ Δ′ → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ′ ⊢ A
mmono⊢ θ (var i) = var i
mmono⊢ θ (lam t) = lam (mmono⊢ θ t)
mmono⊢ θ (app t u) = app (mmono⊢ θ t) (mmono⊢ θ u)
mmono⊢ θ (mvar i {{ts}}) = mvar (mono∈ θ i) {{mmono⊢⋆ θ ts}}
mmono⊢ θ (box t) = box (mmono⊢ θ t)
mmono⊢ θ (unbox t u) = unbox (mmono⊢ θ t) (mmono⊢ (keep θ) u)
mmono⊢ θ (pair t u) = pair (mmono⊢ θ t) (mmono⊢ θ u)
mmono⊢ θ (fst t) = fst (mmono⊢ θ t)
mmono⊢ θ (snd t) = snd (mmono⊢ θ t)
mmono⊢ θ unit = unit
mmono⊢⋆ : ∀ {Ξ Δ Δ′ Γ} → Δ ⊆ Δ′ → Γ ⁏ Δ ⊢⋆ Ξ → Γ ⁏ Δ′ ⊢⋆ Ξ
mmono⊢⋆ θ ∙ = ∙
mmono⊢⋆ θ (ts , t) = mmono⊢⋆ θ ts , mmono⊢ θ t
-- Monotonicity using context pairs.
mono²⊢ : ∀ {A Π Π′} → Π ⊆² Π′ → Π ⊢ A → Π′ ⊢ A
mono²⊢ (η , θ) = mono⊢ η ∘ mmono⊢ θ
-- Shorthand for variables.
v₀ : ∀ {A Γ Δ} → Γ , A ⁏ Δ ⊢ A
v₀ = var i₀
v₁ : ∀ {A B Γ Δ} → Γ , A , B ⁏ Δ ⊢ A
v₁ = var i₁
v₂ : ∀ {A B C Γ Δ} → Γ , A , B , C ⁏ Δ ⊢ A
v₂ = var i₂
mv₀ : ∀ {Ψ A Γ Δ}
→ {{_ : Γ ⁏ Δ , [ Ψ ] A ⊢⋆ Ψ}}
→ Γ ⁏ Δ , [ Ψ ] A ⊢ A
mv₀ = mvar i₀
mv₁ : ∀ {Ψ Ψ′ A B Γ Δ}
→ {{_ : Γ ⁏ Δ , [ Ψ ] A , [ Ψ′ ] B ⊢⋆ Ψ}}
→ Γ ⁏ Δ , [ Ψ ] A , [ Ψ′ ] B ⊢ A
mv₁ = mvar i₁
mv₂ : ∀ {Ψ Ψ′ Ψ″ A B C Γ Δ}
→ {{_ : Γ ⁏ Δ , [ Ψ ] A , [ Ψ′ ] B , [ Ψ″ ] C ⊢⋆ Ψ}}
→ Γ ⁏ Δ , [ Ψ ] A , [ Ψ′ ] B , [ Ψ″ ] C ⊢ A
mv₂ = mvar i₂
-- Generalised reflexivity.
instance
refl⊢⋆ : ∀ {Γ Ψ Δ} → {{_ : Ψ ⊆ Γ}} → Γ ⁏ Δ ⊢⋆ Ψ
refl⊢⋆ {∅} {{done}} = ∙
refl⊢⋆ {Γ , A} {{skip η}} = mono⊢⋆ weak⊆ (refl⊢⋆ {{η}})
refl⊢⋆ {Γ , A} {{keep η}} = mono⊢⋆ weak⊆ (refl⊢⋆ {{η}}) , v₀
-- Deduction theorem is built-in.
-- Modal deduction theorem.
mlam : ∀ {Ψ A B Γ Δ}
→ Γ ⁏ Δ , [ Ψ ] A ⊢ B
→ Γ ⁏ Δ ⊢ [ Ψ ] A ▻ B
mlam t = lam (unbox v₀ (mono⊢ weak⊆ t))
-- Detachment theorems.
det : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ▻ B → Γ , A ⁏ Δ ⊢ B
det t = app (mono⊢ weak⊆ t) v₀
mdet : ∀ {Ψ A B Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] A ▻ B
→ Γ ⁏ Δ , [ Ψ ] A ⊢ B
mdet t = app (mmono⊢ weak⊆ t) (box mv₀)
-- Cut and multicut.
cut : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A → Γ , A ⁏ Δ ⊢ B → Γ ⁏ Δ ⊢ B
cut t u = app (lam u) t
mcut : ∀ {Ψ A B Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] A
→ Γ ⁏ Δ , [ Ψ ] A ⊢ B
→ Γ ⁏ Δ ⊢ B
mcut t u = app (mlam u) t
multicut : ∀ {Ξ A Γ Δ} → Γ ⁏ Δ ⊢⋆ Ξ → Ξ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢ A
multicut ∙ u = mono⊢ bot⊆ u
multicut (ts , t) u = app (multicut ts (lam u)) t
-- Contraction.
ccont : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ (A ▻ A ▻ B) ▻ A ▻ B
ccont = lam (lam (app (app v₁ v₀) v₀))
cont : ∀ {A B Γ Δ} → Γ , A , A ⁏ Δ ⊢ B → Γ , A ⁏ Δ ⊢ B
cont t = det (app ccont (lam (lam t)))
mcont : ∀ {Ψ A B Γ Δ} → Γ ⁏ Δ , [ Ψ ] A , [ Ψ ] A ⊢ B → Γ ⁏ Δ , [ Ψ ] A ⊢ B
mcont t = mdet (app ccont (mlam (mlam t)))
-- Exchange, or Schönfinkel’s C combinator.
cexch : ∀ {A B C Γ Δ} → Γ ⁏ Δ ⊢ (A ▻ B ▻ C) ▻ B ▻ A ▻ C
cexch = lam (lam (lam (app (app v₂ v₀) v₁)))
exch : ∀ {A B C Γ Δ} → Γ , A , B ⁏ Δ ⊢ C → Γ , B , A ⁏ Δ ⊢ C
exch t = det (det (app cexch (lam (lam t))))
mexch : ∀ {Ψ Ψ′ A B C Γ Δ}
→ Γ ⁏ Δ , [ Ψ ] A , [ Ψ′ ] B ⊢ C
→ Γ ⁏ Δ , [ Ψ′ ] B , [ Ψ ] A ⊢ C
mexch t = mdet (mdet (app cexch (mlam (mlam t))))
-- Composition, or Schönfinkel’s B combinator.
ccomp : ∀ {A B C Γ Δ} → Γ ⁏ Δ ⊢ (B ▻ C) ▻ (A ▻ B) ▻ A ▻ C
ccomp = lam (lam (lam (app v₂ (app v₁ v₀))))
comp : ∀ {A B C Γ Δ} → Γ , B ⁏ Δ ⊢ C → Γ , A ⁏ Δ ⊢ B → Γ , A ⁏ Δ ⊢ C
comp t u = det (app (app ccomp (lam t)) (lam u))
mcomp : ∀ {Ψ Ψ′ Ψ″ A B C Γ Δ}
→ Γ ⁏ Δ , [ Ψ′ ] B ⊢ [ Ψ″ ] C
→ Γ ⁏ Δ , [ Ψ ] A ⊢ [ Ψ′ ] B
→ Γ ⁏ Δ , [ Ψ ] A ⊢ [ Ψ″ ] C
mcomp t u = mdet (app (app ccomp (mlam t)) (mlam u))
-- Useful theorems in functional form.
dist : ∀ {Ψ A B Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] (A ▻ B)
→ Γ ⁏ Δ ⊢ [ Ψ ] A
→ Γ ⁏ Δ ⊢ [ Ψ ] B
dist t u = unbox t (unbox (mmono⊢ weak⊆ u) (box (app mv₁ mv₀)))
up : ∀ {Ψ A Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] A
→ Γ ⁏ Δ ⊢ [ Ψ ] [ Ψ ] A
up t = unbox t (box (box mv₀))
down : ∀ {Ψ A Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] A
→ {{_ : Γ ⁏ Δ , [ Ψ ] A ⊢⋆ Ψ}}
→ Γ ⁏ Δ ⊢ A
down t = unbox t mv₀
distup : ∀ {Ψ A B Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] ([ Ψ ] A ▻ B)
→ Γ ⁏ Δ ⊢ [ Ψ ] A
→ Γ ⁏ Δ ⊢ [ Ψ ] B
distup t u = dist t (up u)
-- Useful theorems in combinatory form.
ci : ∀ {A Γ Δ} → Γ ⁏ Δ ⊢ A ▻ A
ci = lam v₀
ck : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ▻ B ▻ A
ck = lam (lam v₁)
cs : ∀ {A B C Γ Δ} → Γ ⁏ Δ ⊢ (A ▻ B ▻ C) ▻ (A ▻ B) ▻ A ▻ C
cs = lam (lam (lam (app (app v₂ v₀) (app v₁ v₀))))
cdist : ∀ {Ψ A B Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] (A ▻ B) ▻
[ Ψ ] A ▻
[ Ψ ] B
cdist = lam (lam (dist v₁ v₀))
cup : ∀ {Ψ A Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] A ▻
[ Ψ ] [ Ψ ] A
cup = lam (up v₀)
cdistup : ∀ {Ψ A B Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] ([ Ψ ] A ▻ B) ▻
[ Ψ ] A ▻ [ Ψ ] B
cdistup = lam (lam (dist v₁ (up v₀)))
cunbox : ∀ {Ψ A C Γ Δ}
→ Γ ⁏ Δ ⊢ [ Ψ ] A ▻
([ Ψ ] A ▻ C) ▻
C
cunbox = lam (lam (app v₀ v₁))
cpair : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ▻ B ▻ A ∧ B
cpair = lam (lam (pair v₁ v₀))
cfst : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ∧ B ▻ A
cfst = lam (fst v₀)
csnd : ∀ {A B Γ Δ} → Γ ⁏ Δ ⊢ A ∧ B ▻ B
csnd = lam (snd v₀)
-- Closure under context concatenation.
concat : ∀ {A B Γ} Γ′ {Δ} → Γ , A ⁏ Δ ⊢ B → Γ′ ⁏ Δ ⊢ A → Γ ⧺ Γ′ ⁏ Δ ⊢ B
concat Γ′ t u = app (mono⊢ (weak⊆⧺₁ Γ′) (lam t)) (mono⊢ weak⊆⧺₂ u)
mconcat : ∀ {Ψ A B Γ Δ} Δ′ → Γ ⁏ Δ , [ Ψ ] A ⊢ B → Γ ⁏ Δ′ ⊢ [ Ψ ] A → Γ ⁏ Δ ⧺ Δ′ ⊢ B
mconcat Δ′ t u = app (mmono⊢ (weak⊆⧺₁ Δ′) (mlam t)) (mmono⊢ weak⊆⧺₂ u)
-- Substitution.
mutual
[_≔_]_ : ∀ {A C Γ Δ} → (i : A ∈ Γ) → Γ ∖ i ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢ C → Γ ∖ i ⁏ Δ ⊢ C
[ i ≔ s ] var j with i ≟∈ j
[ i ≔ s ] var .i | same = s
[ i ≔ s ] var ._ | diff j = var j
[ i ≔ s ] lam t = lam ([ pop i ≔ mono⊢ weak⊆ s ] t)
[ i ≔ s ] app t u = app ([ i ≔ s ] t) ([ i ≔ s ] u)
[ i ≔ s ] mvar j {{ts}} = mvar j {{[ i ≔ s ]⋆ ts}}
[ i ≔ s ] box t = box t
[ i ≔ s ] unbox t u = unbox ([ i ≔ s ] t) ([ i ≔ mmono⊢ weak⊆ s ] u)
[ i ≔ s ] pair t u = pair ([ i ≔ s ] t) ([ i ≔ s ] u)
[ i ≔ s ] fst t = fst ([ i ≔ s ] t)
[ i ≔ s ] snd t = snd ([ i ≔ s ] t)
[ i ≔ s ] unit = unit
[_≔_]⋆_ : ∀ {Ξ A Γ Δ} → (i : A ∈ Γ) → Γ ∖ i ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢⋆ Ξ → Γ ∖ i ⁏ Δ ⊢⋆ Ξ
[_≔_]⋆_ i s ∙ = ∙
[_≔_]⋆_ i s (ts , t) = [ i ≔ s ]⋆ ts , [ i ≔ s ] t
-- Modal substitution.
mutual
m[_≔_]_ : ∀ {Ψ A C Γ Δ} → (i : [ Ψ ] A ∈ Δ) → Ψ ⁏ Δ ∖ i ⊢ A → Γ ⁏ Δ ⊢ C → Γ ⁏ Δ ∖ i ⊢ C
m[ i ≔ s ] var j = var j
m[ i ≔ s ] lam t = lam (m[ i ≔ s ] t)
m[ i ≔ s ] app t u = app (m[ i ≔ s ] t) (m[ i ≔ s ] u)
m[ i ≔ s ] mvar j {{ts}} with i ≟∈ j
m[ i ≔ s ] mvar .i {{ts}} | same = multicut (m[ i ≔ s ]⋆ ts) s
m[ i ≔ s ] mvar ._ {{ts}} | diff j = mvar j {{m[ i ≔ s ]⋆ ts}}
m[ i ≔ s ] box t = box (m[ i ≔ s ] t)
m[ i ≔ s ] unbox t u = unbox (m[ i ≔ s ] t) (m[ pop i ≔ mmono⊢ weak⊆ s ] u)
m[ i ≔ s ] pair t u = pair (m[ i ≔ s ] t) (m[ i ≔ s ] u)
m[ i ≔ s ] fst t = fst (m[ i ≔ s ] t)
m[ i ≔ s ] snd t = snd (m[ i ≔ s ] t)
m[ i ≔ s ] unit = unit
m[_≔_]⋆_ : ∀ {Ξ Ψ A Γ Δ} → (i : [ Ψ ] A ∈ Δ) → Ψ ⁏ Δ ∖ i ⊢ A → Γ ⁏ Δ ⊢⋆ Ξ → Γ ⁏ Δ ∖ i ⊢⋆ Ξ
m[_≔_]⋆_ i s ∙ = ∙
m[_≔_]⋆_ i s (ts , t) = m[ i ≔ s ]⋆ ts , m[ i ≔ s ] t
-- Convertibility.
data _⋙_ {Δ : Cx Box} {Γ : Cx Ty} : ∀ {A} → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊢ A → Set where
refl⋙ : ∀ {A} → {t : Γ ⁏ Δ ⊢ A}
→ t ⋙ t
trans⋙ : ∀ {A} → {t t′ t″ : Γ ⁏ Δ ⊢ A}
→ t ⋙ t′ → t′ ⋙ t″
→ t ⋙ t″
sym⋙ : ∀ {A} → {t t′ : Γ ⁏ Δ ⊢ A}
→ t ⋙ t′
→ t′ ⋙ t
conglam⋙ : ∀ {A B} → {t t′ : Γ , A ⁏ Δ ⊢ B}
→ t ⋙ t′
→ lam t ⋙ lam t′
congapp⋙ : ∀ {A B} → {t t′ : Γ ⁏ Δ ⊢ A ▻ B} → {u u′ : Γ ⁏ Δ ⊢ A}
→ t ⋙ t′ → u ⋙ u′
→ app t u ⋙ app t′ u′
-- NOTE: Rejected by Pfenning and Davies.
-- congbox⋙ : ∀ {Ψ A} → {t t′ : Ψ ⁏ Δ ⊢ A}
-- → t ⋙ t′
-- → box t ⋙ box t′
congunbox⋙ : ∀ {Ψ A C} → {t t′ : Γ ⁏ Δ ⊢ [ Ψ ] A} → {u u′ : Γ ⁏ Δ , [ Ψ ] A ⊢ C}
→ t ⋙ t′ → u ⋙ u′
→ unbox t u ⋙ unbox t′ u′
congpair⋙ : ∀ {A B} → {t t′ : Γ ⁏ Δ ⊢ A} → {u u′ : Γ ⁏ Δ ⊢ B}
→ t ⋙ t′ → u ⋙ u′
→ pair t u ⋙ pair t′ u′
congfst⋙ : ∀ {A B} → {t t′ : Γ ⁏ Δ ⊢ A ∧ B}
→ t ⋙ t′
→ fst t ⋙ fst t′
congsnd⋙ : ∀ {A B} → {t t′ : Γ ⁏ Δ ⊢ A ∧ B}
→ t ⋙ t′
→ snd t ⋙ snd t′
beta▻⋙ : ∀ {A B} → {t : Γ , A ⁏ Δ ⊢ B} → {u : Γ ⁏ Δ ⊢ A}
→ app (lam t) u ⋙ ([ top ≔ u ] t)
eta▻⋙ : ∀ {A B} → {t : Γ ⁏ Δ ⊢ A ▻ B}
→ t ⋙ lam (app (mono⊢ weak⊆ t) v₀)
beta□⋙ : ∀ {Ψ A C} → {t : Ψ ⁏ Δ ⊢ A} → {u : Γ ⁏ Δ , [ Ψ ] A ⊢ C}
→ unbox (box t) u ⋙ (m[ top ≔ t ] u)
eta□⋙ : ∀ {Ψ A} → {t : Γ ⁏ Δ ⊢ [ Ψ ] A}
→ t ⋙ unbox t (box mv₀)
-- TODO: What about commuting conversions for □?
beta∧₁⋙ : ∀ {A B} → {t : Γ ⁏ Δ ⊢ A} → {u : Γ ⁏ Δ ⊢ B}
→ fst (pair t u) ⋙ t
beta∧₂⋙ : ∀ {A B} → {t : Γ ⁏ Δ ⊢ A} → {u : Γ ⁏ Δ ⊢ B}
→ snd (pair t u) ⋙ u
eta∧⋙ : ∀ {A B} → {t : Γ ⁏ Δ ⊢ A ∧ B}
→ t ⋙ pair (fst t) (snd t)
eta⊤⋙ : ∀ {t : Γ ⁏ Δ ⊢ ⊤} → t ⋙ unit
-- Examples from the Nanevski-Pfenning-Pientka paper.
-- NOTE: In many cases, the instance argument for mvar can be automatically inferred, but not always.
module Examples where
e₁ : ∀ {A C D Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ , C ] A ▻
[ ∅ , C , D ] A
e₁ = lam (unbox v₀ (box mv₀))
e₂ : ∀ {A C Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ , C , C ] A ▻
[ ∅ , C ] A
e₂ = lam (unbox v₀ (box mv₀))
e₃ : ∀ {A Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ , A ] A
e₃ = box v₀
e₄ : ∀ {A B C Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ , A ] B ▻
[ ∅ , A ] [ ∅ , B ] C ▻
[ ∅ , A ] C
e₄ = lam (lam (unbox v₁ (unbox v₀ (box
(unbox mv₀ (mv₀ {{∙ , mv₂}}))))))
e₅ : ∀ {A Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ ] A ▻ A
e₅ = lam (unbox v₀ mv₀)
e₆ : ∀ {A C D Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ , C ] A ▻
[ ∅ , D ] [ ∅ , C ] A
e₆ = lam (unbox v₀ (box (box mv₀)))
e₇ : ∀ {A B C D Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ , C ] (A ▻ B) ▻
[ ∅ , D ] A ▻
[ ∅ , C , D ] B
e₇ = lam (lam (unbox v₁ (unbox v₀ (box
(app mv₁ mv₀)))))
e₈ : ∀ {A B C Γ Δ}
→ Γ ⁏ Δ ⊢ [ ∅ , A ] (A ▻ B) ▻
[ ∅ , B ] C ▻
[ ∅ , A ] C
e₈ = lam (lam (unbox v₁ (unbox v₀ (box
(mv₀ {{∙ , app mv₁ v₀}})))))
|
ada/core/agar-event.adb | auzkok/libagar | 286 | 5449 | <reponame>auzkok/libagar
------------------------------------------------------------------------------
-- AGAR CORE LIBRARY --
-- A G A R . E V E N T --
-- B o d y --
-- --
-- Copyright (c) 2018-2019, <NAME> (<EMAIL>) --
-- Copyright (c) 2010, coreland (<EMAIL>) --
-- --
-- Permission to use, copy, modify, and/or distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
package body Agar.Event is
----------------------------------
-- Push a tagged Event Argument --
----------------------------------
procedure Push_Address
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in System.Address)
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
ag_event_push_pointer
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access),
Value => Value);
end Push_Address;
procedure Push_Access
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in Element_Access_Type) is
begin
Push_Address
(Event => Event,
Name => Name,
Value => Value.all'Address);
end Push_Access;
procedure Push_String
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in String)
is
Ch_Name : aliased C.char_array := C.To_C(Name);
Ch_Value : aliased C.char_array := C.To_C(Value);
begin
ag_event_push_string
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access),
Value => CS.To_Chars_Ptr(Ch_Value'Unchecked_Access));
end Push_String;
procedure Push_Integer
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in Integer)
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
ag_event_push_int
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access),
Value => C.int(Value));
end Push_Integer;
procedure Push_Natural
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in Natural)
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
ag_event_push_uint
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access),
Value => C.unsigned (Value));
end Push_Natural;
procedure Push_Long_Integer
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in Long_Integer)
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
ag_event_push_long
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access),
Value => C.long (Value));
end Push_Long_Integer;
#if HAVE_FLOAT
procedure Push_Float
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in Float)
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
ag_event_push_float
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access),
Value => C.C_float (Value));
end Push_Float;
procedure Push_Long_Float
(Event : in Event_Not_Null_Access;
Name : in String;
Value : in Long_Float)
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
ag_event_push_double
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access),
Value => C.double(Value));
end Push_Long_Float;
#end if;
-------------------------------------
-- Push an untagged Event argument --
-------------------------------------
procedure Push_Address
(Event : in Event_Not_Null_Access;
Value : in System.Address)
is begin
ag_event_push_pointer
(Event => Event,
Name => CS.Null_Ptr,
Value => Value);
end Push_Address;
procedure Push_String
(Event : in Event_Not_Null_Access;
Value : in String)
is
Ch_Value : aliased C.char_array := C.To_C(Value);
begin
ag_event_push_string
(Event => Event,
Name => CS.Null_Ptr,
Value => CS.To_Chars_Ptr(Ch_Value'Unchecked_Access));
end Push_String;
procedure Push_Integer
(Event : in Event_Not_Null_Access;
Value : in Integer)
is begin
ag_event_push_int
(Event => Event,
Name => CS.Null_Ptr,
Value => C.int(Value));
end Push_Integer;
procedure Push_Natural
(Event : in Event_Not_Null_Access;
Value : in Natural)
is begin
ag_event_push_uint
(Event => Event,
Name => CS.Null_Ptr,
Value => C.unsigned(Value));
end Push_Natural;
procedure Push_Long_Integer
(Event : in Event_Not_Null_Access;
Value : in Long_Integer)
is begin
ag_event_push_long
(Event => Event,
Name => CS.Null_Ptr,
Value => C.long (Value));
end Push_Long_Integer;
#if HAVE_FLOAT
procedure Push_Float
(Event : in Event_Not_Null_Access;
Value : in Float)
is begin
ag_event_push_float
(Event => Event,
Name => CS.Null_Ptr,
Value => C.C_float (Value));
end Push_Float;
procedure Push_Long_Float
(Event : in Event_Not_Null_Access;
Value : in Long_Float)
is begin
ag_event_push_double
(Event => Event,
Name => CS.Null_Ptr,
Value => C.double(Value));
end Push_Long_Float;
#end if;
------------------------------------
-- Pop an untagged Event Argument --
------------------------------------
function Pop_Address
(Event : in Event_Not_Null_Access) return System.Address
is begin
return ag_event_pop_pointer (Event => Event);
end Pop_Address;
----------------------------
-- Extract Event Argument --
----------------------------
function Get_Address
(Event : in Event_Not_Null_Access;
Index : in Natural) return System.Address
is begin
return ag_event_get_ptr
(Event => Event,
Index => C.unsigned(Index));
end Get_Address;
function Get_Address
(Event : in Event_Not_Null_Access;
Name : in String) return System.Address
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
return ag_event_get_ptr_named
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access));
end Get_Address;
function Get_String
(Event : in Event_Not_Null_Access;
Index : in Natural) return String
is
Result : CS.chars_ptr;
begin
Result := ag_event_get_string
(Event => Event,
Index => C.unsigned(Index));
return C.To_Ada (CS.Value(Result));
end Get_String;
function Get_String
(Event : in Event_Not_Null_Access;
Name : in String) return String
is
Ch_Name : aliased C.char_array := C.To_C(Name);
Result : CS.chars_ptr;
begin
Result := ag_event_get_string_named
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access));
return C.To_Ada(CS.Value(Result));
end Get_String;
function Get_Integer
(Event : in Event_Not_Null_Access;
Index : in Natural) return Integer
is begin
return Integer
(ag_event_get_int
(Event => Event,
Index => C.unsigned(Index)));
end Get_Integer;
function Get_Integer
(Event : in Event_Not_Null_Access;
Name : in String) return Integer
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
return Integer
(ag_event_get_int_named
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access)));
end Get_Integer;
function Get_Natural
(Event : in Event_Not_Null_Access;
Index : in Natural) return Natural
is begin
return Natural
(ag_event_get_uint
(Event => Event,
Index => C.unsigned(Index)));
end Get_Natural;
function Get_Natural
(Event : in Event_Not_Null_Access;
Name : in String) return Natural
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
return Natural
(ag_event_get_uint_named
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access)));
end Get_Natural;
function Get_Long_Integer
(Event : in Event_Not_Null_Access;
Index : in Natural) return Long_Integer
is begin
return Long_Integer
(ag_event_get_long
(Event => Event,
Index => C.unsigned(Index)));
end Get_Long_Integer;
function Get_Long_Integer
(Event : in Event_Not_Null_Access;
Name : in String) return Long_Integer
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
return Long_Integer
(ag_event_get_long_named
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access)));
end Get_Long_Integer;
#if HAVE_FLOAT
function Get_Float
(Event : in Event_Not_Null_Access;
Index : in Natural) return Float
is begin
return Float
(ag_event_get_float
(Event => Event,
Index => C.unsigned(Index)));
end Get_Float;
function Get_Float
(Event : in Event_Not_Null_Access;
Name : in String) return Float
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
return Float
(ag_event_get_float_named
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access)));
end Get_Float;
function Get_Long_Float
(Event : in Event_Not_Null_Access;
Index : in Natural) return Long_Float
is begin
return Long_Float
(ag_event_get_double
(Event => Event,
Index => C.unsigned(Index)));
end Get_Long_Float;
function Get_Long_Float
(Event : in Event_Not_Null_Access;
Name : in String) return Long_Float
is
Ch_Name : aliased C.char_array := C.To_C(Name);
begin
return Long_Float
(ag_event_get_double_named
(Event => Event,
Name => CS.To_Chars_Ptr(Ch_Name'Unchecked_Access)));
end Get_Long_Float;
#end if;
end Agar.Event;
|
oeis/245/A245300.asm | neoneye/loda-programs | 11 | 80241 | ; A245300: Triangle T(n,k) = (n+k)*(n+k+1)/2 + k, 0 <= k <= n, read by rows.
; Submitted by <NAME>
; 0,1,4,3,7,12,6,11,17,24,10,16,23,31,40,15,22,30,39,49,60,21,29,38,48,59,71,84,28,37,47,58,70,83,97,112,36,46,57,69,82,96,111,127,144,45,56,68,81,95,110,126,143,161,180,55,67,80,94,109,125,142,160,179,199,220,66,79,93,108,124,141,159,178,198,219,241,264,78,92,107,123,140,158,177,197,218,240,263,287,312,91,106,122,139,157,176,196,217,239
lpb $0
mov $1,$0
add $1,1
add $2,1
sub $0,$2
bin $1,2
add $1,$0
lpe
mov $0,$1
|
oeis/206/A206417.asm | neoneye/loda-programs | 11 | 94011 | ; A206417: (5*F(n)+3*L(n)-8)/2.
; Submitted by <NAME>(s3)
; 0,3,7,14,25,43,72,119,195,318,517,839,1360,2203,3567,5774,9345,15123,24472,39599,64075,103678,167757,271439,439200,710643,1149847,1860494,3010345,4870843,7881192,12752039,20633235,33385278,54018517,87403799,141422320,228826123,370248447,599074574,969323025,1568397603,2537720632,4106118239,6643838875,10749957118,17393795997,28143753119,45537549120,73681302243,119218851367,192900153614,312119004985,505019158603,817138163592,1322157322199,2139295485795,3461452807998,5600748293797,9062201101799
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
add $3,3
lpe
add $3,$2
mov $0,$3
sub $0,1
|
data/jpred4/jp_batch_1613899824__zrBepmM/jp_batch_1613899824__zrBepmM.als | jonriege/predict-protein-structure | 0 | 2694 | <filename>data/jpred4/jp_batch_1613899824__zrBepmM/jp_batch_1613899824__zrBepmM.als<gh_stars>0
SILENT_MODE
BLOCK_FILE jp_batch_1613899824__zrBepmM.concise.blc
MAX_NSEQ 941
MAX_INPUT_LEN 943
OUTPUT_FILE jp_batch_1613899824__zrBepmM.concise.ps
PORTRAIT
POINTSIZE 8
IDENT_WIDTH 12
X_OFFSET 2
Y_OFFSET 2
DEFINE_FONT 0 Helvetica DEFAULT
DEFINE_FONT 1 Helvetica REL 0.75
DEFINE_FONT 7 Helvetica REL 0.6
DEFINE_FONT 3 Helvetica-Bold DEFAULT
DEFINE_FONT 4 Times-Bold DEFAULT
DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT
#
DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose
DEFINE_COLOUR 4 1 1 0 # Yellow
DEFINE_COLOUR 5 1 0 0 # Red
DEFINE_COLOUR 7 1 0 1 # Purple
DEFINE_COLOUR 8 0 0 1 # Blue
DEFINE_COLOUR 9 0 1 0 # Green
DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue
DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green
DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix)
DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand)
NUMBER_INT 10
SETUP
#
# Highlight specific residues.
# Avoid highlighting Lupas 'C' predictions by
# limiting the highlighting to the alignments
Scol_CHARS C 1 1 112 930 4
Ccol_CHARS H ALL 5
Ccol_CHARS P ALL 8
SURROUND_CHARS LIV ALL
#
# Replace known structure types with whitespace
SUB_CHARS 1 931 112 940 H SPACE
SUB_CHARS 1 931 112 940 E SPACE
SUB_CHARS 1 931 112 940 - SPACE
STRAND 36 934 36
COLOUR_TEXT_REGION 36 934 36 934 51
HELIX 4 934 15
COLOUR_TEXT_REGION 4 934 15 934 50
HELIX 64 934 72
COLOUR_TEXT_REGION 64 934 72 934 50
HELIX 98 934 110
COLOUR_TEXT_REGION 98 934 110 934 50
HELIX 4 939 14
COLOUR_TEXT_REGION 4 939 14 939 50
HELIX 64 939 72
COLOUR_TEXT_REGION 64 939 72 939 50
HELIX 98 939 110
COLOUR_TEXT_REGION 98 939 110 939 50
STRAND 34 940 37
COLOUR_TEXT_REGION 34 940 37 940 51
STRAND 77 940 78
COLOUR_TEXT_REGION 77 940 78 940 51
HELIX 4 940 16
COLOUR_TEXT_REGION 4 940 16 940 50
HELIX 52 940 54
COLOUR_TEXT_REGION 52 940 54 940 50
HELIX 64 940 72
COLOUR_TEXT_REGION 64 940 72 940 50
HELIX 98 940 110
COLOUR_TEXT_REGION 98 940 110 940 50
|
src/cws-types.agda | xoltar/cedille | 0 | 12361 | ----------------------------------------------------------------------------------
-- Types for parse trees
----------------------------------------------------------------------------------
module cws-types where
open import lib
open import parse-tree
posinfo = string
{-# FOREIGN GHC import qualified CedilleCommentsLexer #-}
data entity : Set where
EntityComment : posinfo → posinfo → entity
EntityNonws : entity
EntityWs : posinfo → posinfo → entity
{-# COMPILE GHC entity = data CedilleCommentsLexer.Entity (CedilleCommentsLexer.EntityComment | CedilleCommentsLexer.EntityNonws | CedilleCommentsLexer.EntityWs) #-}
data entities : Set where
EndEntity : entities
Entity : entity → entities → entities
{-# COMPILE GHC entities = data CedilleCommentsLexer.Entities (CedilleCommentsLexer.EndEntity | CedilleCommentsLexer.Entity) #-}
data start : Set where
File : entities → start
{-# COMPILE GHC start = data CedilleCommentsLexer.Start (CedilleCommentsLexer.File) #-}
postulate
scanComments : string → start
{-# COMPILE GHC scanComments = CedilleCommentsLexer.scanComments #-}
-- embedded types:
data ParseTreeT : Set where
parsed-entities : entities → ParseTreeT
parsed-entity : entity → ParseTreeT
parsed-start : start → ParseTreeT
parsed-posinfo : posinfo → ParseTreeT
parsed-alpha : ParseTreeT
parsed-alpha-bar-3 : ParseTreeT
parsed-alpha-range-1 : ParseTreeT
parsed-alpha-range-2 : ParseTreeT
parsed-anychar : ParseTreeT
parsed-anychar-bar-59 : ParseTreeT
parsed-anychar-bar-60 : ParseTreeT
parsed-anychar-bar-61 : ParseTreeT
parsed-anychar-bar-62 : ParseTreeT
parsed-anychar-bar-63 : ParseTreeT
parsed-anynonwschar : ParseTreeT
parsed-anynonwschar-bar-68 : ParseTreeT
parsed-anynonwschar-bar-69 : ParseTreeT
parsed-aws : ParseTreeT
parsed-aws-bar-65 : ParseTreeT
parsed-aws-bar-66 : ParseTreeT
parsed-comment : ParseTreeT
parsed-comment-star-64 : ParseTreeT
parsed-nonws : ParseTreeT
parsed-nonws-plus-70 : ParseTreeT
parsed-num : ParseTreeT
parsed-num-plus-5 : ParseTreeT
parsed-numone : ParseTreeT
parsed-numone-range-4 : ParseTreeT
parsed-numpunct : ParseTreeT
parsed-numpunct-bar-10 : ParseTreeT
parsed-numpunct-bar-11 : ParseTreeT
parsed-numpunct-bar-6 : ParseTreeT
parsed-numpunct-bar-7 : ParseTreeT
parsed-numpunct-bar-8 : ParseTreeT
parsed-numpunct-bar-9 : ParseTreeT
parsed-otherpunct : ParseTreeT
parsed-otherpunct-bar-12 : ParseTreeT
parsed-otherpunct-bar-13 : ParseTreeT
parsed-otherpunct-bar-14 : ParseTreeT
parsed-otherpunct-bar-15 : ParseTreeT
parsed-otherpunct-bar-16 : ParseTreeT
parsed-otherpunct-bar-17 : ParseTreeT
parsed-otherpunct-bar-18 : ParseTreeT
parsed-otherpunct-bar-19 : ParseTreeT
parsed-otherpunct-bar-20 : ParseTreeT
parsed-otherpunct-bar-21 : ParseTreeT
parsed-otherpunct-bar-22 : ParseTreeT
parsed-otherpunct-bar-23 : ParseTreeT
parsed-otherpunct-bar-24 : ParseTreeT
parsed-otherpunct-bar-25 : ParseTreeT
parsed-otherpunct-bar-26 : ParseTreeT
parsed-otherpunct-bar-27 : ParseTreeT
parsed-otherpunct-bar-28 : ParseTreeT
parsed-otherpunct-bar-29 : ParseTreeT
parsed-otherpunct-bar-30 : ParseTreeT
parsed-otherpunct-bar-31 : ParseTreeT
parsed-otherpunct-bar-32 : ParseTreeT
parsed-otherpunct-bar-33 : ParseTreeT
parsed-otherpunct-bar-34 : ParseTreeT
parsed-otherpunct-bar-35 : ParseTreeT
parsed-otherpunct-bar-36 : ParseTreeT
parsed-otherpunct-bar-37 : ParseTreeT
parsed-otherpunct-bar-38 : ParseTreeT
parsed-otherpunct-bar-39 : ParseTreeT
parsed-otherpunct-bar-40 : ParseTreeT
parsed-otherpunct-bar-41 : ParseTreeT
parsed-otherpunct-bar-42 : ParseTreeT
parsed-otherpunct-bar-43 : ParseTreeT
parsed-otherpunct-bar-44 : ParseTreeT
parsed-otherpunct-bar-45 : ParseTreeT
parsed-otherpunct-bar-46 : ParseTreeT
parsed-otherpunct-bar-47 : ParseTreeT
parsed-otherpunct-bar-48 : ParseTreeT
parsed-otherpunct-bar-49 : ParseTreeT
parsed-otherpunct-bar-50 : ParseTreeT
parsed-otherpunct-bar-51 : ParseTreeT
parsed-otherpunct-bar-52 : ParseTreeT
parsed-otherpunct-bar-53 : ParseTreeT
parsed-otherpunct-bar-54 : ParseTreeT
parsed-otherpunct-bar-55 : ParseTreeT
parsed-otherpunct-bar-56 : ParseTreeT
parsed-otherpunct-bar-57 : ParseTreeT
parsed-otherpunct-bar-58 : ParseTreeT
parsed-ws : ParseTreeT
parsed-ws-plus-67 : ParseTreeT
------------------------------------------
-- Parse tree printing functions
------------------------------------------
posinfoToString : posinfo → string
posinfoToString x = "(posinfo " ^ x ^ ")"
mutual
entitiesToString : entities → string
entitiesToString (EndEntity) = "EndEntity" ^ ""
entitiesToString (Entity x0 x1) = "(Entity" ^ " " ^ (entityToString x0) ^ " " ^ (entitiesToString x1) ^ ")"
entityToString : entity → string
entityToString (EntityComment x0 x1) = "(EntityComment" ^ " " ^ (posinfoToString x0) ^ " " ^ (posinfoToString x1) ^ ")"
entityToString (EntityNonws) = "EntityNonws" ^ ""
entityToString (EntityWs x0 x1) = "(EntityWs" ^ " " ^ (posinfoToString x0) ^ " " ^ (posinfoToString x1) ^ ")"
startToString : start → string
startToString (File x0) = "(File" ^ " " ^ (entitiesToString x0) ^ ")"
ParseTreeToString : ParseTreeT → string
ParseTreeToString (parsed-entities t) = entitiesToString t
ParseTreeToString (parsed-entity t) = entityToString t
ParseTreeToString (parsed-start t) = startToString t
ParseTreeToString (parsed-posinfo t) = posinfoToString t
ParseTreeToString parsed-alpha = "[alpha]"
ParseTreeToString parsed-alpha-bar-3 = "[alpha-bar-3]"
ParseTreeToString parsed-alpha-range-1 = "[alpha-range-1]"
ParseTreeToString parsed-alpha-range-2 = "[alpha-range-2]"
ParseTreeToString parsed-anychar = "[anychar]"
ParseTreeToString parsed-anychar-bar-59 = "[anychar-bar-59]"
ParseTreeToString parsed-anychar-bar-60 = "[anychar-bar-60]"
ParseTreeToString parsed-anychar-bar-61 = "[anychar-bar-61]"
ParseTreeToString parsed-anychar-bar-62 = "[anychar-bar-62]"
ParseTreeToString parsed-anychar-bar-63 = "[anychar-bar-63]"
ParseTreeToString parsed-anynonwschar = "[anynonwschar]"
ParseTreeToString parsed-anynonwschar-bar-68 = "[anynonwschar-bar-68]"
ParseTreeToString parsed-anynonwschar-bar-69 = "[anynonwschar-bar-69]"
ParseTreeToString parsed-aws = "[aws]"
ParseTreeToString parsed-aws-bar-65 = "[aws-bar-65]"
ParseTreeToString parsed-aws-bar-66 = "[aws-bar-66]"
ParseTreeToString parsed-comment = "[comment]"
ParseTreeToString parsed-comment-star-64 = "[comment-star-64]"
ParseTreeToString parsed-nonws = "[nonws]"
ParseTreeToString parsed-nonws-plus-70 = "[nonws-plus-70]"
ParseTreeToString parsed-num = "[num]"
ParseTreeToString parsed-num-plus-5 = "[num-plus-5]"
ParseTreeToString parsed-numone = "[numone]"
ParseTreeToString parsed-numone-range-4 = "[numone-range-4]"
ParseTreeToString parsed-numpunct = "[numpunct]"
ParseTreeToString parsed-numpunct-bar-10 = "[numpunct-bar-10]"
ParseTreeToString parsed-numpunct-bar-11 = "[numpunct-bar-11]"
ParseTreeToString parsed-numpunct-bar-6 = "[numpunct-bar-6]"
ParseTreeToString parsed-numpunct-bar-7 = "[numpunct-bar-7]"
ParseTreeToString parsed-numpunct-bar-8 = "[numpunct-bar-8]"
ParseTreeToString parsed-numpunct-bar-9 = "[numpunct-bar-9]"
ParseTreeToString parsed-otherpunct = "[otherpunct]"
ParseTreeToString parsed-otherpunct-bar-12 = "[otherpunct-bar-12]"
ParseTreeToString parsed-otherpunct-bar-13 = "[otherpunct-bar-13]"
ParseTreeToString parsed-otherpunct-bar-14 = "[otherpunct-bar-14]"
ParseTreeToString parsed-otherpunct-bar-15 = "[otherpunct-bar-15]"
ParseTreeToString parsed-otherpunct-bar-16 = "[otherpunct-bar-16]"
ParseTreeToString parsed-otherpunct-bar-17 = "[otherpunct-bar-17]"
ParseTreeToString parsed-otherpunct-bar-18 = "[otherpunct-bar-18]"
ParseTreeToString parsed-otherpunct-bar-19 = "[otherpunct-bar-19]"
ParseTreeToString parsed-otherpunct-bar-20 = "[otherpunct-bar-20]"
ParseTreeToString parsed-otherpunct-bar-21 = "[otherpunct-bar-21]"
ParseTreeToString parsed-otherpunct-bar-22 = "[otherpunct-bar-22]"
ParseTreeToString parsed-otherpunct-bar-23 = "[otherpunct-bar-23]"
ParseTreeToString parsed-otherpunct-bar-24 = "[otherpunct-bar-24]"
ParseTreeToString parsed-otherpunct-bar-25 = "[otherpunct-bar-25]"
ParseTreeToString parsed-otherpunct-bar-26 = "[otherpunct-bar-26]"
ParseTreeToString parsed-otherpunct-bar-27 = "[otherpunct-bar-27]"
ParseTreeToString parsed-otherpunct-bar-28 = "[otherpunct-bar-28]"
ParseTreeToString parsed-otherpunct-bar-29 = "[otherpunct-bar-29]"
ParseTreeToString parsed-otherpunct-bar-30 = "[otherpunct-bar-30]"
ParseTreeToString parsed-otherpunct-bar-31 = "[otherpunct-bar-31]"
ParseTreeToString parsed-otherpunct-bar-32 = "[otherpunct-bar-32]"
ParseTreeToString parsed-otherpunct-bar-33 = "[otherpunct-bar-33]"
ParseTreeToString parsed-otherpunct-bar-34 = "[otherpunct-bar-34]"
ParseTreeToString parsed-otherpunct-bar-35 = "[otherpunct-bar-35]"
ParseTreeToString parsed-otherpunct-bar-36 = "[otherpunct-bar-36]"
ParseTreeToString parsed-otherpunct-bar-37 = "[otherpunct-bar-37]"
ParseTreeToString parsed-otherpunct-bar-38 = "[otherpunct-bar-38]"
ParseTreeToString parsed-otherpunct-bar-39 = "[otherpunct-bar-39]"
ParseTreeToString parsed-otherpunct-bar-40 = "[otherpunct-bar-40]"
ParseTreeToString parsed-otherpunct-bar-41 = "[otherpunct-bar-41]"
ParseTreeToString parsed-otherpunct-bar-42 = "[otherpunct-bar-42]"
ParseTreeToString parsed-otherpunct-bar-43 = "[otherpunct-bar-43]"
ParseTreeToString parsed-otherpunct-bar-44 = "[otherpunct-bar-44]"
ParseTreeToString parsed-otherpunct-bar-45 = "[otherpunct-bar-45]"
ParseTreeToString parsed-otherpunct-bar-46 = "[otherpunct-bar-46]"
ParseTreeToString parsed-otherpunct-bar-47 = "[otherpunct-bar-47]"
ParseTreeToString parsed-otherpunct-bar-48 = "[otherpunct-bar-48]"
ParseTreeToString parsed-otherpunct-bar-49 = "[otherpunct-bar-49]"
ParseTreeToString parsed-otherpunct-bar-50 = "[otherpunct-bar-50]"
ParseTreeToString parsed-otherpunct-bar-51 = "[otherpunct-bar-51]"
ParseTreeToString parsed-otherpunct-bar-52 = "[otherpunct-bar-52]"
ParseTreeToString parsed-otherpunct-bar-53 = "[otherpunct-bar-53]"
ParseTreeToString parsed-otherpunct-bar-54 = "[otherpunct-bar-54]"
ParseTreeToString parsed-otherpunct-bar-55 = "[otherpunct-bar-55]"
ParseTreeToString parsed-otherpunct-bar-56 = "[otherpunct-bar-56]"
ParseTreeToString parsed-otherpunct-bar-57 = "[otherpunct-bar-57]"
ParseTreeToString parsed-otherpunct-bar-58 = "[otherpunct-bar-58]"
ParseTreeToString parsed-ws = "[ws]"
ParseTreeToString parsed-ws-plus-67 = "[ws-plus-67]"
------------------------------------------
-- Reorganizing rules
------------------------------------------
mutual
{-# TERMINATING #-}
norm-start : (x : start) → start
norm-start x = x
{-# TERMINATING #-}
norm-posinfo : (x : posinfo) → posinfo
norm-posinfo x = x
{-# TERMINATING #-}
norm-entity : (x : entity) → entity
norm-entity x = x
{-# TERMINATING #-}
norm-entities : (x : entities) → entities
norm-entities x = x
isParseTree : ParseTreeT → 𝕃 char → string → Set
isParseTree p l s = ⊤ {- this will be ignored since we are using simply typed runs -}
ptr : ParseTreeRec
ptr = record { ParseTreeT = ParseTreeT ; isParseTree = isParseTree ; ParseTreeToString = ParseTreeToString }
|
robozonky-strategy-natural/src/main/antlr4/imports/PortfolioStructure.g4 | liry/robozonky | 0 | 4730 | grammar PortfolioStructure;
import Tokens;
@header {
import java.math.BigInteger;
import com.github.robozonky.strategy.natural.*;
}
portfolioStructureExpression returns [Collection<PortfolioShare> result]:
{ Collection<PortfolioShare> result = new LinkedHashSet<>(); }
(i=portfolioStructureInterestRateExpression { result.add($i.result); })+
{ $result = result; }
;
portfolioStructureInterestRateExpression returns [PortfolioShare result] :
'Prostředky úročené ' r=interestRateBasedRatingExpression 'mají tvořit' (
(
maximumInvestmentInCzk=floatExpr {
$result = new PortfolioShare($r.result,
Ratio.fromPercentage($maximumInvestmentInCzk.result.doubleValue()));
}
)
| (
minimumInvestmentInCzk=floatExpr UP_TO maximumInvestmentInCzk=floatExpr {
$result = new PortfolioShare($r.result,
Ratio.fromPercentage($minimumInvestmentInCzk.result.doubleValue()),
Ratio.fromPercentage($maximumInvestmentInCzk.result.doubleValue()));
}
)
) ' % aktuální zůstatkové částky' DOT
;
|
oeis/218/A218689.asm | neoneye/loda-programs | 11 | 22727 | ; A218689: Sum_{k=0..n} C(n,k)^6*C(n+k,k)^6.
; Submitted by <NAME>
; 1,65,93313,795985985,8178690000001,93706344780048065,1453730786373283012225,26552497154713885161031745,513912636558068387176582890625,10769375530849394271690330588432065,243282405272735566295972089793676717313,5763401688773271719278313934033057270226625,142020678586784232143338559724075425469941040769,3633770713698966683101547530978616042235164846751425,95921469516153233420271129524429872503350839695880797313,2598572242678786184480592052415877916638983134788962504017985
mov $3,$0
mov $5,$0
lpb $5
mov $0,$3
sub $5,1
sub $0,$5
mov $1,$0
add $1,$3
bin $1,$0
pow $1,6
mov $2,$3
bin $2,$0
pow $2,6
mul $1,$2
add $4,$1
lpe
mov $0,$4
add $0,1
|
programs/oeis/209/A209529.asm | neoneye/loda | 22 | 15864 | ; A209529: Half the number of (n+1)X(n+1) 0..2 arrays with every 2X2 subblock having exactly two distinct clockwise edge differences
; 5,25,257,6145,262145,25165825,4294967297,1649267441665,1125899906842625,1729382256910270465,4722366482869645213697,29014219670751100192948225,316912650057057350374175801345,7788445287802241442795744493830145
add $0,2
pow $0,2
seq $0,136252 ; a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3).
sub $0,13
div $0,4
add $0,5
|
oeis/182/A182879.asm | neoneye/loda-programs | 11 | 90054 | <reponame>neoneye/loda-programs
; A182879: The sum of the lengths of all weighted lattice paths in L_n.
; Submitted by <NAME>
; 0,1,3,11,33,96,278,787,2205,6133,16941,46554,127390,347331,944121,2559607,6923529,18690138,50364988,135506485,364063815,976880631,2618206923,7009868646,18749876418,50107633501,133800148323,357012426677,951936494055,2536599284778,6755136924776,17979272262435,47827901887053,127167453776147,337962823166079,897784176336948,2383942546651604,6327764561762931,16789764455190525,44533519974141569,118082434496217303,313001615462561862,829425717841530860,2197273990273900323,5819323044303794673
lpb $0
sub $0,1
add $1,1
add $2,1
mov $3,$0
bin $3,$2
pow $3,2
mul $3,$0
add $1,$3
lpe
mov $0,$1
|
llvm-gcc-4.2-2.9/gcc/ada/opt.ads | vidkidz/crossbridge | 1 | 68 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- O P T --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, 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, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains global flags set by the initialization routine from
-- the command line and referenced throughout the compiler, the binder, or
-- other GNAT tools. The comments indicate which options are used by which
-- programs (GNAT, GNATBIND, GNATLINK, GNATMAKE, GPRMAKE, etc).
with Hostparm; use Hostparm;
with Types; use Types;
with System.WCh_Con; use System.WCh_Con;
with GNAT.Strings; use GNAT.Strings;
package Opt is
----------------------------------------------
-- Settings of Modes for Current Processing --
----------------------------------------------
-- The following mode values represent the current state of processing.
-- The values set here are the default values. Unless otherwise noted,
-- the value may be reset in Switch-? with an appropropiate switch. In
-- some cases, the values can also be modified by pragmas, and in the
-- case of some binder variables, Gnatbind.Scan_Bind_Arg may modify
-- the default values.
Ada_Bind_File : Boolean := True;
-- GNATBIND, GNATLINK
-- Set True if binder file to be generated in Ada rather than C
type Ada_Version_Type is (Ada_83, Ada_95, Ada_05);
pragma Warnings (Off, Ada_Version_Type);
-- Versions of Ada for Ada_Version below. Note that these are ordered,
-- so that tests like Ada_Version >= Ada_95 are legitimate and useful.
-- The Warnings_Off pragma stops warnings for Ada_Version >= Ada_05,
-- which we want to allow, so that things work OK when Ada_15 is added!
-- This warning is now removed, so this pragma can be removed some time???
Ada_Version_Default : Ada_Version_Type := Ada_05;
-- GNAT
-- Default Ada version if no switch given
Ada_Version : Ada_Version_Type := Ada_Version_Default;
-- GNAT
-- Current Ada version for compiler, as set by configuration pragmas,
-- compiler switches, or implicitly (to Ada_Version_Runtime) when a
-- predefined or internal file is compiled.
Ada_Version_Explicit : Ada_Version_Type := Ada_Version_Default;
-- GNAT
-- Like Ada_Version, but does not get set implicitly for predefined
-- or internal units, so it reflects the Ada version explicitly set
-- using configuration pragmas or compiler switches (or if neither
-- appears, it remains set to Ada_Version_Default). This is used in
-- the rare cases (notably for pragmas Preelaborate_05 and Pure_05)
-- where in the run-time we want the explicit version set.
Ada_Version_Runtime : Ada_Version_Type := Ada_05;
-- GNAT
-- Ada version used to compile the runtime. Used to set Ada_Version (but
-- not Ada_Version_Explicit) when compiling predefined or internal units.
Ada_Final_Suffix : constant String := "final";
Ada_Final_Name : String_Ptr := new String'("ada" & Ada_Final_Suffix);
-- GNATBIND
-- The name of the procedure that performs the finalization at the end of
-- execution. This variable may be modified by Gnatbind.Scan_Bind_Arg.
Ada_Init_Suffix : constant String := "init";
Ada_Init_Name : String_Ptr := new String'("ada" & Ada_Init_Suffix);
-- GNATBIND
-- The name of the procedure that performs initialization at the start
-- of execution. This variable may be modified by Gnatbind.Scan_Bind_Arg.
Ada_Main_Name_Suffix : constant String := "main";
-- GNATBIND
-- The suffix for Ada_Main_Name. Defined as a constant here so that it
-- can be referenced in a uniform manner to create either the default
-- value of Ada_Main_Name (declared below), or the non-default name
-- set by Gnatbind.Scan_Bind_Arg.
Ada_Main_Name : String_Ptr := new String'("ada_" & Ada_Main_Name_Suffix);
-- GNATBIND
-- The name of the Ada package generated by the binder (when in Ada mode).
-- This variable may be modified by Gnatbind.Scan_Bind_Arg.
Address_Clause_Overlay_Warnings : Boolean := True;
-- GNAT
-- Set False to disable address clause warnings
Address_Is_Private : Boolean := False;
-- GNAT, GNATBIND
-- Set True if package System has the line "type Address is private;"
All_Errors_Mode : Boolean := False;
-- GNAT
-- Flag set to force display of multiple errors on a single line and
-- also repeated error messages for references to undefined identifiers
-- and certain other repeated error messages.
All_Sources : Boolean := False;
-- GNATBIND
-- Set to True to require all source files to be present. This flag is
-- directly modified by gnatmake to affect the shared binder routines.
Alternate_Main_Name : String_Ptr := null;
-- GNATBIND
-- Set to non null when Bind_Alternate_Main_Name is True. This value
-- is modified as needed by Gnatbind.Scan_Bind_Arg.
Assertions_Enabled : Boolean := False;
-- GNAT
-- Enable assertions made using pragma Assert
ASIS_Mode : Boolean := False;
-- GNAT
-- Enable semantic checks and tree transformations that are important
-- for ASIS but that are usually skipped if Operating_Mode is set to
-- Check_Semantics. This flag does not have the corresponding option to set
-- it ON. It is set ON when Tree_Output is set ON, it can also be set ON
-- from the code of GNSA-based tool (a client may need to set ON the
-- Back_Annotate_Rep_Info flag in this case. At the moment this does not
-- make very much sense, because GNSA cannot do back annotation).
Back_Annotate_Rep_Info : Boolean := False;
-- GNAT
-- If set True, enables back annotation of representation information
-- by gigi, even in -gnatc mode. This is set True by the use of -gnatR
-- (list representation information) or -gnatt (generate tree). It is
-- also set true if certain Unchecked_Conversion instantiations require
-- checking based on annotated values.
Bind_Alternate_Main_Name : Boolean := False;
-- GNATBIND
-- True if main should be called Alternate_Main_Name.all.
-- This variable may be set to True by Gnatbind.Scan_Bind_Arg.
Bind_Main_Program : Boolean := True;
-- GNATBIND
-- Set to False if not binding main Ada program
Bind_For_Library : Boolean := False;
-- GNATBIND
-- Set to True if the binder needs to generate a file designed for
-- building a library. May be set to True by Gnatbind.Scan_Bind_Arg.
Bind_Only : Boolean := False;
-- GNATMAKE, GPRMAKE
-- Set to True to skip compile and link steps
-- (except when Compile_Only and/or Link_Only are True).
Blank_Deleted_Lines : Boolean := False;
-- GNAT, GNATPREP
-- Output empty lines for each line of preprocessed input that is deleted
-- in the output, including preprocessor lines starting with a '#'.
Brief_Output : Boolean := False;
-- GNAT, GNATBIND
-- Force brief error messages to standard error, even if verbose mode is
-- set (so that main error messages go to standard output).
Build_Bind_And_Link_Full_Project : Boolean := False;
-- GNATMAKE
-- Set to True to build, bind and link all the sources of a project file
-- (switch -B)
Check_Object_Consistency : Boolean := False;
-- GNATBIND, GNATMAKE
-- Set to True to check whether every object file is consistent with
-- its corresponding ada library information (ALI) file. An object
-- file is inconsistent with the corresponding ALI file if the object
-- file does not exist or if it has an older time stamp than the ALI file.
-- Default above is for GNATBIND. GNATMAKE overrides this default to
-- True (see Make.Initialize) since we normally do need to check source
-- consistencies in gnatmake.
Check_Only : Boolean := False;
-- GNATBIND
-- Set to True to do checks only, no output of binder file
Check_Readonly_Files : Boolean := False;
-- GNATMAKE
-- Set to True to check readonly files during the make process
Check_Source_Files : Boolean := True;
-- GNATBIND, GNATMAKE
-- Set to True to enable consistency checking for any source files that
-- are present (i.e. date must match the date in the library info file).
-- Set to False for object file consistency check only. This flag is
-- directly modified by gnatmake, to affect the shared binder routines.
Check_Switches : Boolean := False;
-- GNATMAKE, GPRMAKE
-- Set to True to check compiler options during the make process
Check_Unreferenced : Boolean := False;
-- GNAT
-- Set to True to enable checking for unreferenced entities other
-- than formal parameters (for which see Check_Unreferenced_Formals)
Check_Unreferenced_Formals : Boolean := False;
-- GNAT
-- Set True to check for unreferenced formals. This is turned on by
-- -gnatwa/wf/wu and turned off by -gnatwA/wF/wU.
Check_Withs : Boolean := False;
-- GNAT
-- Set to True to enable checking for unused withs, and also the case
-- of withing a package and using none of the entities in the package.
Comment_Deleted_Lines : Boolean := False;
-- GNATPREP
-- True if source lines removed by the preprocessor should be commented
-- in the output file.
Compile_Only : Boolean := False;
-- GNATMAKE, GNATCLEAN, GPRMAKE
-- GNATMAKE, GPRMAKE: set to True to skip bind and link steps (except when
-- Bind_Only is True).
-- GNATCLEAN: set to True to only the files produced by the compiler are to
-- be deleted, but not the library files or executable files.
Config_File : Boolean := True;
-- GNAT
-- Set to False to inhibit reading and processing of gnat.adc file
Config_File_Names : String_List_Access := null;
-- GNAT
-- Names of configuration pragmas files (given by switches -gnatec)
Configurable_Run_Time_Mode : Boolean := False;
-- GNAT, GNATBIND
-- Set True if the compiler is operating in configurable run-time mode.
-- This happens if the flag Targparm.Configurable_Run_TimeMode_On_Target
-- is set True, or if pragma No_Run_Time is used. See the spec of Rtsfind
-- for details on the handling of the latter pragma.
Constant_Condition_Warnings : Boolean := False;
-- GNAT
-- Set to True to activate warnings on constant conditions
Create_Mapping_File : Boolean := False;
-- GNATMAKE, GPRMAKE
-- Set to True (-C switch) to indicate that the compiler will be invoked
-- with a mapping file (-gnatem compiler switch).
Debug_Pragmas_Enabled : Boolean := False;
-- GNAT
-- Enable debug statements from pragma Debug
subtype Debug_Level_Value is Nat range 0 .. 3;
Debugger_Level : Debug_Level_Value := 0;
-- GNATBIND
-- The value given to the -g parameter. The default value for -g with
-- no value is 2. This is usually ignored by GNATBIND, except in the
-- VMS version where it is passed as an argument to __gnat_initialize
-- to trigger the activation of the remote debugging interface.
-- Is this still true ???
Debug_Generated_Code : Boolean := False;
-- GNAT
-- Set True (-gnatD switch) to debug generated expanded code instead
-- of the original source code. Causes debugging information to be
-- written with respect to the generated code file that is written.
Default_Exit_Status : Int := 0;
-- GNATBIND
-- Set the default exit status value. Set by the -Xnnn switch for the
-- binder.
Default_Stack_Size : Int := -1;
-- GNATBIND
-- Set to default primary stack size in units of bytes. Set by
-- the -dnnn switch for the binder. A value of -1 indicates that no
-- default was set by the binder.
Default_Sec_Stack_Size : Int := -1;
-- GNATBIND
-- Set to default secondary stack size in units of bytes. Set by
-- the -Dnnn switch for the binder. A value of -1 indicates that no
-- default was set by the binder, and that the default should be the
-- initial value of System.Secondary_Stack.Default_Secondary_Stack_Size.
Detect_Blocking : Boolean := False;
-- GNAT
-- Set True to force the run time to raise Program_Error if calls to
-- potentially blocking operations are detected from protected actions.
Display_Compilation_Progress : Boolean := False;
-- GNATMAKE, GPRMAKE
-- Set True (-d switch) to display information on progress while compiling
-- files. Internal flag to be used in conjunction with an IDE (e.g GPS).
type Distribution_Stub_Mode_Type is
-- GNAT
(No_Stubs,
-- Normal mode, no generation/compilation of distribution stubs
Generate_Receiver_Stub_Body,
-- The unit being compiled is the RCI body, and the compiler will
-- generate the body for the receiver stubs and compile it.
Generate_Caller_Stub_Body);
-- The unit being compiled is the RCI spec, and the compiler will
-- generate the body for the caller stubs and compile it.
Distribution_Stub_Mode : Distribution_Stub_Mode_Type := No_Stubs;
-- GNAT
-- This enumeration variable indicates the five states of distribution
-- annex stub generation/compilation.
Do_Not_Execute : Boolean := False;
-- GNATMAKE
-- Set to True if no actual compilations should be undertaken.
Dynamic_Elaboration_Checks : Boolean := False;
-- GNAT
-- Set True for dynamic elaboration checking mode, as set by the -gnatE
-- switch or by the use of pragma Elaboration_Checks (Dynamic).
Dynamic_Stack_Measurement : Boolean := False;
-- GNATBIND
-- Set True to enable dynamic stack measurement (-u flag for gnatbind)
Dynamic_Stack_Measurement_Array_Size : Nat := 100;
-- GNATBIND
-- Number of measurements we want to store during dynamic stack analysis.
-- When the buffer is full, non-storable results will be output on the fly.
-- The value is relevant only if Dynamic_Stack_Measurement is set. Set
-- by processing of -u flag for gnatbind.
Elab_Dependency_Output : Boolean := False;
-- GNATBIND
-- Set to True to output complete list of elaboration constraints
Elab_Order_Output : Boolean := False;
-- GNATBIND
-- Set to True to output chosen elaboration order
Elab_Warnings : Boolean := False;
-- GNAT
-- Set to True to generate full elaboration warnings (-gnatwl)
Enable_Overflow_Checks : Boolean := False;
-- GNAT
-- Set to True if -gnato (enable overflow checks) switch is set,
-- but not -gnatp.
Exception_Locations_Suppressed : Boolean := False;
-- GNAT
-- This flag is set True if a Suppress_Exception_Locations configuration
-- pragma is currently active.
type Exception_Mechanism_Type is
-- Determines the handling of exceptions. See Exp_Ch11 for details
--
(Front_End_Setjmp_Longjmp_Exceptions,
-- Exceptions use setjmp/longjmp generated explicitly by the
-- front end (this includes gigi or other equivalent parts of
-- the code generator). AT END handlers are converted into
-- exception handlers by the front end in this mode.
Back_End_Exceptions);
-- Exceptions are handled by the back end. The front end simply
-- generates the handlers as they appear in the source, and AT
-- END handlers are left untouched (they are not converted into
-- exception handlers when operating in this mode.
pragma Convention (C, Exception_Mechanism_Type);
Exception_Mechanism : Exception_Mechanism_Type :=
Front_End_Setjmp_Longjmp_Exceptions;
-- GNAT
-- Set to the appropriate value depending on the default as given in
-- system.ads (ZCX_By_Default, GCC_ZCX_Support).
-- The C convention is there to make this variable accessible to gigi.
Exception_Tracebacks : Boolean := False;
-- GNATBIND
-- Set to True to store tracebacks in exception occurrences (-E)
Extensions_Allowed : Boolean := False;
-- GNAT
-- Set to True by switch -gnatX if GNAT specific language extensions
-- are allowed. For example, "limited with" is a GNAT extension.
type External_Casing_Type is (
As_Is, -- External names cased as they appear in the Ada source
Uppercase, -- External names forced to all uppercase letters
Lowercase); -- External names forced to all lowercase letters
External_Name_Imp_Casing : External_Casing_Type := Lowercase;
-- GNAT
-- The setting of this flag determines the casing of external names
-- when the name is implicitly derived from an entity name (i.e. either
-- no explicit External_Name or Link_Name argument is used, or, in the
-- case of extended DEC pragmas, the external name is given using an
-- identifier. The As_Is setting is not permitted here (since this would
-- create Ada source programs that were case sensitive).
External_Name_Exp_Casing : External_Casing_Type := As_Is;
-- GNAT
-- The setting of this flag determines the casing of an external name
-- specified explicitly with a string literal. As_Is means the string
-- literal is used as given with no modification to the casing. If
-- Lowercase or Uppercase is set, then the string is forced to all
-- lowercase or all uppercase letters as appropriate. Note that this
-- setting has no effect if the external name is given using an identifier
-- in the case of extended DEC import/export pragmas (in this case the
-- casing is controlled by External_Name_Imp_Casing), and also has no
-- effect if an explicit Link_Name is supplied (a link name is always
-- used exactly as given).
External_Unit_Compilation_Allowed : Boolean := False;
-- GNATMAKE
-- When True (set by gnatmake switch -x), allow compilation of sources
-- that are not part of any project file.
Float_Format : Character := ' ';
-- GNAT
-- A non-blank value indicates that a Float_Format pragma has been
-- processed, in which case this variable is set to 'I' for IEEE or
-- to 'V' for VAX. The setting of 'V' is only possible on OpenVMS
-- versions of GNAT.
Float_Format_Long : Character := ' ';
-- GNAT
-- A non-blank value indicates that a Long_Float pragma has been
-- processed (this pragma is recognized only in OpenVMS versions
-- of GNAT), in which case this variable is set to D or G for
-- D_Float or G_Float.
Force_ALI_Tree_File : Boolean := False;
-- GNAT
-- Force generation of ALI file even if errors are encountered.
-- Also forces generation of tree file if -gnatt is also set.
Force_Checking_Of_Elaboration_Flags : Boolean := False;
-- GNATBIND
-- True if binding with forced checking of the elaboration flags
-- (-F switch set).
Force_Compilations : Boolean := False;
-- GNATMAKE, GPRMAKE
-- Set to force recompilations even when the objects are up-to-date.
Full_Path_Name_For_Brief_Errors : Boolean := False;
-- GNAT, GNATMAKE, GNATCLEAN, GPRMAKE
-- When True, in Brief_Output mode, each error message line
-- will start with the full path name of the source.
-- When False, only the file name without directory information
-- is used.
Full_List : Boolean := False;
-- GNAT
-- Set True to generate full source listing with embedded errors
function get_gcc_version return Int;
pragma Import (C, get_gcc_version, "get_gcc_version");
GCC_Version : constant Nat := get_gcc_version;
-- GNATMAKE
-- Indicates which version of gcc is in use (2 = 2.8.1, 3 = 3.x)
Global_Discard_Names : Boolean := False;
-- GNAT, GNATBIND
-- Set true if a pragma Discard_Names applies to the current unit
GNAT_Mode : Boolean := False;
-- GNAT
-- True if compiling in GNAT system mode (-gnatg switch)
HLO_Active : Boolean := False;
-- GNAT
-- True if High Level Optimizer is activated (-gnatH switch)
Implementation_Unit_Warnings : Boolean := True;
-- GNAT
-- Set True to active warnings for use of implementation internal units.
-- Can be controlled by use of -gnatwi/-gnatwI.
Identifier_Character_Set : Character;
-- GNAT
-- This variable indicates the character set to be used for identifiers.
-- The possible settings are:
-- '1' Latin-5 (ISO-8859-1)
-- '2' Latin-5 (ISO-8859-2)
-- '3' Latin-5 (ISO-8859-3)
-- '4' Latin-5 (ISO-8859-4)
-- '5' Latin-5 (ISO-8859-5, Cyrillic)
-- '9' Latin-5 (ISO-8859-9)
-- 'p' PC (US, IBM page 437)
-- '8' PC (European, IBM page 850)
-- 'f' Full upper set (all distinct)
-- 'n' No upper characters (Ada 83 rules)
-- 'w' Latin-1 plus wide characters allowed in identifiers
--
-- The setting affects the set of letters allowed in identifiers and the
-- upper/lower case equivalences. It does not affect the interpretation of
-- character and string literals, which are always stored using the actual
-- coding in the source program. This variable is initialized to the
-- default value appropriate to the system (in Osint.Initialize), and then
-- reset if a command line switch is used to change the setting.
Ineffective_Inline_Warnings : Boolean := False;
-- GNAT
-- Set True to activate warnings if front-end inlining (-gnatN) is not
-- able to actually inline a particular call (or all calls). Can be
-- controlled by use of -gnatwp/-gnatwP.
Init_Or_Norm_Scalars : Boolean := False;
-- GNAT, GANTBIND
-- Set True if a pragma Initialize_Scalars applies to the current unit.
-- Also set True if a pragma Normalize_Scalars applies.
Initialize_Scalars : Boolean := False;
-- GNAT
-- Set True if a pragma Initialize_Scalars applies to the current unit.
-- Note that Init_Or_Norm_Scalars is also set to True if this is True.
Initialize_Scalars_Mode1 : Character := 'I';
Initialize_Scalars_Mode2 : Character := 'N';
-- GNATBIND
-- Set to two characters from -S switch (IN/LO/HI/EV/xx). The default
-- is IN (invalid values), used if no -S switch is used.
Inline_Active : Boolean := False;
-- GNAT
-- Set True to activate pragma Inline processing across modules. Default
-- for now is not to inline across module boundaries.
Interface_Library_Unit : Boolean := False;
-- GNATBIND
-- Set to True to indicate that at least one ALI file is an interface ALI:
-- then elaboration flag checks are to be generated in the binder
-- generated file.
Follow_Links : Boolean := False;
-- GNATMAKE
-- Set to True (-eL) to process the project files in trusted mode
Front_End_Inlining : Boolean := False;
-- GNAT
-- Set True to activate inlining by front-end expansion
Inline_Processing_Required : Boolean := False;
-- GNAT
-- Set True if inline processing is required. Inline processing is
-- required if an active Inline pragma is processed. The flag is set
-- for a pragma Inline or Inline_Always that is actually active.
In_Place_Mode : Boolean := False;
-- GNATMAKE
-- Set True to store ALI and object files in place ie in the object
-- directory if these files already exist or in the source directory
-- if not.
Keep_Going : Boolean := False;
-- GNATMAKE, GPRMAKE
-- When True signals to ignore compilation errors and keep
-- processing sources until there is no more work.
Keep_Temporary_Files : Boolean := False;
-- GNATCMD
-- When True the temporary files created by the GNAT driver are not
-- deleted. Set by switch -dn or qualifier /KEEP_TEMPORARY_FILES.
Link_Only : Boolean := False;
-- GNATMAKE, GPRMAKE
-- Set to True to skip compile and bind steps
-- (except when Bind_Only is set to True).
List_Restrictions : Boolean := False;
-- GNATBIND
-- Set to True to list restrictions pragmas that could apply to partition
List_Units : Boolean := False;
-- GNAT
-- List units in the active library for a compilation (-gnatu switch)
List_Dependencies : Boolean := False;
-- GNATMAKE
-- When True gnatmake verifies that the objects are up to date and
-- outputs the list of object dependencies (-M switch).
-- Output depends if -a switch is used or not.
-- This list can be used directly in a Makefile.
List_Representation_Info : Int range 0 .. 3 := 0;
-- GNAT
-- Set non-zero by -gnatR switch to list representation information.
-- The settings are as follows:
--
-- 0 = no listing of representation information (default as above)
-- 1 = list rep info for user defined record and array types
-- 2 = list rep info for all user defined types and objects
-- 3 = like 2, but variable fields are decoded symbolically
List_Representation_Info_To_File : Boolean := False;
-- GNAT
-- Set true by -gnatRs switch. Causes information from -gnatR/1/2/3
-- to be written to file.rep (where file is the name of the source
-- file) instead of stdout. For example, if file x.adb is compiled
-- using -gnatR2s then representation info is written to x.adb.ref.
List_Representation_Info_Mechanisms : Boolean := False;
-- GNAT
-- Set true by -gnatRm switch. Causes information on mechanisms to
-- be included in the representation output information.
List_Preprocessing_Symbols : Boolean := False;
-- GNAT, GNATPREP
-- Set to True if symbols for preprocessing a source are to be listed
-- before preprocessing occurs. Set to True by switch -s of gnatprep
-- or -s in preprocessing data file for the compiler.
type Creat_Repinfo_File_Proc is access procedure (Src : File_Name_Type);
type Write_Repinfo_Line_Proc is access procedure (Info : String);
type Close_Repinfo_File_Proc is access procedure;
-- Types used for procedure addresses below
Creat_Repinfo_File_Access : Creat_Repinfo_File_Proc := null;
Write_Repinfo_Line_Access : Write_Repinfo_Line_Proc := null;
Close_Repinfo_File_Access : Close_Repinfo_File_Proc := null;
-- GNAT
-- These three locations are left null when operating in non-compiler
-- (e.g. ASIS mode), but when operating in compiler mode, they are
-- set to point to the three corresponding procedures in Osint. The
-- reason for this slightly strange interface is to prevent Repinfo
-- from dragging in Osint in ASIS mode, which would include a lot of
-- unwanted units in the ASIS build.
Locking_Policy : Character := ' ';
-- GNAT, GNATBIND
-- Set to ' ' for the default case (no locking policy specified).
-- Reset to first character (uppercase) of locking policy name if a
-- valid pragma Locking_Policy is encountered.
Locking_Policy_Sloc : Source_Ptr := No_Location;
-- GNAT, GNATBIND
-- Remember location of previous Locking_Policy pragma. This is used
-- for inconsistency error messages. A value of System_Location is
-- used if the policy is set in package System.
Look_In_Primary_Dir : Boolean := True;
-- GNAT, GNATBIND, GNATMAKE, GNATCLEAN
-- Set to False if a -I- was present on the command line.
-- When True we are allowed to look in the primary directory to locate
-- other source or library files.
Make_Steps : Boolean := False;
-- GNATMAKE
-- Set to True when either Compile_Only, Bind_Only or Link_Only is
-- set to True.
Main_Index : Int := 0;
-- GNATMAKE
-- This is set to non-zero by gnatmake switch -eInnn to indicate that
-- the main program is the nnn unit in a multi-unit source file.
Mapping_File_Name : String_Ptr := null;
-- GNAT
-- File name of mapping between unit names, file names and path names.
-- (given by switch -gnatem)
Maximum_Errors : Int := 9999;
-- GNAT, GNATBIND
-- Maximum default number of errors before compilation is terminated.
-- Can be overridden using -gnatm (GNAT) or -m (GNATBIND) switch.
Maximum_File_Name_Length : Int;
-- GNAT, GNATBIND
-- Maximum number of characters allowed in a file name, not counting the
-- extension, as set by the appropriate switch. If no switch is given,
-- then this value is initialized by Osint to the appropriate value.
Maximum_Processes : Positive := 1;
-- GNATMAKE, GPRMAKE
-- Maximum number of processes that should be spawned to carry out
-- compilations.
Minimal_Recompilation : Boolean := False;
-- GNATMAKE
-- Set to True if minimal recompilation mode requested
Multiple_Unit_Index : Int;
-- GNAT
-- This is set non-zero if the current unit is being compiled in multiple
-- unit per file mode, meaning that the current unit is selected from the
-- sequence of units in the current source file, using the value stored
-- in this variable (e.g. 2 = select second unit in file). A value of
-- zero indicates that we are in normal (one unit per file) mode.
No_Main_Subprogram : Boolean := False;
-- GNATMAKE, GNATBIND
-- Set to True if compilation/binding of a program without main
-- subprogram requested.
No_Run_Time_Mode : Boolean := False;
-- GNAT, GNATBIND
-- This flag is set True if a No_Run_Time pragma is encountered. See
-- spec of Rtsfind for a full description of handling of this pragma.
No_Stdinc : Boolean := False;
-- GNAT, GNATBIND, GNATMAKE, GNATFIND, GNATXREF
-- Set to True if no default source search dirs added to search list
No_Stdlib : Boolean := False;
-- GNATMAKE, GNATBIND, GNATFIND, GNATXREF
-- Set to True if no default library search dirs added to search list
No_Strict_Aliasing : Boolean := False;
-- GNAT
-- Set True if pragma No_Strict_Aliasing with no parameters encountered
Normalize_Scalars : Boolean := False;
-- GNAT, GNATBIND
-- Set True if a pragma Normalize_Scalars applies to the current unit.
-- Note that Init_Or_Norm_Scalars is also set to True if this is True.
Object_Directory_Present : Boolean := False;
-- GNATMAKE
-- Set to True when an object directory is specified with option -D
type Operating_Mode_Type is (Check_Syntax, Check_Semantics, Generate_Code);
Operating_Mode : Operating_Mode_Type := Generate_Code;
-- GNAT
-- Indicates the operating mode of the compiler. The default is generate
-- code, which runs the parser, semantics and backend. Switches can be
-- used to set syntax checking only mode, or syntax and semantics checking
-- only mode. Operating_Mode can also be modified as a result of detecting
-- errors during the compilation process. In particular if any serious
-- error is detected then this flag is reset from Generate_Code to
-- Check_Semantics after generating an error message.
Original_Operating_Mode : Operating_Mode_Type := Generate_Code;
-- GNAT
-- Indicates the original operating mode of the compiler as set by
-- compiler options. This is identical to Operating_Mode except that
-- this is not affected by errors.
-- LLVM LOCAL begin
function Optimization_Level return Int;
pragma Import (C, Optimization_Level, "optimization_level");
-- LLVM LOCAL end
-- This constant reflects the optimization level (0,1,2 for -O0,-O1,-O2)
Output_File_Name_Present : Boolean := False;
-- GNATBIND, GNAT, GNATMAKE, GPRMAKE
-- Set to True when the output C file name is given with option -o
-- for GNATBIND, when the object file name is given with option
-- -gnatO for GNAT or when the executable is given with option -o
-- for GNATMAKE or GPRMAKE.
Output_Linker_Option_List : Boolean := False;
-- GNATBIND
-- True if output of list of linker options is requested (-K switch set)
Output_Object_List : Boolean := False;
-- GNATBIND
-- True if output of list of objects is requested (-O switch set)
Persistent_BSS_Mode : Boolean := False;
-- GNAT
-- True if a Persistent_BSS configuration pragma is in effect, causing
-- potentially persistent data to be placed in the persistent_bss section.
Pessimistic_Elab_Order : Boolean := False;
-- GNATBIND
-- True if pessimistic elaboration order is to be chosen (-p switch set)
Polling_Required : Boolean := False;
-- GNAT
-- Set to True if polling for asynchronous abort is enabled by using
-- the -gnatP option for GNAT.
Preprocessing_Data_File : String_Ptr := null;
-- GNAT
-- Set by switch -gnatep=. The file name of the prepocessing data file.
Print_Generated_Code : Boolean := False;
-- GNAT
-- Set to True to enable output of generated code in source form. This
-- flag is set by the -gnatG switch.
Print_Standard : Boolean := False;
-- GNAT
-- Set to true to enable printing of package standard in source form.
-- This flag is set by the -gnatS switch
Propagate_Exceptions : Boolean := False;
-- GNAT
-- Indicates if subprogram descriptor exception tables should be
-- built for imported subprograms. Set True if a Propagate_Exceptions
-- pragma applies to the extended main unit.
type Usage is (Unknown, Not_In_Use, In_Use);
Project_File_In_Use : Usage := Unknown;
-- GNAT
-- Indicates if a project file is used or not.
-- Set to In_Use by the first SFNP pragma.
Queuing_Policy : Character := ' ';
-- GNAT, GNATBIND
-- Set to ' ' for the default case (no queuing policy specified).
-- Reset to first character (uppercase) of locking policy name if a valid
-- Queuing_Policy pragma is encountered.
Queuing_Policy_Sloc : Source_Ptr := No_Location;
-- GNAT, GNATBIND
-- Remember location of previous Queuing_Policy pragma. This is used
-- for inconsistency error messages. A value of System_Location is
-- used if the policy is set in package System.
Quiet_Output : Boolean := False;
-- GNATMAKE, GNATCLEAN, GPRMAKE
-- Set to True if the tool should not have any output if there are no
-- errors or warnings.
Replace_In_Comments : Boolean := False;
-- GNATPREP
-- Set to True if -C switch used
RTS_Lib_Path_Name : String_Ptr := null;
RTS_Src_Path_Name : String_Ptr := null;
-- GNAT
-- Set to the "adalib" and "adainclude" directories of the run time
-- specified by --RTS=.
RTS_Switch : Boolean := False;
-- GNAT, GNATMAKE, GNATBIND, GNATLS, GNATFIND, GNATXREF
-- Set to True when the --RTS switch is set
Run_Path_Option : Boolean := True;
-- GNATMAKE, GNATLINK
-- Set to False when no run_path_option should be issued to the linker
Search_Directory_Present : Boolean := False;
-- GNAT
-- Set to True when argument is -I. Reset to False when next argument,
-- a search directory path is taken into account. Note that this is
-- quite different from other switches in this section in that it is
-- only set in a transitory manner as a result of scanning a -I switch
-- with no file name, and if set, is an indication that the next argument
-- is to be treated as a file name.
Sec_Stack_Used : Boolean := False;
-- GNAT, GBATBIND
-- Set True if generated code uses the System.Secondary_Stack package.
-- For the binder, set if any unit uses the secondary stack package.
Setup_Projects : Boolean := False;
-- GNAT DRIVER
-- Set to True for GNAT SETUP: the Project Manager creates non existing
-- object, library and exec directories.
Shared_Libgnat : Boolean;
-- GNATBIND
-- Set to True if a shared libgnat is requested by using the -shared
-- option for GNATBIND and to False when using the -static option. The
-- value of this flag is set by Gnatbind.Scan_Bind_Arg.
Stack_Checking_Enabled : Boolean;
-- GNAT
-- Set to indicate if -fstack-check switch is set for the compilation. True
-- means that the switch is set, so that stack checking is enabled. False
-- means that the switch is not set (no stack checking). This value is
-- obtained from the external imported value flag_stack_check in the gcc
-- backend (see Frontend) and may be referenced throughout the compilation
-- phases.
Style_Check : Boolean := False;
-- GNAT
-- Set True to perform style checks. Activates checks carried out
-- in package Style (see body of this package for details of checks)
-- This flag is set True by either the -gnatg or -gnaty switches.
System_Extend_Pragma_Arg : Node_Id := Empty;
-- GNAT
-- Set non-empty if and only if a correct Extend_System pragma was present
-- in which case it points to the argument of the pragma, and the name can
-- be located as Chars (Expression (System_Extend_Pragma_Arg)).
System_Extend_Unit : Node_Id := Empty;
-- GNAT
-- This is set to Empty if GNAT_Mode is set, since pragma Extend_System
-- is never appropriate in GNAT_Mode (and causes troubles, including
-- bogus circularities, if we try to compile the run-time library with
-- a System extension). If GNAT_Mode is not set, then System_Extend_Unit
-- is a copy of the value set in System_Extend_Pragma_Arg.
Subunits_Missing : Boolean := False;
-- GNAT
-- This flag is set true if missing subunits are detected with code
-- generation active. This causes code generation to be skipped.
Suppress_Checks : Boolean := False;
-- GNAT
-- Set to True if -gnatp (suppress all checks) switch present.
Suppress_Options : Suppress_Array;
-- GNAT
-- Flags set True to suppress corresponding check, i.e. add an implicit
-- pragma Suppress at the outer level of each unit compiled. Note that
-- these suppress actions can be overridden by the use of the Unsuppress
-- pragma. This variable is initialized by Osint.Initialize.
Suppress_Back_Annotation : Boolean := False;
-- GNAT
-- This flag is set True if back annotation of representation information
-- is to be suppressed. This is set if neither -gnatt or -gnatR0-3 is set.
-- This avoids unnecessary time being spent on back annotation.
Table_Factor : Int := 1;
-- GNAT
-- Factor by which all initial table sizes set in Alloc are multiplied.
-- Used in Table to calculate initial table sizes (the initial table size
-- is the value in Alloc, used as the Table_Initial parameter value,
-- multiplied by the factor given here. The default value is used if no
-- -gnatT switch appears.
Task_Dispatching_Policy : Character := ' ';
-- GNAT, GNATBIND
-- Set to ' ' for the default case (no task dispatching policy specified).
-- Reset to first character (uppercase) of task dispatching policy name
-- if a valid Task_Dispatching_Policy pragma is encountered.
Task_Dispatching_Policy_Sloc : Source_Ptr := No_Location;
-- GNAT, GNATBIND
-- Remember location of previous Task_Dispatching_Policy pragma. This is
-- used for inconsistency error messages. A value of System_Location is
-- used if the policy is set in package System.
Tasking_Used : Boolean := False;
-- Set True if any tasking construct is encountered. Used to activate the
-- output of the Q, L and T lines in ALI files.
Time_Slice_Set : Boolean := False;
-- GNATBIND
-- Set True if a pragma Time_Slice is processed in the main unit, or
-- if the -gnatTnn switch is present to set a time slice value.
Time_Slice_Value : Nat;
-- GNATBIND
-- Time slice value. Valid only if Time_Slice_Set is True, i.e. if
-- Time_Slice pragma has been processed. Set to the time slice value in
-- microseconds. Negative values are stored as zero, and the value is not
-- larger than 1_000_000_000 (1000 seconds). Values larger than this are
-- reset to this maximum. This can also be set with the -gnatTnn switch.
Tolerate_Consistency_Errors : Boolean := False;
-- GNATBIND
-- Tolerate time stamp and other consistency errors. If this flag is set to
-- True (-t), then inconsistencies result in warnings rather than errors.
Tree_Output : Boolean := False;
-- GNAT
-- Set to True (-gnatt) to generate output tree file
Try_Semantics : Boolean := False;
-- GNAT
-- Flag set to force attempt at semantic analysis, even if parser errors
-- occur. This will probably cause blowups at this stage in the game. On
-- the other hand, most such blowups will be caught cleanly and simply
-- say compilation abandoned. This flag is set to True by -gnatq or -gnatQ.
Undefined_Symbols_Are_False : Boolean := False;
-- GNAT, GNATPREP
-- Set to True by switch -u of gnatprep or -u in the preprocessing data
-- file for the compiler. Indicates that while preprocessing sources,
-- symbols that are not defined have the value FALSE.
Unique_Error_Tag : Boolean := Tag_Errors;
-- GNAT
-- Indicates if error messages are to be prefixed by the string error:
-- Initialized from Tag_Errors, can be forced on with the -gnatU switch.
Universal_Addressing_On_AAMP : Boolean := False;
-- GNAAMP
-- Indicates if library-level objects should be accessed and updated using
-- universal addressing instructions on the AAMP architecture. This flag is
-- set to True when pragma Universal_Data is given as a configuration
-- pragma.
Unreserve_All_Interrupts : Boolean := False;
-- GNAT, GNATBIND
-- Normally set False, set True if a valid Unreserve_All_Interrupts pragma
-- appears anywhere in the main unit for GNAT, or if any ALI file has the
-- corresponding attribute set in GNATBIND.
Upper_Half_Encoding : Boolean := False;
-- GNAT
-- Normally set False, indicating that upper half ASCII characters are
-- used in the normal way to represent themselves. If the wide character
-- encoding method uses the upper bit for this encoding, then this flag is
-- set True, and upper half characters in the source indicate the start of
-- a wide character sequence.
Usage_Requested : Boolean := False;
-- GNAT, GNATBIND, GNATMAKE
-- Set to True if -h (-gnath for the compiler) switch encountered
-- requesting usage information
Use_Pragma_Linker_Constructor : Boolean := False;
-- GNATBIND
-- True if pragma Linker_Constructor applies to adainit
Use_VADS_Size : Boolean := False;
-- GNAT
-- Set to True if a valid pragma Use_VADS_Size is processed
Validity_Checks_On : Boolean := True;
-- GNAT
-- This flag determines if validity checking is on or off. The initial
-- state is on, and the required default validity checks are active. The
-- actual set of checks that is performed if Validity_Checks_On is set is
-- defined by the switches in package Validsw. The Validity_Checks_On flag
-- is controlled by pragma Validity_Checks (On | Off), and also some
-- generated compiler code (typically code that has to do with validity
-- check generation) is compiled with this flag set to False. This flag is
-- set to False by the -gnatp switch.
Verbose_Mode : Boolean := False;
-- GNAT, GNATBIND, GNATMAKE, GNATLINK, GNATLS, GNATNAME, GNATCLEAN,
-- GPRMAKE
-- Set to True to get verbose mode (full error message text and location
-- information sent to standard output, also header, copyright and summary)
type Verbosity_Level_Type is (None, Low, Medium, High);
Verbosity_Level : Verbosity_Level_Type := High;
-- GNATMAKE, GPRMAKE
-- Modified by gnatmake or gprmake switches -v, -vl, -vm, -vh. Indicates
-- the level of verbosity of informational messages:
--
-- In Low Verbosity, the reasons why a source is recompiled, the name
-- of the executable and the reason it must be rebuilt is output.
--
-- In Medium Verbosity, additional lines are output for each ALI file
-- that is checked.
--
-- In High Verbosity, additional lines are output when the ALI file
-- is part of an Ada library, is read-only or is part of the runtime.
Warn_On_Ada_2005_Compatibility : Boolean := True;
-- GNAT
-- Set to True to active all warnings on Ada 2005 compatibility issues,
-- including warnings on Ada 2005 obsolescent features used in Ada 2005
-- mode. Set False by -gnatwY.
Warn_On_Bad_Fixed_Value : Boolean := False;
-- GNAT
-- Set to True to generate warnings for static fixed-point expression
-- values that are not an exact multiple of the small value of the type.
Warn_On_Constant : Boolean := False;
-- GNAT
-- Set to True to generate warnings for variables that could be declared
-- as constants. Modified by use of -gnatwk/K.
Warn_On_Dereference : Boolean := False;
-- GNAT
-- Set to True to generate warnings for implicit dereferences for array
-- indexing and record component access. Modified by use of -gnatwd/D.
Warn_On_Export_Import : Boolean := True;
-- GNAT
-- Set to True to generate warnings for suspicious use of export or
-- import pragmas. Modified by use of -gnatwx/X.
Warn_On_Hiding : Boolean := False;
-- GNAT
-- Set to True to generate warnings if a declared entity hides another
-- entity. The default is that this warning is suppressed.
Warn_On_Modified_Unread : Boolean := False;
-- GNAT
-- Set to True to generate warnings if a variable is assigned but is never
-- read. The default is that this warning is suppressed.
Warn_On_No_Value_Assigned : Boolean := True;
-- GNAT
-- Set to True to generate warnings if no value is ever assigned to a
-- variable that is at least partially uninitialized. Set to false to
-- suppress such warnings. The default is that such warnings are enabled.
Warn_On_Obsolescent_Feature : Boolean := False;
-- GNAT
-- Set to True to generate warnings on use of any feature in Annex or if a
-- subprogram is called for which a pragma Obsolescent applies.
Warn_On_Redundant_Constructs : Boolean := False;
-- GNAT
-- Set to True to generate warnings for redundant constructs (e.g. useless
-- assignments/conversions). The default is that this warning is disabled.
Warn_On_Unchecked_Conversion : Boolean := True;
-- GNAT
-- Set to True to generate warnings for unchecked conversions that may have
-- non-portable semantics (e.g. because sizes of types differ). The default
-- is that this warning is enabled.
Warn_On_Unrecognized_Pragma : Boolean := True;
-- GNAT
-- Set to True to generate warnings for unrecognized pragmas. The default
-- is that this warning is enabled.
type Warning_Mode_Type is (Suppress, Normal, Treat_As_Error);
Warning_Mode : Warning_Mode_Type := Normal;
-- GNAT, GNATBIND
-- Controls treatment of warning messages. If set to Suppress, warning
-- messages are not generated at all. In Normal mode, they are generated
-- but do not count as errors. In Treat_As_Error mode, warning messages
-- are generated and are treated as errors.
Wide_Character_Encoding_Method : WC_Encoding_Method := WCEM_Brackets;
-- GNAT
-- Method used for encoding wide characters in the source program. See
-- description of type in unit System.WCh_Con for a list of the methods
-- that are currently supported. Note that brackets notation is always
-- recognized in source programs regardless of the setting of this
-- variable. The default setting causes only the brackets notation to be
-- recognized. If this is the main unit, this setting also controls the
-- output of the W=? parameter in the ALI file, which is used to provide
-- the default for Wide_Text_IO files.
Xref_Active : Boolean := True;
-- GNAT
-- Set if cross-referencing is enabled (i.e. xref info in ALI files)
----------------------------
-- Configuration Settings --
----------------------------
-- These are settings that are used to establish the mode at the start of
-- each unit. The values defined below can be affected either by command
-- line switches, or by the use of appropriate configuration pragmas in the
-- gnat.adc file.
Ada_Version_Config : Ada_Version_Type;
-- GNAT
-- This is the value of the configuration switch for the Ada 83 mode, as
-- set by the command line switches -gnat83/95/05, and possibly modified by
-- the use of configuration pragmas Ada_83/Ada95/Ada05. This switch is used
-- to set the initial value for Ada_Version mode at the start of analysis
-- of a unit. Note however, that the setting of this flag is ignored for
-- internal and predefined units (which are always compiled in the most up
-- to date version of Ada).
Ada_Version_Explicit_Config : Ada_Version_Type;
-- GNAT
-- This is set in the same manner as Ada_Version_Config. The difference is
-- that the setting of this flag is not ignored for internal and predefined
-- units, which for some purposes do indeed access this value, regardless
-- of the fact that they are compiled the the most up to date ada version).
Assertions_Enabled_Config : Boolean;
-- GNAT
-- This is the value of the configuration switch for assertions enabled
-- mode, as possibly set by the command line switch -gnata, and possibly
-- modified by the use of the configuration pragma Assertion_Policy.
Debug_Pragmas_Enabled_Config : Boolean;
-- GNAT
-- This is the value of the configuration switch for debug pragmas enabled
-- mode, as possibly set by the command line switch -gnata and possibly
-- modified by the use of the configuration pragma Debug_Policy.
Dynamic_Elaboration_Checks_Config : Boolean := False;
-- GNAT
-- Set True for dynamic elaboration checking mode, as set by the -gnatE
-- switch or by the use of pragma Elaboration_Checking (Dynamic).
Exception_Locations_Suppressed_Config : Boolean := False;
-- GNAT
-- Set True by use of the configuration pragma Suppress_Exception_Messages
Extensions_Allowed_Config : Boolean;
-- GNAT
-- This is the flag that indicates whether extensions are allowed. It can
-- be set True either by use of the -gnatX switch, or by use of the
-- configuration pragma Extensions_Allowed (On). It is always set to True
-- for internal GNAT units, since extensions are always permitted in such
-- units.
External_Name_Exp_Casing_Config : External_Casing_Type;
-- GNAT
-- This is the value of the configuration switch that controls casing of
-- external symbols for which an explicit external name is given. It can be
-- set to Uppercase by the command line switch -gnatF, and further modified
-- by the use of the configuration pragma External_Name_Casing in the
-- gnat.adc file. This flag is used to set the initial value for
-- External_Name_Exp_Casing at the start of analyzing each unit. Note
-- however that the setting of this flag is ignored for internal and
-- predefined units (which are always compiled with As_Is mode).
External_Name_Imp_Casing_Config : External_Casing_Type;
-- GNAT
-- This is the value of the configuration switch that controls casing of
-- external symbols where the external name is implicitly given. It can be
-- set to Uppercase by the command line switch -gnatF, and further modified
-- by the use of the configuration pragma External_Name_Casing in the
-- gnat.adc file. This flag is used to set the initial value for
-- External_Name_Imp_Casing at the start of analyzing each unit. Note
-- however that the setting of this flag is ignored for internal and
-- predefined units (which are always compiled with Lowercase mode).
Persistent_BSS_Mode_Config : Boolean;
-- GNAT
-- This is the value of the configuration switch that controls whether
-- potentially persistent data is to be placed in the persistent_bss
-- section. It can be set True by use of the pragma Persistent_BSS.
-- This flag is used to set the initial value of Persistent_BSS_Mode
-- at the start of each compilation unit, except that it is always
-- set False for predefined units.
Polling_Required_Config : Boolean;
-- GNAT
-- This is the value of the configuration switch that controls polling
-- mode. It can be set True by the command line switch -gnatP, and then
-- further modified by the use of pragma Polling in the gnat.adc file. This
-- flag is used to set the initial value for Polling_Required at the start
-- of analyzing each unit.
Use_VADS_Size_Config : Boolean;
-- GNAT
-- This is the value of the configuration switch that controls the use of
-- VADS_Size instead of Size whereever the attribute Size is used. It can
-- be set True by the use of the pragma Use_VADS_Size in the gnat.adc file.
-- This flag is used to set the initial value for Use_VADS_Size at the
-- start of analyzing each unit. Note however that the setting of this flag
-- is ignored for internal and predefined units (which are always compiled
-- with the standard Size semantics).
type Config_Switches_Type is private;
-- Type used to save values of the switches set from Config values
procedure Save_Opt_Config_Switches (Save : out Config_Switches_Type);
-- This procedure saves the current values of the switches which are
-- initialized from the above Config values, and then resets these switches
-- according to the Config value settings.
procedure Set_Opt_Config_Switches
(Internal_Unit : Boolean;
Main_Unit : Boolean);
-- This procedure sets the switches to the appropriate initial values. The
-- parameter Internal_Unit is True for an internal or predefined unit, and
-- affects the way the switches are set (see above). Main_Unit is true if
-- switches are being set for the main unit (this affects setting of the
-- assert/debug pragm switches, which are normally set false by default for
-- an internal unit, except when the internal unit is the main unit, in
-- which case we use the command line settings).
procedure Restore_Opt_Config_Switches (Save : Config_Switches_Type);
-- This procedure restores a set of switch values previously saved by a
-- call to Save_Opt_Switches.
procedure Register_Opt_Config_Switches;
-- This procedure is called after processing the gnat.adc file to record
-- the values of the Config switches, as possibly modified by the use of
-- command line switches and configuration pragmas.
------------------------
-- Other Global Flags --
------------------------
Expander_Active : Boolean := False;
-- A flag that indicates if expansion is active (True) or deactivated
-- (False). When expansion is deactivated all calls to expander routines
-- have no effect. Note that the initial setting of False is merely to
-- prevent saving of an undefined value for an initial call to the
-- Expander_Mode_Save_And_Set procedure. For more information on the use of
-- this flag, see package Expander. Indeed this flag might more logically
-- be in the spec of Expander, but it is referenced by Errout, and it
-- really seems wrong for Errout to depend on Expander.
-----------------------
-- Tree I/O Routines --
-----------------------
procedure Tree_Read;
-- Reads switch settings from current tree file using Tree_Read
procedure Tree_Write;
-- Writes out switch settings to current tree file using Tree_Write
--------------------------
-- ASIS Version Control --
--------------------------
-- These two variables (Tree_Version_String and Tree_ASIS_Version_Number)
-- are supposed to be used in the GNAT/ASIS version check performed in
-- the ASIS code (this package is also a part of the ASIS implementation).
-- They are set by Tree_Read procedure, so they represent the version
-- number (and the version string) of the compiler which has created the
-- tree, and they are supposed to be compared with the corresponding values
-- from the Gnatvsn package which is a part of ASIS implementation.
Tree_Version_String : String_Access;
-- Used to store the compiler version string read from a tree file to check
-- if it is from the same date as stored in the version string in Gnatvsn.
-- We require that ASIS Pro can be used only with GNAT Pro, but we allow
-- non-Pro ASIS and ASIS-based tools to be used with any version of the
-- GNAT compiler. Therefore, we need the possibility to compare the dates
-- of the corresponding source sets, using version strings that may be
-- of different lengths.
Tree_ASIS_Version_Number : Int;
-- Used to store the ASIS version number read from a tree file to check if
-- it is the same as stored in the ASIS version number in Gnatvsn.
private
-- The following type is used to save and restore settings of switches in
-- Opt that represent the configuration (i.e. result of config pragmas).
-- Note that Ada_Version_Explicit is not included, since this is a sticky
-- flag that once set does not get reset, since the whole idea of this flag
-- is to record the setting for the main unit.
type Config_Switches_Type is record
Ada_Version : Ada_Version_Type;
Ada_Version_Explicit : Ada_Version_Type;
Assertions_Enabled : Boolean;
Debug_Pragmas_Enabled : Boolean;
Dynamic_Elaboration_Checks : Boolean;
Exception_Locations_Suppressed : Boolean;
Extensions_Allowed : Boolean;
External_Name_Exp_Casing : External_Casing_Type;
External_Name_Imp_Casing : External_Casing_Type;
Persistent_BSS_Mode : Boolean;
Polling_Required : Boolean;
Use_VADS_Size : Boolean;
end record;
end Opt;
|
09_COMP_SPAZI.asm | aleattene/lc2-exams | 0 | 87595 | <reponame>aleattene/lc2-exams
; ************ DESCRIZIONE SOTTOPROGRAMMA ************
Spesso nella scrittura di testi capita di separare le parole con due o più spazi invece di uno, con il risultato di
un’impaginazione irregolare, con parole più o meno lontane le une dalle altre. Per eliminare il problema, il
seguente sottoprogramma denominato COMP_SPAZI riceve:
- nel registro R0 l’indirizzo della prima cella di una zona di memoria contenente una stringa di caratteri
codificati ASCII (un carattere per cella). La stringa è terminata dal valore 0
corrispondente al carattere NUL);
- nel registro R1 l’indirizzo della prima cella di una zona di memoria libera, di dimensioni sufficienti per
contenere la stringa di caratteri di cui sopra.
Il sottoprogramma inoltre:
- trascrive la stringa dalla zona di memoria puntata da R0 a quella puntata da R1, facendo in modo che
non esistano spazi doppi o multipli fra le parole. La stringa trascritta vine terminata dal valore 0
(corrispondente al carattere NUL);
- restituisce nel registro R2 il numero totale di spazi eliminati.
Si ricorda che nel codice ASCII il carattere spazio ha codifica decimale 32 (esadecimale x20).
Nonostante l'utilizzo di altri registri della CPU, il sottoprogramma restituisce
il controllo al programma chiamante senza che tali registri risultino alterati.
************ ESEMPIO FUNZIONAMENTO SOTTOPROGRAMMA ************
INPUT
R0 punta alla zona di memoria contenente la stringa “Un esempio di frase con spazi multipli tra le parole”
OUTPUT
R1 punta alla zona di memoria contenente la stringa “Un esempio di frase con spazi multipli tra le parole”
R2 contiene il valore 9
; ********* PROGRAMMA TEST *************
.orig x3000
LEA R0, stringaS ; in R0 <- indirizzo inizio stringaS (array)
LEA R1, stringaR ; in R1 <- indirizzo inizio stringaR (vuota)
; ********* SOTTOPROGRAMMA *************
; COMP_SPAZI ; nome sottoprogramma
ST R3, store3 ; contenuto R3 -> in cella indirizzo store3
ST R4, store4 ; contenuto R4 -> in cella indirizzo store4
ST R5, store5 ; contenuto R5 -> in cella indirizzo store5
LD R2, spazio ; in R2 <- decimanele opposto ASCII "spazio"
AND R5,R5,#0 ; azzero contatore spazi inutili (da eliminare)
ciclo LDR R3,R0,#0 ; in R3 <- ASCII carat puntato da R0 (stringaS)
BRZ fine ; se zero sequenza (stringaS) finita -> fine
; altrimenti....
ADD R4,R3,R2 ; confronto carattere stringa con spazio
BRZ ver_spazio ; se trovo spazio "verifico" se singolo/multiplo
; altrimenti.....
scrivi STR R3,R1,#0 ; scrivo carattere cella stringaS in stringaR
ADD R0,R0,#1 ; incremento cella puntata da R0 (stringa S)
ADD R1,R1,#1 ; incremento cella puntata da R1 (stringa R)
BRNZP ciclo ; continuo scansione stringa sino fine (/0)
ver_spazio LDR R4,R0,#1 ; leggo carattere successivo stringaS
ADD R4,R4,R2 ; confronto spazio con carattere successivo
BRZ el_spazio ; se trovo un altro spazio lo elimino
BRNP scrivi ; altrimenti è uno spazio da lasciare...
el_spazio ADD R5,R5,#1 ; incremento contatore spazi inutili
ADD R0,R0,#1 ; incremento cella puntata da R0 (stringaS)
BRNZP ciclo ; continuo scansione stringa sino fine (/0)
fine AND R4,R4,#0 ; azzero contatore R4 -> per ASCII /0 stringaR
STR R4,R1,#0 ; contenuto R4 -> in cella puntata da R1 (/0)
ADD R2,R5,#0 ; in R2 <- valore R5 (contatore spazi inutili)
LD R3, store3 ; contenuto cella indirizzo store3 -> in R3
LD R4, store4 ; contenuto cella indirizzo store4 -> in R4
LD R5, store5 ; contenuto cella indirizzo store5 -> in R5
; RET ; ritorno da sottoprogramma
; ********* VAR / COST *************
store3 .blkw 1 ; riservo una cella di memora per contenuto R3
store4 .blkw 1 ; riservo una cella di memora per contenuto R4
store5 .blkw 1 ; riservo una cella di memora per contenuto R5
stringaS .stringz "Un esempio di frase con spazi multipli tra le parole"
stringaR .blkw 53 ; riservo 53 celle memoria per stringaR
spazio .fill #-32 ; valore decimale opposto carat ASCII "spazio"
.end ; fine programma
|
move command.scpt | ldebritto/alfred-mail-sorter | 0 | 3280 | on run argv
set theMailbox to item 1 of argv
activate application "Mail"
tell application "System Events"
tell process "Mail"
click menu item theMailbox of menu 1 of menu item 18 of menu 1 of menu bar item 7 of menu bar 1
end tell
end tell
end run
|
programs/oeis/198/A198954.asm | neoneye/loda | 22 | 164597 | ; A198954: Expansion of the rotational partition function for a heteronuclear diatomic molecule.
; 1,3,0,5,0,0,7,0,0,0,9,0,0,0,0,11,0,0,0,0,0,13,0,0,0,0,0,0,15,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0
mul $0,2
mov $3,1
lpb $0
div $0,2
mul $0,2
mov $2,$0
sub $0,$3
add $3,2
lpe
bin $3,$2
mov $0,$3
|
3-mid/impact/source/3d/math/impact-d3-quaternions.ads | charlie5/lace | 20 | 21058 | <gh_stars>10-100
package impact.d3.Quaternions
--
-- The impact.d3.Quaternion provides subprograms to perform linear algebra rotations in combination with impact.d3.Matrix, impact.d3.Vector and impact.d3.Transform.
--
is
use Math;
BT_EULER_DEFAULT_ZYX : constant Boolean := False;
function to_Quaternion (x, y, z, w : in Real ) return Quaternion;
function to_Quaternion (Axis : in Vector_3; Angle : in Real) return Quaternion;
function to_Quaternion (Yaw, Pitch, Roll : in Real ) return Quaternion;
--
-- yaw Angle around Y unless BT_EULER_DEFAULT_ZYX is true then Z
-- pitch Angle around X unless BT_EULER_DEFAULT_ZYX is true then Y
-- roll Angle around Z unless BT_EULER_DEFAULT_ZYX is true then X
function x (Self : in Quaternion) return Real;
function y (Self : in Quaternion) return Real;
function z (Self : in Quaternion) return Real;
function w (Self : in Quaternion) return Real;
procedure setRotation (Self : out Quaternion; Axis : in Vector_3;
Angle : in Real);
procedure setEuler (Self : out Quaternion; Yaw, Pitch, Roll : in Real);
--
-- yaw Angle around Y
-- pitch Angle around X
-- roll Angle around Z
procedure setEulerZYX (Self : out Quaternion; Yaw, Pitch, Roll : in Real);
--
-- yaw Angle around Z
-- pitch Angle around Y
-- roll Angle around X
function multiply (Left, Right : in Quaternion) return Quaternion;
function dot (Left, Right : in Quaternion) return Real;
function length2 (Self : in Quaternion) return Real; -- Return the length squared of the quaternion.
function length (Self : in Quaternion) return Real; -- Return the length of the quaternion.
function normalize (Self : access Quaternion) return Quaternion; -- Normalize the quaternion such that x^2 + y^2 + z^2 +w^2 = 1 and return it.
function normalized (Self : in Quaternion) return Quaternion;
procedure normalize (Self : in out Quaternion);
-- function "*" (Left : in Quaternion; Right : in Real) return Quaternion; -- Scale a quaternion.
-- function "/" (Left : in Quaternion; Right : in Real) return Quaternion; -- Inversely scale a quaternion.
function Angle (Left, Right : in Quaternion) return Real; -- Return the angle between Left and Right.
function getAngle (Self : in Quaternion) return Real; -- Return the angle of rotation represented by Self.
function getAxis (Self : in Quaternion) return Vector_3; -- Return the axis of the rotation represented by Self.
function inverse (Self : in Quaternion) return Quaternion; -- Return the inverse of Self.
-- function "+" (Left, Right : in Quaternion) return Quaternion;
-- function "-" (Left, Right : in Quaternion) return Quaternion;
function "-" (Self : in Quaternion) return Quaternion; -- Return the negative of this quaternion
function farthest (Self : in Quaternion; qd : in Quaternion) return Quaternion;
function nearest (Self : in Quaternion; qd : in Quaternion) return Quaternion;
function slerp (Self : in Quaternion; q : in Quaternion;
t : in Real ) return Quaternion;
--
-- Return the quaternion which is the result of Spherical Linear Interpolation between Self and q.
-- Slerp interpolates assuming constant velocity.
--
-- t The ratio between Self and q to interpolate.
-- If t = 0.0 the result is Self, if t=1.0 the result is q.
function getIdentity return Quaternion;
function "*" (Left : in Quaternion; Right : in Vector_3) return Quaternion;
function "*" (Left : in Vector_3; Right : in Quaternion) return Quaternion;
function quatRotate (rotation : in Quaternion; v : in Vector_3) return Vector_3;
function shortestArcQuat (v1, v2 : in Vector_3) return Quaternion; -- Game Programming Gems 2.10. Make sure v1,v2 are normalized.
function shortestArcQuatNormalize2 (v1, v2 : access Vector_3) return Quaternion;
end impact.d3.Quaternions;
|
oeis/020/A020736.asm | loda-lang/loda-programs | 11 | 170613 | <filename>oeis/020/A020736.asm<gh_stars>10-100
; A020736: Pisot sequence L(5,8).
; Submitted by <NAME>
; 5,8,13,22,38,66,115,201,352,617,1082,1898,3330,5843,10253,17992,31573,55406,97230,170626,299427,525457,922112,1618193,2839730,4983378,8745218,15346787,26931733,47261896,82938845,145547526,255418102,448227522,786584467,1380359513,2422362080,4250949113,7459895658,13091204282,22973462018,40315615411,70748973085,124155792776,217878227877,382349636062,670976837022,1177482265858,2066337330755,3626169232673,6363483400448,11167134898977,19596955630178,34390259761826,60350698792450,105908093453251
add $0,4
mul $0,2
seq $0,182097 ; Expansion of 1/(1-x^2-x^3).
add $0,1
|
pkgs/tools/yasm/src/modules/preprocs/nasm/tests/nasmpp-decimal.asm | manggoguy/parsec-modified | 2,151 | 92792 | <reponame>manggoguy/parsec-modified
%macro testConcat 0
%push ctx
%assign %$x 0
%rep 8
movd eax, mm%$x
%assign %$x %$x+1
%endrep %pop
%endmacro
testConcat
|
worker/deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/md5/md5-x86_64.asm | vanga-top/mediasoup | 1,666 | 102860 | <reponame>vanga-top/mediasoup
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
section .text code align=64
ALIGN 16
global md5_block_asm_data_order
md5_block_asm_data_order:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_md5_block_asm_data_order:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
push rbp
push rbx
push r12
push r14
push r15
$L$prologue:
mov rbp,rdi
shl rdx,6
lea rdi,[rdx*1+rsi]
mov eax,DWORD[rbp]
mov ebx,DWORD[4+rbp]
mov ecx,DWORD[8+rbp]
mov edx,DWORD[12+rbp]
cmp rsi,rdi
je NEAR $L$end
$L$loop:
mov r8d,eax
mov r9d,ebx
mov r14d,ecx
mov r15d,edx
mov r10d,DWORD[rsi]
mov r11d,edx
xor r11d,ecx
lea eax,[((-680876936))+r10*1+rax]
and r11d,ebx
mov r10d,DWORD[4+rsi]
xor r11d,edx
add eax,r11d
rol eax,7
mov r11d,ecx
add eax,ebx
xor r11d,ebx
lea edx,[((-389564586))+r10*1+rdx]
and r11d,eax
mov r10d,DWORD[8+rsi]
xor r11d,ecx
add edx,r11d
rol edx,12
mov r11d,ebx
add edx,eax
xor r11d,eax
lea ecx,[606105819+r10*1+rcx]
and r11d,edx
mov r10d,DWORD[12+rsi]
xor r11d,ebx
add ecx,r11d
rol ecx,17
mov r11d,eax
add ecx,edx
xor r11d,edx
lea ebx,[((-1044525330))+r10*1+rbx]
and r11d,ecx
mov r10d,DWORD[16+rsi]
xor r11d,eax
add ebx,r11d
rol ebx,22
mov r11d,edx
add ebx,ecx
xor r11d,ecx
lea eax,[((-176418897))+r10*1+rax]
and r11d,ebx
mov r10d,DWORD[20+rsi]
xor r11d,edx
add eax,r11d
rol eax,7
mov r11d,ecx
add eax,ebx
xor r11d,ebx
lea edx,[1200080426+r10*1+rdx]
and r11d,eax
mov r10d,DWORD[24+rsi]
xor r11d,ecx
add edx,r11d
rol edx,12
mov r11d,ebx
add edx,eax
xor r11d,eax
lea ecx,[((-1473231341))+r10*1+rcx]
and r11d,edx
mov r10d,DWORD[28+rsi]
xor r11d,ebx
add ecx,r11d
rol ecx,17
mov r11d,eax
add ecx,edx
xor r11d,edx
lea ebx,[((-45705983))+r10*1+rbx]
and r11d,ecx
mov r10d,DWORD[32+rsi]
xor r11d,eax
add ebx,r11d
rol ebx,22
mov r11d,edx
add ebx,ecx
xor r11d,ecx
lea eax,[1770035416+r10*1+rax]
and r11d,ebx
mov r10d,DWORD[36+rsi]
xor r11d,edx
add eax,r11d
rol eax,7
mov r11d,ecx
add eax,ebx
xor r11d,ebx
lea edx,[((-1958414417))+r10*1+rdx]
and r11d,eax
mov r10d,DWORD[40+rsi]
xor r11d,ecx
add edx,r11d
rol edx,12
mov r11d,ebx
add edx,eax
xor r11d,eax
lea ecx,[((-42063))+r10*1+rcx]
and r11d,edx
mov r10d,DWORD[44+rsi]
xor r11d,ebx
add ecx,r11d
rol ecx,17
mov r11d,eax
add ecx,edx
xor r11d,edx
lea ebx,[((-1990404162))+r10*1+rbx]
and r11d,ecx
mov r10d,DWORD[48+rsi]
xor r11d,eax
add ebx,r11d
rol ebx,22
mov r11d,edx
add ebx,ecx
xor r11d,ecx
lea eax,[1804603682+r10*1+rax]
and r11d,ebx
mov r10d,DWORD[52+rsi]
xor r11d,edx
add eax,r11d
rol eax,7
mov r11d,ecx
add eax,ebx
xor r11d,ebx
lea edx,[((-40341101))+r10*1+rdx]
and r11d,eax
mov r10d,DWORD[56+rsi]
xor r11d,ecx
add edx,r11d
rol edx,12
mov r11d,ebx
add edx,eax
xor r11d,eax
lea ecx,[((-1502002290))+r10*1+rcx]
and r11d,edx
mov r10d,DWORD[60+rsi]
xor r11d,ebx
add ecx,r11d
rol ecx,17
mov r11d,eax
add ecx,edx
xor r11d,edx
lea ebx,[1236535329+r10*1+rbx]
and r11d,ecx
mov r10d,DWORD[4+rsi]
xor r11d,eax
add ebx,r11d
rol ebx,22
mov r11d,edx
add ebx,ecx
mov r11d,edx
mov r12d,edx
not r11d
and r12d,ebx
lea eax,[((-165796510))+r10*1+rax]
and r11d,ecx
mov r10d,DWORD[24+rsi]
or r12d,r11d
mov r11d,ecx
add eax,r12d
mov r12d,ecx
rol eax,5
add eax,ebx
not r11d
and r12d,eax
lea edx,[((-1069501632))+r10*1+rdx]
and r11d,ebx
mov r10d,DWORD[44+rsi]
or r12d,r11d
mov r11d,ebx
add edx,r12d
mov r12d,ebx
rol edx,9
add edx,eax
not r11d
and r12d,edx
lea ecx,[643717713+r10*1+rcx]
and r11d,eax
mov r10d,DWORD[rsi]
or r12d,r11d
mov r11d,eax
add ecx,r12d
mov r12d,eax
rol ecx,14
add ecx,edx
not r11d
and r12d,ecx
lea ebx,[((-373897302))+r10*1+rbx]
and r11d,edx
mov r10d,DWORD[20+rsi]
or r12d,r11d
mov r11d,edx
add ebx,r12d
mov r12d,edx
rol ebx,20
add ebx,ecx
not r11d
and r12d,ebx
lea eax,[((-701558691))+r10*1+rax]
and r11d,ecx
mov r10d,DWORD[40+rsi]
or r12d,r11d
mov r11d,ecx
add eax,r12d
mov r12d,ecx
rol eax,5
add eax,ebx
not r11d
and r12d,eax
lea edx,[38016083+r10*1+rdx]
and r11d,ebx
mov r10d,DWORD[60+rsi]
or r12d,r11d
mov r11d,ebx
add edx,r12d
mov r12d,ebx
rol edx,9
add edx,eax
not r11d
and r12d,edx
lea ecx,[((-660478335))+r10*1+rcx]
and r11d,eax
mov r10d,DWORD[16+rsi]
or r12d,r11d
mov r11d,eax
add ecx,r12d
mov r12d,eax
rol ecx,14
add ecx,edx
not r11d
and r12d,ecx
lea ebx,[((-405537848))+r10*1+rbx]
and r11d,edx
mov r10d,DWORD[36+rsi]
or r12d,r11d
mov r11d,edx
add ebx,r12d
mov r12d,edx
rol ebx,20
add ebx,ecx
not r11d
and r12d,ebx
lea eax,[568446438+r10*1+rax]
and r11d,ecx
mov r10d,DWORD[56+rsi]
or r12d,r11d
mov r11d,ecx
add eax,r12d
mov r12d,ecx
rol eax,5
add eax,ebx
not r11d
and r12d,eax
lea edx,[((-1019803690))+r10*1+rdx]
and r11d,ebx
mov r10d,DWORD[12+rsi]
or r12d,r11d
mov r11d,ebx
add edx,r12d
mov r12d,ebx
rol edx,9
add edx,eax
not r11d
and r12d,edx
lea ecx,[((-187363961))+r10*1+rcx]
and r11d,eax
mov r10d,DWORD[32+rsi]
or r12d,r11d
mov r11d,eax
add ecx,r12d
mov r12d,eax
rol ecx,14
add ecx,edx
not r11d
and r12d,ecx
lea ebx,[1163531501+r10*1+rbx]
and r11d,edx
mov r10d,DWORD[52+rsi]
or r12d,r11d
mov r11d,edx
add ebx,r12d
mov r12d,edx
rol ebx,20
add ebx,ecx
not r11d
and r12d,ebx
lea eax,[((-1444681467))+r10*1+rax]
and r11d,ecx
mov r10d,DWORD[8+rsi]
or r12d,r11d
mov r11d,ecx
add eax,r12d
mov r12d,ecx
rol eax,5
add eax,ebx
not r11d
and r12d,eax
lea edx,[((-51403784))+r10*1+rdx]
and r11d,ebx
mov r10d,DWORD[28+rsi]
or r12d,r11d
mov r11d,ebx
add edx,r12d
mov r12d,ebx
rol edx,9
add edx,eax
not r11d
and r12d,edx
lea ecx,[1735328473+r10*1+rcx]
and r11d,eax
mov r10d,DWORD[48+rsi]
or r12d,r11d
mov r11d,eax
add ecx,r12d
mov r12d,eax
rol ecx,14
add ecx,edx
not r11d
and r12d,ecx
lea ebx,[((-1926607734))+r10*1+rbx]
and r11d,edx
mov r10d,DWORD[20+rsi]
or r12d,r11d
mov r11d,edx
add ebx,r12d
mov r12d,edx
rol ebx,20
add ebx,ecx
mov r11d,ecx
lea eax,[((-378558))+r10*1+rax]
xor r11d,edx
mov r10d,DWORD[32+rsi]
xor r11d,ebx
add eax,r11d
mov r11d,ebx
rol eax,4
add eax,ebx
lea edx,[((-2022574463))+r10*1+rdx]
xor r11d,ecx
mov r10d,DWORD[44+rsi]
xor r11d,eax
add edx,r11d
rol edx,11
mov r11d,eax
add edx,eax
lea ecx,[1839030562+r10*1+rcx]
xor r11d,ebx
mov r10d,DWORD[56+rsi]
xor r11d,edx
add ecx,r11d
mov r11d,edx
rol ecx,16
add ecx,edx
lea ebx,[((-35309556))+r10*1+rbx]
xor r11d,eax
mov r10d,DWORD[4+rsi]
xor r11d,ecx
add ebx,r11d
rol ebx,23
mov r11d,ecx
add ebx,ecx
lea eax,[((-1530992060))+r10*1+rax]
xor r11d,edx
mov r10d,DWORD[16+rsi]
xor r11d,ebx
add eax,r11d
mov r11d,ebx
rol eax,4
add eax,ebx
lea edx,[1272893353+r10*1+rdx]
xor r11d,ecx
mov r10d,DWORD[28+rsi]
xor r11d,eax
add edx,r11d
rol edx,11
mov r11d,eax
add edx,eax
lea ecx,[((-155497632))+r10*1+rcx]
xor r11d,ebx
mov r10d,DWORD[40+rsi]
xor r11d,edx
add ecx,r11d
mov r11d,edx
rol ecx,16
add ecx,edx
lea ebx,[((-1094730640))+r10*1+rbx]
xor r11d,eax
mov r10d,DWORD[52+rsi]
xor r11d,ecx
add ebx,r11d
rol ebx,23
mov r11d,ecx
add ebx,ecx
lea eax,[681279174+r10*1+rax]
xor r11d,edx
mov r10d,DWORD[rsi]
xor r11d,ebx
add eax,r11d
mov r11d,ebx
rol eax,4
add eax,ebx
lea edx,[((-358537222))+r10*1+rdx]
xor r11d,ecx
mov r10d,DWORD[12+rsi]
xor r11d,eax
add edx,r11d
rol edx,11
mov r11d,eax
add edx,eax
lea ecx,[((-722521979))+r10*1+rcx]
xor r11d,ebx
mov r10d,DWORD[24+rsi]
xor r11d,edx
add ecx,r11d
mov r11d,edx
rol ecx,16
add ecx,edx
lea ebx,[76029189+r10*1+rbx]
xor r11d,eax
mov r10d,DWORD[36+rsi]
xor r11d,ecx
add ebx,r11d
rol ebx,23
mov r11d,ecx
add ebx,ecx
lea eax,[((-640364487))+r10*1+rax]
xor r11d,edx
mov r10d,DWORD[48+rsi]
xor r11d,ebx
add eax,r11d
mov r11d,ebx
rol eax,4
add eax,ebx
lea edx,[((-421815835))+r10*1+rdx]
xor r11d,ecx
mov r10d,DWORD[60+rsi]
xor r11d,eax
add edx,r11d
rol edx,11
mov r11d,eax
add edx,eax
lea ecx,[530742520+r10*1+rcx]
xor r11d,ebx
mov r10d,DWORD[8+rsi]
xor r11d,edx
add ecx,r11d
mov r11d,edx
rol ecx,16
add ecx,edx
lea ebx,[((-995338651))+r10*1+rbx]
xor r11d,eax
mov r10d,DWORD[rsi]
xor r11d,ecx
add ebx,r11d
rol ebx,23
mov r11d,ecx
add ebx,ecx
mov r11d,0xffffffff
xor r11d,edx
lea eax,[((-198630844))+r10*1+rax]
or r11d,ebx
mov r10d,DWORD[28+rsi]
xor r11d,ecx
add eax,r11d
mov r11d,0xffffffff
rol eax,6
xor r11d,ecx
add eax,ebx
lea edx,[1126891415+r10*1+rdx]
or r11d,eax
mov r10d,DWORD[56+rsi]
xor r11d,ebx
add edx,r11d
mov r11d,0xffffffff
rol edx,10
xor r11d,ebx
add edx,eax
lea ecx,[((-1416354905))+r10*1+rcx]
or r11d,edx
mov r10d,DWORD[20+rsi]
xor r11d,eax
add ecx,r11d
mov r11d,0xffffffff
rol ecx,15
xor r11d,eax
add ecx,edx
lea ebx,[((-57434055))+r10*1+rbx]
or r11d,ecx
mov r10d,DWORD[48+rsi]
xor r11d,edx
add ebx,r11d
mov r11d,0xffffffff
rol ebx,21
xor r11d,edx
add ebx,ecx
lea eax,[1700485571+r10*1+rax]
or r11d,ebx
mov r10d,DWORD[12+rsi]
xor r11d,ecx
add eax,r11d
mov r11d,0xffffffff
rol eax,6
xor r11d,ecx
add eax,ebx
lea edx,[((-1894986606))+r10*1+rdx]
or r11d,eax
mov r10d,DWORD[40+rsi]
xor r11d,ebx
add edx,r11d
mov r11d,0xffffffff
rol edx,10
xor r11d,ebx
add edx,eax
lea ecx,[((-1051523))+r10*1+rcx]
or r11d,edx
mov r10d,DWORD[4+rsi]
xor r11d,eax
add ecx,r11d
mov r11d,0xffffffff
rol ecx,15
xor r11d,eax
add ecx,edx
lea ebx,[((-2054922799))+r10*1+rbx]
or r11d,ecx
mov r10d,DWORD[32+rsi]
xor r11d,edx
add ebx,r11d
mov r11d,0xffffffff
rol ebx,21
xor r11d,edx
add ebx,ecx
lea eax,[1873313359+r10*1+rax]
or r11d,ebx
mov r10d,DWORD[60+rsi]
xor r11d,ecx
add eax,r11d
mov r11d,0xffffffff
rol eax,6
xor r11d,ecx
add eax,ebx
lea edx,[((-30611744))+r10*1+rdx]
or r11d,eax
mov r10d,DWORD[24+rsi]
xor r11d,ebx
add edx,r11d
mov r11d,0xffffffff
rol edx,10
xor r11d,ebx
add edx,eax
lea ecx,[((-1560198380))+r10*1+rcx]
or r11d,edx
mov r10d,DWORD[52+rsi]
xor r11d,eax
add ecx,r11d
mov r11d,0xffffffff
rol ecx,15
xor r11d,eax
add ecx,edx
lea ebx,[1309151649+r10*1+rbx]
or r11d,ecx
mov r10d,DWORD[16+rsi]
xor r11d,edx
add ebx,r11d
mov r11d,0xffffffff
rol ebx,21
xor r11d,edx
add ebx,ecx
lea eax,[((-145523070))+r10*1+rax]
or r11d,ebx
mov r10d,DWORD[44+rsi]
xor r11d,ecx
add eax,r11d
mov r11d,0xffffffff
rol eax,6
xor r11d,ecx
add eax,ebx
lea edx,[((-1120210379))+r10*1+rdx]
or r11d,eax
mov r10d,DWORD[8+rsi]
xor r11d,ebx
add edx,r11d
mov r11d,0xffffffff
rol edx,10
xor r11d,ebx
add edx,eax
lea ecx,[718787259+r10*1+rcx]
or r11d,edx
mov r10d,DWORD[36+rsi]
xor r11d,eax
add ecx,r11d
mov r11d,0xffffffff
rol ecx,15
xor r11d,eax
add ecx,edx
lea ebx,[((-343485551))+r10*1+rbx]
or r11d,ecx
mov r10d,DWORD[rsi]
xor r11d,edx
add ebx,r11d
mov r11d,0xffffffff
rol ebx,21
xor r11d,edx
add ebx,ecx
add eax,r8d
add ebx,r9d
add ecx,r14d
add edx,r15d
add rsi,64
cmp rsi,rdi
jb NEAR $L$loop
$L$end:
mov DWORD[rbp],eax
mov DWORD[4+rbp],ebx
mov DWORD[8+rbp],ecx
mov DWORD[12+rbp],edx
mov r15,QWORD[rsp]
mov r14,QWORD[8+rsp]
mov r12,QWORD[16+rsp]
mov rbx,QWORD[24+rsp]
mov rbp,QWORD[32+rsp]
add rsp,40
$L$epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_md5_block_asm_data_order:
EXTERN __imp_RtlVirtualUnwind
ALIGN 16
se_handler:
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD[120+r8]
mov rbx,QWORD[248+r8]
lea r10,[$L$prologue]
cmp rbx,r10
jb NEAR $L$in_prologue
mov rax,QWORD[152+r8]
lea r10,[$L$epilogue]
cmp rbx,r10
jae NEAR $L$in_prologue
lea rax,[40+rax]
mov rbp,QWORD[((-8))+rax]
mov rbx,QWORD[((-16))+rax]
mov r12,QWORD[((-24))+rax]
mov r14,QWORD[((-32))+rax]
mov r15,QWORD[((-40))+rax]
mov QWORD[144+r8],rbx
mov QWORD[160+r8],rbp
mov QWORD[216+r8],r12
mov QWORD[232+r8],r14
mov QWORD[240+r8],r15
$L$in_prologue:
mov rdi,QWORD[8+rax]
mov rsi,QWORD[16+rax]
mov QWORD[152+r8],rax
mov QWORD[168+r8],rsi
mov QWORD[176+r8],rdi
mov rdi,QWORD[40+r9]
mov rsi,r8
mov ecx,154
DD 0xa548f3fc
mov rsi,r9
xor rcx,rcx
mov rdx,QWORD[8+rsi]
mov r8,QWORD[rsi]
mov r9,QWORD[16+rsi]
mov r10,QWORD[40+rsi]
lea r11,[56+rsi]
lea r12,[24+rsi]
mov QWORD[32+rsp],r10
mov QWORD[40+rsp],r11
mov QWORD[48+rsp],r12
mov QWORD[56+rsp],rcx
call QWORD[__imp_RtlVirtualUnwind]
mov eax,1
add rsp,64
popfq
pop r15
pop r14
pop r13
pop r12
pop rbp
pop rbx
pop rdi
pop rsi
DB 0F3h,0C3h ;repret
section .pdata rdata align=4
ALIGN 4
DD $L$SEH_begin_md5_block_asm_data_order wrt ..imagebase
DD $L$SEH_end_md5_block_asm_data_order wrt ..imagebase
DD $L$SEH_info_md5_block_asm_data_order wrt ..imagebase
section .xdata rdata align=8
ALIGN 8
$L$SEH_info_md5_block_asm_data_order:
DB 9,0,0,0
DD se_handler wrt ..imagebase
|
LARGEST.asm | ahmedibrahimq/asm | 0 | 88374 | .MODEL SMALL
.STACK
.DATA
LIST DB 80,81,78,65,23,45,89,90,10,99
RESULT DB 80
P DB 2 DUP("$"),"$"
.CODE
MAIN PROC FAR
MOV AX,@Data
MOV DS,AX
;------------
MOV CX,10
LEA SI,LIST
ADD SI,1
WHO_LARGER:
MOV AL,[SI]
CMP RESULT,AL
JL YES
JMP NO
YES:
MOV RESULT,AL
NO:
INC SI
DEC CX
JNZ WHO_LARGER
;------------
MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN
|
alloy4fun_models/trashltl/models/7/Req3FTd5YnuZvGgod.als | Kaixi26/org.alloytools.alloy | 0 | 4590 | <filename>alloy4fun_models/trashltl/models/7/Req3FTd5YnuZvGgod.als
open main
pred idReq3FTd5YnuZvGgod_prop8 {
all f:File| eventually f.*link in Trash
}
pred __repair { idReq3FTd5YnuZvGgod_prop8 }
check __repair { idReq3FTd5YnuZvGgod_prop8 <=> prop8o } |
Palmtree.Math.Core.Implements/vs_build/x64_Release/pmc_subtruct.asm | rougemeilland/Palmtree.Math.Core.Implements | 0 | 17337 | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1
include listing.inc
INCLUDELIB MSVCRT
INCLUDELIB OLDNAMES
PUBLIC Subtruct_Imp
PUBLIC Initialize_Subtruct
PUBLIC PMC_Subtruct_I_X
PUBLIC PMC_Subtruct_L_X
PUBLIC PMC_Subtruct_X_I
PUBLIC PMC_Subtruct_X_L
PUBLIC PMC_Subtruct_X_X
EXTRN CheckBlockLight:PROC
EXTRN AllocateNumber:PROC
EXTRN DeallocateNumber:PROC
EXTRN CommitNumber:PROC
EXTRN CheckNumber:PROC
EXTRN DuplicateNumber:PROC
EXTRN number_zero:BYTE
; COMDAT pdata
pdata SEGMENT
$pdata$Subtruct_Imp DD imagerel $LN140
DD imagerel $LN140+985
DD imagerel $unwind$Subtruct_Imp
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$PMC_Subtruct_I_X DD imagerel $LN25
DD imagerel $LN25+221
DD imagerel $unwind$PMC_Subtruct_I_X
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$PMC_Subtruct_L_X DD imagerel $LN58
DD imagerel $LN58+203
DD imagerel $unwind$PMC_Subtruct_L_X
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$PMC_Subtruct_X_I DD imagerel $LN27
DD imagerel $LN27+395
DD imagerel $unwind$PMC_Subtruct_X_I
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$PMC_Subtruct_X_L DD imagerel $LN69
DD imagerel $LN69+399
DD imagerel $unwind$PMC_Subtruct_X_L
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$PMC_Subtruct_X_X DD imagerel $LN23
DD imagerel $LN23+386
DD imagerel $unwind$PMC_Subtruct_X_X
pdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$PMC_Subtruct_X_X DD 060f01H
DD 0a640fH
DD 09340fH
DD 0700b520fH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$PMC_Subtruct_X_L DD 060f01H
DD 0a640fH
DD 09340fH
DD 0700b520fH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$PMC_Subtruct_X_I DD 060f01H
DD 0a640fH
DD 09340fH
DD 0700b520fH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$PMC_Subtruct_L_X DD 060f01H
DD 07640fH
DD 06340fH
DD 0700b320fH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$PMC_Subtruct_I_X DD 060f01H
DD 07640fH
DD 06340fH
DD 0700b320fH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$Subtruct_Imp DD 020601H
DD 030023206H
xdata ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT Subtruct_X_2W
_TEXT SEGMENT
up$ = 8
u_count$ = 16
v_hi$ = 24
v_lo$ = 32
wp$ = 40
w_count$ = 48
Subtruct_X_2W PROC ; COMDAT
; 98 : {
mov r11, r9
mov r9, rcx
mov r10, rdx
; 99 : if (u_count < 2)
cmp rdx, 2
jae SHORT $LN2@Subtruct_X
; 100 : {
; 101 : // u が 1 ワードしかなかった場合
; 102 :
; 103 : // 明らかに演算結果が負になるのでエラーを通知する。
; 104 : return (PMC_STATUS_INTERNAL_BORROW);
mov eax, -258 ; fffffffffffffefeH
; 116 : w_count -= 2;
; 117 :
; 118 : // 残りの桁の繰り上がりを計算し、復帰する。
; 119 : return (DoBorrow(c, up, u_count, wp, w_count));
; 120 : }
; 121 : }
ret 0
$LN2@Subtruct_X:
; 105 : }
; 106 : else
; 107 : {
; 108 : // x が 2 ワード以上あった場合
; 109 :
; 110 : // 最下位のワードの減算をする
; 111 : char c = _SUBTRUCT_UNIT(0, *up++, v_lo, wp++);
mov rax, QWORD PTR [rcx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
mov rdx, QWORD PTR wp$[rsp]
sub rax, r11
setb cl
add cl, -1
mov QWORD PTR [rdx], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 114 : c = _SUBTRUCT_UNIT(c, *up++, v_hi, wp++);
mov rax, QWORD PTR [r9+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, r8
mov QWORD PTR [rdx+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 114 : c = _SUBTRUCT_UNIT(c, *up++, v_hi, wp++);
lea rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
setb r8b
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 115 : u_count -= 2;
lea rdx, QWORD PTR [r10-2]
add r9, 16
; 44 : if (u_count <= 0)
test rdx, rdx
je SHORT $LN25@Subtruct_X
npad 7
$LL10@Subtruct_X:
; 49 : {
; 50 : // かつそれでも桁借りを行う必要がある場合
; 51 :
; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。
; 53 : return (PMC_STATUS_INTERNAL_BORROW);
; 54 : }
; 55 :
; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。
; 57 :
; 58 : return (PMC_STATUS_OK);
; 59 : }
; 60 : else if (c)
test r8b, r8b
je SHORT $LN24@Subtruct_X
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
mov rcx, QWORD PTR [r9]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add r8b, -1
sbb rcx, 0
mov QWORD PTR [rax], rcx
setb r8b
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
add r9, 8
add rax, 8
; 66 : --u_count;
sub rdx, 1
jne SHORT $LL10@Subtruct_X
$LN25@Subtruct_X:
; 45 : {
; 46 : // x の最上位まで達してしまった場合
; 47 :
; 48 : if (c)
neg r8b
sbb eax, eax
and eax, -258 ; fffffffffffffefeH
; 116 : w_count -= 2;
; 117 :
; 118 : // 残りの桁の繰り上がりを計算し、復帰する。
; 119 : return (DoBorrow(c, up, u_count, wp, w_count));
; 120 : }
; 121 : }
ret 0
$LN24@Subtruct_X:
; 74 : while (u_count > 0)
test rdx, rdx
je SHORT $LN14@Subtruct_X
sub r9, rax
npad 8
$LL13@Subtruct_X:
; 75 : {
; 76 : *wp++ = *up++;
mov rcx, QWORD PTR [r9+rax]
mov QWORD PTR [rax], rcx
lea rax, QWORD PTR [rax+8]
; 77 : --u_count;
sub rdx, 1
jne SHORT $LL13@Subtruct_X
$LN14@Subtruct_X:
; 78 : --w_count;
; 79 : }
; 80 : return (PMC_STATUS_OK);
xor eax, eax
; 116 : w_count -= 2;
; 117 :
; 118 : // 残りの桁の繰り上がりを計算し、復帰する。
; 119 : return (DoBorrow(c, up, u_count, wp, w_count));
; 120 : }
; 121 : }
ret 0
Subtruct_X_2W ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT Subtruct_X_1W
_TEXT SEGMENT
up$ = 8
u_count$ = 16
v$ = 24
wp$ = 32
w_count$ = 40
Subtruct_X_1W PROC ; COMDAT
; 88 : char c = _SUBTRUCT_UNIT(0, *up++, v, wp++);
mov rax, QWORD PTR [rcx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sub rax, r8
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 88 : char c = _SUBTRUCT_UNIT(0, *up++, v, wp++);
lea rax, QWORD PTR [r9+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
setb r8b
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 88 : char c = _SUBTRUCT_UNIT(0, *up++, v, wp++);
lea r9, QWORD PTR [rcx+8]
; 89 : --u_count;
sub rdx, 1
; 44 : if (u_count <= 0)
je SHORT $LN21@Subtruct_X
npad 5
$LL6@Subtruct_X:
; 49 : {
; 50 : // かつそれでも桁借りを行う必要がある場合
; 51 :
; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。
; 53 : return (PMC_STATUS_INTERNAL_BORROW);
; 54 : }
; 55 :
; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。
; 57 :
; 58 : return (PMC_STATUS_OK);
; 59 : }
; 60 : else if (c)
test r8b, r8b
je SHORT $LN20@Subtruct_X
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
mov rcx, QWORD PTR [r9]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add r8b, -1
sbb rcx, 0
mov QWORD PTR [rax], rcx
setb r8b
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
add r9, 8
add rax, 8
; 66 : --u_count;
sub rdx, 1
jne SHORT $LL6@Subtruct_X
$LN21@Subtruct_X:
; 45 : {
; 46 : // x の最上位まで達してしまった場合
; 47 :
; 48 : if (c)
neg r8b
sbb eax, eax
and eax, -258 ; fffffffffffffefeH
; 94 : }
ret 0
$LN20@Subtruct_X:
; 74 : while (u_count > 0)
test rdx, rdx
je SHORT $LN10@Subtruct_X
sub r9, rax
npad 8
$LL9@Subtruct_X:
; 75 : {
; 76 : *wp++ = *up++;
mov rcx, QWORD PTR [r9+rax]
mov QWORD PTR [rax], rcx
lea rax, QWORD PTR [rax+8]
; 77 : --u_count;
sub rdx, 1
jne SHORT $LL9@Subtruct_X
$LN10@Subtruct_X:
; 90 : --w_count;
; 91 :
; 92 : // 残りの桁の繰上りを行い復帰する。
; 93 : return (DoBorrow(c, up, u_count, wp, w_count));
xor eax, eax
; 94 : }
ret 0
Subtruct_X_1W ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT DoBorrow
_TEXT SEGMENT
c$ = 8
up$ = 16
u_count$ = 24
wp$ = 32
w_count$ = 40
DoBorrow PROC ; COMDAT
; 41 : // 桁借りを続く限り行う
; 42 : for (;;)
; 43 : {
; 44 : if (u_count <= 0)
test r8, r8
je SHORT $LN17@DoBorrow
$LL2@DoBorrow:
; 54 : }
; 55 :
; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。
; 57 :
; 58 : return (PMC_STATUS_OK);
; 59 : }
; 60 : else if (c)
test cl, cl
je SHORT $LN16@DoBorrow
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, 0
mov QWORD PTR [r9], rax
setb cl
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
add rdx, 8
add r9, 8
; 66 : --u_count;
sub r8, 1
jne SHORT $LL2@DoBorrow
$LN17@DoBorrow:
; 45 : {
; 46 : // x の最上位まで達してしまった場合
; 47 :
; 48 : if (c)
test cl, cl
je SHORT $LN6@DoBorrow
; 49 : {
; 50 : // かつそれでも桁借りを行う必要がある場合
; 51 :
; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。
; 53 : return (PMC_STATUS_INTERNAL_BORROW);
mov eax, -258 ; fffffffffffffefeH
; 81 : }
; 82 : }
; 83 : }
ret 0
$LN16@DoBorrow:
; 67 : --w_count;
; 68 : }
; 69 : else
; 70 : {
; 71 : // xの最上位に達しておらず、かつボローが立っていない場合
; 72 :
; 73 : // 桁借りを中断し、xの残りのデータをzにそのまま複写し、正常復帰する。
; 74 : while (u_count > 0)
test r8, r8
je SHORT $LN6@DoBorrow
sub rdx, r9
npad 7
$LL5@DoBorrow:
; 75 : {
; 76 : *wp++ = *up++;
mov rax, QWORD PTR [rdx+r9]
mov QWORD PTR [r9], rax
lea r9, QWORD PTR [r9+8]
; 77 : --u_count;
sub r8, 1
jne SHORT $LL5@DoBorrow
$LN6@DoBorrow:
; 78 : --w_count;
; 79 : }
; 80 : return (PMC_STATUS_OK);
xor eax, eax
; 81 : }
; 82 : }
; 83 : }
ret 0
DoBorrow ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; COMDAT _SUBTRUCT_2WORDS_SBB
_TEXT SEGMENT
c$ = 8
xp$ = 16
yp$ = 24
zp$ = 32
_SUBTRUCT_2WORDS_SBB PROC ; COMDAT
; 4465 : #ifdef _MSC_VER
; 4466 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4467 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rcx, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rcx, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rcx
setb al
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4504 : }
ret 0
_SUBTRUCT_2WORDS_SBB ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; COMDAT _SUBTRUCT_4WORDS_SBB
_TEXT SEGMENT
c$ = 8
xp$ = 16
yp$ = 24
zp$ = 32
_SUBTRUCT_4WORDS_SBB PROC ; COMDAT
; 4051 : #ifdef _MSC_VER
; 4052 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4053 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4054 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]);
mov rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+16]
mov QWORD PTR [r9+16], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4055 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]);
mov rcx, QWORD PTR [rdx+24]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rcx, QWORD PTR [r8+24]
mov QWORD PTR [r9+24], rcx
setb al
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4104 : }
ret 0
_SUBTRUCT_4WORDS_SBB ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; COMDAT _SUBTRUCT_8WORDS_SBB
_TEXT SEGMENT
c$ = 8
xp$ = 16
yp$ = 24
zp$ = 32
_SUBTRUCT_8WORDS_SBB PROC ; COMDAT
; 3455 : #ifdef _MSC_VER
; 3456 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3457 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3458 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]);
mov rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+16]
mov QWORD PTR [r9+16], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3459 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]);
mov rax, QWORD PTR [rdx+24]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+24]
mov QWORD PTR [r9+24], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3460 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]);
mov rax, QWORD PTR [rdx+32]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+32]
mov QWORD PTR [r9+32], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3461 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]);
mov rax, QWORD PTR [rdx+40]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+40]
mov QWORD PTR [r9+40], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3462 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]);
mov rax, QWORD PTR [rdx+48]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+48]
mov QWORD PTR [r9+48], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3463 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]);
mov rcx, QWORD PTR [rdx+56]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rcx, QWORD PTR [r8+56]
mov QWORD PTR [r9+56], rcx
setb al
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3536 : }
ret 0
_SUBTRUCT_8WORDS_SBB ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; COMDAT _SUBTRUCT_16WORDS_SBB
_TEXT SEGMENT
c$ = 8
xp$ = 16
yp$ = 24
zp$ = 32
_SUBTRUCT_16WORDS_SBB PROC ; COMDAT
; 2495 : #ifdef _MSC_VER
; 2496 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2497 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2498 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]);
mov rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+16]
mov QWORD PTR [r9+16], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2499 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]);
mov rax, QWORD PTR [rdx+24]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+24]
mov QWORD PTR [r9+24], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2500 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]);
mov rax, QWORD PTR [rdx+32]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+32]
mov QWORD PTR [r9+32], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2501 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]);
mov rax, QWORD PTR [rdx+40]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+40]
mov QWORD PTR [r9+40], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2502 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]);
mov rax, QWORD PTR [rdx+48]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+48]
mov QWORD PTR [r9+48], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2503 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]);
mov rax, QWORD PTR [rdx+56]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+56]
mov QWORD PTR [r9+56], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2504 : c = _SUBTRUCT_UNIT(c, xp[8], yp[8], &zp[8]);
mov rax, QWORD PTR [rdx+64]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+64]
mov QWORD PTR [r9+64], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2505 : c = _SUBTRUCT_UNIT(c, xp[9], yp[9], &zp[9]);
mov rax, QWORD PTR [rdx+72]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+72]
mov QWORD PTR [r9+72], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2506 : c = _SUBTRUCT_UNIT(c, xp[10], yp[10], &zp[10]);
mov rax, QWORD PTR [rdx+80]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+80]
mov QWORD PTR [r9+80], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2507 : c = _SUBTRUCT_UNIT(c, xp[11], yp[11], &zp[11]);
mov rax, QWORD PTR [rdx+88]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+88]
mov QWORD PTR [r9+88], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2508 : c = _SUBTRUCT_UNIT(c, xp[12], yp[12], &zp[12]);
mov rax, QWORD PTR [rdx+96]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+96]
mov QWORD PTR [r9+96], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2509 : c = _SUBTRUCT_UNIT(c, xp[13], yp[13], &zp[13]);
mov rax, QWORD PTR [rdx+104]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+104]
mov QWORD PTR [r9+104], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2510 : c = _SUBTRUCT_UNIT(c, xp[14], yp[14], &zp[14]);
mov rax, QWORD PTR [rdx+112]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+112]
mov QWORD PTR [r9+112], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2511 : c = _SUBTRUCT_UNIT(c, xp[15], yp[15], &zp[15]);
mov rcx, QWORD PTR [rdx+120]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rcx, QWORD PTR [r8+120]
mov QWORD PTR [r9+120], rcx
setb al
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 2632 : }
ret 0
_SUBTRUCT_16WORDS_SBB ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; COMDAT _SUBTRUCT_32WORDS_SBB
_TEXT SEGMENT
c$ = 8
xp$ = 16
yp$ = 24
zp$ = 32
_SUBTRUCT_32WORDS_SBB PROC ; COMDAT
; 807 : #ifdef _MSC_VER
; 808 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 809 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 810 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]);
mov rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+16]
mov QWORD PTR [r9+16], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 811 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]);
mov rax, QWORD PTR [rdx+24]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+24]
mov QWORD PTR [r9+24], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 812 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]);
mov rax, QWORD PTR [rdx+32]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+32]
mov QWORD PTR [r9+32], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 813 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]);
mov rax, QWORD PTR [rdx+40]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+40]
mov QWORD PTR [r9+40], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 814 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]);
mov rax, QWORD PTR [rdx+48]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+48]
mov QWORD PTR [r9+48], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 815 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]);
mov rax, QWORD PTR [rdx+56]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+56]
mov QWORD PTR [r9+56], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 816 : c = _SUBTRUCT_UNIT(c, xp[8], yp[8], &zp[8]);
mov rax, QWORD PTR [rdx+64]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+64]
mov QWORD PTR [r9+64], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 817 : c = _SUBTRUCT_UNIT(c, xp[9], yp[9], &zp[9]);
mov rax, QWORD PTR [rdx+72]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+72]
mov QWORD PTR [r9+72], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 818 : c = _SUBTRUCT_UNIT(c, xp[10], yp[10], &zp[10]);
mov rax, QWORD PTR [rdx+80]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+80]
mov QWORD PTR [r9+80], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 819 : c = _SUBTRUCT_UNIT(c, xp[11], yp[11], &zp[11]);
mov rax, QWORD PTR [rdx+88]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+88]
mov QWORD PTR [r9+88], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 820 : c = _SUBTRUCT_UNIT(c, xp[12], yp[12], &zp[12]);
mov rax, QWORD PTR [rdx+96]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+96]
mov QWORD PTR [r9+96], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 821 : c = _SUBTRUCT_UNIT(c, xp[13], yp[13], &zp[13]);
mov rax, QWORD PTR [rdx+104]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+104]
mov QWORD PTR [r9+104], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 822 : c = _SUBTRUCT_UNIT(c, xp[14], yp[14], &zp[14]);
mov rax, QWORD PTR [rdx+112]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+112]
mov QWORD PTR [r9+112], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 823 : c = _SUBTRUCT_UNIT(c, xp[15], yp[15], &zp[15]);
mov rax, QWORD PTR [rdx+120]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+120]
mov QWORD PTR [r9+120], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 824 : c = _SUBTRUCT_UNIT(c, xp[16], yp[16], &zp[16]);
mov rax, QWORD PTR [rdx+128]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+128]
mov QWORD PTR [r9+128], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 825 : c = _SUBTRUCT_UNIT(c, xp[17], yp[17], &zp[17]);
mov rax, QWORD PTR [rdx+136]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+136]
mov QWORD PTR [r9+136], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 826 : c = _SUBTRUCT_UNIT(c, xp[18], yp[18], &zp[18]);
mov rax, QWORD PTR [rdx+144]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+144]
mov QWORD PTR [r9+144], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 827 : c = _SUBTRUCT_UNIT(c, xp[19], yp[19], &zp[19]);
mov rax, QWORD PTR [rdx+152]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+152]
mov QWORD PTR [r9+152], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 828 : c = _SUBTRUCT_UNIT(c, xp[20], yp[20], &zp[20]);
mov rax, QWORD PTR [rdx+160]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+160]
mov QWORD PTR [r9+160], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 829 : c = _SUBTRUCT_UNIT(c, xp[21], yp[21], &zp[21]);
mov rax, QWORD PTR [rdx+168]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+168]
mov QWORD PTR [r9+168], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 830 : c = _SUBTRUCT_UNIT(c, xp[22], yp[22], &zp[22]);
mov rax, QWORD PTR [rdx+176]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+176]
mov QWORD PTR [r9+176], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 831 : c = _SUBTRUCT_UNIT(c, xp[23], yp[23], &zp[23]);
mov rax, QWORD PTR [rdx+184]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+184]
mov QWORD PTR [r9+184], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 832 : c = _SUBTRUCT_UNIT(c, xp[24], yp[24], &zp[24]);
mov rax, QWORD PTR [rdx+192]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+192]
mov QWORD PTR [r9+192], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 833 : c = _SUBTRUCT_UNIT(c, xp[25], yp[25], &zp[25]);
mov rax, QWORD PTR [rdx+200]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+200]
mov QWORD PTR [r9+200], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 834 : c = _SUBTRUCT_UNIT(c, xp[26], yp[26], &zp[26]);
mov rax, QWORD PTR [rdx+208]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+208]
mov QWORD PTR [r9+208], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 835 : c = _SUBTRUCT_UNIT(c, xp[27], yp[27], &zp[27]);
mov rax, QWORD PTR [rdx+216]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+216]
mov QWORD PTR [r9+216], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 836 : c = _SUBTRUCT_UNIT(c, xp[28], yp[28], &zp[28]);
mov rax, QWORD PTR [rdx+224]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+224]
mov QWORD PTR [r9+224], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 837 : c = _SUBTRUCT_UNIT(c, xp[29], yp[29], &zp[29]);
mov rax, QWORD PTR [rdx+232]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+232]
mov QWORD PTR [r9+232], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 838 : c = _SUBTRUCT_UNIT(c, xp[30], yp[30], &zp[30]);
mov rax, QWORD PTR [rdx+240]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+240]
mov QWORD PTR [r9+240], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 839 : c = _SUBTRUCT_UNIT(c, xp[31], yp[31], &zp[31]);
mov rcx, QWORD PTR [rdx+248]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rcx, QWORD PTR [r8+248]
mov QWORD PTR [r9+248], rcx
setb al
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 1056 : }
ret 0
_SUBTRUCT_32WORDS_SBB ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _LZCNT_ALT_UNIT
_TEXT SEGMENT
x$ = 8
_LZCNT_ALT_UNIT PROC ; COMDAT
; 630 : if (x == 0)
test rcx, rcx
jne SHORT $LN2@LZCNT_ALT_
; 631 : return (sizeof(x) * 8);
mov eax, 64 ; 00000040H
; 655 : }
ret 0
$LN2@LZCNT_ALT_:
; 632 : #ifdef _M_IX86
; 633 : _UINT32_T pos;
; 634 : #ifdef _MSC_VER
; 635 : _BitScanReverse(&pos, x);
; 636 : #elif defined(__GNUC__)
; 637 : __asm__("bsrl %1, %0" : "=r"(pos) : "rm"(x));
; 638 : #else
; 639 : #error unknown compiler
; 640 : #endif
; 641 : #elif defined(_M_X64)
; 642 : #ifdef _MSC_VER
; 643 : _UINT32_T pos;
; 644 : _BitScanReverse64(&pos, x);
bsr rcx, rcx
; 645 : #elif defined(__GNUC__)
; 646 : _UINT64_T pos;
; 647 : __asm__("bsrq %1, %0" : "=r"(pos) : "rm"(x));
; 648 : #else
; 649 : #error unknown compiler
; 650 : #endif
; 651 : #else
; 652 : #error unknown platform
; 653 : #endif
; 654 : return (sizeof(x) * 8 - 1 - pos);
mov eax, 63 ; 0000003fH
sub eax, ecx
; 655 : }
ret 0
_LZCNT_ALT_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _LZCNT_ALT_32
_TEXT SEGMENT
x$ = 8
_LZCNT_ALT_32 PROC ; COMDAT
; 597 : if (x == 0)
test ecx, ecx
jne SHORT $LN2@LZCNT_ALT_
; 598 : return (sizeof(x) * 8);
mov eax, 32 ; 00000020H
; 608 : }
ret 0
$LN2@LZCNT_ALT_:
; 599 : _UINT32_T pos;
; 600 : #ifdef _MSC_VER
; 601 : _BitScanReverse(&pos, x);
bsr ecx, ecx
; 602 : #elif defined(__GNUC__)
; 603 : __asm__("bsrl %1, %0" : "=r"(pos) : "rm"(x));
; 604 : #else
; 605 : #error unknown compiler
; 606 : #endif
; 607 : return (sizeof(x) * 8 - 1 - pos);
mov eax, 31
sub eax, ecx
; 608 : }
ret 0
_LZCNT_ALT_32 ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _SUBTRUCT_UNIT
_TEXT SEGMENT
borrow$ = 8
u$ = 16
v$ = 24
w$ = 32
_SUBTRUCT_UNIT PROC ; COMDAT
; 270 : #ifdef _M_IX86
; 271 : return (_subborrow_u32(borrow, u, v, w));
; 272 : #elif defined(_M_X64)
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rdx, r8
mov QWORD PTR [r9], rdx
setb al
; 274 : #else
; 275 : #error unknown platform
; 276 : #endif
; 277 : }
ret 0
_SUBTRUCT_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _FROMDWORDTOWORD
_TEXT SEGMENT
value$ = 8
result_high$ = 16
_FROMDWORDTOWORD PROC ; COMDAT
; 183 : *result_high = (_UINT32_T)(value >> 32);
mov rax, rcx
shr rax, 32 ; 00000020H
mov DWORD PTR [rdx], eax
; 184 : return ((_UINT32_T)value);
mov eax, ecx
; 185 : }
ret 0
_FROMDWORDTOWORD ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _FROMWORDTODWORD
_TEXT SEGMENT
value_high$ = 8
value_low$ = 16
_FROMWORDTODWORD PROC ; COMDAT
; 178 : return (((_UINT64_T)value_high << 32) | value_low);
mov eax, ecx
shl rax, 32 ; 00000020H
mov ecx, edx
or rax, rcx
; 179 : }
ret 0
_FROMWORDTODWORD ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT PMC_Subtruct_X_X
_TEXT SEGMENT
nz$ = 64
x$ = 64
y$ = 72
o$ = 80
nz_light_check_code$1 = 88
PMC_Subtruct_X_X PROC ; COMDAT
; 665 : {
$LN23:
mov QWORD PTR [rsp+16], rbx
mov QWORD PTR [rsp+24], rsi
push rdi
sub rsp, 48 ; 00000030H
mov rsi, r8
mov rdi, rdx
mov rbx, rcx
; 666 : if (x == NULL)
test rcx, rcx
je $LN20@PMC_Subtru
; 667 : return (PMC_STATUS_ARGUMENT_ERROR);
; 668 : if (y == NULL)
test rdx, rdx
je $LN20@PMC_Subtru
; 669 : return (PMC_STATUS_ARGUMENT_ERROR);
; 670 : if (o == NULL)
test r8, r8
je $LN20@PMC_Subtru
; 672 : NUMBER_HEADER* nx = (NUMBER_HEADER*)x;
; 673 : NUMBER_HEADER* ny = (NUMBER_HEADER*)y;
; 674 : PMC_STATUS_CODE result;
; 675 : if ((result = CheckNumber(nx)) != PMC_STATUS_OK)
call CheckNumber
test eax, eax
jne $LN1@PMC_Subtru
; 676 : return (result);
; 677 : if ((result = CheckNumber(ny)) != PMC_STATUS_OK)
mov rcx, rdi
call CheckNumber
test eax, eax
jne $LN1@PMC_Subtru
; 678 : return (result);
; 679 : NUMBER_HEADER* nz;
; 680 : if (nx->IS_ZERO)
mov eax, DWORD PTR [rdi+40]
and eax, 2
test BYTE PTR [rbx+40], 2
je SHORT $LN7@PMC_Subtru
; 681 : {
; 682 : if (ny->IS_ZERO)
test eax, eax
je SHORT $LN19@PMC_Subtru
; 683 : {
; 684 : // y が 0 である場合
; 685 :
; 686 : // x と y がともに 0 であるので、演算結果の 0 を呼び出し元に返す。
; 687 : *o = &number_zero;
lea rax, OFFSET FLAT:number_zero
; 735 : }
; 736 : #ifdef _DEBUG
; 737 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK)
; 738 : return (result);
; 739 : #endif
; 740 : return (PMC_STATUS_OK);
mov QWORD PTR [rsi], rax
xor eax, eax
; 741 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN7@PMC_Subtru:
; 688 : }
; 689 : else
; 690 : {
; 691 : // y が 0 ではない場合
; 692 :
; 693 : // 演算結果は負となってしまうのでエラーを返す。
; 694 : return (PMC_STATUS_OVERFLOW);
; 695 : }
; 696 : }
; 697 : else
; 698 : {
; 699 : // x が 0 ではない場合
; 700 :
; 701 : if (ny->IS_ZERO)
test eax, eax
je SHORT $LN11@PMC_Subtru
; 702 : {
; 703 : // y が 0 である場合
; 704 :
; 705 : // 演算結果となる x の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。
; 706 : if ((result = DuplicateNumber(nx, &nz)) != PMC_STATUS_OK)
lea rdx, QWORD PTR nz$[rsp]
mov rcx, rbx
call DuplicateNumber
test eax, eax
je $LN12@PMC_Subtru
; 741 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN11@PMC_Subtru:
; 707 : return (result);
; 708 : }
; 709 : else
; 710 : {
; 711 : // x と y がともに 0 ではない場合
; 712 :
; 713 : // x と y の差を計算する
; 714 : __UNIT_TYPE x_bit_count = nx->UNIT_BIT_COUNT;
mov rdx, QWORD PTR [rbx+16]
; 715 : __UNIT_TYPE y_bit_count = ny->UNIT_BIT_COUNT;
; 716 : if (x_bit_count < y_bit_count)
cmp rdx, QWORD PTR [rdi+16]
jae SHORT $LN14@PMC_Subtru
$LN19@PMC_Subtru:
; 717 : {
; 718 : // 演算結果は負となってしまうのでエラーを返す。
; 719 : return (PMC_STATUS_OVERFLOW);
mov eax, -2
; 741 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN14@PMC_Subtru:
; 720 : }
; 721 : __UNIT_TYPE z_bit_count = x_bit_count;
; 722 : __UNIT_TYPE nz_light_check_code;
; 723 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK)
lea r8, QWORD PTR nz_light_check_code$1[rsp]
lea rcx, QWORD PTR nz$[rsp]
call AllocateNumber
test eax, eax
jne $LN1@PMC_Subtru
; 724 : return (result);
; 725 : if ((result = Subtruct_Imp(nx->BLOCK, nx->UNIT_WORD_COUNT, ny->BLOCK, ny->UNIT_WORD_COUNT, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK)
mov rcx, QWORD PTR nz$[rsp]
mov r9, QWORD PTR [rdi+8]
mov r8, QWORD PTR [rdi+56]
mov rdx, QWORD PTR [rbx+8]
mov rax, QWORD PTR [rcx+48]
mov QWORD PTR [rsp+40], rax
mov rax, QWORD PTR [rcx+56]
mov rcx, QWORD PTR [rbx+56]
mov QWORD PTR [rsp+32], rax
call Subtruct_Imp
mov rcx, QWORD PTR nz$[rsp]
mov ebx, eax
test eax, eax
je SHORT $LN16@PMC_Subtru
; 726 : {
; 727 : DeallocateNumber(nz);
call DeallocateNumber
; 728 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result);
mov eax, -2
cmp ebx, -258 ; fffffffffffffefeH
cmove ebx, eax
mov eax, ebx
; 741 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN16@PMC_Subtru:
; 729 : }
; 730 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR nz_light_check_code$1[rsp]
mov rcx, QWORD PTR [rcx+56]
call CheckBlockLight
test eax, eax
jne SHORT $LN1@PMC_Subtru
; 731 : return (result);
; 732 : CommitNumber(nz);
mov rcx, QWORD PTR nz$[rsp]
call CommitNumber
$LN12@PMC_Subtru:
; 733 : }
; 734 : *o = nz;
mov rax, QWORD PTR nz$[rsp]
; 735 : }
; 736 : #ifdef _DEBUG
; 737 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK)
; 738 : return (result);
; 739 : #endif
; 740 : return (PMC_STATUS_OK);
mov QWORD PTR [rsi], rax
xor eax, eax
; 741 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN20@PMC_Subtru:
; 671 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
$LN1@PMC_Subtru:
; 741 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
PMC_Subtruct_X_X ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT PMC_Subtruct_X_L
_TEXT SEGMENT
nz$ = 64
x$ = 64
y$ = 72
o$ = 80
nz_light_check_code$1 = 88
PMC_Subtruct_X_L PROC ; COMDAT
; 524 : {
$LN69:
mov QWORD PTR [rsp+16], rbx
mov QWORD PTR [rsp+24], rsi
push rdi
sub rsp, 48 ; 00000030H
mov rsi, r8
mov rdi, rdx
mov rbx, rcx
; 525 : if (__UNIT_TYPE_BIT_COUNT * 2 < sizeof(y) * 8)
; 526 : {
; 527 : // _UINT64_T が 2 ワードで表現しきれない処理系には対応しない
; 528 : return (PMC_STATUS_INTERNAL_ERROR);
; 529 : }
; 530 : if (x == NULL)
test rcx, rcx
je $LN65@PMC_Subtru
; 531 : return (PMC_STATUS_ARGUMENT_ERROR);
; 532 : if (o == NULL)
test r8, r8
je $LN65@PMC_Subtru
; 534 : NUMBER_HEADER* nx = (NUMBER_HEADER*)x;
; 535 : PMC_STATUS_CODE result;
; 536 : if ((result = CheckNumber(nx)) != PMC_STATUS_OK)
call CheckNumber
test eax, eax
jne $LN1@PMC_Subtru
; 537 : return (result);
; 538 : NUMBER_HEADER* nz;
; 539 : if (nx->IS_ZERO)
test BYTE PTR [rbx+40], 2
je SHORT $LN6@PMC_Subtru
; 540 : {
; 541 : // x が 0 である場合
; 542 :
; 543 : if (y == 0)
test rdi, rdi
jne SHORT $LN64@PMC_Subtru
; 652 : nz = &number_zero;
; 653 : }
; 654 : }
; 655 : *o = nz;
; 656 : }
; 657 : #ifdef _DEBUG
; 658 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK)
; 659 : return (result);
; 660 : #endif
; 661 : return (PMC_STATUS_OK);
lea rax, OFFSET FLAT:number_zero
mov QWORD PTR [rsi], rax
xor eax, eax
; 662 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN6@PMC_Subtru:
; 544 : {
; 545 : // y が 0 である場合
; 546 :
; 547 : // x と y がともに 0 であるので、演算結果の 0 を呼び出し元に返す。
; 548 : *o = &number_zero;
; 549 : }
; 550 : else
; 551 : {
; 552 : // y が 0 ではない場合
; 553 :
; 554 : // 演算結果は負となってしまうのでエラーを返す。
; 555 : return (PMC_STATUS_OVERFLOW);
; 556 : }
; 557 : }
; 558 : else
; 559 : {
; 560 : // x が 0 ではない場合
; 561 :
; 562 : if (y == 0)
test rdi, rdi
jne SHORT $LN10@PMC_Subtru
; 563 : {
; 564 : // y が 0 である場合
; 565 :
; 566 : // 演算結果となる x の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。
; 567 : if ((result = DuplicateNumber(nx, &nz)) != PMC_STATUS_OK)
lea rdx, QWORD PTR nz$[rsp]
mov rcx, rbx
call DuplicateNumber
test eax, eax
jne $LN1@PMC_Subtru
mov rax, QWORD PTR nz$[rsp]
; 652 : nz = &number_zero;
; 653 : }
; 654 : }
; 655 : *o = nz;
; 656 : }
; 657 : #ifdef _DEBUG
; 658 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK)
; 659 : return (result);
; 660 : #endif
; 661 : return (PMC_STATUS_OK);
mov QWORD PTR [rsi], rax
xor eax, eax
; 662 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN10@PMC_Subtru:
; 568 : return (result);
; 569 : }
; 570 : else
; 571 : {
; 572 : // x と y がともに 0 ではない場合
; 573 :
; 574 : // x と y の差を計算する
; 575 : if (__UNIT_TYPE_BIT_COUNT < sizeof(y) * 8)
; 576 : {
; 577 : // _UINT64_T が 1 ワードで表現しきれない場合
; 578 :
; 579 : __UNIT_TYPE x_bit_count = nx->UNIT_BIT_COUNT;
; 580 : _UINT32_T y_hi;
; 581 : _UINT32_T y_lo = _FROMDWORDTOWORD(y, &y_hi);
; 582 : if (y_hi == 0)
; 583 : {
; 584 : // y の値が 32bit で表現可能な場合
; 585 : __UNIT_TYPE y_bit_count = sizeof(y_lo) * 8 - _LZCNT_ALT_32(y_lo);
; 586 : if (x_bit_count < y_bit_count)
; 587 : {
; 588 : // 演算結果は負となってしまうのでエラーを返す。
; 589 : return (PMC_STATUS_OVERFLOW);
; 590 : }
; 591 : __UNIT_TYPE z_bit_count = x_bit_count;
; 592 : __UNIT_TYPE nz_light_check_code;
; 593 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK)
; 594 : return (result);
; 595 : if ((result = Subtruct_X_1W(nx->BLOCK, nx->UNIT_WORD_COUNT, y_lo, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK)
; 596 : {
; 597 : DeallocateNumber(nz);
; 598 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result);
; 599 : }
; 600 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK)
; 601 : return (result);
; 602 : }
; 603 : else
; 604 : {
; 605 : // y の値が 32bit では表現できない場合
; 606 : __UNIT_TYPE y_bit_count = sizeof(y) * 8 - _LZCNT_ALT_32(y_hi);
; 607 : if (x_bit_count < y_bit_count)
; 608 : {
; 609 : // 演算結果は負となってしまうのでエラーを返す。
; 610 : return (PMC_STATUS_OVERFLOW);
; 611 : }
; 612 : __UNIT_TYPE z_bit_count = x_bit_count;
; 613 : __UNIT_TYPE nz_light_check_code;
; 614 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK)
; 615 : return (result);
; 616 : if ((result = Subtruct_X_2W(nx->BLOCK, nx->UNIT_WORD_COUNT, y_hi, y_lo, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK)
; 617 : {
; 618 : DeallocateNumber(nz);
; 619 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result);
; 620 : }
; 621 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK)
; 622 : return (result);
; 623 : }
; 624 : }
; 625 : else
; 626 : {
; 627 : // _UINT64_T が 1 ワードで表現できる場合
; 628 :
; 629 : __UNIT_TYPE x_bit_count = nx->UNIT_BIT_COUNT;
mov rdx, QWORD PTR [rbx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 654 : return (sizeof(x) * 8 - 1 - pos);
mov ecx, 63 ; 0000003fH
bsr rax, rdi
sub ecx, eax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 630 : __UNIT_TYPE y_bit_count = sizeof(y) * 8 - _LZCNT_ALT_UNIT((__UNIT_TYPE)y);
movsxd rax, ecx
mov ecx, 64 ; 00000040H
sub rcx, rax
; 631 : if (x_bit_count < y_bit_count)
cmp rdx, rcx
jae SHORT $LN25@PMC_Subtru
$LN64@PMC_Subtru:
; 632 : {
; 633 : // 演算結果は負となってしまうのでエラーを返す。
; 634 : return (PMC_STATUS_OVERFLOW);
mov eax, -2
; 662 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN25@PMC_Subtru:
; 635 : }
; 636 : __UNIT_TYPE z_bit_count = x_bit_count;
; 637 : __UNIT_TYPE nz_light_check_code;
; 638 : if ((result = AllocateNumber(&nz, z_bit_count, &nz_light_check_code)) != PMC_STATUS_OK)
lea r8, QWORD PTR nz_light_check_code$1[rsp]
lea rcx, QWORD PTR nz$[rsp]
call AllocateNumber
test eax, eax
jne $LN1@PMC_Subtru
; 639 : return (result);
; 640 : if ((result = Subtruct_X_1W(nx->BLOCK, nx->UNIT_WORD_COUNT, (__UNIT_TYPE)y, nz->BLOCK, nz->BLOCK_COUNT)) != PMC_STATUS_OK)
mov r9, QWORD PTR nz$[rsp]
mov r8, rdi
mov rdx, QWORD PTR [rbx+8]
mov rcx, QWORD PTR [rbx+56]
mov rax, QWORD PTR [r9+48]
mov r9, QWORD PTR [r9+56]
mov QWORD PTR [rsp+32], rax
call Subtruct_X_1W
mov rcx, QWORD PTR nz$[rsp]
mov ebx, eax
test eax, eax
je SHORT $LN27@PMC_Subtru
; 641 : {
; 642 : DeallocateNumber(nz);
call DeallocateNumber
; 643 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result);
mov eax, -2
cmp ebx, -258 ; fffffffffffffefeH
cmove ebx, eax
mov eax, ebx
; 662 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN27@PMC_Subtru:
; 644 : }
; 645 : if ((result = CheckBlockLight(nz->BLOCK, nz_light_check_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR nz_light_check_code$1[rsp]
mov rcx, QWORD PTR [rcx+56]
call CheckBlockLight
test eax, eax
jne SHORT $LN1@PMC_Subtru
; 646 : return (result);
; 647 : }
; 648 : CommitNumber(nz);
mov rcx, QWORD PTR nz$[rsp]
call CommitNumber
; 649 : if (nz->IS_ZERO)
mov rax, QWORD PTR nz$[rsp]
test BYTE PTR [rax+40], 2
je SHORT $LN29@PMC_Subtru
; 650 : {
; 651 : DeallocateNumber(nz);
mov rcx, rax
call DeallocateNumber
; 652 : nz = &number_zero;
; 653 : }
; 654 : }
; 655 : *o = nz;
; 656 : }
; 657 : #ifdef _DEBUG
; 658 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK)
; 659 : return (result);
; 660 : #endif
; 661 : return (PMC_STATUS_OK);
lea rax, OFFSET FLAT:number_zero
$LN29@PMC_Subtru:
mov QWORD PTR [rsi], rax
xor eax, eax
; 662 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN65@PMC_Subtru:
; 533 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
$LN1@PMC_Subtru:
; 662 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
PMC_Subtruct_X_L ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT PMC_Subtruct_X_I
_TEXT SEGMENT
nw$ = 64
u$ = 64
v$ = 72
w$ = 80
w_light_check_code$1 = 88
PMC_Subtruct_X_I PROC ; COMDAT
; 269 : {
$LN27:
mov QWORD PTR [rsp+16], rbx
mov QWORD PTR [rsp+24], rsi
push rdi
sub rsp, 48 ; 00000030H
mov edi, edx
mov rsi, r8
mov rbx, rcx
; 270 : if (__UNIT_TYPE_BIT_COUNT < sizeof(v) * 8)
; 271 : {
; 272 : // _UINT32_T が 1 ワードで表現しきれない処理系には対応しない
; 273 : return (PMC_STATUS_INTERNAL_ERROR);
; 274 : }
; 275 : if (u == NULL)
test rcx, rcx
je $LN23@PMC_Subtru
; 276 : return (PMC_STATUS_ARGUMENT_ERROR);
; 277 : if (w == NULL)
test r8, r8
je $LN23@PMC_Subtru
; 279 : NUMBER_HEADER* nu = (NUMBER_HEADER*)u;
; 280 : PMC_STATUS_CODE result;
; 281 : if ((result = CheckNumber(nu)) != PMC_STATUS_OK)
call CheckNumber
test eax, eax
jne $LN1@PMC_Subtru
; 282 : return (result);
; 283 : NUMBER_HEADER* nw;
; 284 : if (nu->IS_ZERO)
test BYTE PTR [rbx+40], 2
je SHORT $LN6@PMC_Subtru
; 285 : {
; 286 : // u が 0 である場合
; 287 :
; 288 : if (v == 0)
test edi, edi
jne SHORT $LN22@PMC_Subtru
; 342 : nw = &number_zero;
; 343 : }
; 344 : }
; 345 : *w = nw;
; 346 : }
; 347 : #ifdef _DEBUG
; 348 : if ((result = CheckNumber(*w)) != PMC_STATUS_OK)
; 349 : return (result);
; 350 : #endif
; 351 : return (PMC_STATUS_OK);
lea rax, OFFSET FLAT:number_zero
mov QWORD PTR [rsi], rax
xor eax, eax
; 352 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN6@PMC_Subtru:
; 289 : {
; 290 : // v が 0 である場合
; 291 :
; 292 : // u と v がともに 0 であるので、演算結果の 0 を呼び出し元に返す。
; 293 : *w = &number_zero;
; 294 : }
; 295 : else
; 296 : {
; 297 : // v が 0 ではない場合
; 298 :
; 299 : // 演算結果は負となってしまうのでエラーを返す。
; 300 : return (PMC_STATUS_OVERFLOW);
; 301 : }
; 302 : }
; 303 : else
; 304 : {
; 305 : // u が 0 ではない場合
; 306 :
; 307 : if (v == 0)
test edi, edi
jne SHORT $LN10@PMC_Subtru
; 308 : {
; 309 : // v が 0 である場合
; 310 :
; 311 : // 演算結果となる x の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。
; 312 : if ((result = DuplicateNumber(nu, &nw)) != PMC_STATUS_OK)
lea rdx, QWORD PTR nw$[rsp]
mov rcx, rbx
call DuplicateNumber
test eax, eax
jne $LN1@PMC_Subtru
mov rax, QWORD PTR nw$[rsp]
; 342 : nw = &number_zero;
; 343 : }
; 344 : }
; 345 : *w = nw;
; 346 : }
; 347 : #ifdef _DEBUG
; 348 : if ((result = CheckNumber(*w)) != PMC_STATUS_OK)
; 349 : return (result);
; 350 : #endif
; 351 : return (PMC_STATUS_OK);
mov QWORD PTR [rsi], rax
xor eax, eax
; 352 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN10@PMC_Subtru:
; 313 : return (result);
; 314 : }
; 315 : else
; 316 : {
; 317 : // u と v がともに 0 ではない場合
; 318 :
; 319 : // u と v の差を計算する
; 320 : __UNIT_TYPE u_bit_count = nu->UNIT_BIT_COUNT;
mov rdx, QWORD PTR [rbx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 607 : return (sizeof(x) * 8 - 1 - pos);
mov ecx, 31
bsr eax, edi
sub ecx, eax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 321 : __UNIT_TYPE v_bit_count = sizeof(v) * 8 - _LZCNT_ALT_32(v);
movsxd rax, ecx
mov ecx, 32 ; 00000020H
sub rcx, rax
; 322 : if (u_bit_count < v_bit_count)
cmp rdx, rcx
jae SHORT $LN13@PMC_Subtru
$LN22@PMC_Subtru:
; 323 : {
; 324 : // 演算結果は負となってしまうのでエラーを返す。
; 325 : return (PMC_STATUS_OVERFLOW);
mov eax, -2
; 352 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN13@PMC_Subtru:
; 326 : }
; 327 : __UNIT_TYPE w_bit_count = u_bit_count;
; 328 : __UNIT_TYPE w_light_check_code;
; 329 : if ((result = AllocateNumber(&nw, w_bit_count, &w_light_check_code)) != PMC_STATUS_OK)
lea r8, QWORD PTR w_light_check_code$1[rsp]
lea rcx, QWORD PTR nw$[rsp]
call AllocateNumber
test eax, eax
jne $LN1@PMC_Subtru
; 330 : return (result);
; 331 : if ((result = Subtruct_X_1W(nu->BLOCK, nu->UNIT_WORD_COUNT, v, nw->BLOCK, nw->BLOCK_COUNT)) != PMC_STATUS_OK)
mov r9, QWORD PTR nw$[rsp]
mov r8, rdi
mov rdx, QWORD PTR [rbx+8]
mov rcx, QWORD PTR [rbx+56]
mov rax, QWORD PTR [r9+48]
mov r9, QWORD PTR [r9+56]
mov QWORD PTR [rsp+32], rax
call Subtruct_X_1W
mov rcx, QWORD PTR nw$[rsp]
mov ebx, eax
test eax, eax
je SHORT $LN15@PMC_Subtru
; 332 : {
; 333 : DeallocateNumber(nw);
call DeallocateNumber
; 334 : return (result == PMC_STATUS_INTERNAL_BORROW ? PMC_STATUS_OVERFLOW : result);
mov eax, -2
cmp ebx, -258 ; fffffffffffffefeH
cmove ebx, eax
mov eax, ebx
; 352 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN15@PMC_Subtru:
; 335 : }
; 336 : if ((result = CheckBlockLight(nw->BLOCK, w_light_check_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR w_light_check_code$1[rsp]
mov rcx, QWORD PTR [rcx+56]
call CheckBlockLight
test eax, eax
jne SHORT $LN1@PMC_Subtru
; 337 : return (result);
; 338 : CommitNumber(nw);
mov rcx, QWORD PTR nw$[rsp]
call CommitNumber
; 339 : if (nw->IS_ZERO)
mov rax, QWORD PTR nw$[rsp]
test BYTE PTR [rax+40], 2
je SHORT $LN17@PMC_Subtru
; 340 : {
; 341 : DeallocateNumber(nw);
mov rcx, rax
call DeallocateNumber
; 342 : nw = &number_zero;
; 343 : }
; 344 : }
; 345 : *w = nw;
; 346 : }
; 347 : #ifdef _DEBUG
; 348 : if ((result = CheckNumber(*w)) != PMC_STATUS_OK)
; 349 : return (result);
; 350 : #endif
; 351 : return (PMC_STATUS_OK);
lea rax, OFFSET FLAT:number_zero
$LN17@PMC_Subtru:
mov QWORD PTR [rsi], rax
xor eax, eax
; 352 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
$LN23@PMC_Subtru:
; 278 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
$LN1@PMC_Subtru:
; 352 : }
mov rbx, QWORD PTR [rsp+72]
mov rsi, QWORD PTR [rsp+80]
add rsp, 48 ; 00000030H
pop rdi
ret 0
PMC_Subtruct_X_I ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT PMC_Subtruct_L_X
_TEXT SEGMENT
u$ = 48
v$ = 56
w$ = 64
PMC_Subtruct_L_X PROC ; COMDAT
; 355 : {
$LN58:
mov QWORD PTR [rsp+8], rbx
mov QWORD PTR [rsp+16], rsi
push rdi
sub rsp, 32 ; 00000020H
mov rdi, r8
mov rsi, rdx
mov rbx, rcx
; 356 : if (__UNIT_TYPE_BIT_COUNT * 2 < sizeof(u) * 8)
; 357 : {
; 358 : // _UINT64_T が 2 ワードで表現しきれない処理系には対応しない
; 359 : return (PMC_STATUS_INTERNAL_ERROR);
; 360 : }
; 361 : if (v == NULL)
test rdx, rdx
je $LN55@PMC_Subtru
; 362 : return (PMC_STATUS_ARGUMENT_ERROR);
; 363 : if (w == NULL)
test r8, r8
je $LN55@PMC_Subtru
; 365 : NUMBER_HEADER* nv = (NUMBER_HEADER*)v;
; 366 : PMC_STATUS_CODE result;
; 367 : if ((result = CheckNumber(nv)) != PMC_STATUS_OK)
mov rcx, rdx
call CheckNumber
test eax, eax
jne $LN1@PMC_Subtru
; 368 : return (result);
; 369 : if (u == 0)
mov eax, DWORD PTR [rsi+40]
and eax, 2
test rbx, rbx
jne SHORT $LN6@PMC_Subtru
; 370 : {
; 371 : // u が 0 である場合
; 372 :
; 373 : if (nv->IS_ZERO)
test eax, eax
je SHORT $LN54@PMC_Subtru
; 374 : {
; 375 : // v が 0 である場合
; 376 :
; 377 : // x と y がともに 0 であるので、演算結果の 0 を呼び出し元に返す。
; 378 : *w = 0;
mov QWORD PTR [rdi], rbx
; 511 : }
; 512 : else
; 513 : {
; 514 : *w = temp_w;
; 515 : }
; 516 : }
; 517 : }
; 518 : }
; 519 : }
; 520 : return (PMC_STATUS_OK);
xor eax, eax
; 521 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
$LN6@PMC_Subtru:
; 379 : }
; 380 : else
; 381 : {
; 382 : // v が 0 ではない場合
; 383 :
; 384 : // 演算結果は負となってしまうのでエラーを返す。
; 385 : return (PMC_STATUS_OVERFLOW);
; 386 : }
; 387 : }
; 388 : else
; 389 : {
; 390 : // u が 0 ではない場合
; 391 :
; 392 : if (nv->IS_ZERO)
test eax, eax
jne SHORT $LN56@PMC_Subtru
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 644 : _BitScanReverse64(&pos, x);
bsr rax, rbx
; 645 : #elif defined(__GNUC__)
; 646 : _UINT64_T pos;
; 647 : __asm__("bsrq %1, %0" : "=r"(pos) : "rm"(x));
; 648 : #else
; 649 : #error unknown compiler
; 650 : #endif
; 651 : #else
; 652 : #error unknown platform
; 653 : #endif
; 654 : return (sizeof(x) * 8 - 1 - pos);
mov ecx, 63 ; 0000003fH
sub ecx, eax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 490 : __UNIT_TYPE u_bit_count = sizeof(u) * 8 - _LZCNT_ALT_UNIT((__UNIT_TYPE)u);
movsxd rax, ecx
mov ecx, 64 ; 00000040H
sub rcx, rax
; 491 : __UNIT_TYPE v_bit_count = nv->UNIT_BIT_COUNT;
; 492 : if (u_bit_count < v_bit_count)
cmp rcx, QWORD PTR [rsi+16]
jb SHORT $LN54@PMC_Subtru
; 493 : {
; 494 : // 明らかに u < v である場合
; 495 :
; 496 : // 演算結果は負となってしまうのでエラーを返す。
; 497 : return (PMC_STATUS_OVERFLOW);
; 498 : }
; 499 : else
; 500 : {
; 501 : // u のビット長が v のビット長以上である場合
; 502 :
; 503 : // u が 64bit 整数で表現できるので v も 64bit 整数で表現できる
; 504 :
; 505 : __UNIT_TYPE temp_w;
; 506 : char borrow = _SUBTRUCT_UNIT(0, (__UNIT_TYPE)u, nv->BLOCK[0], &temp_w);
mov rax, QWORD PTR [rsi+56]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sub rbx, QWORD PTR [rax]
setb al
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 507 : if (borrow)
test al, al
jne SHORT $LN54@PMC_Subtru
$LN56@PMC_Subtru:
; 511 : }
; 512 : else
; 513 : {
; 514 : *w = temp_w;
; 515 : }
; 516 : }
; 517 : }
; 518 : }
; 519 : }
; 520 : return (PMC_STATUS_OK);
mov QWORD PTR [rdi], rbx
xor eax, eax
; 521 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
$LN54@PMC_Subtru:
; 508 : {
; 509 : // ボローが発生した場合は演算結果が負なのでエラーとする
; 510 : return (PMC_STATUS_OVERFLOW);
mov eax, -2
; 521 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
$LN55@PMC_Subtru:
; 364 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
$LN1@PMC_Subtru:
; 521 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
PMC_Subtruct_L_X ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT PMC_Subtruct_I_X
_TEXT SEGMENT
u$ = 48
v$ = 56
w$ = 64
PMC_Subtruct_I_X PROC ; COMDAT
; 189 : {
$LN25:
mov QWORD PTR [rsp+8], rbx
mov QWORD PTR [rsp+16], rsi
push rdi
sub rsp, 32 ; 00000020H
mov esi, ecx
mov rbx, r8
mov rdi, rdx
; 190 : if (__UNIT_TYPE_BIT_COUNT < sizeof(u) * 8)
; 191 : {
; 192 : // _UINT32_T が 1 ワードで表現しきれない処理系には対応しない
; 193 : return (PMC_STATUS_INTERNAL_ERROR);
; 194 : }
; 195 : if (v == NULL)
test rdx, rdx
je $LN23@PMC_Subtru
; 196 : return (PMC_STATUS_ARGUMENT_ERROR);
; 197 : if (w == NULL)
test rbx, rbx
je $LN23@PMC_Subtru
; 199 : NUMBER_HEADER* nv = (NUMBER_HEADER*)v;
; 200 : PMC_STATUS_CODE result;
; 201 : if ((result = CheckNumber(nv)) != PMC_STATUS_OK)
mov rcx, rdx
call CheckNumber
test eax, eax
jne $LN1@PMC_Subtru
; 202 : return (result);
; 203 : if (u == 0)
mov eax, DWORD PTR [rdi+40]
and eax, 2
test esi, esi
jne SHORT $LN6@PMC_Subtru
; 204 : {
; 205 : // u が 0 である場合
; 206 :
; 207 : if (nv->IS_ZERO)
test eax, eax
je SHORT $LN22@PMC_Subtru
; 208 : {
; 209 : // v が 0 である場合
; 210 :
; 211 : // u と v がともに 0 であるので、演算結果の 0 を呼び出し元に返す。
; 212 : *w = 0;
mov DWORD PTR [rbx], esi
; 261 : }
; 262 : }
; 263 : }
; 264 : }
; 265 : return (PMC_STATUS_OK);
xor eax, eax
; 266 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
$LN6@PMC_Subtru:
; 213 : }
; 214 : else
; 215 : {
; 216 : // v が 0 ではない場合
; 217 :
; 218 : // 演算結果は負となってしまうのでエラーを返す。
; 219 : return (PMC_STATUS_OVERFLOW);
; 220 : }
; 221 : }
; 222 : else
; 223 : {
; 224 : // u が 0 ではない場合
; 225 :
; 226 : if (nv->IS_ZERO)
test eax, eax
je SHORT $LN10@PMC_Subtru
; 227 : {
; 228 : // v が 0 である場合
; 229 :
; 230 : // 演算結果となる u の値を持つ NUMBER_HEADER 構造体を獲得し、呼び出し元へ返す。
; 231 : *w = u;
mov DWORD PTR [rbx], esi
; 261 : }
; 262 : }
; 263 : }
; 264 : }
; 265 : return (PMC_STATUS_OK);
xor eax, eax
; 266 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
$LN10@PMC_Subtru:
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 601 : _BitScanReverse(&pos, x);
bsr eax, esi
; 602 : #elif defined(__GNUC__)
; 603 : __asm__("bsrl %1, %0" : "=r"(pos) : "rm"(x));
; 604 : #else
; 605 : #error unknown compiler
; 606 : #endif
; 607 : return (sizeof(x) * 8 - 1 - pos);
mov ecx, 31
sub ecx, eax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 238 : __UNIT_TYPE u_bit_count = sizeof(u) * 8 - _LZCNT_ALT_32(u);
movsxd rax, ecx
mov ecx, 32 ; 00000020H
sub rcx, rax
; 239 : __UNIT_TYPE v_bit_count = nv->UNIT_BIT_COUNT;
; 240 : if (u_bit_count < v_bit_count)
cmp rcx, QWORD PTR [rdi+16]
jb SHORT $LN22@PMC_Subtru
; 241 : {
; 242 : // 明らかに u < v である場合
; 243 : // 演算結果は負となってしまうのでエラーを返す。
; 244 : return (PMC_STATUS_OVERFLOW);
; 245 : }
; 246 : else
; 247 : {
; 248 : // u のビット長が v のビット長以上である場合
; 249 :
; 250 : // u が 32bit 整数なので、v も32bit 整数で表現できる
; 251 : __UNIT_TYPE temp_w;
; 252 : char borrow = _SUBTRUCT_UNIT(0, u, nv->BLOCK[0], &temp_w);
mov rax, QWORD PTR [rdi+56]
mov rcx, rsi
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sub rcx, QWORD PTR [rax]
setb al
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 253 : if (borrow)
test al, al
jne SHORT $LN22@PMC_Subtru
; 257 : }
; 258 : else
; 259 : {
; 260 : *w = (_UINT32_T)temp_w;
mov DWORD PTR [rbx], ecx
; 261 : }
; 262 : }
; 263 : }
; 264 : }
; 265 : return (PMC_STATUS_OK);
xor eax, eax
; 266 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
$LN22@PMC_Subtru:
; 254 : {
; 255 : // ボローが発生した場合は演算結果が負なのでエラーとする
; 256 : return (PMC_STATUS_OVERFLOW);
mov eax, -2
; 266 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
$LN23@PMC_Subtru:
; 198 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
$LN1@PMC_Subtru:
; 266 : }
mov rbx, QWORD PTR [rsp+48]
mov rsi, QWORD PTR [rsp+56]
add rsp, 32 ; 00000020H
pop rdi
ret 0
PMC_Subtruct_I_X ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT Initialize_Subtruct
_TEXT SEGMENT
feature$ = 8
Initialize_Subtruct PROC ; COMDAT
; 745 : return (PMC_STATUS_OK);
xor eax, eax
; 746 : }
ret 0
Initialize_Subtruct ENDP
_TEXT ENDS
; Function compile flags: /Ogtpy
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; COMDAT Subtruct_Imp
_TEXT SEGMENT
up$ = 48
u_count$ = 56
vp$ = 64
v_count$ = 72
wp$ = 80
w_count$ = 88
Subtruct_Imp PROC ; COMDAT
; 125 : {
$LN140:
push rbx
sub rsp, 32 ; 00000020H
; 126 : char c = 0;
; 127 :
; 128 : // まず 32 ワードずつ減算をする。
; 129 : __UNIT_TYPE count = v_count >> 5;
mov rbx, r9
mov r10, rdx
mov rdx, rcx
shr rbx, 5
xor cl, cl
mov r11, r9
; 130 : while (count != 0)
mov r9, QWORD PTR wp$[rsp]
test rbx, rbx
je $LN3@Subtruct_I
npad 10
$LL2@Subtruct_I:
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 808 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 809 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 810 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]);
mov rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+16]
mov QWORD PTR [r9+16], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 811 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]);
mov rax, QWORD PTR [rdx+24]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+24]
mov QWORD PTR [r9+24], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 812 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]);
mov rax, QWORD PTR [rdx+32]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+32]
mov QWORD PTR [r9+32], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 813 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]);
mov rax, QWORD PTR [rdx+40]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+40]
mov QWORD PTR [r9+40], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 814 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]);
mov rax, QWORD PTR [rdx+48]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+48]
mov QWORD PTR [r9+48], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 815 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]);
mov rax, QWORD PTR [rdx+56]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+56]
mov QWORD PTR [r9+56], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 816 : c = _SUBTRUCT_UNIT(c, xp[8], yp[8], &zp[8]);
mov rax, QWORD PTR [rdx+64]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+64]
mov QWORD PTR [r9+64], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 817 : c = _SUBTRUCT_UNIT(c, xp[9], yp[9], &zp[9]);
mov rax, QWORD PTR [rdx+72]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+72]
mov QWORD PTR [r9+72], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 818 : c = _SUBTRUCT_UNIT(c, xp[10], yp[10], &zp[10]);
mov rax, QWORD PTR [rdx+80]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+80]
mov QWORD PTR [r9+80], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 819 : c = _SUBTRUCT_UNIT(c, xp[11], yp[11], &zp[11]);
mov rax, QWORD PTR [rdx+88]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+88]
mov QWORD PTR [r9+88], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 820 : c = _SUBTRUCT_UNIT(c, xp[12], yp[12], &zp[12]);
mov rax, QWORD PTR [rdx+96]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+96]
mov QWORD PTR [r9+96], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 821 : c = _SUBTRUCT_UNIT(c, xp[13], yp[13], &zp[13]);
mov rax, QWORD PTR [rdx+104]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+104]
mov QWORD PTR [r9+104], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 822 : c = _SUBTRUCT_UNIT(c, xp[14], yp[14], &zp[14]);
mov rax, QWORD PTR [rdx+112]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+112]
mov QWORD PTR [r9+112], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 823 : c = _SUBTRUCT_UNIT(c, xp[15], yp[15], &zp[15]);
mov rax, QWORD PTR [rdx+120]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+120]
mov QWORD PTR [r9+120], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 824 : c = _SUBTRUCT_UNIT(c, xp[16], yp[16], &zp[16]);
mov rax, QWORD PTR [rdx+128]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+128]
mov QWORD PTR [r9+128], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 825 : c = _SUBTRUCT_UNIT(c, xp[17], yp[17], &zp[17]);
mov rax, QWORD PTR [rdx+136]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+136]
mov QWORD PTR [r9+136], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 826 : c = _SUBTRUCT_UNIT(c, xp[18], yp[18], &zp[18]);
mov rax, QWORD PTR [rdx+144]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+144]
mov QWORD PTR [r9+144], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 827 : c = _SUBTRUCT_UNIT(c, xp[19], yp[19], &zp[19]);
mov rax, QWORD PTR [rdx+152]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+152]
mov QWORD PTR [r9+152], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 828 : c = _SUBTRUCT_UNIT(c, xp[20], yp[20], &zp[20]);
mov rax, QWORD PTR [rdx+160]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+160]
mov QWORD PTR [r9+160], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 829 : c = _SUBTRUCT_UNIT(c, xp[21], yp[21], &zp[21]);
mov rax, QWORD PTR [rdx+168]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+168]
mov QWORD PTR [r9+168], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 830 : c = _SUBTRUCT_UNIT(c, xp[22], yp[22], &zp[22]);
mov rax, QWORD PTR [rdx+176]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+176]
mov QWORD PTR [r9+176], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 831 : c = _SUBTRUCT_UNIT(c, xp[23], yp[23], &zp[23]);
mov rax, QWORD PTR [rdx+184]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+184]
mov QWORD PTR [r9+184], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 832 : c = _SUBTRUCT_UNIT(c, xp[24], yp[24], &zp[24]);
mov rax, QWORD PTR [rdx+192]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+192]
mov QWORD PTR [r9+192], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 833 : c = _SUBTRUCT_UNIT(c, xp[25], yp[25], &zp[25]);
mov rax, QWORD PTR [rdx+200]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+200]
mov QWORD PTR [r9+200], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 834 : c = _SUBTRUCT_UNIT(c, xp[26], yp[26], &zp[26]);
mov rax, QWORD PTR [rdx+208]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+208]
mov QWORD PTR [r9+208], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 835 : c = _SUBTRUCT_UNIT(c, xp[27], yp[27], &zp[27]);
mov rax, QWORD PTR [rdx+216]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+216]
mov QWORD PTR [r9+216], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 836 : c = _SUBTRUCT_UNIT(c, xp[28], yp[28], &zp[28]);
mov rax, QWORD PTR [rdx+224]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+224]
mov QWORD PTR [r9+224], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 837 : c = _SUBTRUCT_UNIT(c, xp[29], yp[29], &zp[29]);
mov rax, QWORD PTR [rdx+232]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+232]
mov QWORD PTR [r9+232], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 838 : c = _SUBTRUCT_UNIT(c, xp[30], yp[30], &zp[30]);
mov rax, QWORD PTR [rdx+240]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+240]
mov QWORD PTR [r9+240], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 839 : c = _SUBTRUCT_UNIT(c, xp[31], yp[31], &zp[31]);
mov rax, QWORD PTR [rdx+248]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+248]
mov QWORD PTR [r9+248], rax
setb cl
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 133 : up += 32;
add rdx, 256 ; 00000100H
; 134 : vp += 32;
add r8, 256 ; 00000100H
; 135 : wp += 32;
add r9, 256 ; 00000100H
; 136 : --count;
sub rbx, 1
jne $LL2@Subtruct_I
$LN3@Subtruct_I:
; 137 : }
; 138 : // この時点で未処理の桁は 32 ワード未満のはず
; 139 :
; 140 : // 未処理の桁が 16 ワード以上あるなら 16 ワード減算を行う。
; 141 : if (v_count & 0x10)
test r11b, 16
je SHORT $LN4@Subtruct_I
; 142 : {
; 143 : c = _SUBTRUCT_16WORDS_SBB(c, up, vp, wp);
call _SUBTRUCT_16WORDS_SBB
; 144 : up += 16;
sub rdx, -128 ; ffffffffffffff80H
; 145 : vp += 16;
sub r8, -128 ; ffffffffffffff80H
; 146 : wp += 16;
sub r9, -128 ; ffffffffffffff80H
movzx ecx, al
$LN4@Subtruct_I:
; 147 : }
; 148 : // この時点で未処理の桁は 16 ワード未満のはず
; 149 :
; 150 : // 未処理の桁が 8 ワード以上あるなら 8 ワード減算を行う。
; 151 : if (v_count & 0x8)
test r11b, 8
je SHORT $LN5@Subtruct_I
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3456 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3457 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3458 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]);
mov rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+16]
mov QWORD PTR [r9+16], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3459 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]);
mov rax, QWORD PTR [rdx+24]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+24]
mov QWORD PTR [r9+24], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3460 : c = _SUBTRUCT_UNIT(c, xp[4], yp[4], &zp[4]);
mov rax, QWORD PTR [rdx+32]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+32]
mov QWORD PTR [r9+32], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3461 : c = _SUBTRUCT_UNIT(c, xp[5], yp[5], &zp[5]);
mov rax, QWORD PTR [rdx+40]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+40]
mov QWORD PTR [r9+40], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3462 : c = _SUBTRUCT_UNIT(c, xp[6], yp[6], &zp[6]);
mov rax, QWORD PTR [rdx+48]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+48]
mov QWORD PTR [r9+48], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 3463 : c = _SUBTRUCT_UNIT(c, xp[7], yp[7], &zp[7]);
mov rax, QWORD PTR [rdx+56]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+56]
mov QWORD PTR [r9+56], rax
setb cl
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 154 : up += 8;
add rdx, 64 ; 00000040H
; 155 : vp += 8;
add r8, 64 ; 00000040H
; 156 : wp += 8;
add r9, 64 ; 00000040H
$LN5@Subtruct_I:
; 157 : }
; 158 : // この時点で未処理の桁は 8 ワード未満のはず
; 159 :
; 160 : // 未処理の桁が 4 ワード以上あるなら 4 ワード減算を行う。
; 161 : if (v_count & 0x4)
test r11b, 4
je SHORT $LN6@Subtruct_I
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4052 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4053 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4054 : c = _SUBTRUCT_UNIT(c, xp[2], yp[2], &zp[2]);
mov rax, QWORD PTR [rdx+16]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+16]
mov QWORD PTR [r9+16], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4055 : c = _SUBTRUCT_UNIT(c, xp[3], yp[3], &zp[3]);
mov rax, QWORD PTR [rdx+24]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+24]
mov QWORD PTR [r9+24], rax
setb cl
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 164 : up += 4;
add rdx, 32 ; 00000020H
; 165 : vp += 4;
add r8, 32 ; 00000020H
; 166 : wp += 4;
add r9, 32 ; 00000020H
$LN6@Subtruct_I:
; 167 : }
; 168 : // この時点で未処理の桁は 4 ワード未満のはず
; 169 :
; 170 : // 未処理の桁が 2 ワード以上あるなら 2 ワード減算を行う。
; 171 : if (v_count & 0x2)
test r11b, 2
je SHORT $LN7@Subtruct_I
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4466 : c = _SUBTRUCT_UNIT(c, xp[0], yp[0], &zp[0]);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\autogenerated_inline_func.h
; 4467 : c = _SUBTRUCT_UNIT(c, xp[1], yp[1], &zp[1]);
mov rax, QWORD PTR [rdx+8]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
sbb rax, QWORD PTR [r8+8]
mov QWORD PTR [r9+8], rax
setb cl
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 174 : up += 2;
add rdx, 16
; 175 : vp += 2;
add r8, 16
; 176 : wp += 2;
add r9, 16
$LN7@Subtruct_I:
; 177 : }
; 178 : // この時点で未処理の桁は 2 ワード未満のはず
; 179 :
; 180 : // 未処理の桁が 1 ワード以上あるなら 1 ワード減算を行う。
; 181 : if (v_count & 1)
test r11b, 1
je SHORT $LN8@Subtruct_I
; 182 : c = _SUBTRUCT_UNIT(c, *up++, *vp++, wp++);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, QWORD PTR [r8]
mov QWORD PTR [r9], rax
setb cl
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 182 : c = _SUBTRUCT_UNIT(c, *up++, *vp++, wp++);
add rdx, 8
add r9, 8
$LN8@Subtruct_I:
; 183 :
; 184 : // 残りの桁の繰り上がりを計算し、復帰する。
; 185 : return (DoBorrow(c, up, u_count - v_count, wp, w_count - v_count));
sub r10, r11
; 44 : if (u_count <= 0)
je SHORT $LN129@Subtruct_I
$LL113@Subtruct_I:
; 49 : {
; 50 : // かつそれでも桁借りを行う必要がある場合
; 51 :
; 52 : // 減算結果が負になってしまったので呼び出し元に通知する。
; 53 : return (PMC_STATUS_INTERNAL_BORROW);
; 54 : }
; 55 :
; 56 : // xの最上位に達してしまった場合はいずれにしろループを中断して正常復帰する。
; 57 :
; 58 : return (PMC_STATUS_OK);
; 59 : }
; 60 : else if (c)
test cl, cl
je SHORT $LN128@Subtruct_I
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
mov rax, QWORD PTR [rdx]
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; 273 : return (_subborrow_u64(borrow, u, v, w));
add cl, -1
sbb rax, 0
mov QWORD PTR [r9], rax
setb cl
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_subtruct.c
; 65 : c = _SUBTRUCT_UNIT(c, *up++, 0, wp++);
add rdx, 8
add r9, 8
; 66 : --u_count;
sub r10, 1
jne SHORT $LL113@Subtruct_I
$LN129@Subtruct_I:
; 45 : {
; 46 : // x の最上位まで達してしまった場合
; 47 :
; 48 : if (c)
neg cl
sbb eax, eax
and eax, -258 ; fffffffffffffefeH
; 186 : }
add rsp, 32 ; 00000020H
pop rbx
ret 0
$LN128@Subtruct_I:
; 74 : while (u_count > 0)
test r10, r10
je SHORT $LN117@Subtruct_I
sub rdx, r9
npad 2
$LL116@Subtruct_I:
; 75 : {
; 76 : *wp++ = *up++;
mov rax, QWORD PTR [rdx+r9]
mov QWORD PTR [r9], rax
lea r9, QWORD PTR [r9+8]
; 77 : --u_count;
sub r10, 1
jne SHORT $LL116@Subtruct_I
$LN117@Subtruct_I:
; 183 :
; 184 : // 残りの桁の繰り上がりを計算し、復帰する。
; 185 : return (DoBorrow(c, up, u_count - v_count, wp, w_count - v_count));
xor eax, eax
; 186 : }
add rsp, 32 ; 00000020H
pop rbx
ret 0
Subtruct_Imp ENDP
_TEXT ENDS
END
|
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_gover.asm | prismotizm/gigaleak | 0 | 99664 | Name: zel_gover.asm
Type: file
Size: 21958
Last-Modified: '2016-05-13T04:27:09Z'
SHA-1: 54325BE87A1EDA406659991A8C416AA8E1535A5E
Description: null
|
Lab4/lab4_3.asm | chintamanand/Embedded-Systems-Project | 0 | 89311 | AREA RESET, DATA, READONLY
EXPORT __Vectors
__Vectors
DCD 0x10001000
DCD Reset_Handler
ALIGN
AREA mycode, CODE, READONLY
ENTRY
EXPORT Reset_Handler
Reset_Handler
LDR R0,=NUM1
LDR R1,[R0]
MOV R4,#0XA
LDR R5,=RESULT
AND R3,R1,#0X0F
AND R2,R1,#0XF0
LSR R2,#4
MUL R2,R4
ADD R2,R3
STR R2,[R5]
STOP B STOP
NUM1 DCD 0X99
AREA data,DATA,READWRITE
RESULT DCD 0
END |
base/mvdm/dos/v86/doskrnl/dos/mscode.asm | npocmaka/Windows-Server-2003 | 17 | 102193 | TITLE MISC DOS ROUTINES - Int 25 and 26 handlers and other
NAME IBMCODE
;** MSCODE.ASM - System Call Dispatch Code
;
; Revision History
; ================
; Sudeepb 14-Mar-1991 Ported for NT DOSEm
.xlist
.xcref
include version.inc
include mssw.asm
.cref
.list
;** MSCODE.ASM -- MSDOS code
;
.xlist
.xcref
include version.inc
include dossym.inc
include devsym.inc
include dosseg.inc
include fastopen.inc
include fastxxxx.inc
include mult.inc
include vector.inc
include curdir.inc
include mi.inc
include win386.inc ;Win386 constants
include syscall.inc ;M018
include dossvc.inc ;M018
include bop.inc
ifdef NEC_98
include dpb.inc
endif
.cref
.list
AsmVars <Debug>
I_need InDos,BYTE ; TRUE => we are in dos, no interrupt
I_need OpenBuf,128 ; temp name buffer
I_need ExtErr,WORD ; extended error code
I_need AbsRdWr_SS,WORD ; stack segment from user M013
I_need AbsRdWr_SP,WORD ; stack pointer from user M013
I_need DskStack,BYTE ; stack segment inside DOS
I_need ThisCDS,DWORD ; Currently referenced CDS pointer
I_need ThisDPB,DWORD ; Currently referenced DPB pointer
I_need Err_Table_21 ; allowed return map table for errors
I_need FailErr,BYTE ; TRUE => system call is being failed
I_need ExtErr_Action,BYTE ; recommended action
I_need ExtErr_Class,BYTE ; error classification
I_need ExtErr_Locus,BYTE ; error location
I_need User_In_AX,WORD ; initial input user AX
I_need HIGH_SECTOR,WORD ; >32mb
I_need AbsDskErr,WORD ; >32mb
I_need FastOpenFlg,BYTE ;
I_need CURSC_DRIVE,BYTE ;
I_need TEMPSEG,WORD ; hkn; used to store ds temporarily
;
;These needed for code to flush buffers when doing absolute writes(int 26h)
;added by SR - 3/25/89
;
I_need FIRST_BUFF_ADDR,WORD ;DOS 4.0
I_need SC_CACHE_COUNT,WORD ;DOS 4.0
I_need SC_DRIVE,BYTE ;DOS 4.0
;
; SR;
; Needed for WIN386 support
;
I_need IsWin386,byte ; flag indicating Win386 presence
I_need Win386_Info,byte ; DOS instance table for Win386
;
; M001; New table for WIN386 giving offsets of some DOS vars
;
I_need Win386_DOSVars ; Table of DOS offsets ; M001
I_need Redir_Patch ; Crit section flag ; M002
;
; Win386 2.xx instance table
;
I_need OldInstanceJunk
I_need BootDrive,byte ; M018
I_need VxDpath, byte ; M018
I_need TEMP_VAR,WORD ; M039
I_need TEMP_VAR2,WORD ; M039
I_need CurrentPDB,WORD ; M044
I_need WinoldPatch1,BYTE ; M044
I_need WinoldPatch2,BYTE ; M044
I_need UmbSave1,BYTE ; M062
I_need UmbSave2,BYTE ; M062
I_need UmbSaveFlag,BYTE ; M062
I_need umb_head,WORD
I_need Dos_Flag,BYTE ; M066
ifndef NEC_98
;
; Include bios data segment declaration. Used for accessing DOS data segment
; at 70:3 & bios int 2F entry point at 70:5
;
BData segment at 70H ; M023
else ;NEC_98
;
; Include bios data segment declaration. Used for accessing DOS data segment
; at 60:23 & bios int 2F entry point at 60:25
;
BData segment at 60H
endif ;NEC_98
extrn bios_i2f:far ; M023
BData ends ; M023
DOSCODE SEGMENT
ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
extrn FOO:WORD ; return address for dos 2f dispatch
extrn DTAB:WORD ; dos 2f dispatch table
extrn I21_Map_E_Tab:BYTE ; mapping extended error table
extrn NoVxDErrMsg:BYTE ; no VxD error message ;M018
extrn VXDMESLEN:ABS ; length of above message ;M018
IFDEF JAPAN
extrn NoVxDErrMsg2:BYTE ; no VxD error message ;M018
extrn VXDMESLEN2:ABS ; length of above message ;M018
ENDIF
extrn DosDseg:word
BREAK <NullDev -- Driver for null device>
BREAK <AbsDRD, AbsDWRT -- INT int_disk_read, int_disk_write handlers>
Public MSC001S,MSC001E
MSC001S label byte
IF IBM
; Codes returned by BIOS
ERRIN:
DB 2 ; NO RESPONSE
DB 6 ; SEEK FAILURE
DB 12 ; GENERAL ERROR
DB 4 ; BAD CRC
DB 8 ; SECTOR NOT FOUND
DB 0 ; WRITE ATTEMPT ON WRITE-PROTECT DISK
ERROUT:
; DISK ERRORS RETURNED FROM INT 25 and 26
DB 80H ; NO RESPONSE
DB 40H ; Seek failure
DB 2 ; Address Mark not found
DB 10H ; BAD CRC
DB 4 ; SECTOR NOT FOUND
DB 3 ; WRITE ATTEMPT TO WRITE-PROTECT DISK
NUMERR EQU $-ERROUT
ENDIF
MSC001E label byte
;---330------------------------------------------------------------------------
;
; Procedure Name : ABSDRD
;
; Interrupt 25 handler. Performs absolute disk read.
; Inputs: AL - 0-based drive number
; DS:BX point to destination buffer
; CX number of logical sectors to read
; DX starting logical sector number (0-based)
; Outputs: Original flags still on stack
; Carry set
; AH error from BIOS
; AL same as low byte of DI from INT 24
;
;---------------------------------------------------------------------------
procedure ABSDRD,FAR
ASSUME CS:DOSCODE,SS:NOTHING
invoke DOCLI
; set up ds to point to DOSDATA
push ax ; preserve AX value
mov ax, ds ; store DS value in AX
getdseg <ds>
mov [TEMPSEG], ax ; store DS value in TEMPSEG
pop ax ; restore AX value
;
; M072:
; We shall save es on the user stack here. We need to use ES in
; order to access the DOSDATA variables AbsRdWr_SS/SP at exit
; time in order to restore the user stack.
;
push es ; M072
MOV [AbsRdWr_SS],SS ; M013
MOV [AbsRdWr_SP],SP ; M013
PUSH CS
POP SS
;
; set up ss to point to DOSDATA
;
; NOTE! Due to an obscure bug in the 80286, you cannot use the ROMDOS
; version of the getdseg macro with the SS register! An interrupt will
; sneak through.
ifndef ROMDOS
getdseg <ss> ; cli in entry of routine
else
mov ds, cs:[BioDataSeg]
assume ds:bdata
mov ss, ds:[DosDataSg]
assume ss:DOSDATA
endif ; ROMDOS
MOV SP,OFFSET DOSDATA:DSKSTACK
; SS override
mov ds, [TEMPSEG] ; restore DS value
assume ds:nothing
; use macro
Save_World ;>32mb save all regs
PUSH ES
;;; CALL AbsSetup
;;; JC ILEAVE
;M022 conditional removed here
INC INDOS ;for decrement error InDos flag bug 89559 whistler
;
; Here is a gross temporary fix to get around a serious design flaw in
; the secondary cache. The secondary cache does not check for media
; changed (it should). Hence, you can change disks, do an absolute
; read, and get data from the previous disk. To get around this,
; we just won't use the secondary cache for absolute disk reads.
; -mw 8/5/88
;; EnterCrit critDisk
;; MOV [CURSC_DRIVE],-1 ; invalidate SC ;AN000;
;; LeaveCrit critDisk
;;;;;; invoke DSKREAD
SVC SVC_DEMABSDRD
;M039
;; jnz ERR_LEAVE ;Jump if read unsuccessful.
jc ERR_LEAVE
;; mov cx,di
mov WORD PTR [TEMP_VAR2],ds
mov WORD PTR [TEMP_VAR],bx
; CX = # of contiguous sectors read. (These constitute a block of
; sectors, also termed an "Extent".)
; [HIGH_SECTOR]:DX = physical sector # of first sector in extent.
; [TEMP_VAR2]:[TEMP_VAR] = Transfer address (destination data address).
; ES:BP -> Drive Parameter Block (DPB).
;
; The Buffer Queue must now be scanned: the contents of any dirty
; buffers must be "read" into the transfer memory block, so that the
; transfer memory reflects the most recent data.
;;;;
;;;; invoke DskRdBufScan ;This trashes DS, but don't care.
jmp short ILEAVE
;M039
TLEAVE:
; JZ ILEAVE
jnc ILEAVE
ERR_LEAVE: ;M039
IF IBM
PUSH ES
PUSH CS
POP ES
XOR AH,AH ; Nul error code
MOV CX,NUMERR ; Number of possible error conditions
; ERRIN is defined in DOSCODE
MOV DI,OFFSET DOSCODE:ERRIN ; Point to error conditions
REPNE SCASB
JNZ LEAVECODE ; Not found
MOV AH,ES:[DI+NUMERR-1] ; Get translation
LEAVECODE:
POP ES
ENDIF
; SS override
MOV AbsDskErr,AX ;>32mb save error
STC
ILEAVE:
POP ES
;use macro
Restore_World
invoke DOCLI
MOV AX,AbsDskErr ;>32mb restore error;AN000;
; SS override for INDOS, AbsRdWr_sp & AbsRdWr_ss ; M013
DEC INDOS
push ss ; M072 - Start
pop es ; es - dosdata
mov ss, es:[AbsRdWr_ss] ; M013
mov sp, es:[AbsRdWr_sp] ; M013
;; mov sp, [AbsRdWr_sp] ; M013
;; mov ss, [AbsRdWr_ss] ; M013
assume ss:nothing
pop es ; Note es was saved on user
; stack at entry
; M072 - End
invoke DOSTI
RET ; This must not be a RETURN
EndProc ABSDRD
;--------------------------------------------------------------------------
;
; Procedure Name : ABSDWRT
;
; Interrupt 26 handler. Performs absolute disk write.
; Inputs: AL - 0-based drive number
; DS:BX point to source buffer
; CX number of logical sectors to write
; DX starting logical sector number (0-based)
; Outputs: Original flags still on stack
; Carry set
; AH error from BIOS
; AL same as low byte of DI from INT 24
;
; 10-Aug-1992 Jonle , ALWAYS returns ERROR_I24_BAD_UNIT as we
; don't support direct disk access
;
;---------------------------------------------------------------------------
procedure ABSDWRT,FAR
ASSUME SS:NOTHING
invoke DOCLI
; set up ds to point to DOSDATA
push ax
mov ax, ds
getdseg <ds>
mov [TEMPSEG], ax
pop ax
; M072:
; We shall save es on the user stack here. We need to use ES in
; order to access the DOSDATA variables AbsRdWr_SS/SP at exit
; time in order to restore the user stack.
;
push es ; M072
MOV [AbsRdWr_SS],SS ; M013
MOV [AbsRdWr_SP],SP ; M013
PUSH CS
POP SS
;
; set up ss to point to DOSDATA
;
; NOTE! Due to an obscure bug in the 80286, you cannot use the
; ROMDOS version of the getdseg macro with the SS register!
; An interrupt will sneak through.
;
ifndef ROMDOS
getdseg <ss> ; cli in entry of routine
else
mov ds, cs:[BioDa165taSeg]
assume ds:bdata
mov ss, ds:[DosDataSg]
ASSUME SS:DOSDATA
endif ; ROMDOS
MOV SP,OFFSET DOSDATA:DSKSTACK
; we are now switched to DOS's disk stack
mov ds, [TEMPSEG] ; restore user's ds
assume ds:nothing
; use macro
Save_World ;>32mb save all regs ;AN000;
PUSH ES
;;; CALL AbsSetup
;;; JC ILEAVE
INC INDOS
;;; EnterCrit critDisk
; SS override
;;; MOV [CURSC_DRIVE],-1 ; invalidate SC ;AN000;
;;; CALL Fastxxx_Purge ; purge fatopen ;AN000;
;;; LeaveCrit critDisk
;M039
; DS:BX = transfer address (source data address).
; CX = # of contiguous sectors to write. (These constitute a block of
; sectors, also termed an "Extent".)
; [HIGH_SECTOR]:DX = physical sector # of first sector in extent.
; ES:BP -> Drive Parameter Block (DPB).
; [CURSC_DRIVE] = -1 (invalid drive).
;
; Free any buffered sectors which are in Extent; they are being over-
; written. Note that all the above registers are preserved for
; DSKWRITE.
;;;;; push ds
;;;;; invoke DskWrtBufPurge ;This trashes DS.
;;;;; pop ds
;M039
;;;;; invoke DSKWRITE
SVC SVC_DEMABSDWRT
JMP TLEAVE
EndProc ABSDWRT
;----------------------------------------------------------------------------
;
; Procedure Name : GETBP
;
; Inputs:
; AL = Logical unit number (A = 0)
; Function:
; Find Drive Parameter Block
; Outputs:
; ES:BP points to DPB
; [THISDPB] = ES:BP
; Carry set if unit number bad or unit is a NET device.
; Later case sets extended error error_I24_not_supported
; No other registers altered
;
;----------------------------------------------------------------------------
if 0
Procedure GETBP,NEAR
DOSAssume <DS>,"GetBP"
PUSH AX
ADD AL,1 ; No increment; need carry flag
JC SkipGet
invoke GetThisDrv
JNC SkipGet ;PM. good drive ;AN000;
XOR AH,AH ;DCR. ax= error code ;AN000;
CMP AX,error_not_dos_disk ;DCR. is unknown media ? ;AN000;
JZ SkipGet ;DCR. yes, let it go ;AN000;
STC ;DCR. ;AN000;
MOV ExtErr,AX ;PM. invalid drive or Non DOS drive ;AN000;
mov AbsDskErr, 201h
SkipGet:
POP AX
retc
LES BP,[THISCDS]
TEST ES:[BP.curdir_flags],curdir_isnet ; Clears carry
JZ GETBP_CDS
MOV ExtErr,error_not_supported
STC
return
GETBP_CDS:
LES BP,ES:[BP.curdir_devptr]
entry GOTDPB
DOSAssume <DS>,"GotDPB"
; Load THISDPB from ES:BP
MOV WORD PTR [THISDPB],BP
MOV WORD PTR [THISDPB+2],ES
return
EndProc GetBP
endif
BREAK <SYS_RET_OK SYS_RET_ERR CAL_LK ETAB_LK set system call returns>
ASSUME SS:DOSDATA
;----------------------------------------------------------------------------
;
; Procedure Name : SYS_RETURN
;
; These are the general system call exit mechanisms. All internal system
; calls will transfer (jump) to one of these at the end. Their sole purpose
; is to set the user's flags and set his AX register for return.
;
;---------------------------------------------------------------------------
procedure SYS_RETURN,NEAR
entry SYS_RET_OK
invoke get_user_stack
AND [SI.user_F],NOT f_Carry ; turn off user's carry flag
JMP SHORT DO_RET ; carry is now clear
entry SYS_RET_ERR
XOR AH,AH ; hack to allow for smaller error rets
invoke ETAB_LK ; Make sure code is OK, EXTERR gets set
CALL ErrorMap
entry From_GetSet
invoke get_user_stack
OR [SI.user_F],f_Carry ; signal carry to user
STC ; also, signal internal error
DO_RET:
MOV [SI.user_AX],AX ; Really only sets AH
return
entry FCB_RET_OK
entry NO_OP ; obsolete system calls dispatch to here
XOR AL,AL
return
entry FCB_RET_ERR
XOR AH,AH
mov exterr,AX
CALL ErrorMap
MOV AL,-1
return
entry errorMap
PUSH SI
; ERR_TABLE_21 is now in DOSDATA
MOV SI,OFFSET DOSDATA:ERR_TABLE_21
; SS override for FAILERR and EXTERR
CMP [FAILERR],0 ; Check for SPECIAL case.
JZ EXTENDED_NORMAL ; All is OK.
MOV [EXTERR],error_FAIL_I24 ; Ooops, this is the REAL reason
EXTENDED_NORMAL:
invoke CAL_LK ; Set CLASS,ACTION,LOCUS for EXTERR
POP SI
return
EndProc SYS_RETURN
;---------------------------------------------------------------------------
;
; Procedure Name : CAL_LK
;
; Inputs:
; SI is OFFSET in DOSDATA of CLASS,ACTION,LOCUS Table to use
; (DS NEED not be DOSDATA)
; [EXTERR] is set with error
; Function:
; Look up and set CLASS ACTION and LOCUS values for GetExtendedError
; Outputs:
; [EXTERR_CLASS] set
; [EXTERR_ACTION] set
; [EXTERR_LOCUS] set (EXCEPT on certain errors as determined by table)
; Destroys SI, FLAGS
;
;--------------------------------------------------------------------------
procedure CAL_LK,NEAR
PUSH DS
PUSH AX
PUSH BX
;M048 Context DS ; DS:SI -> Table
;
; Since this function can be called thru int 2f we shall not assume that SS
; is DOSDATA
getdseg <ds> ; M048: DS:SI -> Table
MOV BX,[EXTERR] ; Get error in BL
TABLK1:
LODSB
CMP AL,0FFH
JZ GOT_VALS ; End of table
CMP AL,BL
JZ GOT_VALS ; Got entry
ADD SI,3 ; Next table entry
JMP TABLK1
GOT_VALS:
LODSW ; AL is CLASS, AH is ACTION
CMP AH,0FFH
JZ NO_SET_ACT
MOV [EXTERR_ACTION],AH ; Set ACTION
NO_SET_ACT:
CMP AL,0FFH
JZ NO_SET_CLS
MOV [EXTERR_CLASS],AL ; Set CLASS
NO_SET_CLS:
LODSB ; Get LOCUS
CMP AL,0FFH
JZ NO_SET_LOC
MOV [EXTERR_LOCUS],AL
NO_SET_LOC:
POP BX
POP AX
POP DS
return
EndProc CAL_LK
;----------------------------------------------------------------------------
;
; Procedure Name : ETAB_LK
;
; Inputs:
; AX is error code
; [USER_IN_AX] has AH value of system call involved
; Function:
; Make sure error code is appropriate to this call.
; Outputs:
; AX MAY be mapped error code
; [EXTERR] = Input AX
; Destroys ONLY AX and FLAGS
;
;---------------------------------------------------------------------------
procedure ETAB_LK,NEAR
PUSH DS
PUSH SI
PUSH CX
PUSH BX
Context DS ; SS is DOSDATA
MOV [EXTERR],AX ; Set EXTERR with "real" error
; I21_MAP_E_TAB is now in DOSCODE
MOV SI,OFFSET DOSCODE:I21_MAP_E_TAB
MOV BH,AL ; Real code to BH
MOV BL,BYTE PTR [USER_IN_AX + 1] ; Sys call to BL
TABLK2:
;hkn; LODSW
LODS word ptr cs:[si]
CMP AL,0FFH ; End of table?
JZ NOT_IN_TABLE ; Yes
CMP AL,BL ; Found call?
JZ GOT_CALL ; Yes
XCHG AH,AL ; Count to AL
XOR AH,AH ; Make word for add
ADD SI,AX ; Next table entry
JMP TABLK2
NOT_IN_TABLE:
MOV AL,BH ; Restore original code
JMP SHORT NO_MAP
GOT_CALL:
MOV CL,AH
XOR CH,CH ; Count of valid err codes to CX
CHECK_CODE:
;hkn; LODSB
LODS byte ptr cs:[si]
CMP AL,BH ; Code OK?
JZ NO_MAP ; Yes
LOOP CHECK_CODE
NO_MAP:
XOR AH,AH ; AX is now valid code
POP BX
POP CX
POP SI
POP DS
return
EndProc ETAB_LK
BREAK <DOS 2F Handler and default NET 2F handler>
IF installed
;----------------------------------------------------------------------------
;
; Procedure Name : SetBad
;
; SetBad sets up info for bad functions
;
;--------------------------------------------------------------------------
Procedure SetBad,NEAR
ASSUME CS:DOSCODE,SS:NOTHING
MOV AX,error_invalid_function ; ALL NET REQUESTS get inv func
; set up ds to point to DOSDATA
push ds
getdseg <ds>
MOV ExtErr_LOCUS,errLoc_UNK
pop ds ;hkn; restore ds
assume ds:nothing
STC
ret
EndProc SetBad
;--------------------------------------------------------------------------
;
; Procedure Name : BadCall
;
; BadCall is the initial routine for bad function calls
;
;--------------------------------------------------------------------------
procedure BadCall,FAR
call SetBad
ret
EndProc BadCall
;--------------------------------------------------------------------------
;
; OKCall always sets carry to off.
;
;-----------------------------------------------------------------------
Procedure OKCall,FAR
ASSUME CS:DOSCODE,SS:NOTHING
CLC
ret
EndProc OKCall
;---------------------------------------------------------------------------
;
; Procedure Name : INT2F
;
; INT 2F handler works as follows:
; PUSH AX
; MOV AX,multiplex:function
; INT 2F
; POP ...
; The handler itself needs to make the AX available for the various routines.
;
;----------------------------------------------------------------------------
PUBLIC Int2F
INT2F PROC FAR
INT2FNT:
ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
invoke DOSTI
CMP AH,multNET
JNZ INT2FSHR
TestInstall:
OR AL,AL
JZ Leave2F
BadFunc:
CALL SetBad
entry Leave2F
RET 2 ; long return + clear flags off stack
INT2FSHR:
; Sudeepb 07-Aug-1992; As we dont have a true share.exe we
; are putting its int2f support here.
CMP AH,multSHARE ; is this a share request
JNZ INT2FNLS ; no, check next
or al,al
jnz BadFunc
mov al,0ffh ; Indicate share is loaded
jmp short Leave2f
INT2FNLS:
CMP AH,NLSFUNC ; is this a DOS 3.3 NLSFUNC request
JZ TestInstall ; yes check for installation
INT2FDOS:
ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
CMP AH,multDOS
JNZ check_win ;check if win386 broadcast
jmp DispatchDOS
check_win:
cmp ah,multWIN386 ; Is this a broadcast from Win386?
je Win386_Msg
;
; M044
; Check if the callout is from Winoldap indicating swapping out or in
; of Windows. If so, do special action of going and saving last para
; of the Windows memory arena which Winoldap does not save due to a
; bug
;
cmp ah,WINOLDAP ; from Winoldap?
jne next_i2f ; no, chain on
jmp Winold_swap ; yes, do desired action
next_i2f:
jmp bios_i2f
; IRET ; This assume that we are at the head
; of the list
INT2F ENDP
;
; We have received a message from Win386. There are three possible
; messages we could get from Win386:
;
; Init - for this, we set the IsWin386 flag and return a pointer
; to the Win386 startup info structure.
; Exit - for this, we clear the IsWin386 flag.
; DOSMGR query - for this, we need to indicate that instance data
; has already been handled. this is indicated by setting
; CX to a non-zero value.
;
Win386_Msg:
push ds
getdseg <DS> ; ds is DOSDATA
;
; For WIN386 2.xx instance data
;
cmp al,03 ;win386 2.xx instance data call?
lje OldWin386Init ;yes, return instance data
cmp al, Win386_Exit ; is it an exit call?
lje Win386_Leaving
cmp al, Win386_Devcall ; is it call from DOSMGR?
lje Win386_Query
cmp al, Win386_Init ; is it an init call?
ljne win_nexti2f ; no, return
Win386_Starting:
test dx, 1 ; is this really win386?
jz @f ; YES! go and handle it
jmp win_nexti2f ; NO! It's win 286 dos extender! M002
@@:
;
; M018 -- start of block changes
; The VxD needs to be loaded only for Win 3.0. If version is greater
; than 030ah, we skip the VxD presence check
;
;M067 -- Begin changes
; If Win 3.0 is run, the VxD ptr has been initialized. If Win 3.1 is now
;run, it tries to unnecesarily load the VxD even though it is not needed.
;So, we null out the VxD ptr before the check.
;
mov word ptr Win386_Info.SIS_Virt_Dev_File_Ptr, 0
mov word ptr Win386_Info.SIS_Virt_Dev_File_Ptr+2, 0
;
;M067 -- End changes
;
ifdef JAPAN
cmp di,0300h ; version >= 300 i.e 3.10 ;M037
else
cmp di,030ah ; version >= 30a i.e 3.10 ;M037
endif
ljae noVxD31 ; yes, VxD not needed ;M037
push ax
push bx
push cx
push dx
push si
push di ; save regs !!dont change order!!
mov bx, [umb_head] ; M062 - Start
cmp bx, 0ffffh ; Q: have umbs been initialized
je Vxd31 ; N: continue
; Y: save arena associated with
; umb_head
mov [UmbSaveFlag], 1 ; indicate that we're saving
; umb_arena
push ds
push es
mov ax, ds
mov es, ax ; es - > dosdata
mov ds, bx
xor si, si ; ds:si -> umb_head
cld
mov di, offset dosdata:UmbSave1
mov cx, 0bh
rep movsb
mov di, offset dosdata:UmbSave2
mov cx, 05h
rep movsb
pop es
pop ds ; M062 - End
Vxd31:
test Dos_Flag, SUPPRESS_WINA20 ; M066
jz Dont_Supress ; M066
pop di ; M066
pop si ; M066
pop dx ; M066
pop cx ; M066
pop bx ; M066
pop ax ; M066
jmp short NoVxd31 ; M066
;
; We check here if the VxD is available in the root of the boot drive.
; We do an extended open to suppress any error messages
;
Dont_Supress:
mov al,BootDrive
add al,'A' - 1 ; get drive letter
mov byte ptr VxDpath,al ; path is root of bootdrive
mov ah,EXTOPEN ; extended open
mov al,0 ; no extended attributes
mov bx,2080h ; read access, compatibility mode
; no inherit, suppress crit err
mov cx,7 ; hidden,system,read-only attr
mov dx,1 ; fail if file does not exist
mov si,offset DOSDATA:VxDpath
; path of VxD file
mov di,0ffffh ; no extended attributes
int 21h ; do extended open
pop di
pop si
pop dx
pop cx
jnc VxDthere ; we found the VxD, go ahead
;
; We could not find the VxD. Cannot let windows load. Return cx != 0
; to indicate error to Windows after displaying message to user that
; VxD needs to be present to run Windows in enhanced mode.
;
push dx
push ds
push si
mov si,offset DOSCODE:NoVxDErrMsg
push cs
pop ds
mov cx,VXDMESLEN ;
ifdef JAPAN
push ax
push bx
mov ax,4f01h ; get code page
xor bx,bx
int 2fh
cmp bx,932
pop bx
pop ax
jz @f ; if DBCS code page
mov si,offset DOSCODE:NoVxDErrMsg2
mov cx,VXDMESLEN2
@@:
endif
mov ah,02 ; write char to console
cld
vxdlp:
lodsb
xchg dl,al ; get char in dl
int 21h
loop vxdlp
pop si
pop ds
pop dx
pop bx
pop ax ;all registers restored
inc cx ;cx != 0 to indicate error
jmp win_nexti2f ;chain on
VxDthere:
mov bx,ax
mov ah,CLOSE
int 21h ;close the file
;
; Update the VxD ptr in the instance data structure with path to VxD
;
mov bx,offset DOSDATA:Win386_Info
mov word ptr [bx].SIS_Virt_Dev_File_Ptr, offset DOSDATA:VxDpath
mov word ptr [bx].SIS_Virt_Dev_File_Ptr+2, ds ;
pop bx
pop ax
NoVxD31:
;
; M018; End of block changes
;
or ds:IsWIN386,1 ; Indicate WIN386 present
or ds:redir_patch,1 ; Enable critical sections; M002
; M002;
; Save the previous es:bx (instance data ptr) into our instance table
;
push dx ; M002
mov dx,bx ; M002
; point ES:BX to Win386_Info ; M002
mov bx, offset dosdata:Win386_Info
mov word ptr [bx+2],dx ; M002
mov word ptr [bx+4],es ; M002
pop dx ; M002
push ds ; M002
pop es ; M002
jmp win_nexti2f ; M002
Win386_Leaving:
test dx, 1 ; is this really win386?
ljnz win_nexti2f ; NO! It's win 286 dos extender! M002
; M062 - Start
cmp ds:[UmbSaveFlag], 1 ; Q: was umb_arena saved at win start
; up.
jne noumb ; N: not saved
mov ds:[UmbSaveFlag], 0 ; Y: clear UmbSaveFlag and restore
; previously saved umb_head
push ax
push es
push cx
push si
push di
mov ax, [umb_head]
mov es, ax
xor di, di ; es:di -> umb_head
cld
mov si, offset dosdata:UmbSave1
mov cx, 0bh
rep movsb
mov si, offset dosdata:UmbSave2
mov cx, 05h
rep movsb
pop di
pop si
pop cx
pop es
pop ax
noumb: ; M062 - End
and ds:[IsWIN386],0 ; Win386 is gone
and ds:redir_patch,0 ; Disable critical sections ; M002
jmp short win_nexti2f
Win386_Query:
cmp bx, Win386_DOSMGR ; is this from DOSMGR?
jne win_nexti2f ; no, ignore it & chain to next
or cx, cx ; is it an instance query?
jne dosmgr_func ; no, some DOSMGR query
inc cx ; indicate that data is instanced
;
; M001; We were previously returning a null ptr in es:bx. This will not work.
; M001; WIN386 needs a ptr to a table in es:bx with the following offsets:
; M001;
; M001; OFFSETS STRUC
; M001; Major_version db ?
; M001; Minor_version db ?
; M001; SaveDS dw ?
; M001; SaveBX dw ?
; M001; Indos dw ?
; M001; User_id dw ?
; M001; CritPatch dw ?
; M001; OFFSETS ENDS
; M001;
; M001; User_Id is the only variable really important for proper functioning
; M001; of Win386. The other variables are used at init time to patch stuff
; M001; out. In DOS 5.0, we do the patching ourselves. But we still need to
; M001; pass this table because Win386 depends on this table to get the
; M001; User_Id offset.
; M001;
mov bx,offset Win386_DOSVars; M001
push ds ; M001
pop es ; es:bx points at offset table ; M001
jmp short PopIret ; M001
;
; Code to return Win386 2.xx instance table
;
OldWin386Init:
pop ax ; discard ds pushed on stack
mov si,offset dosdata:OldInstanceJunk
; ds:si = instance table
mov ax, 5248h ; indicate instance data present
jmp next_i2f
dosmgr_func:
dec cx
jz win386_patch ; call to patch DOS
dec cx
jz PopIret ; remove DOS patches, ignore
dec cx
jz win386_size ; get size of DOS data structures
dec cx
jz win386_inst ; instance more data
dec cx
jnz PopIret ; no functions above this
;
; Get DOS device driver size -- es:di points at device driver header
; In DOS 4.x, the para before the device header contains an arena
; header for the driver.
;
mov ax,es ; ax = device header segment
;
; We check to see if we have a memory arena for this device driver.
; The way to do this would be to look at the previous para to see if
; it has a 'D' marking it as an arena and also see if the owner-field
; in the arena is the same as the device header segment. These two
; checks together should take care of all cases
;
dec ax ; get arena header
push es
mov es,ax ; arena header for device driver
cmp byte ptr es:[di],'D' ; is it a device arena?
jnz cantsize ; no, cant size this driver
inc ax ; get back device header segment
cmp es:[di+1],ax ; owner field pointing at driver?
jnz cantsize ; no, not a proper arena
mov ax,es:[di+3] ; get arena size in paras
pop es
;
; We have to multiply by 16 to get the number of bytes in (bx:cx)
; Speed is not critical and so we choose the shortest method
; -- use "mul"
;
mov bx,16
mul bx
mov cx,ax
mov bx,dx
jmp short win386_done ; return with device driver size
cantsize:
pop es
xor ax,ax
xor dx,dx ; ask DOSMGR to use its methods
jmp short PopIret ; return
win386_patch:
;
; dx contains bits marking the patches to be applied. We return
; the field with all bits set to indicate that all patches have been
; done
;
mov bx,dx ; move patch bitfield to bx
jmp short win386_done ; done, return
win386_size:
;
;Return the size of DOS data structures -- currently only CDS size
;
test dx,1 ; check for CDS size bit
jz PopIret ; no, unknown structure -- return
ifdef JAPAN
mov cx,size CURDIR_LIST_JPN ; cx = CDS size
else
mov cx,size CURDIR_LIST ; cx = CDS size
endif
jmp short win386_done ; return with the size
win386_inst:
;
; WIN386 check to see if DOS has identified the CDS,SFT and device
; chain as instance data. Currently, we let the WIN386 DOSMGR handle
; this by returning a status of not previously instanced. The basic
; structure of these things have not changed and so the current
; DOSMGR code should be able to work it out
;
xor dx,dx ; make sure dx has a not done value
jmp short PopIret ; skip done indication
win386_done:
mov ax,WIN_OP_DONE ;
mov dx,DOSMGR_OP_DONE ;
PopIret:
pop ds
assume ds:nothing
iret ; return back up the chain
win_nexti2f:
pop ds
assume ds:nothing
jmp next_i2f ; go to BIOS i2f handler
;
;End WIN386 support
;
;M044; Start of changes
; Winoldap has a bug in that its calculations for the Windows memory image
; to save is off by 1 para. This para can happen to be a Windows arena if the
; DOS top of memory happens to be at an odd boundary (as is the case when
; UMBs are present). This is because Windows builds its arenas only at even
; para boundaries. This arena now gets trashed when Windows is swapped back
; in leading to a crash. Winoldap issues callouts when it swaps WIndows out
; and back in. We sit on these callouts. On the Windows swapout, we save the
; last para of the Windows memory block and then restore this para on the
; Windows swapin callout.
;
getwinlast proc near
assume ds:DOSDATA
mov si,CurrentPDB
dec si
mov es,si
add si,es:[3]
ret
getwinlast endp
winold_swap:
push ds
push es
push si
push di
push cx
getdseg <ds> ;ds = DOSDATA
cmp al,01 ;swap Windows out call
jne swapin ;no, check if Swap in call
call getwinlast
push ds
pop es
mov ds,si ;ds = memory arena of Windows
assume ds:nothing
xor si,si
mov di,offset DOSDATA:WinoldPatch1
mov cx,8
cld
push cx
rep movsb ;save first 8 bytes
pop cx
mov di,offset DOSDATA:WinoldPatch2
rep movsb ;save next 8 bytes
jmp short winold_done
swapin:
cmp al,02 ;swap Windows in call?
jne winold_done ;no, something else, pass it on
assume ds:DOSDATA
call getwinlast
mov es,si
xor di,di
mov si,offset DOSDATA:WinoldPatch1
mov cx,8
cld
push cx
rep movsb ;restore first 8 bytes
pop cx
mov si,offset DOSDATA:WinoldPatch2
rep movsb ;restore next 8 bytes
winold_done:
pop cx
pop di
pop si
pop es
pop ds
assume ds:nothing
jmp next_i2f ;chain on
;
;M044; End of changes
;
DispatchDOS:
PUSH FOO ; push return address
PUSH DTab ; push table address
PUSH AX ; push index
PUSH BP
MOV BP,SP
; stack looks like:
; 0 BP
; 2 DISPATCH
; 4 TABLE
; 6 RETURN
; 8 LONG-RETURN
; c FLAGS
; e AX
MOV AX,[BP+0Eh] ; get AX value
POP BP
Invoke TableDispatch
JMP BadFunc ; return indicates invalid function
Procedure INT2F_etcetera,NEAR
entry DosGetGroup
;SR; Cannot use CS now
;
; PUSH CS
; POP DS
getdseg <ds>
return
entry DOSInstall
MOV AL,0FFh
return
EndProc INT2F_etcetera
ENDIF
;---------------------------------------------------------------------------
;
; Procedure Name : RW32_CONVERT
;
;Input: same as ABSDRD and ABSDWRT
; ES:BP -> DPB
;Functions: convert 32bit absolute RW input parms to 16bit input parms
;Output: carry set when CX=-1 and drive is less then 32mb
; carry clear, parms ok
;
;---------------------------------------------------------------------------
ifdef NEC_98
Procedure RW32_CONVERT,NEAR
ASSUME CS:DOSCODE,SS:NOTHING
CMP CX,-1 ;>32mb new format ? ;AN000;
JZ new32format ;>32mb yes ;AN000;
PUSH AX ;>32mb save ax ;AN000;
PUSH DX ;>32mb save dx ;AN000;
MOV AX,ES:[BP.dpb_max_cluster] ;>32mb get max cluster # ;AN000;
MOV DL,ES:[BP.dpb_cluster_mask] ;>32mb ;AN000;
CMP DL,0FEH ;>32mb removable ? ;AN000;
JZ letold ;>32mb yes ;AN000;
INC DL ;>32mb ;AN000;
XOR DH,DH ;>32mb dx = sector/cluster ;AN000;
MUL DX ;>32mb dx:ax= max sector # ;AN000;
OR DX,DX ;>32mb > 32mb ? ;AN000;
letold:
POP DX ;>32mb retore dx ;AN000;
POP AX ;>32mb restore ax ;AN000;
JZ old_style ;>32mb no ;AN000;
push ds
getdseg <ds>
mov AbsDskErr, 207h ;>32mb bad address mark
pop ds
STC ;>32mb ;AN000;
return ;>32mb ;AN000;
new32format:
assume ds:nothing
MOV DX,WORD PTR [BX.SECTOR_RBA+2];>32mb ;AN000;
push ds ; set up ds to DOSDATA
getdseg <ds>
MOV [HIGH_SECTOR],DX ;>32mb ;AN000;
pop ds
assume ds:nothing
MOV DX,WORD PTR [BX.SECTOR_RBA] ;>32mb ;AN000;
MOV CX,[BX.ABS_RW_COUNT] ;>32mb ;AN000;
LDS BX,[BX.BUFFER_ADDR] ;>32mb ;AN000;
old_style: ;>32mb ;AN000;
CLC ;>32mb ;AN000;
return ;>32mb ;AN000;
EndProc RW32_CONVERT
endif ;NEC_98
;---------------------------------------------------------------------------
;
; Procedure Name : Fastxxx_Purge
;
; Input: None
; Functions: Purge Fastopen/ Cache Buffers
; Output: None
;
;------------------------------------------------------------------------
ifdef 0
Procedure Fastxxx_Purge,NEAR
ASSUME CS:DOSCODE,SS:NOTHING
PUSH AX ; save regs. ;AN000;
PUSH SI ;AN000;
PUSH DX ;AN000;
topen:
push ds ; set up ds to DOSDATA
getdseg <ds>
TEST FastOpenflg,Fast_yes ; fastopen installed ? ;AN000;
pop ds
assume ds:nothing
JZ nofast ; no ;AN000;
MOV AH,FastOpen_ID ; AN000;
dofast:
MOV AL,FONC_purge ; purge ;AN000;
MOV DL,ES:[BP.dpb_drive] ; set up drive number ;AN000;
invoke Fast_Dispatch ; call fastopen/seek ;AN000;
nofast:
POP DX ;AN000;
POP SI ; restore regs ;AN000;
POP AX ; ;AN000;
return ; exit ;AN000;
EndProc Fastxxx_Purge
endif
DOSCODE ENDS
END
|
2-a-whirlwind-tour/2-2-dynamics-adding-operations/2.2.2.als | freddiefujiwara/software-abstractions | 0 | 898 | module tour/addressBook1
sig Name, Addr {}
sig Book {
addr: Name -> lone Addr
}
pred showAdd (b,b': Book, n: Name, a:Addr){
add [b,b',n,a]
#Name.(b.addr) > 1
}
pred add (b,b': Book, n: Name, a:Addr){
b'.addr = b.addr + n -> a
}
run showAdd for 3 but 3 Book
|
src/LibraBFT/Impl/IO/OBM/InputOutputHandlers.agda | LaudateCorpus1/bft-consensus-agda | 0 | 5869 | {- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import LibraBFT.Base.Types
import LibraBFT.Impl.Consensus.Network as Network
import LibraBFT.Impl.Consensus.RoundManager as RoundManager
open import LibraBFT.Impl.OBM.Logging.Logging
open import LibraBFT.ImplShared.Consensus.Types
open import LibraBFT.ImplShared.Util.Dijkstra.All
open import Optics.All
open import Util.Prelude
-- This module defines the handler for our implementation. For most message types, it does some
-- initial validation before passing the message on to the proper handlers.
module LibraBFT.Impl.IO.OBM.InputOutputHandlers where
epvv : LBFT (Epoch × ValidatorVerifier)
epvv = _,_ <$> gets (_^∙ rmSafetyRules ∙ srPersistentStorage ∙ pssSafetyData ∙ sdEpoch)
<*> gets (_^∙ rmEpochState ∙ esVerifier)
module handleProposal (now : Instant) (pm : ProposalMsg) where
step₀ : LBFT Unit
step₁ : Epoch → ValidatorVerifier → LBFT Unit
step₀ = do
(myEpoch , vv) ← epvv
step₁ myEpoch vv
step₁ myEpoch vv = do
case⊎D Network.processProposal {- {!!} -} pm myEpoch vv of λ where
(Left (Left e)) → logErr e
(Left (Right i)) → logInfo i
(Right _) → RoundManager.processProposalMsgM now pm
handleProposal : Instant → ProposalMsg → LBFT Unit
handleProposal = handleProposal.step₀
module handleVote (now : Instant) (vm : VoteMsg) where
step₀ : LBFT Unit
step₁ : Epoch → ValidatorVerifier → LBFT Unit
step₀ = do
(myEpoch , vv) ← epvv
step₁ myEpoch vv
step₁ myEpoch vv = do
case Network.processVote vm myEpoch vv of λ where
(Left (Left e)) → logErr e
(Left (Right i)) → logInfo i
(Right _) → RoundManager.processVoteMsgM now vm
abstract
handleVote = handleVote.step₀
handleVote≡ : handleVote ≡ handleVote.step₀
handleVote≡ = refl
handle : NodeId → NetworkMsg → Instant → LBFT Unit
handle _self msg now =
case msg of λ where
(P pm) → handleProposal now pm
(V vm) → handleVote now vm
(C cm) → pure unit -- We don't do anything with commit messages, they are just for defining Correctness.
|
Lab05/Task03.asm | PrabalChowdhury/CSE-341-MICROPROCESSOR | 0 | 174979 | .MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
mov ah,1
int 21h
mov bl,al
sub bl,30h
mov ah,1
int 21h
sub al,30h
mov bh,0
SRT:
cmp bh,al
je AB
add dl,bl
inc bh
loop SRT
AB:
add dl,30h
mov ah,2
int 21h
MOV AX, 4C00H
INT 21H
MAIN ENDP
END MAIN |
Lexical Analyzer/LexicalAnalyzer.g4 | MAE776569/cool-compiler | 0 | 2405 | lexer grammar LexicalAnalyzer;
fragment A : [aA];
fragment B : [bB];
fragment C : [cC];
fragment D : [dD];
fragment E : [eE];
fragment F : [fF];
fragment H : [hH];
fragment I : [iI];
fragment L : [lL];
fragment N : [nN];
fragment O : [oO];
fragment P : [pP];
fragment R : [rR];
fragment S : [sS];
fragment T : [tT];
fragment V : [vV];
fragment W : [wW];
CLASS: C L A S S;
INHERITS: I N H E R I T S;
SEMICOLON: ';';
OPENBRACE: '{';
CLOSEBRACE: '}';
COLON: ':';
COMMA: ',';
OPENPARENTHESES: '(';
CLOSEPARENTHESES: ')';
DOT: '.';
AT: '@';
INTCOMP: '~';
NEW: N E W;
ADD: '+';
SUB: '-';
MUL: '*';
DIV: '/';
EQUAL: '=';
LT: '<';
LTEQ: '<=';
ASSIGN: '<-';
NOT: N O T;
TRUE: 'true';
FALSE: 'false';
STRING: '"' (('\\'|'\t'|'\r\n'|'\r'|'\n'|'\\"') | ~('\\'|'\t'|'\r'|'\n'|'"'))* '"';
IF: I F;
THEN: T H E N;
ELSE: E L S E;
FI: F I;
WHILE: W H I L E;
LOOP: L O O P;
POOL: P O O L;
CASE: C A S E;
OF: O F;
ESAC: E S A C;
LET: L E T;
IN: I N;
CASEASSIGN: '=>';
ISVOID: I S V O I D;
ID: [a-z_][a-zA-Z0-9_]*;
NUM: [0-9]+;
CLASSTYPE: [A-Z][a-zA-Z_0-9]*;
SINGLECOMMENT: '--' ~[\r\n]* -> skip;
MULTICOMMENT: '(*' .*? '*)' -> skip;
WS: [ \n\t\r]+ -> skip;
|
oeis/019/A019299.asm | neoneye/loda-programs | 11 | 9881 | <filename>oeis/019/A019299.asm
; A019299: First n elements of Thue-Morse sequence A010059 read as a binary number.
; Submitted by <NAME>
; 1,2,4,9,18,37,75,150,300,601,1203,2406,4813,9626,19252,38505,77010,154021,308043,616086,1232173,2464346,4928692,9857385,19714771,39429542,78859084,157718169,315436338,630872677,1261745355,2523490710,5046981420
mov $1,1
mov $3,1
lpb $0
sub $0,1
add $2,$1
add $1,$3
add $1,$2
mul $1,2
div $2,$3
mul $3,2
lpe
mov $0,$2
add $0,1
|
programs/oeis/157/A157863.asm | neoneye/loda | 22 | 174602 | ; A157863: a(n) = 103680000*n^2 + 28800*n + 1.
; 103708801,414777601,933206401,1658995201,2592144001,3732652801,5080521601,6635750401,8398339201,10368288001,12545596801,14930265601,17522294401,20321683201,23328432001,26542540801,29964009601,33592838401,37429027201,41472576001,45723484801,50181753601,54847382401,59720371201,64800720001,70088428801,75583497601,81285926401,87195715201,93312864001,99637372801,106169241601,112908470401,119855059201,127009008001,134370316801,141938985601,149715014401,157698403201,165889152001,174287260801,182892729601,191705558401,200725747201,209953296001,219388204801,229030473601,238880102401,248937091201,259201440001,269673148801,280352217601,291238646401,302332435201,313633584001,325142092801,336857961601,348781190401,360911779201,373249728001,385795036801,398547705601,411507734401,424675123201,438049872001,451631980801,465421449601,479418278401,493622467201,508034016001,522652924801,537479193601,552512822401,567753811201,583202160001,598857868801,614720937601,630791366401,647069155201,663554304001,680246812801,697146681601,714253910401,731568499201,749090448001,766819756801,784756425601,802900454401,821251843201,839810592001,858576700801,877550169601,896730998401,916119187201,935714736001,955517644801,975527913601,995745542401,1016170531201,1036802880001
seq $0,157862 ; a(n) = 1728000*n + 240.
pow $0,2
sub $0,2986813497600
div $0,28800
add $0,103708801
|
oeis/313/A313201.asm | neoneye/loda-programs | 11 | 15054 | <gh_stars>10-100
; A313201: Coordination sequence Gal.5.115.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by <NAME>
; 1,4,9,15,19,23,27,33,38,42,46,51,57,61,65,69,75,80,84,88,93,99,103,107,111,117,122,126,130,135,141,145,149,153,159,164,168,172,177,183,187,191,195,201,206,210,214,219,225,229
mul $0,7
add $0,6
mov $3,3
mov $4,2
lpb $0
mov $2,$0
sub $2,4
add $3,6
add $4,6
trn $2,$4
add $2,$3
mov $0,$2
lpe
sub $0,6
trn $0,1
add $0,1
|
programs/oeis/130/A130883.asm | karttu/loda | 1 | 28297 | <filename>programs/oeis/130/A130883.asm
; A130883: a(n) = 2*n^2 - n + 1.
; 1,2,7,16,29,46,67,92,121,154,191,232,277,326,379,436,497,562,631,704,781,862,947,1036,1129,1226,1327,1432,1541,1654,1771,1892,2017,2146,2279,2416,2557,2702,2851,3004,3161,3322,3487,3656,3829,4006,4187,4372,4561,4754,4951,5152,5357,5566,5779,5996,6217,6442,6671,6904,7141,7382,7627,7876,8129,8386,8647,8912,9181,9454,9731,10012,10297,10586,10879,11176,11477,11782,12091,12404,12721,13042,13367,13696,14029,14366,14707,15052,15401,15754,16111,16472,16837,17206,17579,17956,18337,18722,19111,19504,19901,20302,20707,21116,21529,21946,22367,22792,23221,23654,24091,24532,24977,25426,25879,26336,26797,27262,27731,28204,28681,29162,29647,30136,30629,31126,31627,32132,32641,33154,33671,34192,34717,35246,35779,36316,36857,37402,37951,38504,39061,39622,40187,40756,41329,41906,42487,43072,43661,44254,44851,45452,46057,46666,47279,47896,48517,49142,49771,50404,51041,51682,52327,52976,53629,54286,54947,55612,56281,56954,57631,58312,58997,59686,60379,61076,61777,62482,63191,63904,64621,65342,66067,66796,67529,68266,69007,69752,70501,71254,72011,72772,73537,74306,75079,75856,76637,77422,78211,79004,79801,80602,81407,82216,83029,83846,84667,85492,86321,87154,87991,88832,89677,90526,91379,92236,93097,93962,94831,95704,96581,97462,98347,99236,100129,101026,101927,102832,103741,104654,105571,106492,107417,108346,109279,110216,111157,112102,113051,114004,114961,115922,116887,117856,118829,119806,120787,121772,122761,123754
mul $0,2
bin $0,2
mov $1,$0
add $1,1
|
oeis/046/A046095.asm | neoneye/loda-programs | 11 | 178500 | ; A046095: Decimal expansion of Calabi's constant.
; Submitted by <NAME>
; 1,5,5,1,3,8,7,5,2,4,5,4,8,3,2,0,3,9,2,2,6,1,9,5,2,5,1,0,2,6,4,6,2,3,8,1,5,1,6,3,5,9,1,7,0,3,8,0,3,8,8,7,1,9,9,5,2,8,0,0,7,1,2,0,1,1,7,9,2,6,7,4,2,5,5,4,2,5,6,9,5,7,2,9,5,7,6,0,4,5,3,6,1,2,0,2,5,4,3,6
mov $1,1
mov $3,$0
mul $3,3
lpb $3
add $2,$6
add $1,$2
add $2,$1
mov $5,$1
mul $1,2
mul $2,2
sub $3,1
add $5,$2
add $6,$5
lpe
mov $4,10
pow $4,$0
div $2,$4
add $2,1
div $1,$2
mov $0,$1
mod $0,10
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_679.asm | ljhsiun2/medusa | 9 | 13464 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x9d0d, %r11
clflush (%r11)
nop
nop
nop
sub %rbp, %rbp
movb (%r11), %al
nop
nop
nop
nop
dec %r12
lea addresses_D_ht+0x1630d, %r15
dec %r10
and $0xffffffffffffffc0, %r15
vmovntdqa (%r15), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %rax
nop
lfence
lea addresses_UC_ht+0x14901, %rsi
lea addresses_UC_ht+0x122b5, %rdi
sub %r15, %r15
mov $100, %rcx
rep movsw
nop
nop
cmp %rax, %rax
lea addresses_normal_ht+0x1550d, %rsi
lea addresses_UC_ht+0xa68d, %rdi
nop
nop
nop
cmp $64988, %r15
mov $87, %rcx
rep movsw
nop
nop
nop
nop
and %r15, %r15
lea addresses_WT_ht+0x1bf4d, %rsi
nop
dec %rbp
movw $0x6162, (%rsi)
nop
nop
xor $27339, %rcx
lea addresses_A_ht+0x1b30d, %rbp
nop
inc %r10
mov (%rbp), %r15
nop
nop
nop
nop
cmp $56343, %r12
lea addresses_D_ht+0x16394, %rax
nop
xor $40517, %r12
mov $0x6162636465666768, %r11
movq %r11, %xmm6
movups %xmm6, (%rax)
and $54831, %rbp
lea addresses_UC_ht+0x1d90d, %rsi
lea addresses_WC_ht+0x19b57, %rdi
nop
nop
nop
nop
add %rbp, %rbp
mov $38, %rcx
rep movsb
nop
inc %r15
lea addresses_D_ht+0x6d0d, %rax
nop
nop
nop
add $11077, %rdi
movl $0x61626364, (%rax)
nop
nop
and %r12, %r12
lea addresses_D_ht+0x1aec5, %r10
nop
nop
nop
nop
inc %r11
movb $0x61, (%r10)
nop
nop
nop
nop
nop
dec %rcx
lea addresses_UC_ht+0x1ae32, %rbp
clflush (%rbp)
sub %rdi, %rdi
and $0xffffffffffffffc0, %rbp
movntdqa (%rbp), %xmm0
vpextrq $0, %xmm0, %rax
nop
add $61788, %rcx
lea addresses_WC_ht+0x4f0d, %rsi
nop
xor %r12, %r12
movb $0x61, (%rsi)
nop
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x240d, %r15
clflush (%r15)
inc %rbp
mov (%r15), %eax
nop
nop
and $50796, %r15
lea addresses_UC_ht+0x1410d, %rcx
nop
nop
nop
cmp %r12, %r12
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%rcx)
nop
nop
nop
nop
nop
cmp $34779, %r15
lea addresses_WC_ht+0x1a58d, %r11
xor %rcx, %rcx
mov $0x6162636465666768, %rax
movq %rax, %xmm3
vmovups %ymm3, (%r11)
nop
nop
nop
nop
nop
add %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rcx
push %rdi
push %rsi
// Load
lea addresses_normal+0x1b2ad, %r11
nop
nop
nop
nop
sub %r9, %r9
movups (%r11), %xmm7
vpextrq $0, %xmm7, %r8
nop
nop
nop
nop
add %r9, %r9
// Faulty Load
lea addresses_WT+0x1050d, %r11
and $28870, %r13
mov (%r11), %r9d
lea oracles, %r8
and $0xff, %r9
shlq $12, %r9
mov (%r8,%r9,1), %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 4}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': True, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': True, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WC_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/157/A157610.asm | karttu/loda | 1 | 173358 | <reponame>karttu/loda
; A157610: 29282n^2 - 484n + 1.
; 28799,116161,262087,466577,729631,1051249,1431431,1870177,2367487,2923361,3537799,4210801,4942367,5732497,6581191,7488449,8454271,9478657,10561607,11703121,12903199,14161841,15479047,16854817,18289151,19782049,21333511,22943537,24612127,26339281,28124999,29969281,31872127,33833537,35853511,37932049,40069151,42264817,44519047,46831841,49203199,51633121,54121607,56668657,59274271,61938449,64661191,67442497,70282367,73180801,76137799,79153361,82227487,85360177,88551431,91801249,95109631,98476577,101902087,105386161,108928799,112530001,116189767,119908097,123684991,127520449,131414471,135367057,139378207,143447921,147576199,151763041,156008447,160312417,164674951,169096049,173575711,178113937,182710727,187366081,192079999,196852481,201683527,206573137,211521311,216528049,221593351,226717217,231899647,237140641,242440199,247798321,253215007,258690257,264224071,269816449,275467391,281176897,286944967,292771601,298656799,304600561,310602887,316663777,322783231,328961249,335197831,341492977,347846687,354258961,360729799,367259201,373847167,380493697,387198791,393962449,400784671,407665457,414604807,421602721,428659199,435774241,442947847,450180017,457470751,464820049,472227911,479694337,487219327,494802881,502444999,510145681,517904927,525722737,533599111,541534049,549527551,557579617,565690247,573859441,582087199,590373521,598718407,607121857,615583871,624104449,632683591,641321297,650017567,658772401,667585799,676457761,685388287,694377377,703425031,712531249,721696031,730919377,740201287,749541761,758940799,768398401,777914567,787489297,797122591,806814449,816564871,826373857,836241407,846167521,856152199,866195441,876297247,886457617,896676551,906954049,917290111,927684737,938137927,948649681,959219999,969848881,980536327,991282337,1002086911,1012950049,1023871751,1034852017,1045890847,1056988241,1068144199,1079358721,1090631807,1101963457,1113353671,1124802449,1136309791,1147875697,1159500167,1171183201,1182924799,1194724961,1206583687,1218500977,1230476831,1242511249,1254604231,1266755777,1278965887,1291234561,1303561799,1315947601,1328391967,1340894897,1353456391,1366076449,1378755071,1391492257,1404288007,1417142321,1430055199,1443026641,1456056647,1469145217,1482292351,1495498049,1508762311,1522085137,1535466527,1548906481,1562404999,1575962081,1589577727,1603251937,1616984711,1630776049,1644625951,1658534417,1672501447,1686527041,1700611199,1714753921,1728955207,1743215057,1757533471,1771910449,1786345991,1800840097,1815392767,1830004001
mul $0,11
mov $1,55
mov $2,11
add $2,$0
mul $1,$2
sub $1,5
pow $1,2
sub $1,360000
div $1,3025
mul $1,242
add $1,28799
|
data/pokemon/base_stats/crobat.asm | AtmaBuster/pokeplat-gen2 | 6 | 247105 | db 0 ; species ID placeholder
db 85, 90, 80, 130, 70, 80
; hp atk def spd sat sdf
db POISON, FLYING ; type
db 90 ; catch rate
db 204 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 15 ; step cycles to hatch
INCBIN "gfx/pokemon/crobat/front.dimensions"
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_FLYING, EGG_FLYING ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm TOXIC, HIDDEN_POWER, SUNNY_DAY, TAUNT, HYPER_BEAM, PROTECT, RAIN_DANCE, GIGA_DRAIN, FRUSTRATION, RETURN, SHADOW_BALL, DOUBLE_TEAM, SLUDGE_BOMB, AERIAL_ACE, TORMENT, FACADE, SECRET_POWER, REST, ATTRACT, THIEF, STEEL_WING, SNATCH, ROOST, ENDURE, PAYBACK, GIGA_IMPACT, CAPTIVATE, DARK_PULSE, X_SCISSOR, SLEEP_TALK, NATURAL_GIFT, SWAGGER, PLUCK, U_TURN, SUBSTITUTE, FLY, DEFOG, AIR_CUTTER, HEAT_WAVE, OMINOUS_WIND, SNORE, SWIFT, TWISTER, UPROAR, ZEN_HEADBUTT
; end
|
NorthstarDedicatedTest/audio_asm.asm | r-ex/NorthstarLauncher | 186 | 167064 | <filename>NorthstarDedicatedTest/audio_asm.asm<gh_stars>100-1000
public Audio_GetParentEvent
.code
Audio_GetParentEvent proc
mov rax, r12
ret
Audio_GetParentEvent endp
end |
oeis/208/A208900.asm | neoneye/loda-programs | 11 | 171063 | ; A208900: Number of bitstrings of length n which (if having two or more runs) the last two runs have different lengths.
; Submitted by <NAME>
; 2,2,6,10,26,50,114,226,482,962,1986,3970,8066,16130,32514,65026,130562,261122,523266,1046530,2095106,4190210,8384514,16769026,33546242,67092482,134201346,268402690,536838146,1073676290,2147418114,4294836226,8589803522,17179607042,34359476226,68718952450,137438429186,274876858370,549754765314,1099509530626,2199021158402,4398042316802,8796088827906,17592177655810,35184363700226,70368727400450,140737471578114,281474943156226,562949919866882,1125899839733762,2251799746576386,4503599493152770
trn $0,1
mov $1,2
pow $1,$0
div $0,2
mov $2,2
pow $2,$0
sub $1,$2
mov $0,$1
mul $0,4
add $0,2
|
programs/oeis/313/A313580.asm | neoneye/loda | 22 | 97556 | ; A313580: Coordination sequence Gal.5.111.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,10,14,19,25,30,34,39,44,49,54,58,63,69,74,78,83,88,93,98,102,107,113,118,122,127,132,137,142,146,151,157,162,166,171,176,181,186,190,195,201,206,210,215,220,225,230,234,239
mov $3,$0
mov $9,$0
lpb $3
mov $0,$9
sub $3,1
sub $0,$3
mov $5,$0
mov $6,0
mov $7,2
lpb $7
mov $0,$5
mov $2,0
sub $7,1
add $0,$7
sub $0,1
mul $0,2
max $0,0
seq $0,314828 ; Coordination sequence Gal.5.64.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
add $2,$0
mov $4,$2
mov $8,$7
mul $8,$2
add $6,$8
lpe
min $5,1
mul $5,$4
mov $4,$6
sub $4,$5
sub $4,4
add $1,$4
lpe
add $1,1
mov $0,$1
|
antlr/multiple-exampples/src/main/antlr/com/mageddo/antlr/parser/comment/Comment.g4 | mageddo/java-examples | 19 | 6974 | grammar Comment;
@header {
package com.mageddo.antlr.parser.comment;
}
base
: value
;
value
: comment NL (comment)*
;
comment
: SINGLE_LINE_COMMENT
;
SINGLE_LINE_COMMENT
: '#' (LINE_TEXT)+
;
NL
: '\r'? '\n'
;
fragment LINE_TEXT
: ~ [\r\n] // what which isn't a new line
;
|
drivers/linear_solver_test.adb | sciencylab/lagrangian-solver | 0 | 28741 | <gh_stars>0
with Numerics, Numerics.Sparse_Matrices, Numerics.Sparse_Matrices.CSparse;
use Numerics, Numerics.Sparse_Matrices, Numerics.Sparse_Matrices.CSparse;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Containers; use Ada.Containers;
procedure Linear_Solver_Test is
use Real_IO, Int_IO, Real_Functions;
Mat : Sparse_Matrix;
LU : LU_Type;
SX : Sparse_Vector;
SB : Sparse_Vector;
SY : Sparse_Vector;
Y : Sparse_Vector;
Dir : String := "matrices/sparse-triplet/zero-based/";
Res : Real;
begin
Put ("Read Matrix . . .");
------ Rectangular Matrices -----------------
-- Mat := Read_Sparse_Triplet (Dir & "ash219_st.txt"); -- 3.6K
-- Mat := Transpose (Mat) * Mat;
------ Square Matrices ----------------------
-- Mat := Read_Sparse_Triplet (Dir & "a5by5_st.txt"); -- 611
-- Mat := Read_Sparse_Triplet (Dir & "bcsstk01_st.txt"); -- 4.9K
Mat := Read_Sparse_Triplet (Dir & "bcsstk16_st.txt"); -- 3.7M
-- Mat := Read_Sparse_Triplet (Dir & "fs_183_1_st.txt"); -- 24K
-- Mat := Read_Sparse_Triplet (Dir & "kershaw_st.txt"); -- 564
-- Mat := Read_Sparse_Triplet (Dir & "t1_st.txt"); -- 80
-- Mat := Read_Sparse_Triplet (Dir & "west0067_st.txt"); -- 3.9K
Put_Line ("finished");
----- Print matrix' info --------------
Put ("Size of matrix: ");
Put (N_Row (Mat), 0); Put (" x "); Put (N_Col (Mat), 0); New_Line;
Put ("Number of entries: "); Put (Number_Of_Elements (Mat), 0); New_Line;
----- Set size of vectors X and B ----
Set_Length (SB, N_Col (Mat)); Set_Length (SX, N_Col (Mat));
----- Begin LU Decomposition ---------
Put ("LU Decomposition . . .");
LU := LU_Decomposition (Mat);
Put_Line ("finished");
------ Begin tests ------------------------
Put_Line ("Begin testing . . .");
for K in 1 .. 10 loop
Put ("Trial "); Put (K, Width => 2); Put (": ");
for I in 1 .. N_Col (Mat) loop
Set (SB, I, (10.0 * Rand) ** 10 * Sin (10.0 * Rand));
end loop;
SX := Solve (LU, SB);
SY := SB - Mat * SX;
Y := SB - Mat * Solve (Mat, SB);
-- Res := Norm (SY - Y);
-- Res := Norm (Y) / Real'Max (1.0, Norm (SB));
-- Put (" Norm (Res) = "); Put (Res, Fore => 1, Aft => 1, Exp => 3);
-- Put_Line (if Res > 1.0e-10 then " ***" else "");
end loop;
Put_Line ("tests completed");
end loop;
---- Free memory allocated by LU : LU_Type -------
Free (LU);
end Linear_Solver_Test;
|
examples/AIM6/HelloAgda/Datatypes.agda | asr/agda-kanso | 1 | 8169 | {-
Agda Implementors' Meeting VI
Göteborg
May 24 - 30, 2007
Hello Agda!
<NAME>
-}
-- This is where the fun begins.
-- Unleashing datatypes, pattern matching and recursion.
module Datatypes where
{-
Simple datatypes.
-}
-- Now which datatype should we start with...?
data Nat : Set where
zero : Nat
suc : Nat -> Nat
-- Let's start simple.
pred : Nat -> Nat
pred zero = zero
pred (suc n) = n
-- Now let's do recursion.
_+_ : Nat -> Nat -> Nat
zero + m = m
suc n + m = suc (n + m)
-- An aside on infix operators:
-- Any name containing _ can be used as a mixfix operator.
-- The arguments simply go in place of the _. For instance:
data Bool : Set where
true : Bool
false : Bool
if_then_else_ : {A : Set} -> Bool -> A -> A -> A
if true then x else y = x
if false then x else y = y
-- To declare the associativity and precedence of an operator
-- we write. In this case we need parenthesis around the else branch
-- if its precedence is lower than 10. For the condition and the then
-- branch we only need parenthesis for things like λs.
infix 10 if_then_else_
{-
Parameterised datatypes
-}
data List (A : Set) : Set where
[] : List A
_::_ : A -> List A -> List A
infixr 50 _::_
-- The parameters are implicit arguments to the constructors.
nil : (A : Set) -> List A
nil A = [] {A}
map : {A B : Set} -> (A -> B) -> List A -> List B
map f [] = []
map f (x :: xs) = f x :: map f xs
{-
Empty datatypes
-}
-- A very useful guy is the empty datatype.
data False : Set where
-- When pattern matching on an element of an empty type, something
-- interesting happens:
elim-False : {A : Set} -> False -> A
elim-False () -- Look Ma, no right hand side!
-- The pattern () is called an absurd pattern and matches elements
-- of an empty type.
{-
What's next?
-}
-- Fun as they are, eventually you'll get bored with
-- inductive datatypes.
-- Move on to: Families.agda |
code/file/load-sheets.asm | abekermsx/skooted | 3 | 860 | <gh_stars>1-10
load_sheets:
call open_file
ret nz
ld de,SKOOTER.SHEETS
ld b,3
load_sheets_loop:
push bc
push de
ld de,load_buffer
ld c,_SETDTA
call BDOSBAS
ld de,fcb
ld hl,2048
ld c,_RDBLK
call bdos_wrapper
pop de
pop bc
or a
ret nz
push bc
ld hl,load_buffer
ld bc,2048
ldir
pop bc
djnz load_sheets_loop
call close_file
ret
load_buffer: equ $c000
|
archive/agda-3/src/Oscar/Data/ProductIndexEquivalence.agda | m0davis/oscar | 0 | 1756 | <gh_stars>0
open import Oscar.Prelude
open import Oscar.Class.HasEquivalence
import Oscar.Data.Constraint
module Oscar.Data.ProductIndexEquivalence where
module _ {𝔬} {𝔒 : Ø 𝔬} {𝔭} {𝔓 : 𝔒 → Ø 𝔭} {ℓ} ⦃ _ : HasEquivalence 𝔒 ℓ ⦄ where
record _≈₀_ (P Q : Σ 𝔒 𝔓) : Ø ℓ where
constructor ∁
field
π₀ : π₀ P ≈ π₀ Q
open _≈₀_ public
module _ {𝔬} (𝔒 : Ø 𝔬) {𝔭} (𝔓 : 𝔒 → Ø 𝔭) {ℓ} ⦃ _ : HasEquivalence 𝔒 ℓ ⦄ where
ProductIndexEquivalence⟦_/_⟧ : (P Q : Σ 𝔒 𝔓) → Ø ℓ
ProductIndexEquivalence⟦_/_⟧ = _≈₀_
|
y2s2/csa/practicals/practical-2/printNumbers.asm | ouldevloper/university | 8 | 165108 | .MODEL SMALL
.STACK 100
.DATA
VAL1 DB 6
VAL2 DB 3
VAL3 DB 4
RESULT DB ?
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV BL,VAL1
MOV BH,VAL2
ADD BL,BH
SUB BL,VAL3
; --- CONVERT NUMBER TO ASCII ---
ADD BL, 30H
MOV RESULT, BL
; --- DISPLAY ASCII
MOV AH, 02H
MOV DL, RESULT
INT 21H
MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN |
Cubical/Relation/Binary/Raw/Construct/NonStrictToStrict.agda | bijan2005/univalent-foundations | 0 | 14869 | {-# OPTIONS --cubical --no-import-sorts --safe #-}
open import Cubical.Core.Everything
open import Cubical.Relation.Binary.Raw
module Cubical.Relation.Binary.Raw.Construct.NonStrictToStrict
{a ℓ} {A : Type a} (_≤_ : RawRel A ℓ) where
open import Cubical.Relation.Binary.Raw.Properties
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Sigma
open import Cubical.Data.Sum.Base using (inl; inr)
open import Cubical.Data.Empty hiding (rec)
open import Cubical.Foundations.Function using (_∘_; flip)
open import Cubical.Relation.Nullary
open import Cubical.HITs.PropositionalTruncation hiding (elim)
private
_≢_ : RawRel A a
x ≢ y = ¬ (x ≡ y)
------------------------------------------------------------------------
-- _≤_ can be turned into _<_ as follows:
_<_ : RawRel A _
x < y = x ≤ y × x ≢ y
------------------------------------------------------------------------
-- Relationship between relations
<⇒≤ : _<_ ⇒ _≤_
<⇒≤ = fst
<⇒≢ : _<_ ⇒ _≢_
<⇒≢ = snd
≤∧≢⇒< : ∀ {x y} → x ≤ y → x ≢ y → x < y
≤∧≢⇒< = _,_
<⇒≱ : Antisymmetric _≤_ → ∀ {x y} → x < y → ¬ (y ≤ x)
<⇒≱ antisym (x≤y , x≢y) y≤x = x≢y (antisym x≤y y≤x)
≤⇒≯ : Antisymmetric _≤_ → ∀ {x y} → x ≤ y → ¬ (y < x)
≤⇒≯ antisym x≤y y<x = <⇒≱ antisym y<x x≤y
≰⇒> : Reflexive _≤_ → Total _≤_ →
∀ {x y} → ¬ (x ≤ y) → y < x
≰⇒> rfl total {x} {y} x≰y with total x y
... | inl x≤y = elim (x≰y x≤y)
... | inr y≤x = y≤x , x≰y ∘ reflx→fromeq _≤_ rfl ∘ sym
≮⇒≥ : Discrete A → Reflexive _≤_ → Total _≤_ →
∀ {x y} → ¬ (x < y) → y ≤ x
≮⇒≥ _≟_ ≤-refl _≤?_ {x} {y} x≮y with x ≟ y
... | yes x≈y = reflx→fromeq _≤_ ≤-refl (sym x≈y)
... | no x≢y with y ≤? x
... | inl y≤x = y≤x
... | inr x≤y = elim (x≮y (x≤y , x≢y))
------------------------------------------------------------------------
-- Relational properties
<-isPropValued : isPropValued _≤_ → isPropValued _<_
<-isPropValued propv x y = isProp× (propv x y) (isPropΠ λ _ → isProp⊥)
<-toNotEq : ToNotEq _<_
<-toNotEq (_ , x≢y) x≡y = x≢y x≡y
<-irrefl : Irreflexive _<_
<-irrefl = tonoteq→irrefl _<_ <-toNotEq
<-transitive : IsPartialOrder _≤_ → Transitive _<_
<-transitive po (x≤y , x≢y) (y≤z , y≉z) =
(transitive x≤y y≤z , x≢y ∘ antisym x≤y ∘ transitive y≤z ∘ fromEq ∘ sym)
where open IsPartialOrder po
<-≤-trans : Transitive _≤_ → Antisymmetric _≤_ →
Trans _<_ _≤_ _<_
<-≤-trans transitive antisym (x≤y , x≢y) y≤z =
transitive x≤y y≤z , (λ x≡z → x≢y (antisym x≤y (Respectsʳ≡ _≤_ (sym x≡z) y≤z)))
≤-<-trans : Transitive _≤_ → Antisymmetric _≤_ →
Trans _≤_ _<_ _<_
≤-<-trans trans antisym x≤y (y≤z , y≢z) =
trans x≤y y≤z , (λ x≡z → y≢z (antisym y≤z (Respectsˡ≡ _≤_ x≡z x≤y)))
<-asym : Antisymmetric _≤_ → Asymmetric _<_
<-asym antisym (x≤y , x≢y) (y≤x , _) = x≢y (antisym x≤y y≤x)
<-decidable : Discrete A → Decidable _≤_ → Decidable _<_
<-decidable _≟_ _≤?_ x y with x ≤? y
... | no ¬p = no (¬p ∘ fst)
... | yes p with x ≟ y
... | yes q = no (λ x<y → snd x<y q)
... | no ¬q = yes (p , ¬q)
------------------------------------------------------------------------
-- Structures
isStrictPartialOrder : IsPartialOrder _≤_ → IsStrictPartialOrder _<_
isStrictPartialOrder po = record
{ irrefl = <-irrefl
; transitive = <-transitive po
} where open IsPartialOrder po
|
x86_64/src/09-jmp.nasm | karng87/nasm_game | 0 | 243773 | section .data
msg: db "Hello World!", 0xA
mlen equ $-msg
section .bss
section .text
global main
main:
jmp Begin
mov rax, 0x10
xor rbx, rbx
Begin:
mov rax, 5
PrintHW:
push rax
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, mlen
syscall
pop rax
dec rax
jnz PrintHW ;; loop PrintHw : dec rcx => cmp rcx, 0 => jg
mov rax, 60
mov rdi, 0
syscall
|
LibraBFT/Impl/IO/OBM/Start.agda | oracle/bft-consensus-agda | 4 | 4073 | <filename>LibraBFT/Impl/IO/OBM/Start.agda
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import LibraBFT.Impl.Consensus.EpochManagerTypes
import LibraBFT.Impl.Consensus.ConsensusProvider as ConsensusProvider
import LibraBFT.Impl.IO.OBM.GenKeyFile as GenKeyFile
import LibraBFT.Impl.IO.OBM.ObmNeedFetch as ObmNeedFetch
import LibraBFT.Impl.Types.ValidatorSigner as ValidatorSigner
open import LibraBFT.ImplShared.Consensus.Types
open import LibraBFT.ImplShared.Interface.Output
open import LibraBFT.Prelude
open import Optics.All
module LibraBFT.Impl.IO.OBM.Start where
{-
This only does the initialization steps from the Haskell version.
If initialization succeeds, it returns
- the EpochManager (for all epochs)
- note: this contains the initialized RoundManager for the current epoch (i.e., Epoch 0)
- any output from the RoundManager produced during initialization
The only output is (with info logging removed):
-- only the leader of round 1 will broadcast a proposal
BroadcastProposal; [ ... peer addresses ... ];
(ProposalMsg
(B 7194dca (BD 1 1 (Prop ("TX/1/1")) ...)) -- proposed block
(SI (hqc c66a132) (hcc N) (htc (TC N)))) -- SyncInfo
The Haskell code, after initialization, hooks up the communication channels and sockets
and starts threads that handle them. One of the threads is given to
EpochManager.obmStartLoop to get input and pass it through the EpochManager
and then (usually) on to the RoundMnager.
TODO-3: Replace 'Handle.initRM' with the initialized RoundManager obtained
through the following 'startViaConsensusProvider'.
TODO-3: Figure out how to handle the initial BroadcastProposal.
-}
startViaConsensusProvider
: Instant
→ GenKeyFile.NfLiwsVsVvPe
→ TxTypeDependentStuffForNetwork
→ Either ErrLog (EpochManager × List Output)
startViaConsensusProvider now (nf , liws , vs , vv , pe) txTDS = do
(nc , occp , _liws , sk , _pe) ← ConsensusProvider.obmInitialData (nf , liws , vs , vv , pe)
ConsensusProvider.startConsensus
nc now occp liws sk
(ObmNeedFetch∙new {- newNetwork -stps'-})
(txTDS ^∙ ttdsnProposalGenerator) (txTDS ^∙ ttdsnStateComputer)
|
Cats/Displayed.agda | JLimperg/cats | 24 | 6794 | {-# OPTIONS --without-K --safe #-}
module Cats.Displayed where
open import Data.Product using (Σ ; Σ-syntax ; _,_)
open import Level using (_⊔_ ; suc)
open import Relation.Binary using
(Setoid ; IsEquivalence ; Rel ; REL ; _Preserves₂_⟶_⟶_)
open import Cats.Category
record DisplayedCategory {lo la l≈} (C : Category lo la l≈) lo′ la′ l≈′
: Set (lo ⊔ la ⊔ l≈ ⊔ suc (lo′ ⊔ la′ ⊔ l≈′)) where
infixr 9 _∘_
infix 4 _≈[_]_
infixr -1 _⇒[_]_
Base = C
module Base = Category Base
private
module C = Category C
field
Obj : (c : C.Obj) → Set lo′
_⇒[_]_ : ∀ {a b} (a⁺ : Obj a) (f : a C.⇒ b) (b⁺ : Obj b) → Set la′
_≈[_]_ : ∀ {a b} {f g : a C.⇒ b} {a⁺ : Obj a} {b⁺ : Obj b}
→ a⁺ ⇒[ f ] b⁺
→ f C.≈ g
→ a⁺ ⇒[ g ] b⁺
→ Set l≈′
id : ∀ {a} {a⁺ : Obj a} → a⁺ ⇒[ C.id ] a⁺
_∘_ : ∀ {a b c} {a⁺ : Obj a} {b⁺ : Obj b} {c⁺ : Obj c}
→ {f : b C.⇒ c} {g : a C.⇒ b}
→ (f⁺ : b⁺ ⇒[ f ] c⁺) (g⁺ : a⁺ ⇒[ g ] b⁺)
→ a⁺ ⇒[ f C.∘ g ] c⁺
≈-refl : ∀ {a b} {f : a C.⇒ b} {a⁺ : Obj a} {b⁺ : Obj b} {f⁺ : a⁺ ⇒[ f ] b⁺}
→ f⁺ ≈[ C.≈.refl ] f⁺
≈-sym : ∀ {a b} {f g : a C.⇒ b} {f≈g : f C.≈ g} {a⁺ : Obj a} {b⁺ : Obj b}
→ {f⁺ : a⁺ ⇒[ f ] b⁺} {g⁺ : a⁺ ⇒[ g ] b⁺}
→ f⁺ ≈[ f≈g ] g⁺
→ g⁺ ≈[ C.≈.sym f≈g ] f⁺
≈-trans : ∀ {a b}
→ {f g h : a C.⇒ b} {f≈g : f C.≈ g} {g≈h : g C.≈ h}
→ {a⁺ : Obj a} {b⁺ : Obj b}
→ {f⁺ : a⁺ ⇒[ f ] b⁺} {g⁺ : a⁺ ⇒[ g ] b⁺} {h⁺ : a⁺ ⇒[ h ] b⁺}
→ f⁺ ≈[ f≈g ] g⁺ → g⁺ ≈[ g≈h ] h⁺
→ f⁺ ≈[ C.≈.trans f≈g g≈h ] h⁺
∘-resp : ∀ {a b c} {f g : b C.⇒ c} {h i : a C.⇒ b}
→ {f≈g : f C.≈ g} {h≈i : h C.≈ i}
→ {a⁺ : Obj a} {b⁺ : Obj b} {c⁺ : Obj c}
→ {f⁺ : b⁺ ⇒[ f ] c⁺} {g⁺ : b⁺ ⇒[ g ] c⁺}
→ {h⁺ : a⁺ ⇒[ h ] b⁺} {i⁺ : a⁺ ⇒[ i ] b⁺}
→ f⁺ ≈[ f≈g ] g⁺
→ h⁺ ≈[ h≈i ] i⁺
→ f⁺ ∘ h⁺ ≈[ C.∘-resp f≈g h≈i ] g⁺ ∘ i⁺
id-r : ∀ {a b} {f : a C.⇒ b} {a⁺ : Obj a} {b⁺ : Obj b} {f⁺ : a⁺ ⇒[ f ] b⁺}
→ f⁺ ∘ id ≈[ C.id-r ] f⁺
id-l : ∀ {a b} {f : a C.⇒ b} {a⁺ : Obj a} {b⁺ : Obj b} {f⁺ : a⁺ ⇒[ f ] b⁺}
→ id ∘ f⁺ ≈[ C.id-l ] f⁺
assoc : ∀ {a b c d} {f : c C.⇒ d} {g : b C.⇒ c} {h : a C.⇒ b}
→ {a⁺ : Obj a} {b⁺ : Obj b} {c⁺ : Obj c} {d⁺ : Obj d}
→ {f⁺ : c⁺ ⇒[ f ] d⁺} {g⁺ : b⁺ ⇒[ g ] c⁺} {h⁺ : a⁺ ⇒[ h ] b⁺}
→ (f⁺ ∘ g⁺) ∘ h⁺ ≈[ C.assoc ] f⁺ ∘ (g⁺ ∘ h⁺)
module BuildTotal
{lo la l≈} {C : Category lo la l≈} {lo′ la′ l≈′}
(D : DisplayedCategory C lo′ la′ l≈′)
where
infixr 9 _∘_
infix 4 _≈_
infixr -1 _⇒_
private
module C = Category C
module D = DisplayedCategory D
Obj : Set (lo ⊔ lo′)
Obj = Σ[ c ∈ C.Obj ] D.Obj c
_⇒_ : (a b : Obj) → Set (la ⊔ la′)
(a , a⁺) ⇒ (b , b⁺) = Σ[ f ∈ a C.⇒ b ] (a⁺ D.⇒[ f ] b⁺)
_≈_ : ∀ {a b} → Rel (a ⇒ b) (l≈ ⊔ l≈′)
(f , f⁺) ≈ (g , g⁺) = Σ[ f≈g ∈ f C.≈ g ] f⁺ D.≈[ f≈g ] g⁺
id : ∀ {a} → a ⇒ a
id = C.id , D.id
_∘_ : ∀ {a b c} → b ⇒ c → a ⇒ b → a ⇒ c
(f , f⁺) ∘ (g , g⁺) = (f C.∘ g) , (f⁺ D.∘ g⁺)
equiv : ∀ {a b} → IsEquivalence (_≈_ {a} {b})
equiv = record
{ refl = C.≈.refl , D.≈-refl
; sym = λ where
(f≈g , f⁺≈g⁺) → C.≈.sym f≈g , D.≈-sym f⁺≈g⁺
; trans = λ where
(f≈g , f⁺≈g⁺) (g≈h , g⁺≈h⁺) → C.≈.trans f≈g g≈h , D.≈-trans f⁺≈g⁺ g⁺≈h⁺
}
∘-resp : ∀ {a b c} → (_∘_ {a} {b} {c} Preserves₂ _≈_ ⟶ _≈_ ⟶ _≈_)
∘-resp (f≈g , f⁺≈g⁺) (h≈i , h⁺≈i⁺) = C.∘-resp f≈g h≈i , D.∘-resp f⁺≈g⁺ h⁺≈i⁺
id-r : ∀ {a b} {f : a ⇒ b} → f ∘ id ≈ f
id-r = C.id-r , D.id-r
id-l : ∀ {a b} {f : a ⇒ b} → id ∘ f ≈ f
id-l = C.id-l , D.id-l
assoc : ∀ {a b c d} {f : c ⇒ d} {g : b ⇒ c} {h : a ⇒ b}
→ (f ∘ g) ∘ h ≈ f ∘ (g ∘ h)
assoc = C.assoc , D.assoc
Total : Category (lo ⊔ lo′) (la ⊔ la′) (l≈ ⊔ l≈′)
Total = record
{ Obj = Obj
; _⇒_ = _⇒_
; _≈_ = _≈_
; id = id
; _∘_ = _∘_
; equiv = equiv
; ∘-resp = ∘-resp
; id-r = id-r
; id-l = id-l
; assoc = assoc
}
open BuildTotal public using (Total)
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/a55b14a.ada | best08618/asylo | 7 | 8947 | <reponame>best08618/asylo<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/a55b14a.ada<gh_stars>1-10
-- A55B14A.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.
--*
-- USING A CASE_STATEMENT , CHECK THAT THE SUBTYPE BOUNDS ASSOCIATED
-- WITH A LOOP OF THE FORM
-- FOR I IN ST LOOP
-- ARE, RESPECTIVELY, ST'FIRST..ST'LAST WHEN ST IS STATIC.
-- RM 04/07/81
-- SPS 3/2/83
-- JBG 3/14/83
WITH REPORT;
PROCEDURE A55B14A IS
USE REPORT;
USE ASCII ;
TYPE ENUMERATION IS ( A,B,C,D,MIDPOINT,E,F,G,H );
SUBTYPE ST_I IS INTEGER RANGE 1..5 ;
TYPE NEW_ST_I IS NEW INTEGER RANGE 1..5 ;
SUBTYPE ST_E IS ENUMERATION RANGE B..G ;
SUBTYPE ST_B IS BOOLEAN RANGE FALSE..FALSE;
SUBTYPE ST_C IS CHARACTER RANGE 'A'..DEL ;
BEGIN
TEST("A55B14A" , "CHECK THAT THE SUBTYPE OF A LOOP PARAMETER" &
" IN A LOOP OF THE FORM 'FOR I IN ST LOOP'" &
" ARE CORRECTLY DETERMINED WHEN ST IS STATIC" );
BEGIN
FOR I IN ST_I LOOP
CASE I IS
WHEN 1 | 3 | 5 => NULL;
WHEN 2 | 4 => NULL;
END CASE;
END LOOP;
FOR I IN NEW_ST_I LOOP
CASE I IS
WHEN 1 | 3 | 5 => NULL;
WHEN 2 | 4 => NULL;
END CASE;
END LOOP;
FOR I IN ST_B LOOP
CASE I IS
WHEN FALSE => NULL;
END CASE;
END LOOP;
FOR I IN ST_C LOOP
CASE I IS
WHEN 'A'..'U' => NULL;
WHEN 'V'..DEL => NULL;
END CASE;
END LOOP;
FOR I IN ST_E LOOP
CASE I IS
WHEN B..D => NULL;
WHEN E..G => NULL;
WHEN MIDPOINT => NULL;
END CASE;
END LOOP;
END;
RESULT;
END A55B14A;
|
alloy4fun_models/trashltl/models/12/CF775bN4q9xe3HisD.als | Kaixi26/org.alloytools.alloy | 0 | 1654 | <gh_stars>0
open main
pred idCF775bN4q9xe3HisD_prop13 {
always all f : File | always (f in Trash) implies once f in Trash
}
pred __repair { idCF775bN4q9xe3HisD_prop13 }
check __repair { idCF775bN4q9xe3HisD_prop13 <=> prop13o } |
ga_lib/src/ga_utilities.ads | rogermc2/GA_Ada | 3 | 6908 |
with Interfaces;
with GL.Types;
with Blade;
with Blade_Types;
with E3GA;
with GA_Maths;
with Metric;
with Multivectors;
with Multivector_Type;
package GA_Utilities is
use GA_Maths.Float_Array_Package;
function Multivector_Size (MV : Multivectors.Multivector) return Integer;
procedure Print_Bitmap (Name : String; Bitmap : Interfaces.Unsigned_32);
procedure Print_Blade (Name : String; B : Blade.Basis_Blade);
procedure Print_Blade_List (Name : String; BL : Blade.Blade_List);
procedure Print_Blade_String (Name : String; B : Blade.Basis_Blade;
MV_Names : Blade_Types.Basis_Vector_Names);
procedure Print_Blade_String_Array (Name : String;
BB_Array : Blade.Basis_Blade_Array;
MV_Names : Blade_Types.Basis_Vector_Names);
procedure Print_E3_Vector (Name : String; aVector : E3GA.E3_Vector);
procedure Print_E3_Vector_Array (Name : String;
anArray : GL.Types.Singles.Vector3_Array);
procedure Print_Float_3D (Name : String; aVector : GA_Maths.Float_3D);
procedure Print_Float_Array (Name : String; anArray : GA_Maths.Float_Vector);
procedure Print_Integer_Array (Name : String; anArray : GA_Maths.Integer_Array);
procedure Print_Matrix (Name : String; aMatrix : GA_Maths.GA_Matrix3);
procedure Print_Matrix (Name : String; aMatrix : Real_Matrix);
procedure Print_Matrix (Name : String; aMatrix : Real_Matrix;
Start, Last : GA_Maths.Array_I2);
procedure Print_Metric (Name : String; aMetric : Metric.Metric_Record);
procedure Print_Multivector (Name : String; MV : Multivectors.Multivector);
procedure Print_Multivector_Info (Name : String;
Info : Multivector_Type.MV_Type_Record);
procedure Print_Multivector_List (Name : String;
MV_List : Multivectors.Multivector_List);
procedure Print_Multivector_List_String
(Name : String; MV_List : Multivectors.Multivector_List;
MV_Names : Blade_Types.Basis_Vector_Names);
procedure Print_Multivector_String (Name : String; MV : Multivectors.Multivector;
MV_Names : Blade_Types.Basis_Vector_Names);
procedure Print_Vertex (Name : String; Vertex : Multivectors.M_Vector);
end GA_Utilities;
|
programs/oeis/070/A070549.asm | jmorken/loda | 1 | 101881 | <gh_stars>1-10
; A070549: a(n) = Card(k 0<k<=n such that mu(k)=-1).
; 0,1,2,2,3,3,4,4,4,4,5,5,6,6,6,6,7,7,8,8,8,8,9,9,9,9,9,9,10,11,12,12,12,12,12,12,13,13,13,13,14,15,16,16,16,16,17,17,17,17,17,17,18,18,18,18,18,18,19,19,20,20,20,20,20,21,22,22,22,23,24,24,25,25,25,25,25,26,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,29,29,29,30,30,30,30,31,32,33,33,34,34,35,35,36,37,37,37,38,39,39,39,39,39,39,39,39,39,39,39,39,39,40,40,40,41,42,42,42,42,42,42,43,44,45,45,45,45,45,45,45,45,45,45,46,46,47,47,47,48,48,48,49,49,49,49,49,49,50,50,51,51,52,52,52,53,53,53,54,55,55,55,55,55,56,56,57,58,58,58,58,59,59,59,59,60,61,61,62,62,63,63,64,64,65,65,65,65,65,65,65,65,65,65,65,65,66,66,66,66,66,66,66,66,66,66,66,67,68,68,68,68,69,69,70,71,72,72,73,73,73,73,73,74,75,75,76,76,76,76,76,77,77,77,77,77
mov $2,$0
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
cal $0,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0.
mov $3,$0
bin $3,2
add $1,$3
lpe
|
Part-2 Submission/CODE-2.asm | asad-n/CSE331L_Section_7_Summer20_NSU_Midterm_1 | 0 | 29567 | .MODEL SMALL
.STACK 64
.DATA
STRING DB ?
SYM DB '$'
INPUT_M DB 0ah,0dh,0AH,0DH,'Enter a string: ',0DH,0AH,'$'
OUTPUT_M DB 0ah,0dh,0AH,0DH,'The string is: ',0DH,0AH,'$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV DX,OFFSET INPUT_M
MOV AH,09
INT 21H
LEA SI,STRING
INPUT:
MOV AH,01
INT 21H
MOV [SI],AL
INC SI
CMP AL,0DH
JNZ INPUT
MOV [SI],'$'
OUTPUT:
MOV AX,@STRING
MOV DS,AX
MOV DX,OFFSET STRING
MOV AH,09H
INT21H
MOV AX,@STRING
MOV DS,AX
MOV DX,OFFSET STRING
MOV AH,09H
INT21H
MOV AH,4CH
INT 21H
|
mac/get_foregroundapp_info.scpt | albertz/foreground_app_info | 2 | 2503 | <reponame>albertz/foreground_app_info
global frontApp, frontAppName, windowTitle
set windowTitle to ""
tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to short name of frontApp
try
tell process frontAppName
tell (1st window whose value of attribute "AXMain" is true)
set windowTitle to value of attribute "AXTitle"
end tell
end tell
end try
end tell
return {frontAppName, windowTitle}
|
programs/oeis/092/A092517.asm | karttu/loda | 1 | 163552 | <reponame>karttu/loda<gh_stars>1-10
; A092517: Product of tau-values for consecutive integers.
; 2,4,6,6,8,8,8,12,12,8,12,12,8,16,20,10,12,12,12,24,16,8,16,24,12,16,24,12,16,16,12,24,16,16,36,18,8,16,32,16,16,16,12,36,24,8,20,30,18,24,24,12,16,32,32,32,16,8,24,24,8,24,42,28,32,16,12,24,32,16,24,24,8,24,36,24,32,16,20,50,20,8,24,48,16,16,32,16,24,48,24,24,16,16,48,24,12,36,54,18,16,16,16,64,32,8,24,24,16,32,40,20,16,32,24,36,24,16,64,48,12,16,24,24,48,24,16,32,32,16,24,48,16,32,64,16,16,16,24,48,16,16,60,60,16,24,36,12,24,24,16,48,48,32,48,24,8,16,48,48,40,20,12,48,32,8,32,48,24,48,36,12,16,48,60,40,16,8,36,36,16,32,32,32,32,32,24,48,64,16,28,28,8,32,72,18,24,24,24,48,16,16,48,48,16,24,60,40,64,32,12,24,16,16,64,64,16,16,48,48,32,16,24,108,36,8,24,24,16,64,64,16,24,48,24,24,32,16,40,40,12,36,36,36,48,32,32,32,32,16
mov $2,1
add $2,$0
pow $2,2
add $0,$2
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
mov $1,$0
|
multiloops.asm | rudla/multiloops | 0 | 88743 | ; Multi Loops
;
; (c) 2017 <NAME>
DMA_MISSILES = 1
DMA_PLAYERS = 2
_SYS_PRINT_SIGNED = 0
SCR_WIDTH = 40
SCR_HEIGHT = 25
STATUS_LINE = 26
OWNERHIP_TOP_LINE = 27
OWNERSHIP_BASE = 64
BOARD_WIDTH = 40
BOARD_HEIGHT = 25
PAPER_COLOR = 10
CURSOR0_COLOR = $1c
CURSOR4_COLOR = $0F
STATUS_PAPER_COLOR = 8
timer = $14
b1 = 128
b2 = b1+1
b3 = b2+1
w1 = b3+1
aux = w1+2
aux2 = aux+1
aux3 = aux2+1
var = aux3+1
scr = var + 8
;Board state (position, size, number of loose ends)
board_size = scr+2 ;0-n
loose = board_size + 1 ;number of loose ends
board_w = loose+2
board_h = board_w+1
board_max_x = board_h+1
board_max_y = board_max_x+1
board_x = board_max_y+1
board_y = board_x+1
cursor_no = board_y+1
joy_cfg = cursor_no+1 ;0 = normal joysticks, 1 = multijoy
gfx_mode = joy_cfg+1
;clock
TICKS_PER_SECOND = 50
clock = gfx_mode + 1
seconds = clock+1
minutes = seconds+1
hours = minutes+1
music_on = hours + 1
rmt_vars = 255-20 ;hours+1
;:20 .byte ;There must be 20 bytes of zero page variables for RMT
;Direction flags
f_up = 1
f_right = 2
f_down = 4
f_left = 8
icl "atari.hea"
icl 'macros/init_nmi.mac'
org $2000
mva #0 music_on
ldx #<MODUL ;low byte of RMT module to X reg
ldy #>MODUL ;hi byte of RMT module to Y reg
jsr RASTERMUSICTRACKER ;Init
; inc music_on
mva #0 DMACTL
init_nmi $14, nmi , $c0
mwa #DLIST DLPTR
mva #%00111110 DMACTL ;playfield_width_40+missile_dma+player_dma+pm_resolution_1+dl_dma
mva #1 joy_cfg
mva #0 board_size
; jmp START
INTRO
mva #0 music_on
ldx #<MODUL ;low byte of RMT module to X reg
ldy #>MODUL ;hi byte of RMT module to Y reg
jsr RASTERMUSICTRACKER ;Init
inc music_on
jsr SetColors
ldx #BOARD_SIZE_MAX
jsr InitBoardSize ;this actually sets the biggest board size (full screen)
jsr ScrInit
jsr InputInit
jsr PmgInit
jsr ScrClear
jsr GenerateBoard
lda #<LoopsText
ldy #>LoopsText
jsr DrawText
jsr DrawConfig
@ jsr WaitForKey
cmp #KEY_SELECT ;%101 ;KEY_SELECT
bne no_joy_sel
lda joy_cfg
eor #1
sta joy_cfg
jsr DrawConfig
jsr WaitForKeyRelease
jmp @-
no_joy_sel
cmp #KEY_START ;%110 ;KEY_START
bne @-
START
jsr ScrInit
jsr InputInit
jsr PmgInit
jsr ScrClear
ldx board_size
jsr InitBoardSize
jsr GenerateBoard
jsr WaitForKeyRelease
jsr ShuffleBoard
; jsr ShuffleTile
jsr InitCursors
;Initilaize clock
jsr ClockReset
jsr ClockWrite
GAME_LOOP
lda timer
@ cmp timer
beq @-
ret
jsr GetKeyPressed
cmp #KEY_START
bne no_start
jmp START
no_start
cmp #KEY_SELECT
bne no_select
jsr NextBoardSize
jmp START
no_select
cmp #KEY_HELP
bne no_help
jsr HiliteLooseEnds
jsr WaitForKeyRelease
jsr HiliteLooseEnds
no_help
cmp #KEY_OPTION
bne no_option
jsr ShowOwnership
jsr ShowCursors
jmp no_music_key
no_option
cmp #'M'
bne no_music_key
jsr WaitForKeyRelease
lda #1
eor music_on
sta music_on
jsr RASTERMUSICTRACKER+9 ;turn off all sounds
no_music_key
lda clock
seq
jsr ClockWrite
jsr ReadJoysticks
ldx #0
@ stx cursor_no
jsr PlayerMove
ldx cursor_no
inx
cpx #CURSOR_COUNT
bne @-
jsr WriteLoose
lda loose
ora loose+1
beq VICTORY
jmp GAME_LOOP
ShowOwnership .PROC
mwa #ownership DL_SCR_ADR
mva #%10110001 gfx_mode ;switch mode to 9 color display and modify some color registers to propertly show the color map
mva #PAPER_COLOR colpm0
mva #CURSOR0_COLOR colpf0
jsr HideCursors
jsr WaitForKeyRelease
lda #1
jsr Pause
mwa #SCREEN_BUF DL_SCR_ADR
jmp SetColors
.ENDP
VictoryText
dta b(W_M, 0, STATUS_LINE)
; dta b(W_RECTANGLE, 20, 6)
; dta b(W_M, 4, 3)
dta b(W_TEXT, 12, 'You have won')
dta b(W_END)
VICTORY
lda #<VictoryText
ldy #>VictoryText
jsr DrawText
jsr HideCursors
wait_for_start
sta wsync
lda vcount
adc timer
sta colbak
jsr GetKeyPressed
beq wait_for_start
cmp #KEY_OPTION
bne no_option2
jsr ShowOwnership
jmp wait_for_start
no_option2
jmp INTRO
DrawText .PROC
sta w1
sty w1+1
lda #0
sta cursor_x
sta cursor_y
mva #0 b2 ;repeat
step
ldx #0
jsr CursorHide
lda cursor_x
sbc #1
ldy cursor_y
dey
jsr ScreenAdr
jsr read_byte
cmp #W_END
beq done
cmp #W_M
bne no_move
jsr read_byte
add cursor_x
sta cursor_x
jsr read_byte
add cursor_y
sta cursor_y
jmp cursor_show
no_move
cmp #W_TEXT
bne no_text
lda cursor_x
ldy cursor_y
jsr ScreenAdr
jsr read_byte
sta b1
@ jsr read_byte
jsr PrintChar
dec b1
bne @-
jmp cursor_show
no_text
cmp #W_RECTANGLE
beq rect
tax
ldy #BOARD_WIDTH+1
lda (scr),y
ora DIR_BIT,x
sta (scr),y
ldy D_OFFSET,x
lda (scr),y
ora OPPOSITE_DIR,x
sta (scr),y
lda cursor_x
add x_offset,x
sta cursor_x
lda cursor_y
add y_offset,x
sta cursor_y
cursor_show
ldx #0
jsr CursorShow
jsr GetKeyPressed
bne @+
lda #2
jsr Pause
@ jmp step
done
rts
read_2bytes
jsr read_byte
tax
read_byte
ldy #0
lda (w1),y
inc w1
sne
inc w1+1
rts
rect
mva cursor_x b1
mva cursor_y b2
jsr read_2bytes
stx aux
sta aux2
jsr Rectangle
jmp step
.ENDP
Pause .PROC
;Purpose:
; Wait specified number of ticks.
;Input:
; a Number of ticks to wait
add timer
@ cmp timer
bne @-
rts
.ENDP
X_OFFSET
dta b(0,1,0,-1)
Y_OFFSET
dta b(-1,0,1,0)
D_OFFSET
dta b(1, BOARD_WIDTH+2, 2*BOARD_WIDTH+1, BOARD_WIDTH)
DIR_BIT
dta b(f_up, f_right, f_down, f_left)
OPPOSITE_DIR
dta b(f_down, f_left, f_up, f_right)
U = 0
R = 1
D = 2
L = 3
W_M = 4 ;move x_off, y_off
W_END = 5
W_TEXT = 6
W_RECTANGLE = 7
LoopsText
dta b(W_M, 3, 3)
dta b(W_RECTANGLE, 20, 11)
dta b(W_M, 4, 2)
dta b(D,D,D,D,D,R,R,R,R)
dta b(W_M, -1, -3)
dta b(L,L,D,D,R,R,U,U,R)
dta b(R,R,L,L,D,D,R,R,U,U,R)
dta b(D,D,D,D,W_M,0,-4,R,R,D,D,L,L)
dta b(R,R,R,R,R,U,L,L,U,R,R,R)
dta b(W_M, -11, -2)
dta b(W_TEXT, 5, 'multi')
dta b(W_M, -3, 8)
dta b(W_TEXT, 16, 'code Rudla Kudla')
dta b(W_M, 0, 1)
dta b(W_TEXT, 11, 'music R0ger')
dta b(W_END)
PlayerMove .PROC
;In:
; x cursor number
lda button_state,x
cmp prev_button_state,x
beq no_button
sta prev_button_state,x
cmp #0
beq no_button
lda cursor_status,x
jeq show_cursor
mva #CURSOR_TIMEOUT cursor_status,x
lda cursor_y,x
tay
lda cursor_x,x
jsr RotateTile
;record owhership of the tile
ldx cursor_no
lda #OWNERHIP_TOP_LINE
add cursor_y,x
tay
lda cursor_x,x
jsr TileAdr
ldy #0
;If this is first rotation of this tile, remeber original owner and tile
lda cursor_orig_tile,x
bpl no_first_rot
mva b2 cursor_orig_tile,x
mva (scr),y cursor_orig_owner,x
no_first_rot
lda b3
cmp cursor_orig_tile,x
bne not_same
lda cursor_orig_owner,x
jmp set_ownership
not_same
lda cursor_no
add #OWNERSHIP_BASE
set_ownership
sta (scr),y
rts
;----
no_button
lda joy_state,x
cmp prev_joy_state,x
beq no_move
sta prev_joy_state,x
lda cursor_status,x ;if cursor is hidden, first show it (without any aother action)
beq done
jsr CursorHide
lda joy_state,x
cmp #JOY_LEFT
bne no_left
lda cursor_x,x
beq done
dec cursor_x,x
bpl done
no_left
cmp #JOY_RIGHT
bne no_right
lda cursor_x,x
cmp board_max_x
beq done
inc cursor_x,x
bpl done
no_right
cmp #JOY_UP
bne no_up
lda cursor_y,x
beq done
dec cursor_y,x
bpl done
no_up
cmp #JOY_DOWN
bne no_down
lda cursor_y,x
cmp board_max_y
beq done
inc cursor_y,x
bpl done
no_down
done
mva #-1 cursor_orig_tile,x
;mva joy_state,x prev_joy_state,x
show_cursor
mva #CURSOR_TIMEOUT cursor_status,x
jsr CursorShow
rts
no_move
lda timer
and #%00001111
bne no_time
lda cursor_status,x
beq no_time
dec cursor_status,x
sne
jsr CursorHide
no_time rts
.ENDP
WriteLoose .PROC
mwa loose var
ldy #2
jsr BinToBCD
mwa #STATUS_BAR scr
lda #4
ldx #' '
jsr PrintHex
rts
.ENDP
Rectangle .PROC
;Purpose:
; Draw rectangle on board, connecting it outside with the maze.
;Input:
; b1 - x
; b2 - y
; aux - width
; aux2 - heigh
ldx #0
jsr line
@ ldx #1
jsr line
dec aux2
bne @-
ldx #2
;----- draw one line
line
lda b1
ldy b2
jsr ScreenAdr
ldy #0
lda (scr),y
and l_and,x
ora l_or,x
sta (scr),y
iny
@ lda (scr),y
and m_and,x
ora m_or,x
sta (scr),y
iny
cpy aux
bne @-
lda (scr),y
and r_and,x
ora r_or,x
sta (scr),y
inc b2
rts
;top, normal, bottom
l_or dta b(f_right+f_down, f_up+f_down, f_right+f_up)
l_and dta b($ff , $ff-f_right, $ff)
m_or dta b(f_left+f_right, 0 , f_left+f_right)
m_and dta b($ff-f_down, 0 , $ff-f_up)
r_or dta b(f_left+f_down, f_up+f_down, f_left+f_up)
r_and dta b($ff, $ff-f_left, $ff)
.ENDP
ConfigText
dta b(W_M, 10, 16)
dta b(W_RECTANGLE, 22, 4)
dta b(W_M, 1, 1)
dta b(W_TEXT, 20, 'Joysticks: Standard')
dta b(W_M, 12, 1)
dta b(W_TEXT, 8, 'Multijoy')
dta b(W_END)
DrawConfig .PROC
lda #<ConfigText
ldy #>ConfigText
jsr DrawText
ldx #1
jsr CursorHide
lda #17
clc
adc joy_cfg
sta cursor_y+1
lda #22
sta cursor_x+1
ldx #1
jsr CursorShow
; jsr ScreenAdr
; lda #'*'
; ldy #0
; sta (scr),y
rts
.ENDP
ScrInit .PROC
mva #>FONT CHBASE
; lda #DL_CHR_HIRES
; jmp InitDL
rts
.ENDP
icl 'draw.asm'
icl 'pmg.asm'
icl 'input.asm'
icl 'keyboard.asm'
icl 'print.asm'
icl 'clock.asm'
icl 'board.asm'
icl 'cursors.asm'
.PROC nmi
bit NMIST ; if this is VBI, jump to VBI code
bmi dli
vbl
pha
txa
pha
tya
pha
mva #PAPER_COLOR colpf2
mva gfx_mode GTICTL
inc timer
jsr ClockTick
lda music_on
beq no_music
jsr RASTERMUSICTRACKER+3
no_music
pla
tay
pla
tax
pla
rti
dli
pha
mva #%00110001 GTICTL
mva #STATUS_PAPER_COLOR colpf2
pla
rti
;trig_num .byte %00010000, %00000000
.ENDP
RomOff .PROC
.ENDP
RomOn .PROC
.ENDP
RomSwitchVars .PROC
;Purpose:
; Exchange data between first 128 bytes of ZP (Variables used by ROM) and buffer.
;
ldx #0
@ lda 0,x
ldy zp_vars_backup,x
sta zp_vars_backup,x
tya
sta 0,x
inx
bpl @-
rts
.ENDP
SetColors .PROC
mva #%00110001 gfx_mode
sta GTICTL
mva #0 colpf1
mva #PAPER_COLOR colpf2
mva #PAPER_COLOR colbak
ldx #3
@ lda cursor_color,x
sta colpm0,x
mva #0 sizep0,x
dex
bpl @-
mva cursor_color+4 colpf3
rts
.ENDP
cursor_color
dta b(CURSOR0_COLOR, $b6, $47, $77, CURSOR4_COLOR)
DLIST
dta b(DL_BLANK8,DL_BLANK8,DL_BLANK4)
dta b(DL_CHR_HIRES+DL_LMS)
DL_SCR_ADR
dta a(SCREEN_BUF)
:23 dta b(DL_CHR_HIRES)
dta b(DL_BLANK1+DL_DLI)
dta b(DL_CHR_HIRES+DL_LMS) ;status bar
dta a(STATUS_BAR)
dta b(DL_END)
dta a(DLIST)
.align 1024
FONT
ins 'block.fnt'
org FONT+8
; L D R U
;0 0 0 0 0
ins 'gfx/cu.bin' ;1 0 0 0 1 up
ins 'gfx/cr.bin' ;2 0 0 1 0 right
ins 'gfx/au.bin' ;3 0 0 1 1 up+right
ins 'gfx/cd.bin' ;4 0 1 0 0 down
ins 'gfx/vert.bin' ;5 0 1 0 1 down+up
ins 'gfx/ar.bin' ;6 0 1 1 0 down+right
ins 'gfx/tr.bin' ;7 0 1 1 1 down+up+right
ins 'gfx/cl.bin' ;8 1 0 0 0 left
ins 'gfx/al.bin' ;9 1 0 0 1 left+up
ins 'gfx/horiz.bin' ;10 1 0 1 0 left+right
ins 'gfx/tu.bin' ;11 1 0 1 1 left+up+right
ins 'gfx/ad.bin' ;12 1 1 0 0 down+left
ins 'gfx/tl.bin' ;13 1 1 0 1 up+down+left
ins 'gfx/td.bin' ;14 1 1 1 0 right+down+left
ins 'gfx/g.bin' ;15 1 1 1 1 all
org FONT+OWNERSHIP_BASE*8
:8 dta b(%01000100) ;cursor 0
:8 dta b(%00010001) ;cursor 1
:8 dta b(%00100010) ;cursor 2
:8 dta b(%00110011) ;cursor 3
:8 dta b(%01110111) ;cursor 4 colpf3
org FONT+1024
MODUL
ins 'multiloops_stripped.rmt'
FEAT_RELOC = 1
STEREOMODE = 1
icl 'rmt.asm'
.align 4096
PMG_BUF .ds 2048
EMPTY_TOP
.ds SCR_WIDTH
SCREEN_BUF
.ds SCR_WIDTH * SCR_HEIGHT
SCREEN_BUF_END
.ds SCR_WIDTH
STATUS_BAR .ds SCR_WIDTH
ownership .ds SCR_WIDTH * SCR_HEIGHT ;1-8 is number of a player that owns this tile
;Backup of zero page variables.
;This will be initialized when switching the OS off.
;
zp_vars_backup .ds 128
cursor_x .ds CURSOR_COUNT
cursor_y .ds CURSOR_COUNT
cursor_status .ds CURSOR_COUNT ;when not zero, this value decrements every second
cursor_orig_tile .ds CURSOR_COUNT
cursor_orig_owner .ds CURSOR_COUNT ; 0 means uninitialized
joy_state .ds CURSOR_COUNT
prev_joy_state .ds CURSOR_COUNT
button_state .ds CURSOR_COUNT
prev_button_state .ds CURSOR_COUNT
board .ds (BOARD_WIDTH+1)*(BOARD_HEIGHT+2)
done_board .ds (BOARD_WIDTH+1)*(BOARD_HEIGHT+2)
buf .ds 128
|
script.asm | LOuroboros/wonder-trade | 1 | 11786 | <reponame>LOuroboros/wonder-trade<filename>script.asm
.include "pokescript.s"
.loadtable "character-encoding.tbl"
@@main:
lock
faceplayer
checkflag 0x200
gotoif 0x1, @@tothepoint
msgbox @@introduction, 0x5
compare LASTRESULT, 0x1
callif 0x1, @@explaining
msgbox @@wanttostart, 0x5
// if they don't want to WT, bail
compare LASTRESULT, 0x1
gotoif 0x0, @@earlyend
msgbox @@choosepokemon, 0x6
// opens party menu for selecting
special 0x9F
waitstate
// if they pressed B to cancel, bail
compare 0x8004, 0x6
gotoif 0x4, @@earlyend
// if the chosen Pokémon is an egg, bail
special2 LASTRESULT, 0x147
compare LASTRESULT, 0x19C
gotoif 0x1, @@choseegg
msgbox @@partnersearch, 0x6
// load the Pokemon to be traded to the player
callasm (gen_random_pokemon |1)
// special 0xFE needs the player's Pokemon to be on 0x8005
copyvar 0x8005, 0x8004
// actually do the trade animation
special 0xFE
waitstate
@@tothepoint:
msgbox @@wanttostart, 0x5
compare LASTRESULT, 0x1
gotoif 0x0, @@earlyend
msgbox @@choosepokemon, 0x6
special 0x9F
waitstate
compare 0x8004, 0x6
gotoif 0x4, @@earlyend
special2 LASTRESULT, 0x147
compare LASTRESULT, 0x19C
gotoif 0x1, @@choseegg
msgbox @@partnersearch, 0x6
callasm (gen_random_pokemon |1)
copyvar 0x8005, 0x8004
special 0xFE
waitstate
@@earlyend:
msgbox @@comebacksoon, 0x6
release
end
@@choseegg:
msgbox @@noeggsallowed, 0x6
goto @@earlyend
@@explaining:
msgbox @@explanation, 0x6
setflag 0x200
return
@@introduction:
.string "Hello, [player]!\nI am the Wonder Bush!\lI can allow you to WONDER TRADE\lwith my wonderfully magic powers!\p... What? You don't know about the\nmagnificent process known\las WONDER TRADE? Oh dear...\pDo you want to read an explanation\nabout WONDER TRADE?"
@@explanation:
.string "It is pretty simple.\nWONDER TRADE is a process where you\lcan offer any pokémon in order to\lreceive an entirely different one!\l... or the exact same one."
@@wanttostart:
.string "Would you like to start a\nWONDER TRADE?"
@@comebacksoon:
.string "Please come back anytime."
@@choosepokemon:
.string "Please select the POKéMON you\nwant to trade."
@@noeggsallowed:
.string "I'm sorry, but EGGs cannot be\ntraded."
@@partnersearch:
.string "Searching for a trade partner...\nPlease wait.\pA trade partner has been found!\nThe trade will now commence." |
programs/oeis/337/A337640.asm | neoneye/loda | 22 | 177922 | ; A337640: a(n) = one-half of the number of cells in the central rectangle of the graph described in row 2n+1 of A333288.
; 2,11,35,80,155,266,422,626,890,1223,1625,2108,2678,3341,4109,4988,5990,7106,8348,9734,11264,12953,14801,16820,19019,21389,23957,26717,29663,32834,36230,39860,43712,47795,52139,56726,61598,66746,72152,77837
add $0,1
mov $2,$0
mul $0,-2
mul $2,2
div $0,$2
add $0,$2
seq $0,103116 ; a(n) = A005598(n) - 1.
div $0,2
mul $0,3
add $0,2
|
applescripts/radium.scpt | bryantebeek/dotfiles | 0 | 1091 | if application "Radium" is running then
tell application "Radium"
set theName to track name
set theStation to station name
set isPlaying to playing
try
if isPlaying then
return "♫ " & theName & "#[fg=colour241] on #[fg=colour14]" & theStation & " "
end if
on error err
end try
end tell
end if
|
src/si_units.ads | HeisenbugLtd/si_units | 6 | 12451 | --------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
with Ada.Characters.Handling;
with Ada.Strings.UTF_Encoding;
private with Ada.Characters.Latin_1;
private with Ada.Strings.Fixed;
package SI_Units with
Preelaborate => True
is
No_Unit : constant Ada.Strings.UTF_Encoding.UTF_8_String;
-- Designated value for "no unit name", i.e. the empty string.
--
-- Normally, when this package and its children are used, we would expect a
-- non-empty string for any unit (hence the type predicate below), but we
-- allow the empty string as a special exception.
subtype Unit_Name is Ada.Strings.UTF_Encoding.UTF_8_String with
Dynamic_Predicate =>
(Unit_Name = No_Unit or else
(Unit_Name'Length > 0 and then
(for all C of Unit_Name (Unit_Name'First .. Unit_Name'First) =>
-- FIXME: UTF-8 encoding scheme *may* result in what Latin_1
-- considers "Control" characters
-- FIXME: UTF-8 encoding has additional WS characters
not Ada.Characters.Handling.Is_Control (C) and
not Ada.Characters.Handling.Is_Space (C))));
-- Restrict the possibility of a unit name: A unit name can be empty (see
-- No_Unit), but if it isn't, it shall not start with something weird like
-- control characters (which includes tabs), or whitespace. It could start
-- with digits and other weird stuff, though.
private
Degree_Sign : String := Character'Val (16#C2#) & Character'Val (16#B0#);
No_Break_Space : String := Character'Val (16#C2#) & Character'Val (16#A0#);
Micro_Sign : String := Character'Val (16#C2#) & Character'Val (16#B5#);
Minus_Sign : Character renames Ada.Characters.Latin_1.Minus_Sign;
Plus_Sign : Character renames Ada.Characters.Latin_1.Plus_Sign;
No_Unit : constant String := "";
function Trim
(Source : in String;
Side : in Ada.Strings.Trim_End := Ada.Strings.Left) return String
renames Ada.Strings.Fixed.Trim;
end SI_Units;
|
programs/oeis/181/A181763.asm | neoneye/loda | 22 | 245819 | <reponame>neoneye/loda
; A181763: a(n) = A061037(n)^2.
; 0,25,9,441,4,2025,225,5929,36,13689,1225,27225,144,48841,3969,81225,400,127449,9801,190969,900,275625,20449,385641,1764,525625,38025,700569,3136,915849,65025,1177225,5184,1490841,104329,1863225,8100,2301289,159201,2812329,12100,3404025,233289,4084441,17424,4862025,330625,5745609,24336,6744409,455625,7868025,33124,9126441,613089,10530025,44100,12089529,808201,13816089,57600,15721225,1046529,17816841,73984,20115225,1334025,22629049,93636,25371369,1677025,28355625,116964,31595641,2082249,35105625,144400,38900169,2556801,42994249,176400,47403225,3108169,52142841,213444,57229225,3744225,62678889,256036,68508729,4473225,74736025,304704,81378441,5303809,88454025,360000,95981209,6245001,103978809
seq $0,61037 ; Numerator of 1/4 - 1/n^2.
pow $0,2
|
alloy4fun_models/trainstlt/models/8/6einwgA9fcsA6BXdS.als | Kaixi26/org.alloytools.alloy | 0 | 1968 | open main
pred id6einwgA9fcsA6BXdS_prop9 {
always (all t:Train| once(no t.pos => after one t.pos:>Entry) )
}
pred __repair { id6einwgA9fcsA6BXdS_prop9 }
check __repair { id6einwgA9fcsA6BXdS_prop9 <=> prop9o } |
data/baseStats/kadabra.asm | etdv-thevoid/pokemon-rgb-enhanced | 1 | 95334 | <gh_stars>1-10
db KADABRA ; pokedex id
db 40 ; base hp
db 35 ; base attack
db 30 ; base defense
db 105 ; base speed
db 120 ; base special
db PSYCHIC ; species type 1
db PSYCHIC ; species type 2
db 100 ; catch rate
db 145 ; base exp yield
INCBIN "pic/gsmon/kadabra.pic",0,1 ; 66, sprite dimensions
dw KadabraPicFront
dw KadabraPicBack
; attacks known at lvl 0
db KINESIS
db CONFUSION
db 0
db 0
db 3 ; growth rate
; learnset
tmlearn 1,5,6,8
tmlearn 9,10
tmlearn 17,18,19,20
tmlearn 29,30,31,32
tmlearn 33,34,35
tmlearn 41,44,45,46
tmlearn 49,50,55
db BANK(KadabraPicFront)
|
app/src/main.adb | jwarwick/starterkit-ada | 0 | 116 | <gh_stars>0
with Text_IO;
with Ada.Command_Line;
with AWS.Client;
with AWS.Headers;
with AWS.Response;
with AWS.Messages;
use AWS.Messages;
procedure main is
hdrs : AWS.Headers.List := AWS.Headers.Empty_List;
server_url : constant String := Ada.Command_Line.Argument(1);
player_key : constant String := Ada.Command_Line.Argument(2);
result : AWS.Response.Data;
status : AWS.Messages.Status_Code;
begin
Text_IO.Put_Line("ServerURL: " & server_url & ", PlayerKey: " & player_key);
AWS.Headers.Add(hdrs, "Content-Type", "text/plain");
result := AWS.Client.Post(URL => server_url, Data => player_key, Headers => hdrs);
status := AWS.Response.Status_Code(result);
if status = AWS.Messages.S200 then
Text_IO.Put_Line("Server response: " & AWS.Response.Message_Body(result));
else
Text_IO.Put_Line("Unexpected server response:");
Text_IO.Put_Line("HTTP code: " & AWS.Messages.Image(status) & " (" & AWS.Messages.Reason_Phrase(status) & ")");
Text_IO.Put_Line("Response body: " & AWS.Response.Message_Body(result));
Ada.Command_Line.Set_Exit_Status(2);
end if;
end main;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.