max_stars_repo_path
stringlengths 4
261
| max_stars_repo_name
stringlengths 6
106
| max_stars_count
int64 0
38.8k
| id
stringlengths 1
6
| text
stringlengths 7
1.05M
|
---|---|---|---|---|
oeis/218/A218690.asm | neoneye/loda-programs | 11 | 178850 | ; A218690: Sum_{k=0..n} C(n,k)^4*C(n+k,k)^2.
; Submitted by <NAME>
; 1,5,181,9797,616501,45778505,3678753205,314352091205,28154344881205,2612340741982505,249415797821914681,24374175871569953225,2428502737999745059381,245952659136011117909897,25260608441078125508484181,2626023605592369669830217797,275901067896276743165711178805,29259237866228284372614269647817,3128772189716949287851547042204569,337058009970382064705974557423512297,36553685730321070179449438161655619001,3988192256572354742804995648463425483805,437522108343571261975184462101347915628921
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,2
mov $2,$3
bin $2,$0
pow $2,4
mul $1,$2
add $4,$1
lpe
mov $0,$4
add $0,1
|
examples/outdated-and-incorrect/tactics/bool/Bool.agda | cruhland/agda | 1,989 | 16928 |
module Bool where
data Bool : Set where
false : Bool
true : Bool
data IsTrue : Bool -> Set where
isTrue : IsTrue true
open import Vec
open import All
allEnvs : {n : Nat} -> List (Vec Bool n)
allEnvs {zero } = Ξ΅ :: []
allEnvs {suc n} = map (_βΊ_ false) allEnvs ++ map (_βΊ_ true) allEnvs
β++left : {A : Set}{x : A}{xs ys : List A} -> x β xs -> x β (xs ++ ys)
β++left (hd p) = hd p
β++left (tl q) = tl (β++left q)
β++right : {A : Set}{x : A}{xs ys : List A} -> x β ys -> x β (xs ++ ys)
β++right {xs = []} p = p
β++right {xs = x :: xs} p = tl (β++right {xs = xs} p)
βmap : {A B : Set}{f : A -> B}{x : A}{xs : List A} -> x β xs -> f x β map f xs
βmap (hd refl) = hd refl
βmap (tl q) = tl (βmap q)
covered : {n : Nat} -> (xs : Vec Bool n) -> xs β allEnvs
covered Ξ΅ = hd refl
covered (false βΊ xs) = β++left (βmap (covered xs))
covered (true βΊ xs) = β++right {xs = map (_βΊ_ false) allEnvs}
(βmap (covered xs))
Sat : {A : Set} -> (A -> Bool) -> A -> Set
Sat f x = IsTrue (f x)
lemβ : {n : Nat}(f : Vec Bool n -> Bool) ->
All (Sat f) allEnvs -> (xs : Vec Bool n) -> Sat f xs
lemβ f p xs with p ! covered xs
... | (.xs , p , refl) = p
data False : Set where
Β¬_ : Set -> Set
Β¬ P = P -> False
data _β¨_ (A B : Set) : Set where
inl : A -> A β¨ B
inr : B -> A β¨ B
Β¬IsTrue-false : Β¬ IsTrue false
Β¬IsTrue-false ()
decide : {A : Set}(p : A -> Bool)(x : A) ->
Sat p x β¨ Β¬ Sat p x
decide p x with p x
... | true = inl isTrue
... | false = inr Β¬IsTrue-false
all : {A : Set}(p : A -> Bool)(xs : List A) ->
All (Sat p) xs β¨ Some (\x -> Β¬ Sat p x) xs
all p [] = inl β
all p (x :: xs) with decide p x
... | inr Β¬px = inr (hd Β¬px)
... | inl px with all p xs
... | inl ps = inl (px βΉ ps)
... | inr q = inr (tl q)
data NoProof : Set where
no-proof : NoProof
Proof : {n : Nat} -> (Vec Bool n -> Bool) -> Set
Proof {n} f with all f allEnvs
... | inl _ = (xs : Vec Bool n) -> Sat f xs
... | inr _ = NoProof
prove : {n : Nat}(f : Vec Bool n -> Bool) -> Proof f
prove f with all f allEnvs
... | inl ps = lemβ f ps
... | inr _ = no-proof
|
asm/remove_optimization_for_freecam_ntsc.asm | Colt-Zero/spyro06-source | 0 | 18235 | <reponame>Colt-Zero/spyro06-source
.open "sys/main.dol"
; Free cam, credit goes to marius851000, NTSC translation by <NAME>(<NAME>)
.org 0x8034f59c
li r3, 1 ; 0434f59c 38600001
blr ; 0434f5a0 4e800020
.org 0x80324168
nop ; 04324168 60000000
.close |
regtests/servlet_harness.adb | My-Colaborations/ada-servlet | 6 | 17628 | -----------------------------------------------------------------------
-- servlet_harness -- Ada Servlet unit tests
-- Copyright (C) 2009, 2010, 2015, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
with Servlet.Tests;
with Servlet.Testsuite;
procedure Servlet_Harness is
procedure Harness is new Util.Tests.Harness (Suite => Servlet.Testsuite.Suite,
Finish => Servlet.Tests.Finish);
begin
Harness ("servlet-tests.xml");
end Servlet_Harness;
|
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/a-calcon.adb | JCGobbi/Nucleo-STM32G474RE | 0 | 5796 | <gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . C A L E N D A R . C O N T R O L --
-- --
-- B o d y --
-- --
-- Copyright (C) 2020-2021, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package allows clients to set the current time and date.
package body Ada.Calendar.Control is
function As_Duration
(Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number)
return Duration;
-- a convenience function
---------------
-- Set_Clock --
---------------
procedure Set_Clock (Value : Time) is
begin
Radix_Time := Value;
end Set_Clock;
---------------
-- Set_Clock --
---------------
procedure Set_Clock
(Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number;
Fraction : Fractional_Seconds := 0.0)
is
begin
Radix_Time := Time_Of (Year,
Month,
Day,
As_Duration (Hour, Minute, Second) + Fraction);
end Set_Clock;
-----------------
-- As_Duration --
-----------------
function As_Duration
(Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number)
return Duration
is
(Duration ((Hour * 3600) + (Minute * 60) + Second));
end Ada.Calendar.Control;
|
src/System/IO/Transducers/Weight.agda | ilya-fiveisky/agda-system-io | 10 | 16895 | open import Coinduction using ( β―_ )
open import Data.Natural using ( Natural ; # ; _+_ )
open import Data.Strict using ( Strict ; ! )
open import System.IO.Transducers.Session using ( I ; Ξ£ ; β¨_β© )
open import System.IO.Transducers.Lazy using ( _β_ ; inp ; out ; done )
module System.IO.Transducers.Weight where
-- Weight of a trace
weight' : β {S} β (Strict Natural) β S β β¨ Natural β©
weight' {I} (! n) = out n done
weight' {Ξ£ W F} (! n) = inp (β― Ξ» a β weight' (! (n + W a)))
weight : β {S} β S β β¨ Natural β©
weight = weight' (! (# 0)) |
specs/ada/server/ike/tkmrpc-operation_handlers-ike-tkm_version.adb | DrenfongWong/tkm-rpc | 0 | 7168 | with Tkmrpc.Servers.Ike;
with Tkmrpc.Response.Ike.Tkm_Version.Convert;
package body Tkmrpc.Operation_Handlers.Ike.Tkm_Version is
-------------------------------------------------------------------------
procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type) is
pragma Unreferenced (Req);
Specific_Res : Response.Ike.Tkm_Version.Response_Type;
begin
Specific_Res := Response.Ike.Tkm_Version.Null_Response;
Servers.Ike.Tkm_Version
(Result => Specific_Res.Header.Result,
Version => Specific_Res.Data.Version);
Res := Response.Ike.Tkm_Version.Convert.To_Response (S => Specific_Res);
end Handle;
end Tkmrpc.Operation_Handlers.Ike.Tkm_Version;
|
src/gen-commands-page.ads | My-Colaborations/dynamo | 15 | 22099 | <reponame>My-Colaborations/dynamo<gh_stars>10-100
-----------------------------------------------------------------------
-- gen-commands-page -- Page creation command for dynamo
-- Copyright (C) 2011, 2017, 2018, 2019 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package Gen.Commands.Page is
-- ------------------------------
-- Page Creation Command
-- ------------------------------
-- This command adds a XHTML page to the web application.
type Command is new Gen.Commands.Command with null record;
-- Execute the command with the arguments.
overriding
procedure Execute (Cmd : in out Command;
Name : in String;
Args : in Argument_List'Class;
Generator : in out Gen.Generator.Handler);
-- Write the help associated with the command.
overriding
procedure Help (Cmd : in out Command;
Name : in String;
Generator : in out Gen.Generator.Handler);
end Gen.Commands.Page;
|
05/5-b/5-b blackwhitescreen.asm | AbstractXan/ComputerSystemDesignLab | 0 | 242041 | @SCREEN
D=A
@addr
M=D
@256
D=A
@n
M=D
@32
D=A
@m
M=D
@row
M=0
@21845
D=A
@oddrow
M=D
@32767
D=A
@evenrow
M=D
@10923
D=A
@evenrow
M=M+D
@i
M=0
(OUTLOOP)
@i
D=M
@n
D=D-M
@ENDOUT
D;JGE
@row
D=M
@EVENROW
D;JEQ
@oddrow
D=M
@current
M=D
@row
M=0
@ROWSTART
0;JMP
(EVENROW)
@evenrow
D=M
@current
M=D
@row
M=1
(ROWSTART)
@j
M=0
(INLOOP)
@j
D=M
@m
D=D-M
@ENDIN
D;JGE
@current
D=M
@addr
A=M
M=D
@addr
M=M+1
@j
M=M+1
@INLOOP
0;JMP
(ENDIN)
@i
M=M+1
@OUTLOOP
0;JMP
(ENDOUT)
@ENDOUT
0;JMP
|
src/dds-request_reply-replier-impl.ads | persan/dds-requestreply | 0 | 6019 | with DDS.Request_Reply.Impl;
private package DDS.Request_Reply.Replier.Impl is
type Ref is limited new DDS.Request_Reply.Impl.Ref and DDS.Request_Reply.Replier.Ref with record
null;
end record;
type Ref_Access is access all Ref;
procedure Wait_For_Requests
(Self : not null access Ref;
Min_Count : DDS.Integer;
Max_Wait : DDS.Duration_T);
procedure Configure_Params_For_Reply
(Self : not null access Ref;
Params : in out WriteParams_T;
Related_Request_Info : DDS.SampleIdentity_T);
procedure send_sample
(Self : not null access Ref;
data : System.Address;
Params : in out WriteParams_T;
Related_Request_Info : DDS.SampleIdentity_T);
end DDS.Request_Reply.Replier.Impl;
|
bios/sysinit2.asm | minblock/msdos | 0 | 242371 | <filename>bios/sysinit2.asm
page ,160
;
; Microsoft Confidential
; Copyright (C) Microsoft Corporation 1981-1991
; All Rights Reserved.
;
title bios system initialization
;
; Multiple configuration block support Created 16-Mar-1992 by JeffPar
;
; Summary:
;
; The procedure "organize" crunches the in-memory copy of config.sys
; into lines delimited by CR/LF (sometimes no CR, but *always* an LF)
; with the leading "keyword=" replaced by single character codes (eg, B
; for BUFFERS, D for DEVICE, Z for any unrecognized keyword); see comtab
; and/or config.inc for the full list.
;
; [blockname] and INCLUDE are the major syntactical additions for multi-
; configuration support. blockname is either MENU, which contains one
; or more MENUITEM lines, an optional MENUDEFAULT (which includes optional
; time-out), or any user-defined keyword, such as NETWORK, CD-ROM, etc.
; INCLUDE allows the current block to name another block for inclusion
; during the processing phase of CONFIG.SYS. An INCLUDE is only honored
; once, precluding nasty infinite-loop scenarios. If blocks are present
; without a MENU block, then only lines inside COMMON blocks are processed.
;
; Example:
;
; [menu]
; menuitem=misc,Miscellaneous
; menuitem=network,Network Configuration
; menudefault=network,15
;
; [network]
; include misc
; device=foo
;
; [misc]
; device=bar
; include alternate
;
; [alternate]
; device=tar
;
;
; When the menu is displayed
;
; 1. Miscellaneous
; 2. Network Configuration
;
; #2 is highlighted as the default option, and will be automatically
; selected after 15 seconds. It will invoke the following lines in the
; following order:
;
; DEVICE=BAR
; DEVICE=TAR
; DEVICE=FOO
;
MULTI_CONFIG equ 1
.xlist
include version.inc ; set version build flags
include biosseg.inc ; establish bios segment structure
.list
lf equ 10
cr equ 13
tab equ 9
; the following depends on the positions of the various letters in switchlist
switchnum equ 11111000b ; which switches require number
.xlist
include bpb.inc
include syscall.inc
include doscntry.inc
include devsym.inc
include ioctl.inc
include devmark.inc
include config.inc
ifdef MULTI_CONFIG
include rombios.inc
endif
.list
stacksw equ true ; include switchable hardware stacks
if ibmjapver
noexec equ true
else
noexec equ false
endif
Bios_Data segment
extrn eot:byte
extrn ec35_flag: byte
Bios_Data ends
sysinitseg segment public
assume cs:sysinitseg,ds:nothing,es:nothing,ss:nothing
ifdef MULTI_CONFIG
MAX_MULTI_CONFIG equ 9 ; max # of multi-config menu items supported
extrn config_envlen:word
extrn config_wrkseg:word
extrn config_cmd:byte
extrn config_multi:byte
extrn OnOff:byte
extrn $PauseMsg:byte
extrn $CleanMsg:byte
extrn $InterMsg:byte
extrn $MenuHeader:byte
extrn $MenuPrmpt:byte
extrn $StatusLine:byte
extrn $InterPrmpt:byte
extrn $YES:byte
extrn $NO:byte
extrn $TimeOut:byte
extrn $AutoPrmpt:byte
extrn swit_n:byte, swit_f:byte
public newcmd,tmplate,commnd2,commnd3,commnd4
endif
IFDEF CONFIGPROC
extrn badopm:byte,badcom:byte,badblock:byte
extrn badsiz_pre:byte,
extrn error_line:near
extrn dosinfo:dword
extrn memory_size:word,fcbs:byte,keep:byte
extrn default_drive:byte,confbot:word
extrn buffers:word,zero:byte,sepchr:byte
extrn files:byte
extrn count:word,chrptr:word
extrn bufptr:byte,prmblk:byte
extrn ldoff:word,area:word,packet:byte,unitcount:byte,
extrn break_addr:dword,bpb_addr:dword,drivenumber:byte
extrn com_level:byte, cmmt:byte, cmmt1:byte, cmmt2:byte
extrn cmd_indicator:byte
extrn multdeviceflag:byte
extrn org_count:word
extrn getchr:near
extrn DevEntry:dword
insert_blank db 0 ; M051: indicates that blank has been
; M051: inserted
ENDIF ; CONFIGPROC
extrn memlo:word,memhi:word,alloclim:word
extrn devmark_addr:word,badmem:byte,crlfm:byte
extrn setdevmarkflag:byte,badld_pre:byte
extrn donotshownum:byte
extrn pararound:near
extrn stall:near
public int24,open_dev,mem_err,prndev,auxdev,condev
public commnd,command_line
public badfil,round,print
IFDEF CONFIGPROC
public organize,newline,calldev,badload
public config,getnum,prnerr
public delim
public setparms, parseline, diddleback
public setdoscountryinfo,set_country_path,move_asciiz
public cntry_drv,cntry_root,cntry_path
public pathstring
;
;----------------------------------------------------------------------------
;
; procedure : setparms
;
; the following set of routines is used to parse the drivparm = command in
; the config.sys file to change the default drive parameters.
;
;----------------------------------------------------------------------------
;
setparms proc near
push ds
push ax
push bx
push cx
push dx
push cs
pop ds
assume ds:sysinitseg
xor bx,bx
mov bl,byte ptr drive
inc bl ; get it correct for ioctl
; call (1=a,2=b...)
mov dx,offset deviceparameters
mov ah,ioctl
mov al,generic_ioctl
mov ch,rawio
mov cl,set_device_parameters
int 21h
mov ax,Bios_Data ; get Bios_Data segment
mov ds,ax ; set Bios_Data segment
assume ds:Bios_Data
test cs:word ptr switches, flagec35
jz not_ec35
mov cl,cs:byte ptr drive ; which drive was this for?
mov al,1 ; assume drive 0
shl al,cl ; set proper bit depending on drive
or ds:ec35_flag,al ; set the bit in the permanent flags
not_ec35:
; Now adjust the BIOS's EOT variable if our new drive has more
; sectors per track than any old ones.
mov al,cs:byte ptr deviceparameters.DP_BPB.BPB_SECTORSPERTRACK
cmp al,eot
jbe eot_ok
mov eot,al
eot_ok:
pop dx ; fix up all the registers
pop cx
pop bx
pop ax
pop ds
assume ds:nothing
ret
setparms endp
;
;----------------------------------------------------------------------------
;
; procedure : diddleback
;
; replace default values for further drivparm commands
;
;----------------------------------------------------------------------------
;
diddleback proc near
push ds
push cs
pop ds
assume ds:sysinitseg
mov word ptr deviceparameters.dp_cylinders,80
mov byte ptr deviceparameters.dp_devicetype, dev_3inch720kb
mov word ptr deviceparameters.dp_deviceattributes,0
mov word ptr switches,0 ; zero all switches
pop ds
assume ds:nothing
ret
diddleback endp
;
;----------------------------------------------------------------------------
;
; procedure : parseline
;
; entry point is parseline. al contains the first character in command line.
;
;----------------------------------------------------------------------------
;
parseline proc near
; don't get character first time
push ds
push cs
pop ds
assume ds:sysinitseg
nextswtch:
cmp al,cr ; carriage return?
jz done_line
cmp al,lf ; linefeed?
jz put_back ; put it back and done
; anything less or equal to a space is ignored.
cmp al,' ' ; space?
jbe get_next ; skip over space
cmp al,'/'
jz getparm
stc ; mark error invalid-character-in-input
jmp short exitpl
getparm:
call check_switch
mov word ptr switches,bx ; save switches read so far
jc swterr
get_next:
call getchr
jc done_line
jmp nextswtch
swterr:
jmp short exitpl ; exit if error
done_line:
test word ptr switches,flagdrive ; see if drive specified
jnz okay
stc ; mark error no-drive-specified
jmp short exitpl
okay:
mov ax,word ptr switches
and ax,0003h ; get flag bits for changeline and non-rem
mov word ptr deviceparameters.dp_deviceattributes,ax
mov word ptr deviceparameters.dp_tracktableentries, 0
clc ; everything is fine
call setdeviceparameters
exitpl:
pop ds
ret
put_back:
inc count ; one more char to scan
dec chrptr ; back up over linefeed
jmp short done_line
parseline endp
;
;----------------------------------------------------------------------------
;
; procedure : check_switch
;
; processes a switch in the input. it ensures that the switch is valid, and
; gets the number, if any required, following the switch. the switch and the
; number *must* be separated by a colon. carry is set if there is any kind of
; error.
;
;----------------------------------------------------------------------------
;
check_switch proc near
call getchr
jc err_check
and al,0dfh ; convert it to upper case
cmp al,'A'
jb err_check
cmp al,'Z'
ja err_check
push es
push cs
pop es
mov cl,byte ptr switchlist ; get number of valid switches
mov ch,0
mov di,1+offset switchlist ; point to string of valid switches
repne scasb
pop es
jnz err_check
mov ax,1
shl ax,cl ; set bit to indicate switch
mov bx,word ptr switches ; get switches so far
or bx,ax ; save this with other switches
mov cx,ax
test ax, switchnum ; test against switches that require number to follow
jz done_swtch
call getchr
jc err_swtch
cmp al,':'
jnz err_swtch
call getchr
push bx ; preserve switches
mov byte ptr cs:sepchr,' ' ; allow space separators
call getnum
mov byte ptr cs:sepchr,0
pop bx ; restore switches
; because getnum does not consider carriage-return or line-feed as ok, we do
; not check for carry set here. if there is an error, it will be detected
; further on (hopefully).
call process_num
done_swtch:
clc
ret
err_swtch:
xor bx,cx ; remove this switch from the records
err_check:
stc
ret
check_switch endp
;
;----------------------------------------------------------------------------
;
; procedure : process_num
;
; this routine takes the switch just input, and the number following (if any),
; and sets the value in the appropriate variable. if the number input is zero
; then it does nothing - it assumes the default value that is present in the
; variable at the beginning. zero is ok for form factor and drive, however.
;
;----------------------------------------------------------------------------
;
process_num proc near
test word ptr switches,cx ; if this switch has been done before,
jnz done_ret ; ignore this one.
test cx,flagdrive
jz try_f
mov byte ptr drive,al
jmp short done_ret
try_f:
test cx,flagff
jz try_t
; ensure that we do not get bogus form factors that are not supported
mov byte ptr deviceparameters.dp_devicetype,al
jmp short done_ret
try_t:
or ax,ax
jz done_ret ; if number entered was 0, assume default value
test cx,flagcyln
jz try_s
mov word ptr deviceparameters.dp_cylinders,ax
jmp short done_ret
try_s:
test cx,flagseclim
jz try_h
mov word ptr slim,ax
jmp short done_ret
; must be for number of heads
try_h:
mov word ptr hlim,ax
done_ret:
clc
ret
process_num endp
; M047 -- Begin modifications (too numerous to mark specifically)
;
;----------------------------------------------------------------------------
;
; procedure : setdeviceparameters
;
; setdeviceparameters sets up the recommended bpb in each bds in the
; system based on the form factor. it is assumed that the bpbs for the
; various form factors are present in the bpbtable. for hard files,
; the recommended bpb is the same as the bpb on the drive.
; no attempt is made to preserve registers since we are going to jump to
; sysinit straight after this routine.
;
; if we return carry, the DRIVPARM will be aborted, but presently
; we always return no carry
;
;
; note: there is a routine by the same name in msdioctl.asm
;
;----------------------------------------------------------------------------
;
setdeviceparameters proc near
push es
push cs
pop es
assume es:sysinitseg
xor bx,bx
mov bl,byte ptr deviceparameters.dp_devicetype
cmp bl,dev_5inch
jnz got_80
mov word ptr deviceparameters.dp_cylinders,40 ; 48 tpi=40 cyl
got_80:
shl bx,1 ; get index into bpb table
mov si,bpbtable[bx] ; get address of bpb
mov di,offset deviceparameters.dp_bpb ; es:di -> bpb
mov cx,size A_BPB
cld
repe movsb
pop es
assume es:nothing
test word ptr switches,flagseclim
jz see_heads
mov ax,word ptr slim
mov word ptr deviceparameters.dp_bpb.bpb_sectorspertrack,ax
see_heads:
test word ptr switches,flagheads
jz heads_not_altered
mov ax,word ptr hlim
mov word ptr deviceparameters.dp_bpb.bpb_heads,ax
heads_not_altered:
; set up correct media descriptor byte and sectors/cluster
; sectors/cluster is always 2 except for any one sided disk or 1.44M
mov byte ptr deviceparameters.dp_bpb.bpb_sectorspercluster,2
mov bl,0f0h ; get default mediabyte
; preload the mediadescriptor from the bpb into bh for convenient access
mov bh,byte ptr deviceparameters.dp_bpb.bpb_mediadescriptor
cmp word ptr deviceparameters.dp_bpb.bpb_heads,2 ; >2 heads?
ja got_correct_mediad ; just use default if heads>2
jnz only_one_head ; one head, do one head stuff
; two head drives will use the mediadescriptor from the bpb
mov bl,bh ; get mediadescriptor from bpb
; two sided drives have two special cases to look for. One is
; a 320K diskette (40 tracks, 8 secs per track). It uses
; a mediaid of 0fch. The other is 1.44M, which uses only
; one sector/cluster.
; any drive with 18secs/trk, 2 heads, 80 tracks, will be assumed
; to be a 1.44M and use only 1 sector per cluster. Any other
; type of 2 headed drive is all set.
cmp deviceparameters.dp_bpb.bpb_sectorspertrack,18
jnz not_144m
cmp deviceparameters.dp_cylinders,80
jnz not_144m
; We've got cyl=80, heads=2, secpertrack=18. Set cluster size to 1.
jmp short got_one_secperclus_drive
; check for 320K
not_144m:
cmp deviceparameters.dp_cylinders,40
jnz got_correct_mediad
cmp deviceparameters.dp_bpb.bpb_sectorspertrack,8
jnz got_correct_mediad
mov bl,0fch
jmp short got_correct_mediad
only_one_head:
; if we don't have a 360K drive, then just go use 0f0h as media descr.
cmp deviceparameters.dp_devicetype,dev_5inch
jnz got_one_secperclus_drive
; single sided 360K drive uses either 0fch or 0feh, depending on
; whether sectorspertrack is 8 or 9. For our purposes, anything
; besides 8 will be considered 0fch
mov bl,0fch ; single sided 9 sector media id
cmp word ptr deviceparameters.dp_bpb.bpb_sectorspertrack,8
jnz got_one_secperclus_drive ; okay if anything besides 8
mov bl,0feh ; 160K mediaid
; we've either got a one sided drive, or a 1.44M drive
; either case we'll use 1 sector per cluster instead of 2
got_one_secperclus_drive:
mov byte ptr deviceparameters.dp_bpb.bpb_sectorspercluster,1
got_correct_mediad:
mov byte ptr deviceparameters.dp_bpb.bpb_mediadescriptor,bl
; Calculate the correct number of Total Sectors on medium
;
mov ax,deviceparameters.dp_cylinders
mul word ptr deviceparameters.dp_bpb.bpb_heads
mul word ptr deviceparameters.dp_bpb.bpb_sectorspertrack
mov word ptr deviceparameters.dp_bpb.bpb_totalsectors,ax
clc ; we currently return no errors
ret
setdeviceparameters endp
; M047 -- end rewritten routine
;
;----------------------------------------------------------------------------
;
; procedure : organize
;
;----------------------------------------------------------------------------
;
assume ds:nothing, es:nothing
organize proc near
mov cx,[count]
jcxz nochar1
ifndef MULTI_CONFIG
;
; In MULTI_CONFIG, we map to upper case on a line-by-line basis,
; because we the case of values in SET commands preserved
;
call mapcase
endif
xor si,si
mov di,si
xor ax,ax
mov com_level, 0
org1:
call skip_comment
jz end_commd_line ; found a comment string and skipped.
call get2 ; not a comment string. then get a char.
cmp al, lf
je end_commd_line ; starts with a blank line.
cmp al, ' '
jbe org1 ; skip leading control characters
jmp short findit
end_commd_line:
stosb ; store line feed char in buffer for the linecount.
mov com_level, 0 ; reset the command level.
jmp org1
nochar1:
stc
ret
findit:
push cx
push si
push di
mov bp,si
dec bp
mov si,offset comtab ; prepare to search command table
mov ch,0
findcom:
mov di,bp
mov cl,[si]
inc si
jcxz nocom
ifdef MULTI_CONFIG
;
; Simplify future parsing by collapsing ";" onto "REM", and at the same
; time skip the upcoming delimiter test (since ";" need not be followed by
; anything in particular)
;
cmp byte ptr es:[di],CONFIG_SEMICOLON
je semicolon
loopcom:
mov al,es:[di]
inc di
and al,not 20h ; force upper case
inc si ; compare to byte @es:di
cmp al,ds:[si-1]
loope loopcom
else
repe cmpsb
endif
lahf
add si,cx ; bump to next position without affecting flags
sahf
lodsb ; get indicator letter
jnz findcom
cmp byte ptr es:[di], cr ; the next char might be cr,lf
je gotcom0 ; such as in "rem",cr,lf case.
cmp byte ptr es:[di], lf
je gotcom0
ifdef MULTI_CONFIG
;
; Skip the delimiter test for the BEGIN identifier (it doesn't have one).
;
cmp al,CONFIG_BEGIN
je gotcom0
endif
push ax
mov al, byte ptr es:[di] ; now the next char. should be a delim.
ifdef MULTI_CONFIG
;
; If keyword is *immediately* followed by a question mark (?), then
; set the high bit of the ASCII command code (CONFIG_OPTION_QUERY) that is
; stored in the CONFIG.SYS memory image.
;
cmp al,'?' ; explicit interactive command?
jne no_query ; no
pop ax ; yes, so retrieve the original code
or al,CONFIG_OPTION_QUERY ; and set the QUERY bit
jmp short gotcom0 ;
semicolon:
mov al,CONFIG_REM
jmp short gotcom0
no_query:
endif ;MULTI_CONFIG
call delim
no_delim:
pop ax
jnz findcom
gotcom0:
pop di
pop si
pop cx
jmp short gotcom
nocom:
pop di
pop si
pop cx
mov al,CONFIG_UNKNOWN
stosb ; save indicator char.
skipline:
call get2
cmp al, lf ; skip this bad command line
jne skipline
jmp end_commd_line ; handle next command line
gotcom:
stosb ; save indicator char in buffer
ifdef MULTI_CONFIG
;
; Don't pollute "cmd_indicator" with the CONFIG_OPTION_QUERY bit though;
; it screws up the direct comparisons below.
;
and al,NOT CONFIG_OPTION_QUERY
endif
mov cmd_indicator, al ; save it for the future use.
ifdef MULTI_CONFIG
;
; There is no whitespace/delimiter between the "begin block" character
; ([) and the name of block (eg, [menu]), therefore skip this delimiter
; skipping code
;
cmp al,CONFIG_BEGIN
je org31
cmp al,CONFIG_SUBMENU
je no_mapcase
cmp al,CONFIG_MENUITEM
je no_mapcase
cmp al,CONFIG_MENUDEFAULT
je no_mapcase
cmp al,CONFIG_INCLUDE
je no_mapcase
call mapcase ; map case of rest of line to UPPER
no_mapcase:
endif
org2: call get2 ; skip the command name until delimiter
cmp al, lf
je org21
cmp al, cr
je org21
cmp al, '/' ; T-RICHJ: Added to allow DEVHIGH/L:...
je org21 ; T-RICHJ: to be parsed properly.
call delim
jnz org2
jmp short org3
org21: ;if cr or lf then
dec si ; undo si, cx register
inc cx ; and continue
org3: cmp cmd_indicator, CONFIG_COMMENT
je get_cmt_token
cmp cmd_indicator, CONFIG_DEVICE
je org_file
cmp cmd_indicator, CONFIG_INSTALL
je org_file
cmp cmd_indicator, CONFIG_INSTALLHIGH
je org_file
cmp cmd_indicator, CONFIG_SHELL
je org_file
cmp cmd_indicator, CONFIG_SWITCHES
je org_switch
org31:
jmp org4
org_switch:
call skip_comment
jz end_commd_line_brdg
call get2
call org_delim
jz org_switch
stosb
jmp org5
org_file: ; get the filename and put 0 at end,
call skip_comment
jz org_put_zero
call get2 ; not a comment
call delim
jz org_file ; skip the possible delimeters
stosb ; copy the first non delim char found in buffer
org_copy_file:
call skip_comment ; comment char in the filename?
jz org_put_zero ; then stop copying filename at that point
call get2
cmp al, '/' ; a switch char? (device=filename/xxx)
je end_file_slash ; this will be the special case.
stosb ; save the char. in buffer
call delim
jz end_copy_file
cmp al, ' '
ja org_copy_file ; keep copying
jmp short end_copy_file ; otherwise, assume end of the filename.
get_cmt_token: ; get the token. just max. 2 char.
call get2
cmp al, ' ' ; skip white spaces or "=" char.
je get_cmt_token ; (we are allowing the other special
cmp al, tab ; charaters can used for comment id.
je get_cmt_token ; character.)
cmp al, '=' ; = is special in this case.
je get_cmt_token
cmp al, cr
je get_cmt_end ; cannot accept the carridge return
cmp al, lf
je get_cmt_end
mov cmmt1, al ; store it
mov cmmt, 1 ; 1 char. so far.
call get2
cmp al, ' '
je get_cmt_end
cmp al, tab
je get_cmt_end
cmp al, cr
je get_cmt_end
cmp al, lf
je end_commd_line_brdg
mov cmmt2, al
inc cmmt
get_cmt_end:
call get2
cmp al, lf
jne get_cmt_end ; skip it.
end_commd_line_brdg: jmp end_commd_line ; else jmp to end_commd_line
org_put_zero: ; make the filename in front of
mov byte ptr es:[di], 0 ; the comment string to be an asciiz.
inc di
jmp end_commd_line ; (maybe null if device=/*)
end_file_slash: ; al = "/" option char.
mov byte ptr es:[di],0 ; make a filename an asciiz
inc di ; and
stosb ; store "/" after that.
jmp short org5 ; continue with the rest of the line
end_copy_file:
mov byte ptr es:[di-1], 0 ; make it an asciiz and handle the next char.
cmp al, lf
je end_commd_line_brdg
jmp short org5
org4: ; org4 skips all delimiters after the command name except for '/'
call skip_comment
jz end_commd_line_brdg
call get2
call org_delim ; skip delimiters except '/' (mrw 4/88)
jz org4
jmp short org51
org5: ; rest of the line
call skip_comment ; comment?
jz end_commd_line_brdg
call get2 ; not a comment.
org51:
stosb ; copy the character
cmp al, '"' ; a quote ?
je at_quote
cmp al, ' '
ja org5
; M051 - Start
cmp cmd_indicator, CONFIG_DEVICEHIGH; Q: is this devicehigh
jne not_dh ; N:
cmp al, lf ; Q: is this line feed
je org_dhlf ; Y: stuff a blank before the lf
cmp al, cr ; Q: is this a cr
jne org5 ; N:
mov byte ptr es:[di-1], ' ' ; overwrite cr with blank
stosb ; put cr after blank
inc [insert_blank] ; indicate that blank has been
; inserted
jmp org5
not_dh: ; M051 - End
cmp al, lf ; line feed?
je org1_brdg ; handles the next command line.
jmp org5 ; handles next char in this line.
org_dhlf: ; M051 - Start
cmp [insert_blank], 1 ; Q:has a blank already been inserted
je org1_brdg ; Y:
mov byte ptr es:[di-1], ' ' ; overwrite lf with blank
stosb ; put lf after blank
; M051 - End
org1_brdg:
mov [insert_blank], 0 ; M051: clear blank indicator for
; M051: devicehigh
jmp org1
at_quote:
cmp com_level, 0
je up_level
mov com_level, 0 ; reset it.
jmp org5
up_level:
inc com_level ; set it.
jmp org5
organize endp
;
;----------------------------------------------------------------------------
;
; procedure : get2
;
;----------------------------------------------------------------------------
;
get2 proc near
jcxz noget
lods byte ptr es:[si]
dec cx
ret
noget:
pop cx
mov count,di
mov org_count, di
xor si,si
mov chrptr,si
ifndef MULTI_CONFIG
ret
else
;
; This was the rather kludgy way out of procedure "organize", but instead
; of returning to doconf, we now want to check config.sys BEGIN/END blocks
; and the new boot menu stuff...
;
mov cx,di
jmp menu_check
endif
get2 endp
;
;----------------------------------------------------------------------------
;
; procedure : skip_comment
;
;skip the commented string until lf, if current es:si-> a comment string.
;in) es:si-> sting
; cx -> length.
;out) zero flag not set if not found a comment string.
; zero flag set if found a comment string and skipped it. al will contain
; the line feed charater at this moment when return.
; ax register destroyed.
; if found, si, cx register adjusted accordingly.
;
;----------------------------------------------------------------------------
;
skip_comment proc near
jcxz noget ; get out of the organize routine.
cmp com_level, 0 ; only check it if parameter level is 0.
jne no_commt ; (not inside quotations)
cmp cmmt, 1
jb no_commt
mov al, es:[si]
cmp cmmt1, al
jne no_commt
cmp cmmt, 2
jne skip_cmmt
mov al, es:[si+1]
cmp cmmt2, al
jne no_commt
skip_cmmt:
jcxz noget ; get out of organize routine.
mov al, es:[si]
inc si
dec cx
cmp al, lf ; line feed?
jne skip_cmmt
no_commt:
ret
skip_comment endp
ifdef MULTI_CONFIG
assume ds:sysinitseg
;
;----------------------------------------------------------------------------
;
; kbd_read: wait for keystroke
;
; INPUT
; DS == CS == sysinitseg
;
; OUTPUT
; Carry SET to clean boot, CLEAR otherwise
;
; OTHER REGS USED
; All
;
; HISTORY
; Created 16-Nov-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public kbd_read
kbd_read proc near
test byte ptr [bDisableUI],2
jnz kbd_nodelay
push ds ; the bios timer tick count is incremented
sub ax,ax ; 18.2 times per second;
mov ds,ax ; watch the timer tick count for 37 transitions
mov dx,ds:[046Ch] ; get initial value
kbd_loop:
mov ah,1 ;
int 16h ; peek the keyboard
jnz kbd_loopdone ; something's there, get out
mov ah,2 ; peek the shift states
int 16h ;
test al,03h ; either right or left shift key bits set?
jnz kbd_loopdone ; yes
mov ax,ds:[046Ch] ;
sub ax,dx ; get difference
cmp al,37 ; reached limit?
jb kbd_loop ; not yet
kbd_loopdone:
pop ds ; delay complete!
kbd_nodelay:
sub bx,bx ; assume clean boot
mov ah,2 ; peek the shift states
int 16h ;
test al,03h ; either right or left shift key bits set?
jz kbd_notshift ; no
inc bx ; yes
inc bx ;
kbd_notshift: ;
mov ah,1 ; peek the keyboard
int 16h ;
jz kbd_test ; no key present
or al,al ; is it a function key?
jnz kbd_test ; no
cmp ah,3Fh ; F5 function key?
jne kbd_notf5 ; no
mov dx,offset $CleanMsg
call print ;
jmp short kbd_eat ; yes, clean boot selected
kbd_notf5:
cmp ah,42h ; F8 function key?
jne kbd_exit ; no
mov dx,offset $InterMsg
call print ;
mov bl,1 ; yes, interactive-boot option enabled
mov [bQueryOpt],bl ; change default setting
kbd_eat: ;
mov ah,0 ;
int 16h ; eat the key we assumed was a signal
mov byte ptr [secElapsed],-1
or bx,bx ;
jz kbd_clean ;
kbd_test: ;
cmp bl,2 ;
jb kbd_exit ;
kbd_clean: ;
call disable_autoexec; yes, tell COMMAND to skip autoexec.bat
stc ; set carry to indicate abort
ret ;
kbd_exit: ;
clc ; clear carry to indicate success
ret ;
kbd_read endp
;
;----------------------------------------------------------------------------
;
; set_numlock: set numlock LED
;
; INPUT
; ES:SI -> numlock setting (ie, "ON" or "OFF")
;
; OUTPUT
; None
;
; OTHER REGS USED
; None
;
; HISTORY
; Created 16-Nov-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public set_numlock
set_numlock proc near
push ax
push ds
sub ax,ax
mov ds,ax
mov ax,es:[si] ; get 1st 2 bytes of value (ON or OF)
cmp ax,word ptr cs:[OnOff+2]; should we turn it off?
jne not_off ; no
and byte ptr ds:[0417h],not 20h
jmp short set_done
not_off:
cmp ax,word ptr cs:[OnOff] ; should we turn it on?
stc
jne set_done ; no
or byte ptr ds:[0417h],20h
set_done:
pop ds
pop ax
ret
set_numlock endp
;
;----------------------------------------------------------------------------
;
; menu_check: check for presence of menu (and other) configuration blocks
;
; INPUT
; CX == "organized" config.sys memory image length
; ES:SI -> "organized" config.sys memory image
; DS == CS == sysinitseg
;
; OUTPUT
; Same as above; the idea is that menu_check simply transforms
; a block-structured config.sys image into a conventional image,
; based on the user's block selection and any other boot-time options
; the user may have employed...
;
; OTHER REGS USED
; All
;
; NOTES
; [count] and [org_count] are set to the new config.sys image length
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public menu_check
menu_check proc near
;
; Search for SWITCHES, determine if /N or /F are present; if so, then
; disable clean/interactive boot options
;
push cx ;
push si ;
sub bx,bx ; remains ZERO until first block
swchk_loop: ;
call get_char ; get first char of current line
jc swchk_end ; hit eof
cmp al,CONFIG_BEGIN ;
jne swchk_next1 ;
inc bx ; remember that we've seen a block
jmp short swchk_nextline
swchk_next1: ;
cmp al,CONFIG_NUMLOCK
jne swchk_next2 ;
or bx,bx ; only do NUMLOCK commands that exist
jnz swchk_nextline ; before the first block
call set_numlock ; REM it out so we don't act on it later, too
mov byte ptr es:[si-1],CONFIG_REM
jmp short swchk_nextline
swchk_next2: ;
cmp al,CONFIG_SWITCHES
jne swchk_nextline ; this line ain't it
swchk_scan: ;
call get_char ; look for /N or /F
swchk_scan1: ;
cmp al,LF ; end of line?
je swchk_nextline ; yes
cmp al,'/' ; switch-char?
jne swchk_scan ; no
call get_char ;
and al,not 20h ; convert to upper case
cmp al,byte ptr swit_n+1
jne swchk_scan2 ; no
or byte ptr [bDisableUI],1
jmp swchk_scan ; continue looking for switches of interest
swchk_scan2: ;
cmp al,byte ptr swit_f+1
jne swchk_scan1 ; no
or byte ptr [bDisableUI],2
jmp swchk_scan ; continue looking for switches of interest
swchk_nextline: ;
call skip_opt_line ;
jmp swchk_loop ;
swchk_end: ;
pop si ;
pop cx ;
;
; Do the keyboard tests for clean/interactive boot now, but only if
; the DisableUI flag is still clear
;
test byte ptr [bDisableUI],1
jnz menu_search
;
; Wait for 2 seconds first, UNLESS the /F bit was set in bDisableUI, or
; there is anything at all in the keyboard buffer
;
call kbd_read
jnc menu_search
jmp menu_abort
;
; Search for MENU block; it is allowed to be anywhere in config.sys
;
menu_search:
sub bx,bx ; if no MENU, default to zero for no_selection
mov di,offset szMenu;
call find_block ; find the MENU block
jnc menu_found ;
mov byte ptr [szBoot],0
jmp no_selection ; not found
;
; Process the requested menu color(s)
;
menu_color:
push cx ;
push dx ;
mov dx,0007h ; default color setting
call get_number ; get first number
and bl,00Fh ; first # is foreground color (for low nibble)
mov ch,bl ; save it in CH
and dl,0F0h ;
or dl,bl ;
call delim ; did we hit a delimiter
jne check_color ; no, all done
call get_number ; get next number
and bl,00Fh ; second # is background color (for high nibble)
mov dh,bl ; save it in DH
and dl,00Fh ;
mov cl,4 ;
shl bl,cl ;
or dl,bl ;
check_color: ;
cmp ch,dh ; are foreground/background the same?
jne set_color ; no
xor dl,08h ; yes, so modify the fgnd intensity
set_color:
mov [bMenuColor],dl ;
pop dx ;
pop cx ;
jmp menu_nextitem ;
;
; Back to our regularly scheduled program (the COLOR and other goop
; above is there simply to alleviate short jump problems)
;
menu_found:
mov byte ptr [bDefBlock],1
mov word ptr [offDefBlock],0
mov byte ptr [secTimeOut],-1
and byte ptr [bQueryOpt],not 2
call skip_opt_line ; skip to next line
sub dx,dx ; initialize total block count (0 => none yet)
;
; Process the menu block now
;
menu_process:
call get_char ; get first char of current line
jc to_menu_getdefault ; could happen if menu block at end (rare)
and al,NOT CONFIG_OPTION_QUERY
cmp al,CONFIG_BEGIN ; BEGIN implies END
je to_menu_getdefault
cmp al,CONFIG_SUBMENU
je menu_item ; go process sub-menu
cmp al,CONFIG_MENUITEM
je menu_item ; go process menu item
cmp al,CONFIG_MENUDEFAULT
je menu_default ; go process menu default
cmp al,CONFIG_MENUCOLOR
je menu_color ; go process menu color
cmp al,CONFIG_NUMLOCK
je menu_numlock ;
cmp al,CONFIG_REM ; allow remarks in menu block
je menu_nextitem ;
call any_delim ; allow blank lines and such
je menu_nextitem ;
stc ;
call print_error ; non-MENU command!
jmp short menu_nextitem
menu_numlock:
call set_numlock
jmp short menu_nextitem
to_menu_getdefault:
jmp short menu_getdefault
;
; Save the offset of the default block name, we'll need it later
;
menu_default:
mov [offDefBlock],si; save address of default block name
cmp byte ptr [secElapsed],0
jne timeout_skip ; secElapsed is only zero for the FIRST menu,
call skip_token ; and for subsequent menus IF nothing was typed;
jc menu_nextitem ; secElapsed becomes -1 forever as soon as
call skip_delim ; something is typed
jc menu_nextitem ;
mov si,bx ;
call get_number ; get number (of seconds for timeout)
cmp bl,90 ; limit it to a reasonable number
jb timeout_ok ; (besides, 99 is the largest # my simple
mov bl,90 ; display function can handle)
timeout_ok: ;
mov [secTimeOut],bl ;
timeout_skip:
jmp short menu_nextitem
;
; Verify that this is a valid menu item by searching for the named block
;
menu_item:
cmp dl,MAX_MULTI_CONFIG ; have we reached the max # of items yet?
jae menu_nextitem ;
mov di,si ; DS:DI -> block name to search for
call srch_block ;
je menu_itemfound ;
stc ;
call print_error ; print error and pause
jmp short menu_nextitem ; if not found, ignore this menu item
;
; srch_block, having succeeded, returns DI -> past the token that it
; just matched, which in this case should be a descriptive string; ES:SI
; and CX are unmodified
;
menu_itemfound:
inc dx ; otherwise, increment total block count
mov bx,dx ; and use it to index the arrays of offsets
mov abBlockType[bx],al
add bx,bx ; of recorded block names and descriptions
;
; There should be a description immediately following the block name on
; MENUITEM line; failing that, we'll just use the block name as the
; description...
;
mov aoffBlockName[bx],si
mov aoffBlockDesc[bx],si
mov di,bx ; skip_delim modifies BX, so stash it in DI
call skip_token ;
jc menu_nextitem ; hit eol/eof
call skip_delim ;
jc menu_nextitem ; hit eol/eof
xchg bx,di ;
mov aoffBlockDesc[bx],di
menu_nextitem:
call skip_opt_line ;
jmp menu_process ; go back for more lines
;
; Display menu items now, after determining which one is default
;
menu_getdefault:
or dl,dl ; where there any valid blocks at all?
jnz menu_valid ; yes
sub bx,bx ; no, so force autoselect of 0
jmp menu_autoselect ; (meaning: process common blocks only)
menu_valid:
sub bx,bx ;
mov [bMaxBlock],dl ; first, record how many blocks we found
mov di,[offDefBlock];
or di,di ; does a default block exist?
jz menu_nodefault ; no
inc bx ; yes, walk name table, looking for default
menu_chkdefault:
push bx ;
add bx,bx ;
mov si,aoffBlockName[bx]
mov cx,128 ; arbitrary maximum length of a name
push ds ;
push es ;
pop ds ;
call comp_names ; is this block the same as the default?
pop ds ;
pop bx ;
je menu_setdefault ; yes
inc bx ;
cmp bl,[bMaxBlock] ; all done searching?
jbe menu_chkdefault ; not yet
menu_nodefault:
mov bl,1 ; if no default, force default to #1
menu_setdefault:
mov [bDefBlock],bl ; yes, this will be the initial current block
;
; If the timeout was explicitly set to 0 (or technically, anything that
; failed to resolve to a number, like "NONE" or "EAT POTATOES"), then we're
; supposed to skip menu display and run with the specified default block;
; however, if the user hit Enter prior to boot, thereby requesting fully
; INTERACTIVE boot, then we shall display the menu block anyway (though still
; with no timeout)
;
cmp [secTimeOut],0 ; is timeout zero? (ie, assume default)
jne menu_display ; no
test byte ptr [bQueryOpt],1 ; yes, but was INTERACTIVE requested?
jnz menu_display ; yes, so *don't* assume default after all
jmp not_topmenu ;
;
; Reset the mode, so that we know screen is clean and cursor is home
;
menu_display:
mov ah,0Fh ; get current video mode
int 10h ;
mov ah,00h ; just re-select that mode
int 10h ;
push es ;
mov ax,40h ; reach down into the ROM BIOS data area
mov es,ax ; and save the current (default) video page
mov ax,es:[004Eh] ; start address and page #, in case the
mov [wCRTStart],ax ; undocumented QUIET option was enabled
mov al,es:[0062h] ;
mov [bCRTPage],al ;
mov ax,word ptr [bMenuPage] ; select new page for menu
int 10h ;
mov ax,0600h ; clear entire screen
mov bh,[bMenuColor] ; using this color
sub cx,cx ; upper left row/col
mov dl,byte ptr es:[CRT_Cols]
dec dl ;
mov dh,es:[CRT_Rows];
or dh,dh ; # of rows valid?
jnz menu_clear ; hopefully
mov dh,[bLastRow] ; no, use a default
menu_clear:
int 10h ; clear the screen using the req. attribute
pop es ;
mov [bLastRow],dh ; save DH
mov dx,offset $MenuHeader
call print ; cursor now on row 3 (numbered from 0)
test byte ptr [bDisableUI],1
jnz menu_nostatus ;
mov bh,[bMenuPage] ;
mov dh,[bLastRow] ; restore DH
mov dl,0 ; print the status line on row DH, col 0,
mov ah,02h ; now that we can trash the cursor position
int 10h ;
mov dx,offset $StatusLine
call print ;
mov ah,3 ; get cursor position
int 10h ;
sub dl,2 ;
mov [bLastCol],dl ; save column where status char will go
menu_nostatus:
mov bx,1 ; now prepare to display all the menu items
menu_disploop:
call print_item ; print item #BL
inc bx ; why "inc bx"? because it's a 1-byte opcode
cmp bl,[bMaxBlock] ; all done?
jbe menu_disploop ; not yet
;
; Set cursor position to just below the menu items
;
mov dl,0 ; select column
mov dh,bl ;
add dh,4 ; select row below menu
mov bh,[bMenuPage] ;
mov ah,02h ; set cursor position beneath the block list
int 10h ;
mov dx,offset $MenuPrmpt
call print ;
call select_item ; make a selection, return # in BX
mov dx,offset crlfm ;
call print ;
push word ptr [bDisableUI]
or byte ptr [bDisableUI],1
call show_status ; clear the status line now
pop word ptr [bDisableUI]
;
; Now begins the "re-organization" process...
;
menu_autoselect:
cmp bx,-1 ; clean boot requested?
jne normal_boot ; no
call disable_autoexec; basically, add a /D to the command.com line
menu_abort:
sub cx,cx ; then immediately exit with 0 config.sys image
jmp menu_exit ;
normal_boot:
cmp bx,-2 ; back to top-level menu?
jne not_topmenu ; no
mov cx,[count] ; yes, start all over
sub si,si ;
jmp menu_search
not_topmenu:
cmp abBlockType[bx],CONFIG_SUBMENU
jne not_submenu ;
add bx,bx ;
mov di,aoffBlockName[bx]
call srch_block ; THIS CANNOT FAIL!
mov si,di ;
mov cx,bx ; ES:SI and CX are ready for another round
jmp menu_found
not_submenu:
add bx,bx ; get BX -> name of selected block
mov bx,aoffBlockName[bx]
;
; BX should now either be ZERO (meaning no block has been selected) or
; the offset relative to ES of the block name to be processed (along with
; all the "common" lines of course)
;
no_selection:
mov [offDefBlock],bx; save selection
mov cx,[count] ; reset ES:SI and CX for reprocessing
sub si,si ;
push ds ;
mov ds,[config_wrkseg]; this is where we'll store new config.sys image
assume ds:nothing ;
sub di,di ;
;
; ES:SI-> config.sys, DS:DI -> new config.sys workspace
;
; Work our way through the config.sys image again, this time copying
; all lines that are (A) "common" lines outside any block or (B) lines
; within the requested block. Lines inside INCLUDEd blocks are transparently
; copied by copy_block in a recursive fashion; the amount of recursion is
; limited by the fact INCLUDE statements are REMed by copy_block as they are
; processed and by the number of unique INCLUDE stmts in config.sys...
;
; BUGBUG 20-Mar-1992 JeffPar: If we can figure out the lower bound of the
; stack we're running on, then we should check it inside copy_block
;
copyblock_loop:
push bx ; save selected block name
call copy_block ; process (named or common) block
pop bx ;
jc move_config ; hit eof
;
; copy_block can only return for two reasons: it hit eof or a new block
;
copyblock_begin:
push ax ;
push cx ;
push si ;
push di ; always do "common" blocks
mov di,offset szCommon
push ds ;
push cs ;
pop ds ;
call comp_names ;
pop ds ;
pop di ;
pop si ;
pop cx ;
pop ax ;
je copyblock_check ;
or bx,bx ; is there a block name to check?
jz copyblock_skip ; no
push di ;
mov di,bx ; check block against given block name
push ds ;
push es ;
pop ds ;
call comp_names ; is this the block we really want to do?
pop ds ;
pop di ;
copyblock_check:
jc move_config ; hit eof
jne copyblock_skip ;
call skip_opt_line ;
jmp copyblock_loop ;
copyblock_skip: ;
call skip_opt_line ; this ain't the block we wanted, so skip it
call get_char ;
jc move_config ; hit eof
and al,NOT CONFIG_OPTION_QUERY
cmp al,CONFIG_BEGIN ;
je copyblock_begin ;
jmp copyblock_skip ; anything else is just skipped
;
; To create as little risk to the rest of SysInit as little as possible,
; and to free the workspace at "config_wrkseg" for creating an environment,
; copy the new config.sys image to "confbot"
;
move_config:
mov cx,di ; now copy workspace at DS:DI to "confbot"
push cx ;
;
; But first, copy the CONFIG=<configuration><0> string to the workspace,
; since the configuration name only currently exists in the "confbot" area
;
mov cx,offset szMenu-offset szBoot-1
mov si,offset szBoot; first copy the CONFIG= part
inc di ; skip a byte, in case absolutely nothing
; was copied to the workspace, because we always
; zero the first byte of the workspace (below)
copy_boot: ;
lods byte ptr cs:[si];
mov [di],al ;
inc di ;
loop copy_boot ;
push es ; then copy the configuration name
mov cx,128-7 ; put an upper limit on the name, to be safe
mov si,cs:[offDefBlock]; ES:SI -> default block name
or si,si ; valid?
jnz l1 ; yes
push cs ;
pop es ;
mov si,offset szCommon
l1: mov al,es:[si] ;
call any_delim ;
je l2 ;
mov [di],al ;
inc si ;
inc di ;
loop l1 ;
l2: mov byte ptr [di],LF; terminate the configuration string
pop es ;
;
; Now we can copy "config_wrkseg" (DS) to "confbot" (ES)
;
sub di,di ;
mov [config_envlen],di
sub si,si ;
pop cx ; recover the size of "config_wrkseg"
push cx ;
rep movsb ; moved!
pop cx ;
mov ax,ds ;
pop ds ;
assume ds:sysinitseg ;
;
; Now that the config_wrkseg is available once again, we shall
; use it to create an environment. The first thing to go in will be
; the "CONFIG=configuration" thing. It is also important to zero
; the first byte of the workspace, so that copy_envvar knows the buffer
; is empty.
;
push es ;
mov es,ax ;
inc si ; ES:SI -> "CONFIG=configuration"
mov byte ptr es:[0],0;empty the environment block
call copy_envvar ; copy envvar at ES:SI to "config_wrkseg"
pop es
;
; Before returning, restore the default video page setting but do NOT
; do it using INT 10h's Set Active Page function, because if the menu was
; displayed on a different page, then it's because we don't want to see
; all the device driver/TSR goop (which goes to the default page)
;
menu_done:
cmp byte ptr [bMenuPage],0
je menu_exit ;
push es ;
mov ax,40h ;
mov es,ax ;
mov ax,[wCRTStart] ;
mov es:[004Eh],ax ;
mov al,[bCRTPage] ;
mov es:[0062h],al ;
pop es ;
menu_exit:
mov [count],cx ; set new counts
mov [org_count],cx ;
sub si,si ; always return ES:SI pointing to config.sys
ret
menu_check endp
;
;----------------------------------------------------------------------------
;
; copy_envvar: copy the envvar at ES:SI to "config_wrkseg"
;
; INPUT
; ES:SI -> environment variable (in the form "var=string<cr/lf>")
;
; OUTPUT
; config_envlen (ie, where to put next envvar) updated appropriately
; carry set if error (eg, missing =); clear otherwise
;
; OTHER REGS USED
; None
;
; NOTES
; None
;
; HISTORY
; Created 29-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public copy_envvar
assume ds:sysinitseg,es:nothing
copy_envvar proc near
push cx ;
push si ;
push ds ;
push es ;
push es ;
mov es,[config_wrkseg]; ES:DI to point to next available byte
pop ds ; DS:SI to point to envvar
assume ds:nothing ;
;
; Have to calculate the length of the variable name (and if we hit
; the end of the line before we hit '=', then it's curtains for this
; config.sys line)
;
; The check for NULL is important because copy_envvar is also used to copy
; the initial CONFIG= setting, which will have been zapped by a NULL if no
; menu block existed (in order to prevent the creation of an environment)
;
sub cx,cx ;
copy_varlen: ;
lodsb ;
or al,al ; NULL?
stc ;
jz copy_envexit ; yes, abort
cmp al,CR ;
stc ;
je copy_envexit ;
cmp al,LF ;
stc ;
je copy_envexit ;
inc cx ;
cmp al,'=' ;
jne copy_varlen ;
mov al,0 ;
mov ah,[si] ; save char after '='
sub si,cx ; back up to given varname
dec cx ; CX == # of bytes in varname
sub di,di ; start looking for DS:SI at ES:0
copy_varsrch:
cmp byte ptr es:[di],al
je copy_envprep ; search failed, just copy var
mov bx,di ; ES:BX -> start of this varname
push cx ;
push si ;
repe cmpsb ;
pop si ;
pop cx ;
jne copy_varnext ; no match, skip to next varname
cmp byte ptr es:[di],'='
jne copy_varnext ; no match, there's more characters
;
; Previous occurrence of variable has been found; determine the
; entire length and then destroy it
;
mov cx,-1 ;
repne scasb ; guaranteed to get null (since we put it there)
push si ;
mov si,di ;
mov di,bx ;
mov cx,[config_envlen]
sub cx,si ; destroy variable now
rep movs byte ptr es:[di],byte ptr es:[si]
pop si ;
copy_envprep:
cmp ah,CR ; if there is nothing after the '='
je copy_envdel ; then just exit with variable deleted
cmp ah,LF ;
je copy_envdel ;
jmp short copy_envloop
copy_varnext: ;
push cx ;
mov cx,-1 ;
repne scasb ;
pop cx ;
jmp copy_varsrch ;
copy_envloop: ;
lodsb ;
cmp al,CR ;
je copy_envdone ;
cmp al,LF ;
je copy_envdone ;
stosb ;
jmp copy_envloop ;
copy_envdone: ;
sub al,al ; do SUB to clear carry as well
stosb ; always null-terminate these puppies
copy_envdel: ;
mov es:[di],al ; and stick another null to terminate the env.
mov [config_envlen],di
copy_envexit: ;
pop es ;
pop ds ;
assume ds:sysinitseg ;
pop si ;
pop cx ;
ret ;
copy_envvar endp
;
;----------------------------------------------------------------------------
;
; copy_block: copy the current block to the new config.sys workspace
;
; INPUT
; CX == remaining bytes in "organized" config.sys memory image
; ES:SI -> remaining bytes in "organized" config.sys memory image
; DS:DI -> new config.sys workspace (equal in size to the original
; config.sys image) where the current block is to be copied
;
; OUTPUT
; Same as above
; AL also equals the last character read from the organized image
;
; OTHER REGS USED
; All
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public copy_block
copy_block proc near
call get_char ; check for include
jc copy_done ;
and al,NOT CONFIG_OPTION_QUERY
cmp al,CONFIG_BEGIN ; another BEGIN implies END as well
je copy_done ;
;
; BOOTCON relies on these things being in-memory (sigh)
;
; cmp al,CONFIG_REM ; don't bother copying this
; je copy_nextline ;
; cmp al,CONFIG_COMMENT;don't bother copying this either
; je copy_nextline ;
;
; This is being left out for old reporting of bad command lines;
; alternatively, we could report the error here and save the rest of
; sysinit from ever having to deal with bogus CONFIG.SYS stuff...
;
; cmp al,CONFIG_UNKNOWN;don't bother copying this either too
; je copy_nextline ;
;
cmp al,CONFIG_INCLUDE
mov al,ah ; AL == the original line code
jne copy_line ; not an "include" line
;
; We have hit an "INCLUDE" line; first, REM out the line so that we
; never try to include the block again (no infinite include loops please),
; then search for the named block and call copy_block again.
;
mov byte ptr es:[si-1],CONFIG_REM
push di ;
mov di,offset szMenu
call comp_names_safe ; don't allow INCLUDE MENU
je copy_skip ;
mov di,offset szCommon
call comp_names_safe ; don't allow INCLUDE COMMON
je copy_skip ;
mov di,si ; try to find the block
call srch_block ;
mov dx,di ;
pop di ;
jne copy_error ; no such block
push cx ;
mov cx,bx ;
push si ;
dec dx ;
mov si,dx ;
call skip_line ; skip the rest of the "block name" line
call copy_block ; and copy in the rest of that block
pop si ;
pop cx ;
sub al,al ; force skip_opt_line to skip...
jmp short copy_nextline
copy_skip:
pop di
copy_error:
clc ;
call print_error ; note that carry is clear, no pause
jmp short copy_nextline
;
; Copy the line at ES:SI to the current location at DS:DI
;
copy_line:
mov [di],al ;
inc di ;
cmp al,' ' ; is this is a "real" line with a "real" code?
jb copy_nextline ; no
cmp cs:[config_multi],0
je copy_loop ; not a multi-config config.sys, don't embed #s
call get_linenum ; BX == line # of line @ES:SI
mov [di],bx ; stash it immediately following the line code
inc di ;
inc di ;
jmp short copy_next ;
copy_loop: ;
call get_char ;
jc copy_done ; end of file
mov [di],al ;
inc di ;
copy_next:
cmp al,LF ; done with line?
jne copy_loop ; nope
copy_nextline:
call skip_opt_line ;
jmp copy_block ;
copy_done:
ret
copy_block endp
;
;----------------------------------------------------------------------------
;
; get_linenum: return line # (in BX) of current line (@ES:SI)
;
; INPUT
; ES:SI -> some line in the config.sys memory image
;
; OUTPUT
; BX == line # (relative to 1)
;
; OTHER REGS USED
; DX
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public get_linenum
get_linenum proc near
push ax ;
sub bx,bx ; BX == line # (to be returned)
push cx ;
mov dx,si ; DX == the offset we're looking for
push si ;
mov cx,cs:[count] ;
sub si,si ; prepare to scan entire file
get_linenum_loop: ;
call skip_line ;
jc get_linenum_done;
inc bx ;
cmp si,dx ; have we exceeded the desired offset yet?
jb get_linenum_loop; no
get_linenum_done: ;
pop si ;
pop cx ;
pop ax ;
ret ;
get_linenum endp
;
;----------------------------------------------------------------------------
;
; srch_block: searches entire config.sys for block name @ES:DI
;
; INPUT
; ES -> config.sys image
; ES:DI -> block name to find
;
; OUTPUT
; ZF flag set, if found
; ES:DI -> just past the name in the block heading, if found
; BX == # bytes remaining from that point, if found
;
; OTHER REGS USED
; None
;
; NOTES
; This differs from "find_block" in that it searches the ENTIRE
; config.sys image, not merely the remaining portion, and that it
; takes a pointer to block name that is *elsewhere* in the image
; (ie, ES) as opposed to some string constant in our own segment (DS).
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public srch_block
srch_block proc near ; returns BX -> named block in CONFIG.SYS
push ax ;
push cx ;
mov cx,cs:[count] ;
push si ;
sub si,si ;
push ds ;
push es ;
pop ds ;
call find_block ;
mov di,si ;
mov bx,cx ;
pop ds ;
pop si ;
pop cx ;
pop ax ;
ret ;
srch_block endp
;
;----------------------------------------------------------------------------
;
; find_block: searches rest of config.sys for block name @DS:DI
;
; INPUT
; DS:DI -> block name to find
; ES:SI -> remainder of config.sys image
; CX == remaining size of config.sys image
;
; OUTPUT
; ZF flag set, if found (also, CF set if EOF)
; ES:SI -> where the search stopped (at end of block name or EOF)
; CX == # bytes remaining from that point
;
; OTHER REGS USED
; AX
;
; NOTES
; This differs from "srch_block" in that it searches only the
; remaining portion of the config.sys image and leaves SI and CX
; pointing to where the search left off, and that it takes a pointer
; to search string in our own segment (DS:DI instead of ES:DI).
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public find_block
find_block proc near
call get_char ; get line code
jc find_exit ; end of file
and al,NOT CONFIG_OPTION_QUERY
cmp al,CONFIG_BEGIN ; beginning of a block?
je check_line ; no
cmp al,CONFIG_INCLUDE
jne next_line ;
or cs:[config_multi],1
jmp short next_line ;
check_line:
or cs:[config_multi],1
call comp_names ; compare block names
jbe find_exit ; end of file, or names matched
next_line:
call skip_opt_line ; no, so skip to next line
jmp find_block ;
find_exit:
ret
find_block endp
;
;----------------------------------------------------------------------------
;
; comp_names: compares keyword @DS:DI to position in config.sys @ES:SI
;
; INPUT
; DS:DI -> keyword to compare
; ES:SI -> position in config.sys
; CX == remaining bytes in config.sys
;
; OUTPUT
; ZF flag set, if match (also, CF set if EOF)
; ES:SI -> where the comparison stopped (at end of block name or EOF)
; CX == # bytes remaining from that point
;
; OTHER REGS USED
; AX
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public comp_names
comp_names proc near
push di ;
comp_loop: ;
call get_char ;
jc comp_exit ;
call any_delim ; is next character a delimiter?
mov ah,[di] ; (get next character we're supposed to match)
je comp_almost ; yes, it *could* be a match
inc di ;
and ax,not 2020h ; BUGBUG -- assumes both names are alphanumeric -JTP
cmp al,ah ; match?
je comp_loop ; yes, keep looking at the characters
clc ; prevent erroneous eof indication: clear carry
comp_exit: ;
pop di ;
ret ;
comp_almost: ;
xchg al,ah ; we don't know for sure if it's a match
call any_delim ; until we verify that the second string has
xchg al,ah ; been exhausted also...
jmp comp_exit ; if we are, this call to any_delim will tell...
comp_names endp
public comp_names_safe
comp_names_safe proc near
push ax
push cx
push si
push ds
push cs
pop ds
call comp_names
pop ds
pop si
pop cx
pop ax
ret
comp_names_safe endp
;
;----------------------------------------------------------------------------
;
; print_item: display menu item #BL
;
; INPUT
; BL == menu item # to display
;
; OUTPUT
; Menu item displayed, with appropriate highlighting if BL == bDefBlock
;
; OTHER REGS USED
; None
;
; NOTES
; This function saves/restores the current cursor position, so you
; needn't worry about it.
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public print_item
print_item proc near ; prints menu item #BL (1 to N)
push ax ;
push bx ;
push cx ;
push dx ;
push si ;
mov ah,03h ; get cursor position
mov bh,[bMenuPage] ; always page zero
int 10h ; DH/DL = row/column
push dx ; save it
mov ah,02h ; set cursor position
mov dh,bl ;
add dh,3 ;
mov dl,5 ;
int 10h ; set cursor position for correct row/col
mov al,bl ;
add al,'0' ; convert menu item # to ASCII digit
mov ah,[bMenuColor] ; normal attribute
cmp bl,[bDefBlock] ; are we printing the current block?
jne print_other ; no
or ah,70h ; yes, set bgnd color to white
mov ch,ah ;
mov cl,4 ;
rol ch,cl ;
cmp ch,ah ; are fgnd/bgnd the same?
jne print_other ; no
xor ah,08h ; yes, so modify the fgnd intensity
print_other: ;
mov bh,0 ;
add bx,bx ;
mov di,aoffBlockDesc[bx]
mov bl,ah ; put the attribute in the correct register now
mov bh,[bMenuPage] ; get correct video page #
mov ah,09h ; write char/attr
mov cx,1 ;
int 10h ;
inc dl ; increment column
mov ah,02h ;
int 10h ;
mov ax,0900h+'.' ;
int 10h ; display '.'
inc dl ; increment column
mov ah,02h ;
int 10h ;
mov ax,0900h+' ' ;
int 10h ; display ' '
inc dl ; increment column
mov ah,02h ;
int 10h ;
push es ;
print_loop: ;
mov al,es:[di] ; get a character of the description
inc di ;
cmp al,TAB ; substitute spaces for tabs
jne print_nontab ;
mov al,' ' ;
print_nontab: ;
cmp al,' ' ;
jb print_done ; stop at the 1st character < space
cmp al,'$' ;
je print_done ; also stop on $
mov ah,09h ; display function #
int 10h ;
inc dl ; increment column
cmp dl,78 ; far enough?
jae print_done ; yes
mov ah,02h ;
int 10h ;
jmp print_loop ;
print_done: ;
pop es ;
pop dx ;
mov ah,02h ;
int 10h ; restore previous row/col
pop si ;
pop dx ;
pop cx ;
pop bx ;
pop ax ;
ret ;
print_item endp
;
;----------------------------------------------------------------------------
;
; select_item: wait for user to select menu item, with time-out
;
; INPUT
; None
;
; OUTPUT
; BX == menu item # (1-N), or -1 for clean boot
; Selected menu item highlighted
; Cursor positioned beneath menu, ready for tty-style output now
;
; OTHER REGS USED
; None
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public select_item
select_item proc near ; returns digit value in BX (trashes AX/CX/DX)
mov bl,[bDefBlock] ; BL will be the default block #
mov al,bl ;
call disp_num ;
call show_status ; display current interactive status
cmp byte ptr [secTimeOut],-1
je input_key ; no time-out, just go to input
mov ah,Get_Time ;
int 21h ;
mov bh,dh ; BH = initial # of seconds
check_time:
mov al,[secTimeOut] ;
sub al,[secElapsed] ;
jae show_time ;
or byte ptr [bQueryOpt],2 ; disable all further prompting
mov byte ptr [secElapsed],0
jmp select_done ; time's up!
show_time:
push bx ;
mov bl,al ; save # in BL
mov bh,[bMenuPage] ;
mov ah,03h ; get cursor position
int 10h ;
push dx ;
add dl,8 ; move cursor to the right
mov ah,02h ; set cursor position
int 10h ;
mov dx,offset $TimeOut
call print ; print the "Time remaining: " prompt
mov al,bl ; recover # from BL
cbw ; this works because AL is always <= 90
mov cl,10 ;
div cl ; AL = tens digit, AH = ones digit
mov cl,ah ;
add al,'0' ;
mov ah,0Eh ;
int 10h ; write TTY tens digit
mov al,cl ;
add al,'0' ;
mov ah,0Eh ;
int 10h ; write TTY ones digit
pop dx
mov ah,02h ; set cursor position back to where it was
int 10h ;
pop bx ;
input_key:
mov ah,Raw_Con_IO ;
mov dl,0FFh ; input request
int 21h ;
jnz got_key ;
cmp byte ptr [secTimeOut],-1; is there a time-out?
je input_key ; no, just go back to input
mov ah,Get_Time ;
int 21h ; DH = seconds
mov ah,dh ;
sub dh,bh ; should generally be zero or one
mov bh,ah ;
jnc got_time ;
mov dh,1 ; it wrapped back to zero, so assume one
got_time:
or dh,dh ; any change?
jz input_key ; no
add [secElapsed],dh ;
jmp check_time ;
got_key:
push ax ;
mov ax,-1 ; zap both secTimeOut and secElapsed
xchg word ptr [secTimeOut],ax
cmp al,-1 ; was time-out already disabled?
je timeout_disabled; yes
push bx ; let's disable # seconds display
mov ax,0A20h ; write multiple spaces
mov bx,word ptr [bMenuColor]
mov cx,80 ; 80 of them, to be safe
int 10h ; to completely obliterate # seconds display
pop bx ;
timeout_disabled:
pop ax ;
or al,al ; extended key pressed?
jnz normal_key ; no
int 21h ; get the next part of the key then
jz input_key ; hmmm, what happened to the second part?
cmp al,48h ; up arrow?
jne not_up ; no
cmp bl,1 ; are we as up as up can get?
jbe input_key ; yes, ignore it
dec [bDefBlock] ;
call print_item ; re-print the current item
dec bl ; and then print the new current item
jmp short print1
not_up:
cmp al,50h ; down arrow?
jne not_down ; no
cmp bl,[bMaxBlock] ; are we as down as down can get?
jae to_input_key ; yes, ignore it
inc [bDefBlock] ;
call print_item ; re-print the current item
inc bx ; and then print the new current item
print1: mov al,bl ;
print2: call print_item ;
call disp_num ;
to_input_key:
jmp input_key ;
not_down:
test byte ptr [bDisableUI],1
jnz to_input_key ; don't allow F8 or F5
cmp al,42h ; F8 function key?
jne not_f8 ; no
xor byte ptr [bQueryOpt],1
call show_status ;
jmp input_key ;
not_f8:
cmp al,3Fh ; F5 function key?
jne to_input_key ; no
mov bx,-1 ; special return code (-1) indicating clean boot
mov al,' ' ; don't want to display anything really;
jmp short disp_input; just want to display the cr/lf sequence...
normal_key:
cmp al,0Dh ; Enter?
je select_done ; yes
cmp al,08h ; backspace?
jne not_backspace ; no
mov bx,-2 ; yes, special return code
ret ;
not_backspace:
sub al,'0' ; is greater than '0'?
jbe to_input_key ; no
cmp al,[bMaxBlock] ; is less than or equal to the maximum digit?
ja to_input_key ; no
mov [bDefBlock],al ;
call print_item ; redisplay the current selection
mov bl,al ; set new selection
jmp print2
select_done:
mov bh,0 ; return a full 16-bit value (for indexing)
mov al,bl ;
add al,'0' ; convert it into a digit, then display it
if2
.errnz disp_input-$ ; fall into disp_input
endif
select_item endp
;
;----------------------------------------------------------------------------
;
; disp_input: display a single character + cr/lf
;
; INPUT
; AL == character to display
;
; OUTPUT
; None
;
; OTHER REGS USED
; None
;
; NOTES
; This function is used not only for the menu input selection but
; also for the interactive line prompting (the y/n/a thing).
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public disp_input
disp_input proc near
push ax
cmp al,' '
jae disp_ok
mov al,' '
disp_ok:
mov dl,al
mov ah,Std_Con_Output
int 21h
mov dx,offset crlfm
call print
pop ax
ret
disp_input endp
disp_num proc near
push bx
add al,'0'
mov ah,0Ah
mov bx,word ptr [bMenuColor]
mov cx,1
int 10h
pop bx
ret
disp_num endp
;
;----------------------------------------------------------------------------
;
; show_status: display current interactive mode setting (on/off/none)
;
; INPUT
; None
;
; OUTPUT
; None
;
; OTHER REGS USED
; None
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public show_status
show_status proc near
push bx ; BL = video page #
mov bx,word ptr [bMenuColor]
mov ah,03h ; get cursor position
int 10h ;
push dx ; save it
mov ah,02h ; set cursor position
mov dx,word ptr [bLastCol] ; set correct row/col
test byte ptr [bDisableUI],1
jz show_onoff ; just show on/off
mov dl,0 ;
int 10h ;
mov ax,0A20h ; write multiple spaces
mov cx,80 ; 80 of them, to be exact
int 10h ; to obliterate the status line
jmp short show_done ;
show_onoff: ;
int 10h ;
mov al,$NO ; assume OFF
cmp byte ptr [bQueryOpt],1 ; is interactive mode on?
jne show_noton ; no
mov al,$YES ; yes
show_noton: ;
mov ah,0Eh ; write TTY
int 10h ;
show_done: ;
pop dx ;
mov ah,02h ;
int 10h ; restore original cursor position
pop bx ;
ret ;
show_status endp
;
;----------------------------------------------------------------------------
;
; skip_token: advances ES:SI/CX past the current token
;
; INPUT
; ES:SI -> position in config.sys
; CX == remaining bytes in config.sys
;
; OUTPUT
; CF set if EOL/EOF hit
; AL == 1st char of delimiter
; ES:SI -> just past the delimiter
; CX == # bytes remaining from that point
;
; OTHER REGS USED
; AX
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public skip_token
skip_token proc near
call get_char
jc skip_token_done
call any_delim
jne skip_token
skip_check_eol:
cmp al,CR
je skip_token_eol
cmp al,LF
je skip_token_eol
clc
jmp short skip_token_done
skip_token_eol:
stc
skip_token_done:
ret
skip_token endp
;
;----------------------------------------------------------------------------
;
; skip_delim: advances ES:SI/CX past the current delimiter
;
; INPUT
; ES:SI -> position in config.sys
; CX == remaining bytes in config.sys
;
; OUTPUT
; CF set if EOF hit
; AL == 1st char of token
; ES:SI -> just past the token
; CX == # bytes remaining from that point
; ES:BX -> new token (since ES:SI is already pointing 1 byte past token)
;
; OTHER REGS USED
; AX
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public skip_delim
skip_delim proc near ; returns carry set if eol/eof
call get_char ;
lea bx,[si-1] ; also returns BX -> next token
jc skip_token_done ;
call delim ;
je skip_delim ;
jmp skip_check_eol ;
skip_delim endp
;
;----------------------------------------------------------------------------
;
; skip_opt_line: same as skip_line provided AL != LF
;
; INPUT
; AL == last character read
; ES:SI -> position in config.sys
; CX == remaining bytes in config.sys
;
; OUTPUT
; CF set if EOF hit
; AL == 1st char of new line
; ES:SI -> just past 1st char of new line
; CX == # bytes remaining from that point
;
; OTHER REGS USED
; AX
;
; NOTES
; In other words, the purpose here is to skip to the next line,
; unless ES:SI is already sitting at the front of the next line (which
; it would be if the last character fetched -- AL -- was a linefeed)
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public skip_opt_line
skip_opt_line proc near
cmp al,LF
je skip_line_done
if2
.errnz skip_line-$ ; fall into skip_line
endif
skip_opt_line endp
;
;----------------------------------------------------------------------------
;
; skip_line: skip to the next line
;
; INPUT
; ES:SI -> position in config.sys
; CX == remaining bytes in config.sys
;
; OUTPUT
; CF set if EOF hit
; ES:SI -> just past 1st char of new line
; CX == # bytes remaining from that point
;
; OTHER REGS USED
; AX
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public skip_line
skip_line proc near
call get_char
jc skip_line_done
cmp al,LF
jne skip_line
skip_line_done:
ret
skip_line endp
;
;----------------------------------------------------------------------------
;
; get_number: return binary equivalent of numeric string
;
; INPUT
; ES:SI -> position in config.sys
; CX == remaining bytes in config.sys
;
; OUTPUT
; AL == non-digit encountered
; BX == binary #
; ES:SI -> just past 1st non-digit
; CX == # bytes remaining from that point
;
; OTHER REGS USED
; AX
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public get_number
get_number proc near
sub bx,bx ; BX = result
num_loop:
call get_char ;
jc num_done ;
cmp al,'0' ; convert to value
jb num_done ; no more number
cmp al,'9' ;
ja num_done ;
push ax ;
mov ax,10 ;
push dx ;
mul bx ;
pop dx ;
mov bx,ax ;
pop ax ;
sub al,'0' ;
cbw ;
add bx,ax ;
jmp num_loop ;
num_done:
ret
get_number endp
;
;----------------------------------------------------------------------------
;
; get_char: return next character, advance ES:SI, and decrement CX
;
; INPUT
; ES:SI -> position in config.sys
; CX == remaining bytes in config.sys
;
; OUTPUT
; AL == next character
; ES:SI -> just past next character
; CX == # bytes remaining from that point
;
; OTHER REGS USED
; AX
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public get_char
get_char proc near
sub cx,1 ; use SUB to set carry,zero
jb get_fail ; out of data
lods byte ptr es:[si];
mov ah,al ;
ret ;
get_fail: ; restore CX to zero
mov cx,0 ; leave carry set, zero not set
nearby_ret:
ret
get_char endp
;
;----------------------------------------------------------------------------
;
; query_user: ask user whether to execute current config.sys command
;
; INPUT
; AL == current command code
; ES:SI -> current command line in config.sys
; config_cmd == current command code, but with QUERY bit intact
; (00h used to generate "Process AUTOEXEC.BAT" prompt)
;
; OUTPUT
; CF set if command should be ignored (it is also REM'ed out)
;
; OTHER REGS USED
; BX, CX, DX, DI
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public query_user
query_user proc near
test byte ptr [bQueryOpt],4 ; answer no to everything?
jz @F ;
jmp skip_all ;
@@: test byte ptr [bQueryOpt],2 ; answer yes to everything?
jnz nearby_ret ; yes (and return carry clear!)
push ax ;
mov al,[config_cmd] ;
test byte ptr [bQueryOpt],1 ; query every command?
jnz query_all ; yes
test al,CONFIG_OPTION_QUERY ;
jnz query_all ;
jmp do_cmd ;
query_all:
;
; Search for the command code (AL) in "comtab", and then print
; out the corresponding keyword, followed by the rest of the actual
; line pointed to by ES:SI
;
push si ; save pointer to rest of CONFIG.SYS line
mov dx,offset $AutoPrmpt ;
and al,NOT CONFIG_OPTION_QUERY
jz generic_prompt ; config_cmd must have been 0
mov dh,al ; save config_cmd in DH
sub bx,bx ;
mov di,offset comtab ;
find_match: ;
mov bl,[di] ; get size of current keyword
or bl,bl ;
jz line_print ; end of table
inc di ;
cmp al,[di+bx] ; match?
je cmd_match ; yes
lea di,[di+bx+1] ; otherwise, skip this command code
jmp find_match ; loop
cmd_match: ;
mov cl,[di-1] ;
mov ch,0 ;
mov ah,Std_Con_Output
cmd_print: ;
mov al,[di] ;
inc di ;
mov dl,al ;
int 21h ;
loop cmd_print ;
mov dl,'=' ;
cmp dh,CONFIG_SET ; for SET commands, don't display a '='
jne cmd_notset ;
mov dl,' ' ;
cmd_notset:
int 21h ; '=' looks funny on SET commands
line_print: ;
lods byte ptr es:[si] ;
or al,al ;
jnz non_null ;
mov al,' ' ;
non_null: ;
cmp al,' ' ; control code?
jb prompt_user ; yes, assume end of line
jne non_space ;
cmp byte ptr es:[si],' ' ;
jb prompt_user ;
non_space: ;
mov dl,al ;
mov ah,Std_Con_Output ;
int 21h ;
jmp line_print ;
prompt_user: ;
mov dx,offset $InterPrmpt ;
generic_prompt:
call print ;
input_loop: ;
mov ah,0 ; read a key
int 16h ;
or al,al ; is it a function key?
jnz not_func ; no
cmp ah,3Fh ; F5 function key?
jne input_loop ; no
mov al,$NO ;
or byte ptr [bQueryOpt],4 ; no more queries
jmp short legal_char ;
not_func:
and al,not 20h ; converting to upper case
cmp al,$NO ; verify character is legal
je legal_char ;
cmp al,$YES ;
je legal_char ;
cmp [config_cmd],0 ;
je input_loop ; don't allow Esc on this query
cmp al,1Bh ; Esc?
jne input_loop ;
or byte ptr [bQueryOpt],2 ; no more interactive boot prompts
mov al,$YES
legal_char: ;
call disp_input ;
pop si ; restore pointer to rest of CONFIG.SYS line
cmp al,$NO ; process line?
je skip_cmd ; no
do_cmd:
pop ax ;
clc ; just do the command
ret
skip_cmd:
pop ax ;
skip_all:
mov ah,CONFIG_REM ; fake out the rest of sysinit's processing
stc
ret
query_user endp
;
;----------------------------------------------------------------------------
;
; print_error: displays multi-config error conditions
;
; INPUT
; Carry set to pause, clear to not
; ES:SI -> current command line in config.sys
;
; OUTPUT
; None
;
; OTHER REGS USED
; None
;
; NOTES
; None
;
; HISTORY
; Created 16-Mar-1992 by JeffPar
;
;----------------------------------------------------------------------------
;
public print_error
extrn error_line:near
extrn linecount:word
print_error proc near
push ax
push bx
push cx
push dx
push ds
push cs
pop ds
pushf
call get_linenum
mov [linecount],bx
call error_line
popf
jnc pe_ret
mov dx,offset $PauseMsg
call print
mov ax,0C07h ; flush input buffer, then wait for key
int 21h ; wait for a key
or al,al ; extended key?
jnz @F ; no
mov ah,07h ; yes
int 21h ; eat it too
@@: mov dx,offset crlfm
call print
pe_ret: pop ds
pop dx
pop cx
pop bx
pop ax
ret
print_error endp
;
; This function is very simple: it merely prepends a "/D" to the
; command-line for the shell; this (undocumented) switch disables
; AUTOEXEC.BAT processing and the date/time prompt that is usually
; displayed when there's no AUTOEXEC.BAT.
;
public disable_autoexec
disable_autoexec proc near
or byte ptr [bQueryOpt],2
mov al,[command_line-1] ; get default switchchar
or al,al ; anything there?
jz disable_exit ; no, disable_autoexec already called
mov bl,[command_line] ;
mov bh,0 ; BX == command-line length
mov cx,bx ;
add bl,3 ;
cmp bl,126 ;
ja disable_exit ;
mov [command_line],bl ; update length
add bx,offset command_line+1; make sure we move the NULL too
inc cx ; (just for consistency sake)
disable_loop: ;
mov ah,[bx-3] ;
mov [bx],ah ;
dec bx ;
loop disable_loop ;
mov [bx-2],al ;
mov word ptr [bx-1],' D' ; /D is stuffed into place now
mov byte ptr [command_line-1],0
disable_exit: ;
ret ;
disable_autoexec endp
assume ds:nothing
endif ;MULTI_CONFIG
;
;----------------------------------------------------------------------------
;
; procedure : delim
;
;----------------------------------------------------------------------------
;
ifdef MULTI_CONFIG
any_delim proc near
cmp al,CR
je delim_ret
cmp al,LF
je delim_ret
cmp al,'['
je delim_ret
cmp al,']'
je delim_ret
if2
.errnz delim-$
endif
any_delim endp
endif ;MULTI_CONFIG
delim proc near
cmp al,'/' ; ibm will assume "/" as an delimeter.
jz delim_ret
cmp al, 0 ; special case for sysinit!!!
jz delim_ret
org_delim: ; used by organize routine except for getting
cmp al,' ' ;the filename.
jz delim_ret
cmp al,TAB
jz delim_ret
cmp al,'='
jz delim_ret
cmp al,','
jz delim_ret
cmp al,';'
ifdef MULTI_CONFIG
;
; Make sure there's no chance of a false EOF indication
;
clc
endif
delim_ret:
ret
delim endp
;
;----------------------------------------------------------------------------
;
; procedure : newline
;
; newline returns with first character of next line
;
;----------------------------------------------------------------------------
;
newline proc near
call getchr ;skip non-control characters
jc nl_ret
cmp al,lf ;look for line feed
jnz newline
call getchr
nl_ret:
ret
newline endp
;
;----------------------------------------------------------------------------
;
; procedure : mapcase
;
;----------------------------------------------------------------------------
;
mapcase proc near
push cx
push si
push ds
push es
pop ds
ifdef MULTI_CONFIG
mov bl,al ; same cmd code this line
else
xor si,si
endif
convloop:
lodsb
ifdef DBCS
call testkanj
jz normconv ; if this is not lead byte
mov ah,al
lodsb ; get tail byte
cmp ax,DB_SPACE
jnz @f ; if this is not dbcs space
mov word ptr [si-2],' ' ; set 2 single space
@@:
dec cx
jcxz convdone ; just ignore 1/2 kanji error
jmp short noconv
;fall through, know al is not in 'a'-'z' range
normconv:
endif
cmp al,'a'
jb noconv
cmp al,'z'
ja noconv
sub al,20h
mov [si-1],al
noconv:
ifdef MULTI_CONFIG
;
; When MULTI_CONFIG enabled, "mapcase" is used to map everything to
; upper-case a line at a time, after we've been able to figure out whether
; the line is a SET command or not (since we don't want to upper-case
; anything after the "=" in a SET)
;
cmp bl,CONFIG_SET ; preserve case for part of the line?
jne check_eol ; no, just check for end-of-line
cmp al,'=' ; separator between SET var and value?
je convdone ; yes
check_eol:
cmp al,cr
je convdone
cmp al,lf
je convdone
endif
loop convloop
convdone:
pop ds
pop si
pop cx
ret
ifdef DBCS
public testkanj
testkanj:
push si
push ds
push ax
mov ax,6300h ; get dos dbcs vector
int 21h
pop ax
bdbcs_do:
cmp ds:word ptr [si],0 ; end of lead byte info?
jz bdbcs_notfound ; jump if so
cmp al,ds:[si] ; less than first byte character?
jb bdbcs_next ; jump if not
cmp al,ds:[si+1] ; grater than first byte character?
ja bdbcs_next
bdbcs_found:
push ax
xor ax,ax
inc ax ; reset zero flag
pop ax
bdbcs_exit:
pop ds
pop si
ret
bdbcs_notfound:
push ax
xor ax,ax ; set zero flag
pop ax
jmp short bdbcs_exit
bdbcs_next:
add si,2 ; points next lead byte table
jmp short bdbcs_do
endif ; DBCS
mapcase endp
ENDIF ; CONFIGPROC
;
;----------------------------------------------------------------------------
;
; procedure : round
;
; round the values in memlo and memhi to paragraph boundary.
; perform bounds check.
;
;----------------------------------------------------------------------------
;
round proc near
push ax
mov ax,[memlo]
call pararound ; para round up
add [memhi],ax
mov [memlo],0
mov ax,memhi ; ax = new memhi
cmp ax,[alloclim] ; if new memhi >= alloclim, error
jae mem_err
test cs:[setdevmarkflag], for_devmark
jz skip_set_devmarksize
push es
push si
mov si, cs:[devmark_addr]
mov es, si
sub ax, si
dec ax
mov es:[devmark_size], ax ; paragraph
and cs:[setdevmarkflag], not_for_devmark
pop si
pop es
skip_set_devmarksize:
pop ax
clc ;clear carry
ret
mem_err:
mov dx,offset badmem
push cs
pop ds
call print
jmp stall
round endp
IFDEF CONFIGPROC
;
;----------------------------------------------------------------------------
;
; procedure : calldev
;
;----------------------------------------------------------------------------
;
calldev proc near
mov ds,word ptr cs:[DevEntry+2]
add bx,word ptr cs:[DevEntry] ;do a little relocation
mov ax,ds:[bx]
push word ptr cs:[DevEntry]
mov word ptr cs:[DevEntry],ax
mov bx,offset packet
call [DevEntry]
pop word ptr cs:[DevEntry]
ret
calldev endp
;
;----------------------------------------------------------------------------
;
; procedure : todigit
;
;----------------------------------------------------------------------------
;
todigit proc near
sub al,'0'
jb notdig
cmp al,9
ja notdig
clc
ret
notdig:
stc
ret
todigit endp
;
;----------------------------------------------------------------------------
;
; procedure : getnum
;
; getnum parses a decimal number.
; returns it in ax, sets zero flag if ax = 0 (may be considered an
; error), if number is bad carry is set, zero is set, ax=0.
;
;----------------------------------------------------------------------------
;
getnum proc near
push bx
xor bx,bx ; running count is zero
b2:
call todigit ; do we have a digit
jc badnum ; no, bomb
xchg ax,bx ; put total in ax
push bx ; save digit
mov bx,10 ; base of arithmetic
mul bx ; shift by one decimal di...
pop bx ; get back digit
add al,bl ; get total
adc ah,0 ; make that 16 bits
jc badnum ; too big a number
xchg ax,bx ; stash total
call getchr ;get next digit
jc b1 ; no more characters
cmp al, ' ' ; space?
jz b15 ; then end of digits
cmp al, ',' ; ',' is a seperator!!!
jz b15 ; then end of digits.
cmp al, tab ; tab
jz b15
cmp al,sepchr ; allow 0 or special separators
jz b15
cmp al,'/' ; see if another switch follows
nop ; cas - remnant of old bad code
nop
jz b15
cmp al,lf ; line-feed?
jz b15
cmp al,cr ; carriage return?
jz b15
or al,al ; end of line separator?
jnz b2 ; no, try as a valid char...
b15:
inc count ; one more character to s...
dec chrptr ; back up over separator
b1:
mov ax,bx ; get proper count
or ax,ax ; clears carry, sets zero accordingly
pop bx
ret
badnum:
mov sepchr,0
xor ax,ax ; set zero flag, and ax = 0
pop bx
stc ; and carry set
ret
getnum endp
;*****************************************************************
setdoscountryinfo proc near
;input: es:di -> pointer to dos_country_cdpg_info
; ds:0 -> buffer.
; si = 0
; ax = country id
; dx = code page id. (if 0, then use ccsyscodepage as a default.)
; bx = file handle
; this routine can handle maxium 438 country_data entries.
;
;output: dos_country_cdpg_info set.
; carry set if any file read failure or wrong information in the file.
; carry set and cx = -1 if cannot find the matching country_id, codepage
; _id in the file.
push di
push ax
push dx
xor cx,cx
xor dx,dx
mov ax,512 ;read 512 bytes
call readincontrolbuffer ;read the file header
jc setdosdata_fail
push es
push si
push cs
pop es
mov di,offset country_file_signature
mov cx,8 ;length of the signature
repz cmpsb
pop si
pop es
jnz setdosdata_fail ;signature mismatch
add si,18 ;si -> county info type
cmp byte ptr ds:[si],1 ;only accept type 1 (currently only 1 header type)
jne setdosdata_fail ;cannot proceed. error return
inc si ;si -> file offset
mov dx,word ptr ds:[si] ;get the info file offset.
mov cx,word ptr ds:[si+2]
mov ax,6144 ;read 6144 bytes.
call readincontrolbuffer ;read info
jc setdosdata_fail
mov cx, word ptr ds:[si] ;get the # of country, codepage combination entries
cmp cx, 438 ;cannot handle more than 438 entries.
;
ja setdosdata_fail
inc si
inc si ;si -> entry information packet
pop dx ;restore code page id
pop ax ;restore country id
pop di
setdoscntry_find: ;search for desired country_id,codepage_id.
cmp ax, word ptr ds:[si+2] ;compare country_id
jne setdoscntry_next
cmp dx, 0 ;no user specified code page ?
je setdoscntry_any_codepage;then no need to match code page id.
cmp dx, word ptr ds:[si+4] ;compare code page id
je setdoscntry_got_it
setdoscntry_next:
add si, word ptr ds:[si] ;next entry
inc si
inc si ;take a word for size of entry itself
loop setdoscntry_find
mov cx, -1 ;signals that bad country id entered.
setdoscntry_fail:
stc
ret
setdosdata_fail:
pop si
pop cx
pop di
jmp short setdoscntry_fail
setdoscntry_any_codepage: ;use the code_page_id of the country_id found.
mov dx, word ptr ds:[si+4]
setdoscntry_got_it: ;found the matching entry
mov cs:cntrycodepage_id, dx ;save code page id for this country.
mov dx, word ptr ds:[si+10] ;get the file offset of country data
mov cx, word ptr ds:[si+12]
mov ax, 512 ;read 512 bytes
call readincontrolbuffer
jc setdoscntry_fail
mov cx, word ptr ds:[si] ;get the number of entries to handle.
inc si
inc si ;si -> first entry
setdoscntry_data:
push di ;es:di -> dos_country_cdpg_info
push cx ;save # of entry left
push si ;si -> current entry in control buffer
mov al, byte ptr ds:[si+2] ;get data entry id
call getcountrydestination ;get the address of destination in es:di
jc setdoscntry_data_next ;no matching data entry id in dos
mov dx, word ptr ds:[si+4] ;get offset of data
mov cx, word ptr ds:[si+6]
mov ax,4200h
stc
int 21h ;move pointer
jc setdosdata_fail
mov dx,512 ;start of data buffer
mov cx,20 ;read 20 bytes only. we only need to
mov ah,3fh ;look at the length of the data in the file.
stc
int 21h ;read the country.sys data
jc setdosdata_fail ;read failure
cmp ax,cx
jne setdosdata_fail
mov dx,word ptr ds:[si+4] ;get offset of data again.
mov cx,word ptr ds:[si+6]
mov ax,4200h
stc
int 21h ;move pointer back again
jc setdosdata_fail
push si
mov si,(512+8) ;get length of the data from the file
mov cx,word ptr ds:[si]
pop si
mov dx,512 ;start of data buffer
add cx,10 ;signature + a word for the length itself
mov ah,3fh ;read the data from the file.
stc
int 21h
jc setdosdata_fail
cmp ax, cx
jne setdosdata_fail
mov al,byte ptr ds:[si+2] ;save data id for future use.
mov si,(512+8) ;si-> data buffer + id tag field
mov cx,word ptr ds:[si] ;get the length of the file
inc cx ;take care of a word for lenght of tab
inc cx ;itself.
cmp cx,(2048 - 512 - 8) ;fit into the buffer?
ja setdosdata_fail
if bugfix
call setdbcs_before_copy
endif
cmp al, setcountryinfo ;is the data for setcountryinfo table?
jne setdoscntry_mov ;no, don't worry
push word ptr es:[di+ccmono_ptr-cccountryinfolen] ;cannot destroy ccmono_ptr address. save them.
push word ptr es:[di+ccmono_ptr-cccountryinfolen+2] ;at this time di -> cccountryinfolen
push di ;save di
push ax
mov ax,cs:cntrycodepage_id ;do not use the code page info in country_info
mov ds:[si+4], ax ;use the saved one for this !!!!
pop ax
setdoscntry_mov:
rep movsb ;copy the table into dos
cmp al, setcountryinfo ;was the ccmono_ptr saved?
jne setdoscntry_data_next
pop di ;restore di
pop word ptr es:[di+ccmono_ptr-cccountryinfolen+2] ;restore
pop word ptr es:[di+ccmono_ptr-cccountryinfolen]
setdoscntry_data_next:
pop si ;restore control buffer pointer
pop cx ;restore # of entries left
pop di ;restore pointer to dso_country_cdpg
add si, word ptr ds:[si] ;try to get the next entry
inc si
inc si ;take a word of entry length itself
dec cx
cmp cx,0
je setdoscntry_ok
jmp setdoscntry_data
setdoscntry_ok:
ret
setdoscountryinfo endp
if bugfix
setdbcs_before_copy proc near
cmp al,setdbcs ; dbcs vector set?
jnz @f ; jump if not
cmp word ptr es:[di], 0 ; zero byte data block?
jz @f ; jump if so
push di
push ax
push cx
mov cx,es:[di] ; load block length
add di,2 ; points actual data
xor al,al ; fill bytes
rep stosb ; clear data block
pop cx
pop ax
pop di
@@:
ret
setdbcs_before_copy endp
endif
getcountrydestination proc near
;get the destination address in the dos country info table.
;input: al - data id
; es:di -> dos_country_cdpg_info
;on return:
; es:di -> destination address of the matching data id
; carry set if no matching data id found in dos.
push cx
add di,ccnumber_of_entries ;skip the reserved area, syscodepage etc.
mov cx,word ptr es:[di] ;get the number of entries
inc di
inc di ;si -> the first start entry id
getcntrydest:
cmp byte ptr es:[di],al
je getcntrydest_ok
cmp byte ptr es:[di],setcountryinfo ;was it setcountryinfo entry?
je getcntrydest_1
add di,5 ;next data id
jmp short getcntrydest_loop
getcntrydest_1:
add di,new_country_size + 3 ;next data id
getcntrydest_loop:
loop getcntrydest
stc
jmp short getcntrydest_exit
getcntrydest_ok:
cmp al,setcountryinfo ;select country info?
jne getcntrydest_ok1
inc di ;now di -> cccountryinfolen
jmp short getcntrydest_exit
getcntrydest_ok1:
les di,dword ptr es:[di+1] ;get the destination in es:di
getcntrydest_exit:
pop cx
ret
getcountrydestination endp
readincontrolbuffer proc near
;move file pointer to cx:dx
;read ax bytes into the control buffer. (should be less than 2 kb)
;si will be set to 0 hence ds:si points to the control buffer.
;entry: cx,dx offset from the start of the file where the read/write pointer
; be moved.
; ax - # of bytes to read
; bx - file handle
; ds - buffer seg.
;return: the control data information is read into ds:0 - ds:0200.
; cx,dx value destroyed.
; carry set if error in reading file.
push ax ;# of bytes to read
mov ax, 4200h
stc
int 21h ;move pointer
pop cx ;# of bytes to read
jc ricb_exit
xor dx,dx ;ds:dx -> control buffer
xor si,si
mov ah,3fh ;read into the buffer
stc
int 21h ;should be less than 1024 bytes.
ricb_exit:
ret
readincontrolbuffer endp
set_country_path proc near
;in: ds - sysinitseg, es - confbot, si -> start of the asciiz path string
; dosinfo_ext, cntry_drv, cntry_root, cntry_path
; assumes current directory is the root directory.
;out: ds:di -> full path (cntry_drv).
; set the cntry_drv string from the country=,,path command.
; ds, es, si value saved.
push si
push ds ;switch ds, es
push es
pop ds
pop es ;now ds -> confbot, es -> sysinitseg
call chk_drive_letter ;current ds:[si] is a drive letter?
jc scp_default_drv ;no, use current default drive.
mov al, byte ptr ds:[si]
inc si
inc si ;si -> next char after ":"
jmp short scp_setdrv
scp_default_drv:
mov ah, 19h
int 21h
add al, "A" ;convert it to a character.
scp_setdrv:
mov cs:cntry_drv, al ;set the drive letter.
mov di, offset cntry_path
mov al, byte ptr ds:[si]
cmp al, "\"
je scp_root_dir
cmp al,"/" ;let's accept "/" as an directory delim
je scp_root_dir
jmp short scp_path
scp_root_dir:
dec di ;di -> cntry_root
scp_path:
call move_asciiz ;copy it
mov di, offset cntry_drv
scpath_exit:
push ds ;switch ds, es
push es
pop ds
pop es ;ds, es value restored
pop si
ret
set_country_path endp
chk_drive_letter proc near
;check if ds:[si] is a drive letter followed by ":".
;assume that every alpha charater is already converted to upper case.
;carry set if not.
push ax
cmp byte ptr ds:[si], "A"
jb cdletter_no
cmp byte ptr ds:[si], "Z"
ja cdletter_no
cmp byte ptr ds:[si+1], ":"
jne cdletter_no
jmp short cdletter_exit
cdletter_no:
stc
cdletter_exit:
pop ax
ret
chk_drive_letter endp
move_asciiz proc near
;in: ds:si -> source es:di -> target
;out: copy the string until 0.
;assumes there exists a 0.
masciiz_loop:
movsb
cmp byte ptr ds:[si-1],0 ;was it 0?
jne masciiz_loop
ret
move_asciiz endp
ENDIF ; CONFIGPROC
;
; ds:dx points to string to output (asciz)
;
; prints <badld_pre> <string> <badld_post>
badfil:
push cs
pop es
mov si,dx
badload:
mov dx,offset badld_pre ;want to print config error
mov bx, offset crlfm
prnerr:
push cs
pop ds
call print
prn1:
mov dl,es:[si]
or dl,dl
jz prn2
mov ah,std_con_output
int 21h
inc si
jmp prn1
prn2:
mov dx,bx
call print
IFDEF CONFIGPROC
cmp donotshownum,1 ; suppress line number when handling command.com
je prnexit
call error_line
ENDIF ; CONFIGPROC
prnexit:
ret
print:
mov ah,std_con_string_output
int 21h
ret
if noexec
; load non exe file called [ds:dx] at memory location es:bx
ldfil:
push ax
push bx
push cx
push dx
push si
push ds
push bx
xor ax,ax ;open the file
mov ah,open
stc ;in case of int 24
int 21h
pop dx ;clean stack in case jump
jc ldret
push dx
mov bx,ax ;handle in bx
xor cx,cx
xor dx,dx
mov ax,(lseek shl 8) or 2
stc ;in case of int 24
int 21h ; get file size in dx:ax
jc ldclsp
or dx,dx
jnz lderrp ; file >64k
pop dx
push dx
mov cx,es ; cx:dx is xaddr
add dx,ax ; add file size to xaddr
jnc dosize
add cx,1000h ; ripple carry
dosize:
mov ax,dx
call pararound
mov dx,ax
add cx,dx
cmp cx,[alloclim]
jb okld
jmp mem_err
okld:
xor cx,cx
xor dx,dx
mov ax,lseek shl 8 ;reset pointer to beginning of file
stc ;in case of int 24
int 21h
jc ldclsp
pop dx
push es ;read the file in
pop ds ;trans addr is ds:dx
mov cx,0ff00h ; .com files arn't any bigger than
; 64k-100h
mov ah,read
stc ;in case of int 24
int 21h
jc ldcls
mov si,dx ;check for exe file
cmp word ptr [si],"ZM"
clc ; assume ok
jnz ldcls ; only know how to do .com files
stc
jmp short ldcls
lderrp:
stc
ldclsp:
pop dx ;clean stack
ldcls:
pushf
mov ah,close ;close the file
stc
int 21h
popf
ldret: pop ds
pop si
pop dx
pop cx
pop bx
pop ax
ret
endif
;
; open device pointed to by dx, al has access code
; if unable to open do a device open null device instead
;
open_dev:
call open_file
jnc open_dev3
open_dev1:
mov dx,offset nuldev
call open_file
of_ret:
ret
open_dev3:
mov bx,ax ; handle from open to bx
xor ax,ax ; get device info
mov ah,ioctl
int 21h
test dl,10000000b
jnz of_ret
mov ah,close
int 21h
jmp open_dev1
open_file:
mov ah,open
stc
int 21h
ret
; test int24. return back to dos with the fake user response of "fail"
int24:
mov al, 3 ; fail the system call
iret ; return back to dos.
include copyrigh.inc ; copyright statement
nuldev db "NUL",0
condev db "CON",0
auxdev db "AUX",0
prndev db "PRN",0
IFDEF CONFIGPROC
config db "\CONFIG.SYS",0
cntry_drv db "A:"
cntry_root db "\"
cntry_path db "COUNTRY.SYS",0
db 52 dup (0)
country_file_signature db 0ffh,'COUNTRY'
cntrycodepage_id dw ?
ENDIF ; CONFIGPROC
ifdef MULTI_CONFIG
newcmd db 0 ; non-zero if non-std shell specified
tmplate db 64 ; must precede commnd
endif
ifdef ROMEXEC
db 7 ; size of commnd line (excl. null)
commnd db "COMMAND",0
db 56 dup (0)
else
db 12 ; size of commnd line (excl. null)
commnd db "\COMMAND.COM",0
db 51 dup (0)
endif
ifdef MULTI_CONFIG
commnd2 db "\COMMAND.COM",0 ; alternate commands to exec,
db 2,"/P",0 ; followed by their respective alternate
commnd3 db "\MSDOS\COMMAND.COM",0 ; command lines
db 11,"A:\MSDOS /P",0 ;(the drive letter are dynamically replaced)
commnd4 db "\DOS\COMMAND.COM",0 ;
db 9,"A:\DOS /P",0 ;
db 0 ; default switchchar (referenced as command_line-1)
endif
command_line db 2,"/P" ; default command.com args
db 125 dup (0)
IFDEF CONFIGPROC
pathstring db 64 dup (0)
ifdef MULTI_CONFIG
;
; Beware of byte pairs accessed as words (see all "KEEP AFTER" notes below)
;
bMenuColor db 07h ;1Fh ; default fgnd/bgnd color
bMenuPage db 0 ; menu video page (KEEP AFTER bMenuColor)
db 5 ; video page function # (KEEP AFTER bMenuPage)
bLastCol db ? ; ending column on status line
bLastRow db 24 ; row # of status line (KEEP AFTER bLastCol)
bDisableUI db 0 ; 1=disable clean/interactive
; 2=disable default 2-second delay
bCRTPage db ? ; value saved from BIOS data area
wCRTStart dw ? ; value saved from BIOS data area
bQueryOpt db 0 ; 0=off, 1=prompt all, 2=prompt none, 4=skip all
bDefBlock db 1 ; default block #
bMaxBlock db ? ; maxmimum block #
offDefBlock dw 0 ; offset of name of default block (if any)
secTimeOut db -1 ; # of seconds for timeout (-1 == indefinite)
secElapsed db 0 ; # of seconds elapsed so far (KEEP AFTER secTimeOut)
abBlockType db MAX_MULTI_CONFIG+1 dup(?) ; array of block types
aoffBlockName dw MAX_MULTI_CONFIG+1 dup(?) ; array of offsets of block names
aoffBlockDesc dw MAX_MULTI_CONFIG+1 dup(?) ; array of offsets of block descriptions
szBoot db "CONFIG=",0
szMenu db "MENU",0
szCommon db "COMMON",0
endif ;MULTI_CONFIG
comtab label byte
; cmd len command cmd code
; ------- ------- --------
;
ifdef MULTI_CONFIG
db 1, "[", CONFIG_BEGIN
endif
db 5, "BREAK", CONFIG_BREAK
db 7, "BUFFERS", CONFIG_BUFFERS
db 7, "COMMENT", CONFIG_COMMENT
db 7, "COUNTRY", CONFIG_COUNTRY
db 6, "DEVICE", CONFIG_DEVICE
db 10, "DEVICEHIGH", CONFIG_DEVICEHIGH
db 3, "DOS", CONFIG_DOS
db 8, "DRIVPARM", CONFIG_DRIVPARM
db 4, "FCBS", CONFIG_FCBS
db 5, "FILES", CONFIG_FILES
ifdef MULTI_CONFIG
db 7, "INCLUDE", CONFIG_INCLUDE
endif
db 7, "INSTALL", CONFIG_INSTALL
db 11, "INSTALLHIGH", CONFIG_INSTALLHIGH
db 9, "LASTDRIVE", CONFIG_LASTDRIVE
ifdef MULTI_CONFIG
db 7, "SUBMENU", CONFIG_SUBMENU
db 9, "MENUCOLOR", CONFIG_MENUCOLOR
db 11, "MENUDEFAULT", CONFIG_MENUDEFAULT
db 8, "MENUITEM", CONFIG_MENUITEM
endif
db 10, "MULTITRACK", CONFIG_MULTITRACK
ifdef MULTI_CONFIG
db 7, "NUMLOCK", CONFIG_NUMLOCK
endif
db 3, "REM", CONFIG_REM
ifdef MULTI_CONFIG
db 3, "SET", CONFIG_SET
endif
db 5, "SHELL", CONFIG_SHELL
if STACKSW
db 6, "STACKS", CONFIG_STACKS
endif
db 8, "SWITCHES", CONFIG_SWITCHES
db 0
ENDIF ;CONFIGPROC
public deviceparameters
deviceparameters a_deviceparameters <0,dev_3inch720kb,0,80>
IFDEF CONFIGPROC
hlim dw 2
slim dw 9
public drive
drive db ?
public switches
switches dw 0
; the following are the recommended bpbs for the media that we know of so
; far.
; 48 tpi diskettes
bpb48t dw 512
db 2
dw 1
db 2
dw 112
dw 2*9*40
db 0fdh
dw 2
dw 9
dw 2
dd 0
dd 0
; 96tpi diskettes
bpb96t dw 512
db 1
dw 1
db 2
dw 224
dw 2*15*80
db 0f9h
dw 7
dw 15
dw 2
dd 0
dd 0
; 3 1/2 inch diskette bpb
bpb35 dw 512
db 2
dw 1
db 2
dw 70h
dw 2*9*80
db 0f9h
dw 3
dw 9
dw 2
dd 0
dd 0
bpb35h dw 0200h
db 01h
dw 0001h
db 02h
dw 0e0h
dw 0b40h
db 0f0h
dw 0009h
dw 0012h
dw 0002h
dd 0
dd 0
;
; m037 - BEGIN
;
bpb288 dw 0200h
db 02h
dw 0001h
db 02h
dw 240
dw 2*36*80
db 0f0h
dw 0009h
dw 36
dw 0002h
dd 0
dd 0
;
; m037 - END
;
bpbtable dw bpb48t ; 48tpi drives
dw bpb96t ; 96tpi drives
dw bpb35 ; 3.5" drives
; the following are not supported, so default to 3.5" media layout
dw bpb35 ; not used - 8" drives
dw bpb35 ; not used - 8" drives
dw bpb35 ; not used - hard files
dw bpb35 ; not used - tape drives
dw bpb35h ; 3-1/2" 1.44mb drive
dw bpb35 ; ERIMO m037
dw bpb288 ; 2.88 MB diskette drives m037
switchlist db 8,"FHSTDICN" ; preserve the positions of n and c.
; the following depend on the positions of the various letters in switchlist
;switchnum equ 11111000b ; which switches require number
flagec35 equ 00000100b ; electrically compatible 3.5 inch disk drive
flagdrive equ 00001000b
flagcyln equ 00010000b
flagseclim equ 00100000b
flagheads equ 01000000b
flagff equ 10000000b
ENDIF ; CONFIGPROC
sysinitseg ends
end
|
oeis/003/A003076.asm | neoneye/loda-programs | 11 | 26746 | ; A003076: n-th digit after decimal point of square root of n.
; Submitted by <NAME>
; 0,0,1,2,0,6,9,3,2,0,1,5,7,9,4,6,0,4,6,2,1,8,6,3,8,0,0,4,2,4,8,5,9,9,0,4,0,0,3,2,1,2,4,3,9,8,9,0,1,0,4,3,4,3,5,7,0,8,4,3,7,7,5,7,0,6,2,6,0,5,7,0,0,3,6,4,3,0,2,5,9,0,3,8,8,8,4,0,1,8,5,4,7,3,9,6,0,7,0,2
mov $2,1
mov $3,$0
add $3,8
mov $4,$0
add $4,3
mul $4,2
mov $7,10
pow $7,$4
mov $9,10
lpb $3
add $1,1
mov $4,$2
pow $4,2
mul $4,$0
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,2
div $1,$8
div $2,$8
sub $3,1
lpe
mov $3,$9
pow $3,$0
div $2,$3
div $1,$2
mod $1,$9
mov $0,$1
|
Core/third_party/JavaScriptCore/jit/JITStubsMSVC64.asm | InfiniteSynthesis/lynx-native | 677 | 164048 | ;/*
; Copyright (C) 2014 Apple Inc. All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; are met:
; 1. Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
; OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*/
EXTERN getHostCallReturnValueWithExecState : near
PUBLIC getHostCallReturnValue
_TEXT SEGMENT
getHostCallReturnValue PROC
lea rcx, [rsp - 8]
; Allocate space for all 4 parameter registers, and align stack pointer to 16 bytes boundary by allocating another 8 bytes.
; The stack alignment is needed to fix a crash in the CRT library on a floating point instruction.
sub rsp, 40
call getHostCallReturnValueWithExecState
add rsp, 40
ret
getHostCallReturnValue ENDP
_TEXT ENDS
END
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca.log_21829_1530.asm | ljhsiun2/medusa | 9 | 162621 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1c4d7, %rcx
nop
cmp %r9, %r9
movups (%rcx), %xmm6
vpextrq $1, %xmm6, %r8
nop
nop
nop
nop
and %r11, %r11
lea addresses_WC_ht+0x9117, %r13
nop
nop
nop
inc %rsi
movups (%r13), %xmm5
vpextrq $1, %xmm5, %rdi
nop
nop
nop
and $50962, %r11
lea addresses_WT_ht+0x1cce7, %rsi
lea addresses_WC_ht+0x1bd97, %rdi
clflush (%rsi)
nop
nop
lfence
mov $112, %rcx
rep movsw
and $57180, %r11
lea addresses_UC_ht+0x9517, %rsi
lea addresses_UC_ht+0xdc97, %rdi
clflush (%rsi)
nop
nop
cmp %r8, %r8
mov $77, %rcx
rep movsq
sub $25243, %r9
lea addresses_normal_ht+0x3297, %rsi
add $564, %rcx
mov (%rsi), %r8d
nop
nop
nop
nop
nop
xor $14338, %rcx
lea addresses_WT_ht+0x1e8d7, %rsi
lea addresses_WT_ht+0x19397, %rdi
clflush (%rdi)
nop
sub $11059, %rax
mov $102, %rcx
rep movsw
dec %rdi
lea addresses_UC_ht+0xdbc7, %rsi
lea addresses_A_ht+0xbb17, %rdi
clflush (%rsi)
nop
and $22789, %rax
mov $122, %rcx
rep movsq
nop
xor $6414, %rcx
lea addresses_WT_ht+0x16717, %rsi
nop
nop
and %r9, %r9
movups (%rsi), %xmm6
vpextrq $1, %xmm6, %rdi
add %r8, %r8
lea addresses_normal_ht+0x10967, %r11
nop
nop
cmp $2688, %rcx
mov $0x6162636465666768, %r13
movq %r13, %xmm6
and $0xffffffffffffffc0, %r11
movaps %xmm6, (%r11)
xor %rcx, %rcx
lea addresses_UC_ht+0x1eabf, %rax
nop
nop
nop
nop
xor $21277, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
vmovups %ymm3, (%rax)
nop
nop
nop
sub $5906, %r8
lea addresses_normal_ht+0x87e7, %rsi
lea addresses_A_ht+0x12297, %rdi
add %rax, %rax
mov $33, %rcx
rep movsw
nop
nop
sub $40272, %r13
lea addresses_WT_ht+0x917, %rsi
lea addresses_D_ht+0x1117, %rdi
nop
nop
nop
nop
nop
sub %rax, %rax
mov $10, %rcx
rep movsq
nop
nop
nop
nop
cmp $22441, %r11
lea addresses_normal_ht+0x1bfd7, %r8
nop
nop
nop
add $18160, %rsi
movl $0x61626364, (%r8)
nop
nop
nop
and %r8, %r8
lea addresses_A_ht+0x1e997, %r11
nop
nop
nop
dec %rax
movb $0x61, (%r11)
nop
nop
nop
cmp $2293, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %r9
push %rbx
push %rdx
push %rsi
// Store
lea addresses_UC+0x4af, %rbx
nop
nop
cmp %rdx, %rdx
movw $0x5152, (%rbx)
nop
xor $27435, %r15
// Faulty Load
mov $0x2db3b20000000117, %rsi
nop
nop
and $35799, %r8
vmovups (%rsi), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r15
lea oracles, %r8
and $0xff, %r15
shlq $12, %r15
mov (%r8,%r15,1), %r15
pop %rsi
pop %rdx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': True, 'type': 'addresses_A_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
oeis/007/A007987.asm | neoneye/loda-programs | 11 | 91412 | ; A007987: Number of irreducible words of length 2n in the free group with generators x,y such that the total degree of x and the total degree of y both equal zero.
; Submitted by <NAME>
; 1,0,8,40,312,2240,17280,134568,1071000,8627872,70302888,577920200,4786740112,39899052960,334391846048,2815803070920,23809393390680,202061204197632,1720404406215720,14690717541313128,125775000062934552,1079385045953993280,9283159270280736288,79996549815856535400,690607997145290074032,5971922917975823185440,51720603917113318912200,448570271013410149102408,3895568675408807790787440,33872342778205898972446112,294861489236108527665886720,2569550813247491956957838280,22414734329410560427735592408
mov $1,$0
mov $3,2
lpb $3
mov $0,$1
sub $3,1
add $0,$3
trn $0,1
seq $0,2426 ; Central trinomial coefficients: largest coefficient of (1 + x + x^2)^n.
pow $0,2
mov $4,$3
mul $4,$0
add $2,$4
lpe
min $1,1
mul $1,$0
mov $0,$2
sub $0,$1
|
oeis/061/A061167.asm | neoneye/loda-programs | 11 | 9332 | ; A061167: a(n) = n^5 - n.
; 0,0,30,240,1020,3120,7770,16800,32760,59040,99990,161040,248820,371280,537810,759360,1048560,1419840,1889550,2476080,3199980,4084080,5153610,6436320,7962600,9765600,11881350,14348880,17210340,20511120,24299970,28629120,33554400,39135360,45435390,52521840,60466140,69343920,79235130,90224160,102399960,115856160,130691190,147008400,164916180,184528080,205962930,229344960,254803920,282475200,312499950,345025200,380203980,418195440,459164970,503284320,550731720,601692000,656356710,714924240
mov $1,$0
pow $0,5
sub $0,$1
|
programs/oeis/153/A153192.asm | karttu/loda | 1 | 172009 | <filename>programs/oeis/153/A153192.asm
; A153192: Numbers such that the numerator of floor(sqrt(n))/n, when reduced to its lowest terms, is equal to 2.
; 5,7,18,22,39,45,68,76,105,115,150,162,203,217,264,280,333,351,410,430,495,517,588,612,689,715,798,826,915,945,1040,1072,1173,1207,1314,1350,1463,1501,1620,1660,1785,1827,1958,2002,2139,2185,2328,2376,2525,2575,2730,2782,2943,2997,3164,3220,3393,3451,3630,3690,3875,3937,4128,4192,4389,4455,4658,4726,4935,5005,5220,5292,5513,5587,5814,5890,6123,6201,6440,6520,6765,6847,7098,7182,7439,7525,7788,7876,8145,8235,8510,8602,8883,8977,9264,9360,9653,9751,10050,10150,10455,10557,10868,10972,11289,11395,11718,11826,12155,12265,12600,12712,13053,13167,13514,13630,13983,14101,14460,14580,14945,15067,15438,15562,15939,16065,16448,16576,16965,17095,17490,17622,18023,18157,18564,18700,19113,19251,19670,19810,20235,20377,20808,20952,21389,21535,21978,22126,22575,22725,23180,23332,23793,23947,24414,24570,25043,25201,25680,25840,26325,26487,26978,27142,27639,27805,28308,28476,28985,29155,29670,29842,30363,30537,31064,31240,31773,31951,32490,32670,33215,33397,33948,34132,34689,34875,35438,35626,36195,36385,36960,37152,37733,37927,38514,38710,39303,39501,40100,40300,40905,41107,41718,41922,42539,42745,43368,43576,44205,44415,45050,45262,45903,46117,46764,46980,47633,47851,48510,48730,49395,49617,50288,50512,51189,51415,52098,52326,53015,53245,53940,54172,54873,55107,55814,56050,56763,57001,57720,57960,58685,58927,59658,59902,60639,60885,61628,61876,62625,62875
mul $0,2
add $0,5
mov $2,$0
div $0,4
mul $0,$2
mov $1,$0
|
src/test/resources/asm/dhrystoneO3C.asm | cbrune/VexRiscv | 1,524 | 15797 | <filename>src/test/resources/asm/dhrystoneO3C.asm
build/dhrystone.elf: file format elf32-littleriscv
Disassembly of section .vector:
80000000 <crtStart>:
.global crtStart
.global main
.global irqCallback
crtStart:
j crtInit
80000000: a8ad j 8000007a <crtInit>
nop
80000002: 0001 nop
nop
80000004: 0001 nop
nop
80000006: 0001 nop
nop
80000008: 0001 nop
nop
8000000a: 0001 nop
nop
8000000c: 0001 nop
nop
8000000e: 0001 nop
80000010 <trap_entry>:
.global trap_entry
trap_entry:
sw x1, - 1*4(sp)
80000010: fe112e23 sw ra,-4(sp)
sw x5, - 2*4(sp)
80000014: fe512c23 sw t0,-8(sp)
sw x6, - 3*4(sp)
80000018: fe612a23 sw t1,-12(sp)
sw x7, - 4*4(sp)
8000001c: fe712823 sw t2,-16(sp)
sw x10, - 5*4(sp)
80000020: fea12623 sw a0,-20(sp)
sw x11, - 6*4(sp)
80000024: feb12423 sw a1,-24(sp)
sw x12, - 7*4(sp)
80000028: fec12223 sw a2,-28(sp)
sw x13, - 8*4(sp)
8000002c: fed12023 sw a3,-32(sp)
sw x14, - 9*4(sp)
80000030: fce12e23 sw a4,-36(sp)
sw x15, -10*4(sp)
80000034: fcf12c23 sw a5,-40(sp)
sw x16, -11*4(sp)
80000038: fd012a23 sw a6,-44(sp)
sw x17, -12*4(sp)
8000003c: fd112823 sw a7,-48(sp)
sw x28, -13*4(sp)
80000040: fdc12623 sw t3,-52(sp)
sw x29, -14*4(sp)
80000044: fdd12423 sw t4,-56(sp)
sw x30, -15*4(sp)
80000048: fde12223 sw t5,-60(sp)
sw x31, -16*4(sp)
8000004c: fdf12023 sw t6,-64(sp)
addi sp,sp,-16*4
80000050: 7139 addi sp,sp,-64
call irqCallback
80000052: 28ad jal 800000cc <irqCallback>
lw x1 , 15*4(sp)
80000054: 50f2 lw ra,60(sp)
lw x5, 14*4(sp)
80000056: 52e2 lw t0,56(sp)
lw x6, 13*4(sp)
80000058: 5352 lw t1,52(sp)
lw x7, 12*4(sp)
8000005a: 53c2 lw t2,48(sp)
lw x10, 11*4(sp)
8000005c: 5532 lw a0,44(sp)
lw x11, 10*4(sp)
8000005e: 55a2 lw a1,40(sp)
lw x12, 9*4(sp)
80000060: 5612 lw a2,36(sp)
lw x13, 8*4(sp)
80000062: 5682 lw a3,32(sp)
lw x14, 7*4(sp)
80000064: 4772 lw a4,28(sp)
lw x15, 6*4(sp)
80000066: 47e2 lw a5,24(sp)
lw x16, 5*4(sp)
80000068: 4852 lw a6,20(sp)
lw x17, 4*4(sp)
8000006a: 48c2 lw a7,16(sp)
lw x28, 3*4(sp)
8000006c: 4e32 lw t3,12(sp)
lw x29, 2*4(sp)
8000006e: 4ea2 lw t4,8(sp)
lw x30, 1*4(sp)
80000070: 4f12 lw t5,4(sp)
lw x31, 0*4(sp)
80000072: 4f82 lw t6,0(sp)
addi sp,sp,16*4
80000074: 6121 addi sp,sp,64
mret
80000076: 30200073 mret
8000007a <crtInit>:
crtInit:
.option push
.option norelax
la gp, __global_pointer$
8000007a: 00004197 auipc gp,0x4
8000007e: c2618193 addi gp,gp,-986 # 80003ca0 <__global_pointer$>
.option pop
la sp, _stack_start
80000082: 00006117 auipc sp,0x6
80000086: 44e10113 addi sp,sp,1102 # 800064d0 <_stack_start>
8000008a <bss_init>:
bss_init:
la a0, _bss_start
8000008a: 81c18513 addi a0,gp,-2020 # 800034bc <Dhrystones_Per_Second>
la a1, _bss_end
8000008e: 00006597 auipc a1,0x6
80000092: 03658593 addi a1,a1,54 # 800060c4 <_bss_end>
80000096 <bss_loop>:
bss_loop:
beq a0,a1,bss_done
80000096: 00b50663 beq a0,a1,800000a2 <bss_done>
sw zero,0(a0)
8000009a: 00052023 sw zero,0(a0)
add a0,a0,4
8000009e: 0511 addi a0,a0,4
j bss_loop
800000a0: bfdd j 80000096 <bss_loop>
800000a2 <bss_done>:
bss_done:
ctors_init:
la a0, _ctors_start
800000a2: 00003517 auipc a0,0x3
800000a6: 3fa50513 addi a0,a0,1018 # 8000349c <_ctors_end>
addi sp,sp,-4
800000aa: 1171 addi sp,sp,-4
800000ac <ctors_loop>:
ctors_loop:
la a1, _ctors_end
800000ac: 00003597 auipc a1,0x3
800000b0: 3f058593 addi a1,a1,1008 # 8000349c <_ctors_end>
beq a0,a1,ctors_done
800000b4: 00b50863 beq a0,a1,800000c4 <ctors_done>
lw a3,0(a0)
800000b8: 4114 lw a3,0(a0)
add a0,a0,4
800000ba: 0511 addi a0,a0,4
sw a0,0(sp)
800000bc: c02a sw a0,0(sp)
jalr a3
800000be: 9682 jalr a3
lw a0,0(sp)
800000c0: 4502 lw a0,0(sp)
j ctors_loop
800000c2: b7ed j 800000ac <ctors_loop>
800000c4 <ctors_done>:
ctors_done:
addi sp,sp,4
800000c4: 0111 addi sp,sp,4
//li a0, 0x880 //880 enable timer + external interrupts
//csrw mie,a0
//li a0, 0x1808 //1808 enable interrupts
//csrw mstatus,a0
call main
800000c6: 407020ef jal ra,80002ccc <end>
800000ca <infinitLoop>:
infinitLoop:
j infinitLoop
800000ca: a001 j 800000ca <infinitLoop>
Disassembly of section .memory:
800000cc <irqCallback>:
}
void irqCallback(int irq){
}
800000cc: 8082 ret
800000ce <Proc_2>:
One_Fifty Int_Loc;
Enumeration Enum_Loc;
Int_Loc = *Int_Par_Ref + 10;
do /* executed once */
if (Ch_1_Glob == 'A')
800000ce: 8351c703 lbu a4,-1995(gp) # 800034d5 <Ch_1_Glob>
800000d2: 04100793 li a5,65
800000d6: 00f70363 beq a4,a5,800000dc <Proc_2+0xe>
Int_Loc -= 1;
*Int_Par_Ref = Int_Loc - Int_Glob;
Enum_Loc = Ident_1;
} /* if */
while (Enum_Loc != Ident_1); /* true */
} /* Proc_2 */
800000da: 8082 ret
Int_Loc -= 1;
800000dc: 411c lw a5,0(a0)
*Int_Par_Ref = Int_Loc - Int_Glob;
800000de: 83c1a703 lw a4,-1988(gp) # 800034dc <Int_Glob>
Int_Loc -= 1;
800000e2: 07a5 addi a5,a5,9
*Int_Par_Ref = Int_Loc - Int_Glob;
800000e4: 8f99 sub a5,a5,a4
800000e6: c11c sw a5,0(a0)
} /* Proc_2 */
800000e8: 8082 ret
800000ea <Proc_3>:
/* Ptr_Ref_Par becomes Ptr_Glob */
Rec_Pointer *Ptr_Ref_Par;
{
if (Ptr_Glob != Null)
800000ea: 8441a603 lw a2,-1980(gp) # 800034e4 <Ptr_Glob>
800000ee: c609 beqz a2,800000f8 <Proc_3+0xe>
/* then, executed */
*Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
800000f0: 4218 lw a4,0(a2)
800000f2: c118 sw a4,0(a0)
800000f4: 8441a603 lw a2,-1980(gp) # 800034e4 <Ptr_Glob>
Proc_7 (10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
800000f8: 83c1a583 lw a1,-1988(gp) # 800034dc <Int_Glob>
800000fc: 0631 addi a2,a2,12
800000fe: 4529 li a0,10
80000100: 6d80006f j 800007d8 <Proc_7>
80000104 <Proc_1>:
{
80000104: 1141 addi sp,sp,-16
80000106: c04a sw s2,0(sp)
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
80000108: 8441a783 lw a5,-1980(gp) # 800034e4 <Ptr_Glob>
{
8000010c: c422 sw s0,8(sp)
REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
8000010e: 4100 lw s0,0(a0)
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
80000110: 4398 lw a4,0(a5)
{
80000112: c226 sw s1,4(sp)
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
80000114: 0047ae83 lw t4,4(a5)
80000118: 0087ae03 lw t3,8(a5)
8000011c: 0107a303 lw t1,16(a5)
80000120: 0147a883 lw a7,20(a5)
80000124: 0187a803 lw a6,24(a5)
80000128: 538c lw a1,32(a5)
8000012a: 53d0 lw a2,36(a5)
8000012c: 5794 lw a3,40(a5)
{
8000012e: c606 sw ra,12(sp)
80000130: 84aa mv s1,a0
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
80000132: 4fc8 lw a0,28(a5)
80000134: 57dc lw a5,44(a5)
80000136: c018 sw a4,0(s0)
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
80000138: 4098 lw a4,0(s1)
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
8000013a: cc48 sw a0,28(s0)
8000013c: d45c sw a5,44(s0)
8000013e: 01d42223 sw t4,4(s0)
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
80000142: 4795 li a5,5
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
80000144: 01c42423 sw t3,8(s0)
80000148: 00642823 sw t1,16(s0)
8000014c: 01142a23 sw a7,20(s0)
80000150: 01042c23 sw a6,24(s0)
80000154: d00c sw a1,32(s0)
80000156: d050 sw a2,36(s0)
80000158: d414 sw a3,40(s0)
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
8000015a: c4dc sw a5,12(s1)
= Ptr_Val_Par->variant.var_1.Int_Comp;
8000015c: c45c sw a5,12(s0)
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
8000015e: c018 sw a4,0(s0)
Proc_3 (&Next_Record->Ptr_Comp);
80000160: 8522 mv a0,s0
80000162: 3761 jal 800000ea <Proc_3>
if (Next_Record->Discr == Ident_1)
80000164: 405c lw a5,4(s0)
80000166: cfb1 beqz a5,800001c2 <Proc_1+0xbe>
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
80000168: 409c lw a5,0(s1)
} /* Proc_1 */
8000016a: 40b2 lw ra,12(sp)
8000016c: 4422 lw s0,8(sp)
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
8000016e: 0007af83 lw t6,0(a5)
80000172: 0047af03 lw t5,4(a5)
80000176: 0087ae83 lw t4,8(a5)
8000017a: 00c7ae03 lw t3,12(a5)
8000017e: 0107a303 lw t1,16(a5)
80000182: 0147a883 lw a7,20(a5)
80000186: 0187a803 lw a6,24(a5)
8000018a: 4fcc lw a1,28(a5)
8000018c: 5390 lw a2,32(a5)
8000018e: 53d4 lw a3,36(a5)
80000190: 5798 lw a4,40(a5)
80000192: 57dc lw a5,44(a5)
80000194: 01f4a023 sw t6,0(s1)
80000198: 01e4a223 sw t5,4(s1)
8000019c: 01d4a423 sw t4,8(s1)
800001a0: 01c4a623 sw t3,12(s1)
800001a4: 0064a823 sw t1,16(s1)
800001a8: 0114aa23 sw a7,20(s1)
800001ac: 0104ac23 sw a6,24(s1)
800001b0: cccc sw a1,28(s1)
800001b2: d090 sw a2,32(s1)
800001b4: d0d4 sw a3,36(s1)
800001b6: d498 sw a4,40(s1)
800001b8: d4dc sw a5,44(s1)
} /* Proc_1 */
800001ba: 4902 lw s2,0(sp)
800001bc: 4492 lw s1,4(sp)
800001be: 0141 addi sp,sp,16
800001c0: 8082 ret
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
800001c2: 4488 lw a0,8(s1)
Next_Record->variant.var_1.Int_Comp = 6;
800001c4: 4799 li a5,6
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
800001c6: 00840593 addi a1,s0,8
Next_Record->variant.var_1.Int_Comp = 6;
800001ca: c45c sw a5,12(s0)
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
800001cc: 6d0000ef jal ra,8000089c <Proc_6>
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
800001d0: 8441a783 lw a5,-1980(gp) # 800034e4 <Ptr_Glob>
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
800001d4: 4448 lw a0,12(s0)
800001d6: 00c40613 addi a2,s0,12
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
800001da: 439c lw a5,0(a5)
} /* Proc_1 */
800001dc: 40b2 lw ra,12(sp)
800001de: 4492 lw s1,4(sp)
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
800001e0: c01c sw a5,0(s0)
} /* Proc_1 */
800001e2: 4422 lw s0,8(sp)
800001e4: 4902 lw s2,0(sp)
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
800001e6: 45a9 li a1,10
} /* Proc_1 */
800001e8: 0141 addi sp,sp,16
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
800001ea: 5ee0006f j 800007d8 <Proc_7>
800001ee <Proc_4>:
/*******/
/* executed once */
{
Boolean Bool_Loc;
Bool_Loc = Ch_1_Glob == 'A';
800001ee: 8351c783 lbu a5,-1995(gp) # 800034d5 <Ch_1_Glob>
Bool_Glob = Bool_Loc | Bool_Glob;
800001f2: 8381a683 lw a3,-1992(gp) # 800034d8 <Bool_Glob>
Bool_Loc = Ch_1_Glob == 'A';
800001f6: fbf78793 addi a5,a5,-65
800001fa: 0017b793 seqz a5,a5
Bool_Glob = Bool_Loc | Bool_Glob;
800001fe: 8fd5 or a5,a5,a3
80000200: 82f1ac23 sw a5,-1992(gp) # 800034d8 <Bool_Glob>
Ch_2_Glob = 'B';
80000204: 04200713 li a4,66
80000208: 82e18a23 sb a4,-1996(gp) # 800034d4 <Ch_2_Glob>
} /* Proc_4 */
8000020c: 8082 ret
8000020e <Proc_5>:
Proc_5 () /* without parameters */
/*******/
/* executed once */
{
Ch_1_Glob = 'A';
8000020e: 04100713 li a4,65
80000212: 82e18aa3 sb a4,-1995(gp) # 800034d5 <Ch_1_Glob>
Bool_Glob = false;
80000216: 8201ac23 sw zero,-1992(gp) # 800034d8 <Bool_Glob>
} /* Proc_5 */
8000021a: 8082 ret
8000021c <main2>:
{
8000021c: 7135 addi sp,sp,-160
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
8000021e: 03000513 li a0,48
{
80000222: cf06 sw ra,156(sp)
80000224: cd22 sw s0,152(sp)
80000226: dce2 sw s8,120(sp)
80000228: d6ee sw s11,108(sp)
8000022a: cb26 sw s1,148(sp)
8000022c: c94a sw s2,144(sp)
8000022e: c74e sw s3,140(sp)
80000230: c552 sw s4,136(sp)
80000232: c356 sw s5,132(sp)
80000234: c15a sw s6,128(sp)
80000236: dede sw s7,124(sp)
80000238: dae6 sw s9,116(sp)
8000023a: d8ea sw s10,112(sp)
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
8000023c: 74e000ef jal ra,8000098a <malloc>
80000240: 84a1a023 sw a0,-1984(gp) # 800034e0 <Next_Ptr_Glob>
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
80000244: 03000513 li a0,48
80000248: 742000ef jal ra,8000098a <malloc>
Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
8000024c: 8401a783 lw a5,-1984(gp) # 800034e0 <Next_Ptr_Glob>
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
80000250: 84a1a223 sw a0,-1980(gp) # 800034e4 <Ptr_Glob>
Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
80000254: c11c sw a5,0(a0)
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
80000256: 4789 li a5,2
80000258: c51c sw a5,8(a0)
strcpy (Ptr_Glob->variant.var_1.Str_Comp,
8000025a: 800035b7 lui a1,0x80003
Ptr_Glob->variant.var_1.Int_Comp = 40;
8000025e: 02800793 li a5,40
80000262: c55c sw a5,12(a0)
strcpy (Ptr_Glob->variant.var_1.Str_Comp,
80000264: 467d li a2,31
80000266: ce458593 addi a1,a1,-796 # 80002ce4 <_stack_start+0xffffc814>
Ptr_Glob->Discr = Ident_1;
8000026a: 00052223 sw zero,4(a0)
strcpy (Ptr_Glob->variant.var_1.Str_Comp,
8000026e: 0541 addi a0,a0,16
80000270: 01d000ef jal ra,80000a8c <memcpy>
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
80000274: 80003737 lui a4,0x80003
80000278: 24c70793 addi a5,a4,588 # 8000324c <_stack_start+0xffffcd7c>
8000027c: 24c72e03 lw t3,588(a4)
80000280: 0047a303 lw t1,4(a5)
80000284: 0087a883 lw a7,8(a5)
80000288: 00c7a803 lw a6,12(a5)
8000028c: 4b8c lw a1,16(a5)
8000028e: 4bd0 lw a2,20(a5)
80000290: 4f94 lw a3,24(a5)
80000292: 01c7d703 lhu a4,28(a5)
80000296: 01e7c783 lbu a5,30(a5)
Arr_2_Glob [8][7] = 10;
8000029a: 80003db7 lui s11,0x80003
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
8000029e: 02e11e23 sh a4,60(sp)
800002a2: 02f10f23 sb a5,62(sp)
Arr_2_Glob [8][7] = 10;
800002a6: 5b4d8713 addi a4,s11,1460 # 800035b4 <_stack_start+0xffffd0e4>
800002aa: 47a9 li a5,10
printf ("\n");
800002ac: 4529 li a0,10
Arr_2_Glob [8][7] = 10;
800002ae: 64f72e23 sw a5,1628(a4)
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
800002b2: d072 sw t3,32(sp)
800002b4: d21a sw t1,36(sp)
800002b6: d446 sw a7,40(sp)
800002b8: d642 sw a6,44(sp)
800002ba: d82e sw a1,48(sp)
800002bc: da32 sw a2,52(sp)
800002be: dc36 sw a3,56(sp)
printf ("\n");
800002c0: 7b8000ef jal ra,80000a78 <putchar>
printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
800002c4: 80003537 lui a0,0x80003
800002c8: d0450513 addi a0,a0,-764 # 80002d04 <_stack_start+0xffffc834>
800002cc: 786000ef jal ra,80000a52 <puts>
printf ("\n");
800002d0: 4529 li a0,10
800002d2: 7a6000ef jal ra,80000a78 <putchar>
if (Reg)
800002d6: 8301a783 lw a5,-2000(gp) # 800034d0 <Reg>
800002da: 4c078663 beqz a5,800007a6 <main2+0x58a>
printf ("Program compiled with 'register' attribute\n");
800002de: 80003537 lui a0,0x80003
800002e2: d3450513 addi a0,a0,-716 # 80002d34 <_stack_start+0xffffc864>
800002e6: 76c000ef jal ra,80000a52 <puts>
printf ("\n");
800002ea: 4529 li a0,10
800002ec: 78c000ef jal ra,80000a78 <putchar>
printf ("Please give the number of runs through the benchmark: ");
800002f0: 80003537 lui a0,0x80003
800002f4: d9050513 addi a0,a0,-624 # 80002d90 <_stack_start+0xffffc8c0>
800002f8: 6b4000ef jal ra,800009ac <printf>
printf ("\n");
800002fc: 4529 li a0,10
800002fe: 77a000ef jal ra,80000a78 <putchar>
printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
80000302: 80003537 lui a0,0x80003
80000306: 0c800593 li a1,200
8000030a: dc850513 addi a0,a0,-568 # 80002dc8 <_stack_start+0xffffc8f8>
8000030e: 69e000ef jal ra,800009ac <printf>
Begin_Time = clock();
80000312: 770000ef jal ra,80000a82 <clock>
80000316: 80003437 lui s0,0x80003
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
8000031a: 26c42783 lw a5,620(s0) # 8000326c <_stack_start+0xffffcd9c>
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
8000031e: 80003d37 lui s10,0x80003
80000322: 28cd2b83 lw s7,652(s10) # 8000328c <_stack_start+0xffffcdbc>
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
80000326: c43e sw a5,8(sp)
Begin_Time = clock();
80000328: 82a1a623 sw a0,-2004(gp) # 800034cc <Begin_Time>
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
8000032c: 4985 li s3,1
8000032e: 26c40413 addi s0,s0,620
Int_1_Loc = 2;
80000332: 4489 li s1,2
Proc_5();
80000334: 3de9 jal 8000020e <Proc_5>
Proc_4();
80000336: 3d65 jal 800001ee <Proc_4>
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
80000338: 01e44783 lbu a5,30(s0)
8000033c: 4850 lw a2,20(s0)
8000033e: 00442e03 lw t3,4(s0)
80000342: 00842303 lw t1,8(s0)
80000346: 00c42883 lw a7,12(s0)
8000034a: 01042803 lw a6,16(s0)
8000034e: 4c14 lw a3,24(s0)
80000350: 01c45703 lhu a4,28(s0)
80000354: 4ea2 lw t4,8(sp)
80000356: 04f10f23 sb a5,94(sp)
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
8000035a: 008c addi a1,sp,64
Enum_Loc = Ident_2;
8000035c: 4785 li a5,1
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
8000035e: 1008 addi a0,sp,32
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
80000360: cab2 sw a2,84(sp)
Enum_Loc = Ident_2;
80000362: ce3e sw a5,28(sp)
Int_1_Loc = 2;
80000364: ca26 sw s1,20(sp)
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
80000366: c0f6 sw t4,64(sp)
80000368: c2f2 sw t3,68(sp)
8000036a: c49a sw t1,72(sp)
8000036c: c6c6 sw a7,76(sp)
8000036e: c8c2 sw a6,80(sp)
80000370: ccb6 sw a3,88(sp)
80000372: 04e11e23 sh a4,92(sp)
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
80000376: 21dd jal 8000085c <Func_2>
while (Int_1_Loc < Int_2_Loc) /* loop body executed once */
80000378: 4652 lw a2,20(sp)
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
8000037a: 00153513 seqz a0,a0
8000037e: 82a1ac23 sw a0,-1992(gp) # 800034d8 <Bool_Glob>
while (Int_1_Loc < Int_2_Loc) /* loop body executed once */
80000382: 02c4c063 blt s1,a2,800003a2 <main2+0x186>
Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
80000386: 00261793 slli a5,a2,0x2
8000038a: 97b2 add a5,a5,a2
8000038c: 17f5 addi a5,a5,-3
Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
8000038e: 8532 mv a0,a2
80000390: 458d li a1,3
80000392: 0830 addi a2,sp,24
Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
80000394: cc3e sw a5,24(sp)
Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
80000396: 2189 jal 800007d8 <Proc_7>
Int_1_Loc += 1;
80000398: 4652 lw a2,20(sp)
8000039a: 0605 addi a2,a2,1
8000039c: ca32 sw a2,20(sp)
while (Int_1_Loc < Int_2_Loc) /* loop body executed once */
8000039e: fec4d4e3 ble a2,s1,80000386 <main2+0x16a>
Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
800003a2: 46e2 lw a3,24(sp)
800003a4: 84c18513 addi a0,gp,-1972 # 800034ec <Arr_1_Glob>
800003a8: 5b4d8593 addi a1,s11,1460
800003ac: 2915 jal 800007e0 <Proc_8>
Proc_1 (Ptr_Glob);
800003ae: 8441a503 lw a0,-1980(gp) # 800034e4 <Ptr_Glob>
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
800003b2: 04100a93 li s5,65
Int_2_Loc = 3;
800003b6: 4a0d li s4,3
Proc_1 (Ptr_Glob);
800003b8: 33b1 jal 80000104 <Proc_1>
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
800003ba: 8341c703 lbu a4,-1996(gp) # 800034d4 <Ch_2_Glob>
800003be: 04000793 li a5,64
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
800003c2: 28cd0c93 addi s9,s10,652
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
800003c6: 02e7f163 bleu a4,a5,800003e8 <main2+0x1cc>
if (Enum_Loc == Func_1 (Ch_Index, 'C'))
800003ca: 8556 mv a0,s5
800003cc: 04300593 li a1,67
800003d0: 2995 jal 80000844 <Func_1>
800003d2: 47f2 lw a5,28(sp)
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
800003d4: 001a8713 addi a4,s5,1
if (Enum_Loc == Func_1 (Ch_Index, 'C'))
800003d8: 36f50e63 beq a0,a5,80000754 <main2+0x538>
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
800003dc: 8341c783 lbu a5,-1996(gp) # 800034d4 <Ch_2_Glob>
800003e0: 0ff77a93 andi s5,a4,255
800003e4: ff57f3e3 bleu s5,a5,800003ca <main2+0x1ae>
Int_2_Loc = Int_2_Loc * Int_1_Loc;
800003e8: 45d2 lw a1,20(sp)
800003ea: 8552 mv a0,s4
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
800003ec: 0985 addi s3,s3,1
Int_2_Loc = Int_2_Loc * Int_1_Loc;
800003ee: 7ba020ef jal ra,80002ba8 <__mulsi3>
Int_1_Loc = Int_2_Loc / Int_3_Loc;
800003f2: 4ae2 lw s5,24(sp)
Int_2_Loc = Int_2_Loc * Int_1_Loc;
800003f4: c62a sw a0,12(sp)
Int_1_Loc = Int_2_Loc / Int_3_Loc;
800003f6: 85d6 mv a1,s5
800003f8: 7d4020ef jal ra,80002bcc <__divsi3>
800003fc: 8a2a mv s4,a0
Proc_2 (&Int_1_Loc);
800003fe: 0848 addi a0,sp,20
Int_1_Loc = Int_2_Loc / Int_3_Loc;
80000400: ca52 sw s4,20(sp)
Proc_2 (&Int_1_Loc);
80000402: 31f1 jal 800000ce <Proc_2>
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
80000404: 0c900793 li a5,201
80000408: f2f996e3 bne s3,a5,80000334 <main2+0x118>
End_Time = clock();
8000040c: 676000ef jal ra,80000a82 <clock>
80000410: 82a1a423 sw a0,-2008(gp) # 800034c8 <End_Time>
printf ("Execution ends\n");
80000414: 80003537 lui a0,0x80003
80000418: df850513 addi a0,a0,-520 # 80002df8 <_stack_start+0xffffc928>
8000041c: 636000ef jal ra,80000a52 <puts>
printf ("\n");
80000420: 4529 li a0,10
80000422: 656000ef jal ra,80000a78 <putchar>
printf ("Final values of the variables used in the benchmark:\n");
80000426: 80003537 lui a0,0x80003
8000042a: e0850513 addi a0,a0,-504 # 80002e08 <_stack_start+0xffffc938>
8000042e: 624000ef jal ra,80000a52 <puts>
printf ("\n");
80000432: 4529 li a0,10
80000434: 644000ef jal ra,80000a78 <putchar>
printf ("Int_Glob: %d\n", Int_Glob);
80000438: 83c1a583 lw a1,-1988(gp) # 800034dc <Int_Glob>
8000043c: 80003537 lui a0,0x80003
80000440: e4050513 addi a0,a0,-448 # 80002e40 <_stack_start+0xffffc970>
printf (" should be: %d\n", 5);
80000444: 80003437 lui s0,0x80003
printf ("Int_Glob: %d\n", Int_Glob);
80000448: 564000ef jal ra,800009ac <printf>
printf (" should be: %d\n", 5);
8000044c: 4595 li a1,5
8000044e: e5c40513 addi a0,s0,-420 # 80002e5c <_stack_start+0xffffc98c>
80000452: 55a000ef jal ra,800009ac <printf>
printf ("Bool_Glob: %d\n", Bool_Glob);
80000456: 8381a583 lw a1,-1992(gp) # 800034d8 <Bool_Glob>
8000045a: 80003537 lui a0,0x80003
8000045e: e7850513 addi a0,a0,-392 # 80002e78 <_stack_start+0xffffc9a8>
80000462: 54a000ef jal ra,800009ac <printf>
printf (" should be: %d\n", 1);
80000466: 4585 li a1,1
80000468: e5c40513 addi a0,s0,-420
8000046c: 540000ef jal ra,800009ac <printf>
printf ("Ch_1_Glob: %c\n", Ch_1_Glob);
80000470: 8351c583 lbu a1,-1995(gp) # 800034d5 <Ch_1_Glob>
80000474: 80003537 lui a0,0x80003
80000478: e9450513 addi a0,a0,-364 # 80002e94 <_stack_start+0xffffc9c4>
8000047c: 2b05 jal 800009ac <printf>
printf (" should be: %c\n", 'A');
8000047e: 800034b7 lui s1,0x80003
80000482: 04100593 li a1,65
80000486: eb048513 addi a0,s1,-336 # 80002eb0 <_stack_start+0xffffc9e0>
8000048a: 230d jal 800009ac <printf>
printf ("Ch_2_Glob: %c\n", Ch_2_Glob);
8000048c: 8341c583 lbu a1,-1996(gp) # 800034d4 <Ch_2_Glob>
80000490: 80003537 lui a0,0x80003
80000494: ecc50513 addi a0,a0,-308 # 80002ecc <_stack_start+0xffffc9fc>
80000498: 2b11 jal 800009ac <printf>
printf (" should be: %c\n", 'B');
8000049a: 04200593 li a1,66
8000049e: eb048513 addi a0,s1,-336
800004a2: 2329 jal 800009ac <printf>
printf ("Arr_1_Glob[8]: %d\n", Arr_1_Glob[8]);
800004a4: 84c18793 addi a5,gp,-1972 # 800034ec <Arr_1_Glob>
800004a8: 538c lw a1,32(a5)
800004aa: 80003537 lui a0,0x80003
800004ae: ee850513 addi a0,a0,-280 # 80002ee8 <_stack_start+0xffffca18>
800004b2: 29ed jal 800009ac <printf>
printf (" should be: %d\n", 7);
800004b4: 459d li a1,7
800004b6: e5c40513 addi a0,s0,-420
800004ba: 29cd jal 800009ac <printf>
printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
800004bc: 800037b7 lui a5,0x80003
800004c0: 5b478793 addi a5,a5,1460 # 800035b4 <_stack_start+0xffffd0e4>
800004c4: 65c7a583 lw a1,1628(a5)
800004c8: 80003537 lui a0,0x80003
800004cc: f0450513 addi a0,a0,-252 # 80002f04 <_stack_start+0xffffca34>
800004d0: 29f1 jal 800009ac <printf>
printf (" should be: Number_Of_Runs + 10\n");
800004d2: 80003537 lui a0,0x80003
800004d6: f2050513 addi a0,a0,-224 # 80002f20 <_stack_start+0xffffca50>
800004da: 578000ef jal ra,80000a52 <puts>
printf ("Ptr_Glob->\n");
800004de: 80003537 lui a0,0x80003
800004e2: f4c50513 addi a0,a0,-180 # 80002f4c <_stack_start+0xffffca7c>
800004e6: 56c000ef jal ra,80000a52 <puts>
printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
800004ea: 8441a783 lw a5,-1980(gp) # 800034e4 <Ptr_Glob>
800004ee: 80003db7 lui s11,0x80003
800004f2: f58d8513 addi a0,s11,-168 # 80002f58 <_stack_start+0xffffca88>
800004f6: 438c lw a1,0(a5)
printf (" Discr: %d\n", Ptr_Glob->Discr);
800004f8: 80003cb7 lui s9,0x80003
printf (" Enum_Comp: %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
800004fc: 80003bb7 lui s7,0x80003
printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
80000500: 2175 jal 800009ac <printf>
printf (" should be: (implementation-dependent)\n");
80000502: 80003537 lui a0,0x80003
80000506: f7450513 addi a0,a0,-140 # 80002f74 <_stack_start+0xffffcaa4>
8000050a: 548000ef jal ra,80000a52 <puts>
printf (" Discr: %d\n", Ptr_Glob->Discr);
8000050e: 8441a783 lw a5,-1980(gp) # 800034e4 <Ptr_Glob>
80000512: fa4c8513 addi a0,s9,-92 # 80002fa4 <_stack_start+0xffffcad4>
printf (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
80000516: 80003b37 lui s6,0x80003
printf (" Discr: %d\n", Ptr_Glob->Discr);
8000051a: 43cc lw a1,4(a5)
printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
8000051c: 800039b7 lui s3,0x80003
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
80000520: 80003937 lui s2,0x80003
printf (" Discr: %d\n", Ptr_Glob->Discr);
80000524: 2161 jal 800009ac <printf>
printf (" should be: %d\n", 0);
80000526: 4581 li a1,0
80000528: e5c40513 addi a0,s0,-420
8000052c: 2141 jal 800009ac <printf>
printf (" Enum_Comp: %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
8000052e: 8441a783 lw a5,-1980(gp) # 800034e4 <Ptr_Glob>
80000532: fc0b8513 addi a0,s7,-64 # 80002fc0 <_stack_start+0xffffcaf0>
80000536: 478c lw a1,8(a5)
80000538: 2995 jal 800009ac <printf>
printf (" should be: %d\n", 2);
8000053a: 4589 li a1,2
8000053c: e5c40513 addi a0,s0,-420
80000540: 21b5 jal 800009ac <printf>
printf (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
80000542: 8441a783 lw a5,-1980(gp) # 800034e4 <Ptr_Glob>
80000546: fdcb0513 addi a0,s6,-36 # 80002fdc <_stack_start+0xffffcb0c>
8000054a: 47cc lw a1,12(a5)
8000054c: 2185 jal 800009ac <printf>
printf (" should be: %d\n", 17);
8000054e: 45c5 li a1,17
80000550: e5c40513 addi a0,s0,-420
80000554: 29a1 jal 800009ac <printf>
printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
80000556: 8441a583 lw a1,-1980(gp) # 800034e4 <Ptr_Glob>
8000055a: ff898513 addi a0,s3,-8 # 80002ff8 <_stack_start+0xffffcb28>
8000055e: 05c1 addi a1,a1,16
80000560: 21b1 jal 800009ac <printf>
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
80000562: 01490513 addi a0,s2,20 # 80003014 <_stack_start+0xffffcb44>
80000566: 21f5 jal 80000a52 <puts>
printf ("Next_Ptr_Glob->\n");
80000568: 80003537 lui a0,0x80003
8000056c: 04850513 addi a0,a0,72 # 80003048 <_stack_start+0xffffcb78>
80000570: 21cd jal 80000a52 <puts>
printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
80000572: 8401a783 lw a5,-1984(gp) # 800034e0 <Next_Ptr_Glob>
80000576: f58d8513 addi a0,s11,-168
8000057a: 438c lw a1,0(a5)
8000057c: 2905 jal 800009ac <printf>
printf (" should be: (implementation-dependent), same as above\n");
8000057e: 80003537 lui a0,0x80003
80000582: 05850513 addi a0,a0,88 # 80003058 <_stack_start+0xffffcb88>
80000586: 21f1 jal 80000a52 <puts>
printf (" Discr: %d\n", Next_Ptr_Glob->Discr);
80000588: 8401a783 lw a5,-1984(gp) # 800034e0 <Next_Ptr_Glob>
8000058c: fa4c8513 addi a0,s9,-92
80000590: 43cc lw a1,4(a5)
80000592: 2929 jal 800009ac <printf>
printf (" should be: %d\n", 0);
80000594: 4581 li a1,0
80000596: e5c40513 addi a0,s0,-420
8000059a: 2909 jal 800009ac <printf>
printf (" Enum_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
8000059c: 8401a783 lw a5,-1984(gp) # 800034e0 <Next_Ptr_Glob>
800005a0: fc0b8513 addi a0,s7,-64
800005a4: 478c lw a1,8(a5)
800005a6: 2119 jal 800009ac <printf>
printf (" should be: %d\n", 1);
800005a8: 4585 li a1,1
800005aa: e5c40513 addi a0,s0,-420
800005ae: 2efd jal 800009ac <printf>
printf (" Int_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
800005b0: 8401a783 lw a5,-1984(gp) # 800034e0 <Next_Ptr_Glob>
800005b4: fdcb0513 addi a0,s6,-36
800005b8: 47cc lw a1,12(a5)
800005ba: 2ecd jal 800009ac <printf>
printf (" should be: %d\n", 18);
800005bc: 45c9 li a1,18
800005be: e5c40513 addi a0,s0,-420
800005c2: 26ed jal 800009ac <printf>
printf (" Str_Comp: %s\n",
800005c4: 8401a583 lw a1,-1984(gp) # 800034e0 <Next_Ptr_Glob>
800005c8: ff898513 addi a0,s3,-8
800005cc: 05c1 addi a1,a1,16
800005ce: 2ef9 jal 800009ac <printf>
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
800005d0: 01490513 addi a0,s2,20
800005d4: 29bd jal 80000a52 <puts>
printf ("Int_1_Loc: %d\n", Int_1_Loc);
800005d6: 45d2 lw a1,20(sp)
800005d8: 80003537 lui a0,0x80003
800005dc: 09850513 addi a0,a0,152 # 80003098 <_stack_start+0xffffcbc8>
800005e0: 26f1 jal 800009ac <printf>
printf (" should be: %d\n", 5);
800005e2: 4595 li a1,5
800005e4: e5c40513 addi a0,s0,-420
800005e8: 26d1 jal 800009ac <printf>
Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
800005ea: 47b2 lw a5,12(sp)
printf ("Int_2_Loc: %d\n", Int_2_Loc);
800005ec: 80003537 lui a0,0x80003
800005f0: 0b450513 addi a0,a0,180 # 800030b4 <_stack_start+0xffffcbe4>
Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
800005f4: 41578ab3 sub s5,a5,s5
800005f8: 003a9793 slli a5,s5,0x3
800005fc: 41578ab3 sub s5,a5,s5
printf ("Int_2_Loc: %d\n", Int_2_Loc);
80000600: 414a85b3 sub a1,s5,s4
80000604: 2665 jal 800009ac <printf>
printf (" should be: %d\n", 13);
80000606: 45b5 li a1,13
80000608: e5c40513 addi a0,s0,-420
8000060c: 2645 jal 800009ac <printf>
printf ("Int_3_Loc: %d\n", Int_3_Loc);
8000060e: 45e2 lw a1,24(sp)
80000610: 80003537 lui a0,0x80003
80000614: 0d050513 addi a0,a0,208 # 800030d0 <_stack_start+0xffffcc00>
80000618: 2e51 jal 800009ac <printf>
printf (" should be: %d\n", 7);
8000061a: 459d li a1,7
8000061c: e5c40513 addi a0,s0,-420
80000620: 2671 jal 800009ac <printf>
printf ("Enum_Loc: %d\n", Enum_Loc);
80000622: 45f2 lw a1,28(sp)
80000624: 80003537 lui a0,0x80003
80000628: 0ec50513 addi a0,a0,236 # 800030ec <_stack_start+0xffffcc1c>
8000062c: 2641 jal 800009ac <printf>
printf (" should be: %d\n", 1);
8000062e: 4585 li a1,1
80000630: e5c40513 addi a0,s0,-420
80000634: 2ea5 jal 800009ac <printf>
printf ("Str_1_Loc: %s\n", Str_1_Loc);
80000636: 80003537 lui a0,0x80003
8000063a: 100c addi a1,sp,32
8000063c: 10850513 addi a0,a0,264 # 80003108 <_stack_start+0xffffcc38>
80000640: 26b5 jal 800009ac <printf>
printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
80000642: 80003537 lui a0,0x80003
80000646: 12450513 addi a0,a0,292 # 80003124 <_stack_start+0xffffcc54>
8000064a: 2121 jal 80000a52 <puts>
printf ("Str_2_Loc: %s\n", Str_2_Loc);
8000064c: 80003537 lui a0,0x80003
80000650: 008c addi a1,sp,64
80000652: 15850513 addi a0,a0,344 # 80003158 <_stack_start+0xffffcc88>
80000656: 2e99 jal 800009ac <printf>
printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
80000658: 80003537 lui a0,0x80003
8000065c: 17450513 addi a0,a0,372 # 80003174 <_stack_start+0xffffcca4>
80000660: 2ecd jal 80000a52 <puts>
printf ("\n");
80000662: 4529 li a0,10
80000664: 2911 jal 80000a78 <putchar>
User_Time = End_Time - Begin_Time;
80000666: 82c1a703 lw a4,-2004(gp) # 800034cc <Begin_Time>
8000066a: 8281a583 lw a1,-2008(gp) # 800034c8 <End_Time>
if (User_Time < Too_Small_Time)
8000066e: 1f300793 li a5,499
User_Time = End_Time - Begin_Time;
80000672: 8d99 sub a1,a1,a4
80000674: 82b1a223 sw a1,-2012(gp) # 800034c4 <User_Time>
if (User_Time < Too_Small_Time)
80000678: 12b7df63 ble a1,a5,800007b6 <main2+0x59a>
printf ("Clock cycles=%d \n", User_Time);
8000067c: 80003537 lui a0,0x80003
80000680: 20050513 addi a0,a0,512 # 80003200 <_stack_start+0xffffcd30>
80000684: 2625 jal 800009ac <printf>
Microseconds = (float) User_Time * Mic_secs_Per_Second
80000686: 8241a503 lw a0,-2012(gp) # 800034c4 <User_Time>
8000068a: 156020ef jal ra,800027e0 <__floatsisf>
8000068e: 842a mv s0,a0
80000690: 274020ef jal ra,80002904 <__extendsfdf2>
80000694: 800037b7 lui a5,0x80003
80000698: 4a07a603 lw a2,1184(a5) # 800034a0 <_stack_start+0xffffcfd0>
8000069c: 4a47a683 lw a3,1188(a5)
800006a0: 661000ef jal ra,80001500 <__muldf3>
/ ((float) CORE_HZ * ((float) Number_Of_Runs));
800006a4: 800037b7 lui a5,0x80003
800006a8: 4a87a603 lw a2,1192(a5) # 800034a8 <_stack_start+0xffffcfd8>
800006ac: 4ac7a683 lw a3,1196(a5)
800006b0: 640000ef jal ra,80000cf0 <__divdf3>
800006b4: 35c020ef jal ra,80002a10 <__truncdfsf2>
800006b8: 82a1a023 sw a0,-2016(gp) # 800034c0 <Microseconds>
/ (float) User_Time;
800006bc: 800037b7 lui a5,0x80003
800006c0: 4b07a503 lw a0,1200(a5) # 800034b0 <_stack_start+0xffffcfe0>
800006c4: 85a2 mv a1,s0
800006c6: 52a010ef jal ra,80001bf0 <__divsf3>
Dhrystones_Per_Second = ((float) CORE_HZ * (float) Number_Of_Runs)
800006ca: 80a1ae23 sw a0,-2020(gp) # 800034bc <Dhrystones_Per_Second>
printf ("DMIPS per Mhz: ");
800006ce: 80003537 lui a0,0x80003
800006d2: 21450513 addi a0,a0,532 # 80003214 <_stack_start+0xffffcd44>
800006d6: 2cd9 jal 800009ac <printf>
float dmips = (1e6f/1757.0f) * Number_Of_Runs / User_Time;
800006d8: 8241a503 lw a0,-2012(gp) # 800034c4 <User_Time>
800006dc: 104020ef jal ra,800027e0 <__floatsisf>
800006e0: 800037b7 lui a5,0x80003
800006e4: 85aa mv a1,a0
800006e6: 4b47a503 lw a0,1204(a5) # 800034b4 <_stack_start+0xffffcfe4>
800006ea: 506010ef jal ra,80001bf0 <__divsf3>
800006ee: 842a mv s0,a0
int dmipsNatural = dmips;
800006f0: 080020ef jal ra,80002770 <__fixsfsi>
800006f4: 84aa mv s1,a0
int dmipsReal = (dmips - dmipsNatural)*100.0f;
800006f6: 0ea020ef jal ra,800027e0 <__floatsisf>
800006fa: 85aa mv a1,a0
800006fc: 8522 mv a0,s0
800006fe: 3fb010ef jal ra,800022f8 <__subsf3>
80000702: 800037b7 lui a5,0x80003
80000706: 4b87a583 lw a1,1208(a5) # 800034b8 <_stack_start+0xffffcfe8>
8000070a: 07f010ef jal ra,80001f88 <__mulsf3>
8000070e: 062020ef jal ra,80002770 <__fixsfsi>
80000712: 842a mv s0,a0
printf ("%d.", dmipsNatural);
80000714: 80003537 lui a0,0x80003
80000718: 85a6 mv a1,s1
8000071a: 24450513 addi a0,a0,580 # 80003244 <_stack_start+0xffffcd74>
8000071e: 2479 jal 800009ac <printf>
if(dmipsReal < 10) printf("0");
80000720: 47a5 li a5,9
80000722: 0a87d763 ble s0,a5,800007d0 <main2+0x5b4>
printf ("%d", dmipsReal);
80000726: 80003537 lui a0,0x80003
8000072a: 85a2 mv a1,s0
8000072c: 24850513 addi a0,a0,584 # 80003248 <_stack_start+0xffffcd78>
80000730: 2cb5 jal 800009ac <printf>
printf ("\n");
80000732: 4529 li a0,10
80000734: 2691 jal 80000a78 <putchar>
}
80000736: 40fa lw ra,156(sp)
80000738: 446a lw s0,152(sp)
8000073a: 44da lw s1,148(sp)
8000073c: 494a lw s2,144(sp)
8000073e: 49ba lw s3,140(sp)
80000740: 4a2a lw s4,136(sp)
80000742: 4a9a lw s5,132(sp)
80000744: 4b0a lw s6,128(sp)
80000746: 5bf6 lw s7,124(sp)
80000748: 5c66 lw s8,120(sp)
8000074a: 5cd6 lw s9,116(sp)
8000074c: 5d46 lw s10,112(sp)
8000074e: 5db6 lw s11,108(sp)
80000750: 610d addi sp,sp,160
80000752: 8082 ret
Proc_6 (Ident_1, &Enum_Loc);
80000754: 086c addi a1,sp,28
80000756: 4501 li a0,0
80000758: 2291 jal 8000089c <Proc_6>
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
8000075a: 004cae03 lw t3,4(s9)
8000075e: 008ca303 lw t1,8(s9)
80000762: 00cca883 lw a7,12(s9)
80000766: 010ca803 lw a6,16(s9)
8000076a: 014ca503 lw a0,20(s9)
8000076e: 018ca583 lw a1,24(s9)
80000772: 01ccd603 lhu a2,28(s9)
80000776: 01ecc703 lbu a4,30(s9)
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
8000077a: 8341c783 lbu a5,-1996(gp) # 800034d4 <Ch_2_Glob>
8000077e: 0a85 addi s5,s5,1
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
80000780: c0de sw s7,64(sp)
80000782: c2f2 sw t3,68(sp)
80000784: c49a sw t1,72(sp)
80000786: c6c6 sw a7,76(sp)
80000788: c8c2 sw a6,80(sp)
8000078a: caaa sw a0,84(sp)
8000078c: ccae sw a1,88(sp)
8000078e: 04c11e23 sh a2,92(sp)
80000792: 04e10f23 sb a4,94(sp)
Int_Glob = Run_Index;
80000796: 8331ae23 sw s3,-1988(gp) # 800034dc <Int_Glob>
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
8000079a: 0ffafa93 andi s5,s5,255
8000079e: 8a4e mv s4,s3
800007a0: c357f5e3 bleu s5,a5,800003ca <main2+0x1ae>
800007a4: b191 j 800003e8 <main2+0x1cc>
printf ("Program compiled without 'register' attribute\n");
800007a6: 80003537 lui a0,0x80003
800007aa: d6050513 addi a0,a0,-672 # 80002d60 <_stack_start+0xffffc890>
800007ae: 2455 jal 80000a52 <puts>
printf ("\n");
800007b0: 4529 li a0,10
800007b2: 24d9 jal 80000a78 <putchar>
800007b4: be35 j 800002f0 <main2+0xd4>
printf ("Measured time too small to obtain meaningful results\n");
800007b6: 80003537 lui a0,0x80003
800007ba: 1a850513 addi a0,a0,424 # 800031a8 <_stack_start+0xffffccd8>
800007be: 2c51 jal 80000a52 <puts>
printf ("Please increase number of runs\n");
800007c0: 80003537 lui a0,0x80003
800007c4: 1e050513 addi a0,a0,480 # 800031e0 <_stack_start+0xffffcd10>
800007c8: 2469 jal 80000a52 <puts>
printf ("\n");
800007ca: 4529 li a0,10
800007cc: 2475 jal 80000a78 <putchar>
800007ce: b7a5 j 80000736 <main2+0x51a>
if(dmipsReal < 10) printf("0");
800007d0: 03000513 li a0,48
800007d4: 2455 jal 80000a78 <putchar>
800007d6: bf81 j 80000726 <main2+0x50a>
800007d8 <Proc_7>:
One_Fifty Int_2_Par_Val;
One_Fifty *Int_Par_Ref;
{
One_Fifty Int_Loc;
Int_Loc = Int_1_Par_Val + 2;
800007d8: 0509 addi a0,a0,2
*Int_Par_Ref = Int_2_Par_Val + Int_Loc;
800007da: 95aa add a1,a1,a0
800007dc: c20c sw a1,0(a2)
} /* Proc_7 */
800007de: 8082 ret
800007e0 <Proc_8>:
/* Int_Par_Val_2 == 7 */
Arr_1_Dim Arr_1_Par_Ref;
Arr_2_Dim Arr_2_Par_Ref;
int Int_1_Par_Val;
int Int_2_Par_Val;
{
800007e0: 1101 addi sp,sp,-32
800007e2: c64e sw s3,12(sp)
REG One_Fifty Int_Index;
REG One_Fifty Int_Loc;
Int_Loc = Int_1_Par_Val + 5;
800007e4: 00560993 addi s3,a2,5
{
800007e8: ca26 sw s1,20(sp)
Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
800007ea: 00299493 slli s1,s3,0x2
{
800007ee: cc22 sw s0,24(sp)
800007f0: c84a sw s2,16(sp)
800007f2: ce06 sw ra,28(sp)
Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
800007f4: 94aa add s1,s1,a0
{
800007f6: 8932 mv s2,a2
800007f8: 842e mv s0,a1
Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
800007fa: 0734ac23 sw s3,120(s1)
Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
800007fe: c094 sw a3,0(s1)
Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
80000800: c0d4 sw a3,4(s1)
for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
80000802: 854e mv a0,s3
80000804: 0c800593 li a1,200
80000808: 3a0020ef jal ra,80002ba8 <__mulsi3>
8000080c: 090a slli s2,s2,0x2
8000080e: 012507b3 add a5,a0,s2
80000812: 97a2 add a5,a5,s0
Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
80000814: 4b98 lw a4,16(a5)
Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
80000816: 0137aa23 sw s3,20(a5)
8000081a: 0137ac23 sw s3,24(a5)
Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
8000081e: 0705 addi a4,a4,1
80000820: cb98 sw a4,16(a5)
Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
80000822: 409c lw a5,0(s1)
80000824: 942a add s0,s0,a0
80000826: 944a add s0,s0,s2
80000828: 6605 lui a2,0x1
8000082a: 9432 add s0,s0,a2
8000082c: faf42a23 sw a5,-76(s0)
Int_Glob = 5;
} /* Proc_8 */
80000830: 40f2 lw ra,28(sp)
80000832: 4462 lw s0,24(sp)
Int_Glob = 5;
80000834: 4715 li a4,5
80000836: 82e1ae23 sw a4,-1988(gp) # 800034dc <Int_Glob>
} /* Proc_8 */
8000083a: 44d2 lw s1,20(sp)
8000083c: 4942 lw s2,16(sp)
8000083e: 49b2 lw s3,12(sp)
80000840: 6105 addi sp,sp,32
80000842: 8082 ret
80000844 <Func_1>:
/* second call: Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C' */
/* third call: Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C' */
Capital_Letter Ch_1_Par_Val;
Capital_Letter Ch_2_Par_Val;
{
80000844: 0ff57513 andi a0,a0,255
80000848: 0ff5f593 andi a1,a1,255
Capital_Letter Ch_1_Loc;
Capital_Letter Ch_2_Loc;
Ch_1_Loc = Ch_1_Par_Val;
Ch_2_Loc = Ch_1_Loc;
if (Ch_2_Loc != Ch_2_Par_Val)
8000084c: 00b50463 beq a0,a1,80000854 <Func_1+0x10>
/* then, executed */
return (Ident_1);
80000850: 4501 li a0,0
else /* not executed */
{
Ch_1_Glob = Ch_1_Loc;
return (Ident_2);
}
} /* Func_1 */
80000852: 8082 ret
Ch_1_Glob = Ch_1_Loc;
80000854: 82a18aa3 sb a0,-1995(gp) # 800034d5 <Ch_1_Glob>
return (Ident_2);
80000858: 4505 li a0,1
8000085a: 8082 ret
8000085c <Func_2>:
/* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
/* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
Str_30 Str_1_Par_Ref;
Str_30 Str_2_Par_Ref;
{
8000085c: 1141 addi sp,sp,-16
8000085e: c422 sw s0,8(sp)
80000860: c226 sw s1,4(sp)
80000862: c606 sw ra,12(sp)
80000864: 842a mv s0,a0
80000866: 84ae mv s1,a1
REG One_Thirty Int_Loc;
Capital_Letter Ch_Loc;
Int_Loc = 2;
while (Int_Loc <= 2) /* loop body executed once */
if (Func_1 (Str_1_Par_Ref[Int_Loc],
80000868: 0034c583 lbu a1,3(s1)
8000086c: 00244503 lbu a0,2(s0)
80000870: 3fd1 jal 80000844 <Func_1>
80000872: f97d bnez a0,80000868 <Func_2+0xc>
if (Ch_Loc == 'R')
/* then, not executed */
return (true);
else /* executed */
{
if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
80000874: 85a6 mv a1,s1
80000876: 8522 mv a0,s0
80000878: 2cf5 jal 80000b74 <strcmp>
Int_Loc += 7;
Int_Glob = Int_Loc;
return (true);
}
else /* executed */
return (false);
8000087a: 4781 li a5,0
if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
8000087c: 00a05663 blez a0,80000888 <Func_2+0x2c>
Int_Glob = Int_Loc;
80000880: 4729 li a4,10
80000882: 82e1ae23 sw a4,-1988(gp) # 800034dc <Int_Glob>
return (true);
80000886: 4785 li a5,1
} /* if Ch_Loc */
} /* Func_2 */
80000888: 40b2 lw ra,12(sp)
8000088a: 4422 lw s0,8(sp)
8000088c: 4492 lw s1,4(sp)
8000088e: 853e mv a0,a5
80000890: 0141 addi sp,sp,16
80000892: 8082 ret
80000894 <Func_3>:
Enumeration Enum_Par_Val;
{
Enumeration Enum_Loc;
Enum_Loc = Enum_Par_Val;
if (Enum_Loc == Ident_3)
80000894: 1579 addi a0,a0,-2
/* then, executed */
return (true);
else /* not executed */
return (false);
} /* Func_3 */
80000896: 00153513 seqz a0,a0
8000089a: 8082 ret
8000089c <Proc_6>:
{
8000089c: 1141 addi sp,sp,-16
8000089e: c422 sw s0,8(sp)
800008a0: c226 sw s1,4(sp)
800008a2: c606 sw ra,12(sp)
800008a4: 842a mv s0,a0
800008a6: 84ae mv s1,a1
if (! Func_3 (Enum_Val_Par))
800008a8: 37f5 jal 80000894 <Func_3>
800008aa: c115 beqz a0,800008ce <Proc_6+0x32>
*Enum_Ref_Par = Enum_Val_Par;
800008ac: c080 sw s0,0(s1)
switch (Enum_Val_Par)
800008ae: 4785 li a5,1
800008b0: 02f40463 beq s0,a5,800008d8 <Proc_6+0x3c>
800008b4: c805 beqz s0,800008e4 <Proc_6+0x48>
800008b6: 4709 li a4,2
800008b8: 02e40d63 beq s0,a4,800008f2 <Proc_6+0x56>
800008bc: 4791 li a5,4
800008be: 00f41363 bne s0,a5,800008c4 <Proc_6+0x28>
*Enum_Ref_Par = Ident_3;
800008c2: c098 sw a4,0(s1)
} /* Proc_6 */
800008c4: 40b2 lw ra,12(sp)
800008c6: 4422 lw s0,8(sp)
800008c8: 4492 lw s1,4(sp)
800008ca: 0141 addi sp,sp,16
800008cc: 8082 ret
*Enum_Ref_Par = Ident_4;
800008ce: 478d li a5,3
800008d0: c09c sw a5,0(s1)
switch (Enum_Val_Par)
800008d2: 4785 li a5,1
800008d4: fef410e3 bne s0,a5,800008b4 <Proc_6+0x18>
if (Int_Glob > 100)
800008d8: 83c1a703 lw a4,-1988(gp) # 800034dc <Int_Glob>
800008dc: 06400793 li a5,100
800008e0: 00e7df63 ble a4,a5,800008fe <Proc_6+0x62>
} /* Proc_6 */
800008e4: 40b2 lw ra,12(sp)
800008e6: 4422 lw s0,8(sp)
*Enum_Ref_Par = Ident_1;
800008e8: 0004a023 sw zero,0(s1)
} /* Proc_6 */
800008ec: 4492 lw s1,4(sp)
800008ee: 0141 addi sp,sp,16
800008f0: 8082 ret
800008f2: 40b2 lw ra,12(sp)
800008f4: 4422 lw s0,8(sp)
*Enum_Ref_Par = Ident_2;
800008f6: c09c sw a5,0(s1)
} /* Proc_6 */
800008f8: 4492 lw s1,4(sp)
800008fa: 0141 addi sp,sp,16
800008fc: 8082 ret
800008fe: 40b2 lw ra,12(sp)
80000900: 4422 lw s0,8(sp)
else *Enum_Ref_Par = Ident_4;
80000902: 478d li a5,3
80000904: c09c sw a5,0(s1)
} /* Proc_6 */
80000906: 4492 lw s1,4(sp)
80000908: 0141 addi sp,sp,16
8000090a: 8082 ret
8000090c <printf_s>:
{
putchar(c);
}
static void printf_s(char *p)
{
8000090c: 1141 addi sp,sp,-16
8000090e: c422 sw s0,8(sp)
80000910: c606 sw ra,12(sp)
80000912: 842a mv s0,a0
while (*p)
80000914: 00054503 lbu a0,0(a0)
80000918: c511 beqz a0,80000924 <printf_s+0x18>
putchar(*(p++));
8000091a: 0405 addi s0,s0,1
8000091c: 2ab1 jal 80000a78 <putchar>
while (*p)
8000091e: 00044503 lbu a0,0(s0)
80000922: fd65 bnez a0,8000091a <printf_s+0xe>
}
80000924: 40b2 lw ra,12(sp)
80000926: 4422 lw s0,8(sp)
80000928: 0141 addi sp,sp,16
8000092a: 8082 ret
8000092c <printf_c>:
putchar(c);
8000092c: a2b1 j 80000a78 <putchar>
8000092e <printf_d>:
static void printf_d(int val)
{
8000092e: 7179 addi sp,sp,-48
80000930: d226 sw s1,36(sp)
80000932: d606 sw ra,44(sp)
80000934: d422 sw s0,40(sp)
80000936: d04a sw s2,32(sp)
80000938: 84aa mv s1,a0
char buffer[32];
char *p = buffer;
if (val < 0) {
8000093a: 04054263 bltz a0,8000097e <printf_d+0x50>
{
8000093e: 890a mv s2,sp
80000940: 844a mv s0,s2
80000942: a829 j 8000095c <printf_d+0x2e>
printf_c('-');
val = -val;
}
while (val || p == buffer) {
*(p++) = '0' + val % 10;
80000944: 30c020ef jal ra,80002c50 <__modsi3>
80000948: 03050793 addi a5,a0,48
8000094c: 0405 addi s0,s0,1
val = val / 10;
8000094e: 8526 mv a0,s1
80000950: 45a9 li a1,10
*(p++) = '0' + val % 10;
80000952: fef40fa3 sb a5,-1(s0)
val = val / 10;
80000956: 276020ef jal ra,80002bcc <__divsi3>
8000095a: 84aa mv s1,a0
*(p++) = '0' + val % 10;
8000095c: 45a9 li a1,10
8000095e: 8526 mv a0,s1
while (val || p == buffer) {
80000960: f0f5 bnez s1,80000944 <printf_d+0x16>
80000962: ff2401e3 beq s0,s2,80000944 <printf_d+0x16>
}
while (p != buffer)
printf_c(*(--p));
80000966: 147d addi s0,s0,-1
80000968: 00044503 lbu a0,0(s0)
8000096c: 37c1 jal 8000092c <printf_c>
while (p != buffer)
8000096e: ff241ce3 bne s0,s2,80000966 <printf_d+0x38>
}
80000972: 50b2 lw ra,44(sp)
80000974: 5422 lw s0,40(sp)
80000976: 5492 lw s1,36(sp)
80000978: 5902 lw s2,32(sp)
8000097a: 6145 addi sp,sp,48
8000097c: 8082 ret
printf_c('-');
8000097e: 02d00513 li a0,45
80000982: 376d jal 8000092c <printf_c>
val = -val;
80000984: 409004b3 neg s1,s1
80000988: bf5d j 8000093e <printf_d+0x10>
8000098a <malloc>:
char *p = heap_memory + heap_memory_used;
8000098a: 8481a703 lw a4,-1976(gp) # 800034e8 <heap_memory_used>
heap_memory_used += size;
8000098e: 00a707b3 add a5,a4,a0
char *p = heap_memory + heap_memory_used;
80000992: 80006537 lui a0,0x80006
heap_memory_used += size;
80000996: 84f1a423 sw a5,-1976(gp) # 800034e8 <heap_memory_used>
char *p = heap_memory + heap_memory_used;
8000099a: cc450513 addi a0,a0,-828 # 80005cc4 <_stack_start+0xfffff7f4>
if (heap_memory_used > 1024)
8000099e: 40000693 li a3,1024
char *p = heap_memory + heap_memory_used;
800009a2: 953a add a0,a0,a4
if (heap_memory_used > 1024)
800009a4: 00f6d363 ble a5,a3,800009aa <malloc+0x20>
asm volatile ("ebreak");
800009a8: 9002 ebreak
}
800009aa: 8082 ret
800009ac <printf>:
int printf(const char *format, ...)
{
800009ac: 715d addi sp,sp,-80
800009ae: cc52 sw s4,24(sp)
800009b0: d606 sw ra,44(sp)
800009b2: d422 sw s0,40(sp)
800009b4: d226 sw s1,36(sp)
800009b6: d04a sw s2,32(sp)
800009b8: ce4e sw s3,28(sp)
800009ba: ca56 sw s5,20(sp)
800009bc: 8a2a mv s4,a0
int i;
va_list ap;
va_start(ap, format);
for (i = 0; format[i]; i++)
800009be: 00054503 lbu a0,0(a0)
{
800009c2: c2be sw a5,68(sp)
va_start(ap, format);
800009c4: 185c addi a5,sp,52
{
800009c6: da2e sw a1,52(sp)
800009c8: dc32 sw a2,56(sp)
800009ca: de36 sw a3,60(sp)
800009cc: c0ba sw a4,64(sp)
800009ce: c4c2 sw a6,72(sp)
800009d0: c6c6 sw a7,76(sp)
va_start(ap, format);
800009d2: c63e sw a5,12(sp)
for (i = 0; format[i]; i++)
800009d4: c11d beqz a0,800009fa <printf+0x4e>
800009d6: 4401 li s0,0
if (format[i] == '%') {
800009d8: 02500a93 li s5,37
while (format[++i]) {
if (format[i] == 'c') {
800009dc: 06300493 li s1,99
printf_c(va_arg(ap,int));
break;
}
if (format[i] == 's') {
800009e0: 07300913 li s2,115
printf_s(va_arg(ap,char*));
break;
}
if (format[i] == 'd') {
800009e4: 06400993 li s3,100
if (format[i] == '%') {
800009e8: 03550263 beq a0,s5,80000a0c <printf+0x60>
printf_d(va_arg(ap,int));
break;
}
}
} else
printf_c(format[i]);
800009ec: 3781 jal 8000092c <printf_c>
for (i = 0; format[i]; i++)
800009ee: 0405 addi s0,s0,1
800009f0: 008a07b3 add a5,s4,s0
800009f4: 0007c503 lbu a0,0(a5)
800009f8: f965 bnez a0,800009e8 <printf+0x3c>
va_end(ap);
}
800009fa: 50b2 lw ra,44(sp)
800009fc: 5422 lw s0,40(sp)
800009fe: 5492 lw s1,36(sp)
80000a00: 5902 lw s2,32(sp)
80000a02: 49f2 lw s3,28(sp)
80000a04: 4a62 lw s4,24(sp)
80000a06: 4ad2 lw s5,20(sp)
80000a08: 6161 addi sp,sp,80
80000a0a: 8082 ret
80000a0c: 00140693 addi a3,s0,1
80000a10: 00da0733 add a4,s4,a3
80000a14: a031 j 80000a20 <printf+0x74>
if (format[i] == 's') {
80000a16: 03278263 beq a5,s2,80000a3a <printf+0x8e>
if (format[i] == 'd') {
80000a1a: 03378663 beq a5,s3,80000a46 <printf+0x9a>
80000a1e: 0685 addi a3,a3,1
while (format[++i]) {
80000a20: 00074783 lbu a5,0(a4)
80000a24: 8436 mv s0,a3
80000a26: 0705 addi a4,a4,1
80000a28: d3f9 beqz a5,800009ee <printf+0x42>
if (format[i] == 'c') {
80000a2a: fe9796e3 bne a5,s1,80000a16 <printf+0x6a>
printf_c(va_arg(ap,int));
80000a2e: 47b2 lw a5,12(sp)
80000a30: 4388 lw a0,0(a5)
80000a32: 0791 addi a5,a5,4
80000a34: c63e sw a5,12(sp)
80000a36: 3ddd jal 8000092c <printf_c>
break;
80000a38: bf5d j 800009ee <printf+0x42>
printf_s(va_arg(ap,char*));
80000a3a: 47b2 lw a5,12(sp)
80000a3c: 4388 lw a0,0(a5)
80000a3e: 0791 addi a5,a5,4
80000a40: c63e sw a5,12(sp)
80000a42: 35e9 jal 8000090c <printf_s>
break;
80000a44: b76d j 800009ee <printf+0x42>
printf_d(va_arg(ap,int));
80000a46: 47b2 lw a5,12(sp)
80000a48: 4388 lw a0,0(a5)
80000a4a: 0791 addi a5,a5,4
80000a4c: c63e sw a5,12(sp)
80000a4e: 35c5 jal 8000092e <printf_d>
break;
80000a50: bf79 j 800009ee <printf+0x42>
80000a52 <puts>:
int puts(char *s){
80000a52: 1141 addi sp,sp,-16
80000a54: c422 sw s0,8(sp)
80000a56: c606 sw ra,12(sp)
80000a58: 842a mv s0,a0
while (*s) {
80000a5a: 00054503 lbu a0,0(a0)
80000a5e: c511 beqz a0,80000a6a <puts+0x18>
putchar(*s);
s++;
80000a60: 0405 addi s0,s0,1
putchar(*s);
80000a62: 2819 jal 80000a78 <putchar>
while (*s) {
80000a64: 00044503 lbu a0,0(s0)
80000a68: fd65 bnez a0,80000a60 <puts+0xe>
}
putchar('\n');
80000a6a: 4529 li a0,10
80000a6c: 2031 jal 80000a78 <putchar>
return 0;
}
80000a6e: 40b2 lw ra,12(sp)
80000a70: 4422 lw s0,8(sp)
80000a72: 4501 li a0,0
80000a74: 0141 addi sp,sp,16
80000a76: 8082 ret
80000a78 <putchar>:
void putchar(char c){
TEST_COM_BASE[0] = c;
80000a78: f01007b7 lui a5,0xf0100
80000a7c: f0a7a023 sw a0,-256(a5) # f00fff00 <_stack_start+0x700f9a30>
}
80000a80: 8082 ret
80000a82 <clock>:
#include <time.h>
clock_t clock(){
return TEST_COM_BASE[4];
80000a82: f01007b7 lui a5,0xf0100
80000a86: f107a503 lw a0,-240(a5) # f00fff10 <_stack_start+0x700f9a40>
}
80000a8a: 8082 ret
80000a8c <memcpy>:
80000a8c: 00a5c7b3 xor a5,a1,a0
80000a90: 0037f793 andi a5,a5,3
80000a94: 00c50733 add a4,a0,a2
80000a98: 00079663 bnez a5,80000aa4 <memcpy+0x18>
80000a9c: 00300793 li a5,3
80000aa0: 02c7e463 bltu a5,a2,80000ac8 <memcpy+0x3c>
80000aa4: 00050793 mv a5,a0
80000aa8: 00e56c63 bltu a0,a4,80000ac0 <memcpy+0x34>
80000aac: 00008067 ret
80000ab0: 0005c683 lbu a3,0(a1)
80000ab4: 00178793 addi a5,a5,1
80000ab8: 00158593 addi a1,a1,1
80000abc: fed78fa3 sb a3,-1(a5)
80000ac0: fee7e8e3 bltu a5,a4,80000ab0 <memcpy+0x24>
80000ac4: 00008067 ret
80000ac8: 00357793 andi a5,a0,3
80000acc: 08079263 bnez a5,80000b50 <memcpy+0xc4>
80000ad0: 00050793 mv a5,a0
80000ad4: ffc77693 andi a3,a4,-4
80000ad8: fe068613 addi a2,a3,-32
80000adc: 08c7f663 bleu a2,a5,80000b68 <memcpy+0xdc>
80000ae0: 0005a383 lw t2,0(a1)
80000ae4: 0045a283 lw t0,4(a1)
80000ae8: 0085af83 lw t6,8(a1)
80000aec: 00c5af03 lw t5,12(a1)
80000af0: 0105ae83 lw t4,16(a1)
80000af4: 0145ae03 lw t3,20(a1)
80000af8: 0185a303 lw t1,24(a1)
80000afc: 01c5a883 lw a7,28(a1)
80000b00: 02458593 addi a1,a1,36
80000b04: 02478793 addi a5,a5,36
80000b08: ffc5a803 lw a6,-4(a1)
80000b0c: fc77ae23 sw t2,-36(a5)
80000b10: fe57a023 sw t0,-32(a5)
80000b14: fff7a223 sw t6,-28(a5)
80000b18: ffe7a423 sw t5,-24(a5)
80000b1c: ffd7a623 sw t4,-20(a5)
80000b20: ffc7a823 sw t3,-16(a5)
80000b24: fe67aa23 sw t1,-12(a5)
80000b28: ff17ac23 sw a7,-8(a5)
80000b2c: ff07ae23 sw a6,-4(a5)
80000b30: fadff06f j 80000adc <memcpy+0x50>
80000b34: 0005c683 lbu a3,0(a1)
80000b38: 00178793 addi a5,a5,1
80000b3c: 00158593 addi a1,a1,1
80000b40: fed78fa3 sb a3,-1(a5)
80000b44: 0037f693 andi a3,a5,3
80000b48: fe0696e3 bnez a3,80000b34 <memcpy+0xa8>
80000b4c: f89ff06f j 80000ad4 <memcpy+0x48>
80000b50: 00050793 mv a5,a0
80000b54: ff1ff06f j 80000b44 <memcpy+0xb8>
80000b58: 0005a603 lw a2,0(a1)
80000b5c: 00478793 addi a5,a5,4
80000b60: 00458593 addi a1,a1,4
80000b64: fec7ae23 sw a2,-4(a5)
80000b68: fed7e8e3 bltu a5,a3,80000b58 <memcpy+0xcc>
80000b6c: f4e7eae3 bltu a5,a4,80000ac0 <memcpy+0x34>
80000b70: 00008067 ret
80000b74 <strcmp>:
80000b74: 00b56733 or a4,a0,a1
80000b78: fff00393 li t2,-1
80000b7c: 00377713 andi a4,a4,3
80000b80: 10071063 bnez a4,80000c80 <strcmp+0x10c>
80000b84: 7f7f87b7 lui a5,0x7f7f8
80000b88: f7f78793 addi a5,a5,-129 # 7f7f7f7f <_stack_size+0x7f7f7b7f>
80000b8c: 00052603 lw a2,0(a0)
80000b90: 0005a683 lw a3,0(a1)
80000b94: 00f672b3 and t0,a2,a5
80000b98: 00f66333 or t1,a2,a5
80000b9c: 00f282b3 add t0,t0,a5
80000ba0: 0062e2b3 or t0,t0,t1
80000ba4: 10729263 bne t0,t2,80000ca8 <strcmp+0x134>
80000ba8: 08d61663 bne a2,a3,80000c34 <strcmp+0xc0>
80000bac: 00452603 lw a2,4(a0)
80000bb0: 0045a683 lw a3,4(a1)
80000bb4: 00f672b3 and t0,a2,a5
80000bb8: 00f66333 or t1,a2,a5
80000bbc: 00f282b3 add t0,t0,a5
80000bc0: 0062e2b3 or t0,t0,t1
80000bc4: 0c729e63 bne t0,t2,80000ca0 <strcmp+0x12c>
80000bc8: 06d61663 bne a2,a3,80000c34 <strcmp+0xc0>
80000bcc: 00852603 lw a2,8(a0)
80000bd0: 0085a683 lw a3,8(a1)
80000bd4: 00f672b3 and t0,a2,a5
80000bd8: 00f66333 or t1,a2,a5
80000bdc: 00f282b3 add t0,t0,a5
80000be0: 0062e2b3 or t0,t0,t1
80000be4: 0c729863 bne t0,t2,80000cb4 <strcmp+0x140>
80000be8: 04d61663 bne a2,a3,80000c34 <strcmp+0xc0>
80000bec: 00c52603 lw a2,12(a0)
80000bf0: 00c5a683 lw a3,12(a1)
80000bf4: 00f672b3 and t0,a2,a5
80000bf8: 00f66333 or t1,a2,a5
80000bfc: 00f282b3 add t0,t0,a5
80000c00: 0062e2b3 or t0,t0,t1
80000c04: 0c729263 bne t0,t2,80000cc8 <strcmp+0x154>
80000c08: 02d61663 bne a2,a3,80000c34 <strcmp+0xc0>
80000c0c: 01052603 lw a2,16(a0)
80000c10: 0105a683 lw a3,16(a1)
80000c14: 00f672b3 and t0,a2,a5
80000c18: 00f66333 or t1,a2,a5
80000c1c: 00f282b3 add t0,t0,a5
80000c20: 0062e2b3 or t0,t0,t1
80000c24: 0a729c63 bne t0,t2,80000cdc <strcmp+0x168>
80000c28: 01450513 addi a0,a0,20
80000c2c: 01458593 addi a1,a1,20
80000c30: f4d60ee3 beq a2,a3,80000b8c <strcmp+0x18>
80000c34: 01061713 slli a4,a2,0x10
80000c38: 01069793 slli a5,a3,0x10
80000c3c: 00f71e63 bne a4,a5,80000c58 <strcmp+0xe4>
80000c40: 01065713 srli a4,a2,0x10
80000c44: 0106d793 srli a5,a3,0x10
80000c48: 40f70533 sub a0,a4,a5
80000c4c: 0ff57593 andi a1,a0,255
80000c50: 02059063 bnez a1,80000c70 <strcmp+0xfc>
80000c54: 00008067 ret
80000c58: 01075713 srli a4,a4,0x10
80000c5c: 0107d793 srli a5,a5,0x10
80000c60: 40f70533 sub a0,a4,a5
80000c64: 0ff57593 andi a1,a0,255
80000c68: 00059463 bnez a1,80000c70 <strcmp+0xfc>
80000c6c: 00008067 ret
80000c70: 0ff77713 andi a4,a4,255
80000c74: 0ff7f793 andi a5,a5,255
80000c78: 40f70533 sub a0,a4,a5
80000c7c: 00008067 ret
80000c80: 00054603 lbu a2,0(a0)
80000c84: 0005c683 lbu a3,0(a1)
80000c88: 00150513 addi a0,a0,1
80000c8c: 00158593 addi a1,a1,1
80000c90: 00d61463 bne a2,a3,80000c98 <strcmp+0x124>
80000c94: fe0616e3 bnez a2,80000c80 <strcmp+0x10c>
80000c98: 40d60533 sub a0,a2,a3
80000c9c: 00008067 ret
80000ca0: 00450513 addi a0,a0,4
80000ca4: 00458593 addi a1,a1,4
80000ca8: fcd61ce3 bne a2,a3,80000c80 <strcmp+0x10c>
80000cac: 00000513 li a0,0
80000cb0: 00008067 ret
80000cb4: 00850513 addi a0,a0,8
80000cb8: 00858593 addi a1,a1,8
80000cbc: fcd612e3 bne a2,a3,80000c80 <strcmp+0x10c>
80000cc0: 00000513 li a0,0
80000cc4: 00008067 ret
80000cc8: 00c50513 addi a0,a0,12
80000ccc: 00c58593 addi a1,a1,12
80000cd0: fad618e3 bne a2,a3,80000c80 <strcmp+0x10c>
80000cd4: 00000513 li a0,0
80000cd8: 00008067 ret
80000cdc: 01050513 addi a0,a0,16
80000ce0: 01058593 addi a1,a1,16
80000ce4: f8d61ee3 bne a2,a3,80000c80 <strcmp+0x10c>
80000ce8: 00000513 li a0,0
80000cec: 00008067 ret
80000cf0 <__divdf3>:
80000cf0: fb010113 addi sp,sp,-80
80000cf4: 04812423 sw s0,72(sp)
80000cf8: 03412c23 sw s4,56(sp)
80000cfc: 00100437 lui s0,0x100
80000d00: 0145da13 srli s4,a1,0x14
80000d04: 05212023 sw s2,64(sp)
80000d08: 03312e23 sw s3,60(sp)
80000d0c: 03512a23 sw s5,52(sp)
80000d10: 03812423 sw s8,40(sp)
80000d14: fff40413 addi s0,s0,-1 # fffff <_stack_size+0xffbff>
80000d18: 04112623 sw ra,76(sp)
80000d1c: 04912223 sw s1,68(sp)
80000d20: 03612823 sw s6,48(sp)
80000d24: 03712623 sw s7,44(sp)
80000d28: 03912223 sw s9,36(sp)
80000d2c: 03a12023 sw s10,32(sp)
80000d30: 01b12e23 sw s11,28(sp)
80000d34: 7ffa7a13 andi s4,s4,2047
80000d38: 00050913 mv s2,a0
80000d3c: 00060c13 mv s8,a2
80000d40: 00068a93 mv s5,a3
80000d44: 00b47433 and s0,s0,a1
80000d48: 01f5d993 srli s3,a1,0x1f
80000d4c: 0a0a0663 beqz s4,80000df8 <__divdf3+0x108>
80000d50: 7ff00793 li a5,2047
80000d54: 10fa0463 beq s4,a5,80000e5c <__divdf3+0x16c>
80000d58: 00341413 slli s0,s0,0x3
80000d5c: 008007b7 lui a5,0x800
80000d60: 00f46433 or s0,s0,a5
80000d64: 01d55b13 srli s6,a0,0x1d
80000d68: 008b6b33 or s6,s6,s0
80000d6c: 00351493 slli s1,a0,0x3
80000d70: c01a0a13 addi s4,s4,-1023
80000d74: 00000b93 li s7,0
80000d78: 014ad513 srli a0,s5,0x14
80000d7c: 00100937 lui s2,0x100
80000d80: fff90913 addi s2,s2,-1 # fffff <_stack_size+0xffbff>
80000d84: 7ff57513 andi a0,a0,2047
80000d88: 01597933 and s2,s2,s5
80000d8c: 000c0593 mv a1,s8
80000d90: 01fada93 srli s5,s5,0x1f
80000d94: 10050263 beqz a0,80000e98 <__divdf3+0x1a8>
80000d98: 7ff00793 li a5,2047
80000d9c: 16f50263 beq a0,a5,80000f00 <__divdf3+0x210>
80000da0: 00800437 lui s0,0x800
80000da4: 00391913 slli s2,s2,0x3
80000da8: 00896933 or s2,s2,s0
80000dac: 01dc5413 srli s0,s8,0x1d
80000db0: 01246433 or s0,s0,s2
80000db4: 003c1593 slli a1,s8,0x3
80000db8: c0150513 addi a0,a0,-1023
80000dbc: 00000793 li a5,0
80000dc0: 002b9713 slli a4,s7,0x2
80000dc4: 00f76733 or a4,a4,a5
80000dc8: fff70713 addi a4,a4,-1
80000dcc: 00e00693 li a3,14
80000dd0: 0159c933 xor s2,s3,s5
80000dd4: 40aa0a33 sub s4,s4,a0
80000dd8: 16e6e063 bltu a3,a4,80000f38 <__divdf3+0x248>
80000ddc: 00002697 auipc a3,0x2
80000de0: 4d068693 addi a3,a3,1232 # 800032ac <end+0x5e0>
80000de4: 00271713 slli a4,a4,0x2
80000de8: 00d70733 add a4,a4,a3
80000dec: 00072703 lw a4,0(a4)
80000df0: 00d70733 add a4,a4,a3
80000df4: 00070067 jr a4
80000df8: 00a46b33 or s6,s0,a0
80000dfc: 060b0e63 beqz s6,80000e78 <__divdf3+0x188>
80000e00: 04040063 beqz s0,80000e40 <__divdf3+0x150>
80000e04: 00040513 mv a0,s0
80000e08: 679010ef jal ra,80002c80 <__clzsi2>
80000e0c: ff550793 addi a5,a0,-11
80000e10: 01c00713 li a4,28
80000e14: 02f74c63 blt a4,a5,80000e4c <__divdf3+0x15c>
80000e18: 01d00b13 li s6,29
80000e1c: ff850493 addi s1,a0,-8
80000e20: 40fb0b33 sub s6,s6,a5
80000e24: 00941433 sll s0,s0,s1
80000e28: 01695b33 srl s6,s2,s6
80000e2c: 008b6b33 or s6,s6,s0
80000e30: 009914b3 sll s1,s2,s1
80000e34: c0d00a13 li s4,-1011
80000e38: 40aa0a33 sub s4,s4,a0
80000e3c: f39ff06f j 80000d74 <__divdf3+0x84>
80000e40: 641010ef jal ra,80002c80 <__clzsi2>
80000e44: 02050513 addi a0,a0,32
80000e48: fc5ff06f j 80000e0c <__divdf3+0x11c>
80000e4c: fd850413 addi s0,a0,-40
80000e50: 00891b33 sll s6,s2,s0
80000e54: 00000493 li s1,0
80000e58: fddff06f j 80000e34 <__divdf3+0x144>
80000e5c: 00a46b33 or s6,s0,a0
80000e60: 020b0463 beqz s6,80000e88 <__divdf3+0x198>
80000e64: 00050493 mv s1,a0
80000e68: 00040b13 mv s6,s0
80000e6c: 7ff00a13 li s4,2047
80000e70: 00300b93 li s7,3
80000e74: f05ff06f j 80000d78 <__divdf3+0x88>
80000e78: 00000493 li s1,0
80000e7c: 00000a13 li s4,0
80000e80: 00100b93 li s7,1
80000e84: ef5ff06f j 80000d78 <__divdf3+0x88>
80000e88: 00000493 li s1,0
80000e8c: 7ff00a13 li s4,2047
80000e90: 00200b93 li s7,2
80000e94: ee5ff06f j 80000d78 <__divdf3+0x88>
80000e98: 01896433 or s0,s2,s8
80000e9c: 06040e63 beqz s0,80000f18 <__divdf3+0x228>
80000ea0: 04090063 beqz s2,80000ee0 <__divdf3+0x1f0>
80000ea4: 00090513 mv a0,s2
80000ea8: 5d9010ef jal ra,80002c80 <__clzsi2>
80000eac: ff550793 addi a5,a0,-11
80000eb0: 01c00713 li a4,28
80000eb4: 02f74e63 blt a4,a5,80000ef0 <__divdf3+0x200>
80000eb8: 01d00413 li s0,29
80000ebc: ff850593 addi a1,a0,-8
80000ec0: 40f40433 sub s0,s0,a5
80000ec4: 00b91933 sll s2,s2,a1
80000ec8: 008c5433 srl s0,s8,s0
80000ecc: 01246433 or s0,s0,s2
80000ed0: 00bc15b3 sll a1,s8,a1
80000ed4: c0d00713 li a4,-1011
80000ed8: 40a70533 sub a0,a4,a0
80000edc: ee1ff06f j 80000dbc <__divdf3+0xcc>
80000ee0: 000c0513 mv a0,s8
80000ee4: 59d010ef jal ra,80002c80 <__clzsi2>
80000ee8: 02050513 addi a0,a0,32
80000eec: fc1ff06f j 80000eac <__divdf3+0x1bc>
80000ef0: fd850413 addi s0,a0,-40
80000ef4: 008c1433 sll s0,s8,s0
80000ef8: 00000593 li a1,0
80000efc: fd9ff06f j 80000ed4 <__divdf3+0x1e4>
80000f00: 01896433 or s0,s2,s8
80000f04: 02040263 beqz s0,80000f28 <__divdf3+0x238>
80000f08: 00090413 mv s0,s2
80000f0c: 7ff00513 li a0,2047
80000f10: 00300793 li a5,3
80000f14: eadff06f j 80000dc0 <__divdf3+0xd0>
80000f18: 00000593 li a1,0
80000f1c: 00000513 li a0,0
80000f20: 00100793 li a5,1
80000f24: e9dff06f j 80000dc0 <__divdf3+0xd0>
80000f28: 00000593 li a1,0
80000f2c: 7ff00513 li a0,2047
80000f30: 00200793 li a5,2
80000f34: e8dff06f j 80000dc0 <__divdf3+0xd0>
80000f38: 01646663 bltu s0,s6,80000f44 <__divdf3+0x254>
80000f3c: 488b1263 bne s6,s0,800013c0 <__divdf3+0x6d0>
80000f40: 48b4e063 bltu s1,a1,800013c0 <__divdf3+0x6d0>
80000f44: 01fb1693 slli a3,s6,0x1f
80000f48: 0014d713 srli a4,s1,0x1
80000f4c: 01f49c13 slli s8,s1,0x1f
80000f50: 001b5b13 srli s6,s6,0x1
80000f54: 00e6e4b3 or s1,a3,a4
80000f58: 00841413 slli s0,s0,0x8
80000f5c: 0185dc93 srli s9,a1,0x18
80000f60: 008cecb3 or s9,s9,s0
80000f64: 010cda93 srli s5,s9,0x10
80000f68: 010c9793 slli a5,s9,0x10
80000f6c: 0107d793 srli a5,a5,0x10
80000f70: 00859d13 slli s10,a1,0x8
80000f74: 000b0513 mv a0,s6
80000f78: 000a8593 mv a1,s5
80000f7c: 00f12223 sw a5,4(sp)
80000f80: 455010ef jal ra,80002bd4 <__udivsi3>
80000f84: 00050593 mv a1,a0
80000f88: 00050b93 mv s7,a0
80000f8c: 010c9513 slli a0,s9,0x10
80000f90: 01055513 srli a0,a0,0x10
80000f94: 415010ef jal ra,80002ba8 <__mulsi3>
80000f98: 00050413 mv s0,a0
80000f9c: 000a8593 mv a1,s5
80000fa0: 000b0513 mv a0,s6
80000fa4: 479010ef jal ra,80002c1c <__umodsi3>
80000fa8: 01051513 slli a0,a0,0x10
80000fac: 0104d713 srli a4,s1,0x10
80000fb0: 00a76533 or a0,a4,a0
80000fb4: 000b8993 mv s3,s7
80000fb8: 00857e63 bleu s0,a0,80000fd4 <__divdf3+0x2e4>
80000fbc: 01950533 add a0,a0,s9
80000fc0: fffb8993 addi s3,s7,-1
80000fc4: 01956863 bltu a0,s9,80000fd4 <__divdf3+0x2e4>
80000fc8: 00857663 bleu s0,a0,80000fd4 <__divdf3+0x2e4>
80000fcc: ffeb8993 addi s3,s7,-2
80000fd0: 01950533 add a0,a0,s9
80000fd4: 40850433 sub s0,a0,s0
80000fd8: 000a8593 mv a1,s5
80000fdc: 00040513 mv a0,s0
80000fe0: 3f5010ef jal ra,80002bd4 <__udivsi3>
80000fe4: 00050593 mv a1,a0
80000fe8: 00050b93 mv s7,a0
80000fec: 010c9513 slli a0,s9,0x10
80000ff0: 01055513 srli a0,a0,0x10
80000ff4: 3b5010ef jal ra,80002ba8 <__mulsi3>
80000ff8: 00050b13 mv s6,a0
80000ffc: 000a8593 mv a1,s5
80001000: 00040513 mv a0,s0
80001004: 419010ef jal ra,80002c1c <__umodsi3>
80001008: 01049d93 slli s11,s1,0x10
8000100c: 01051513 slli a0,a0,0x10
80001010: 010ddd93 srli s11,s11,0x10
80001014: 00adedb3 or s11,s11,a0
80001018: 000b8713 mv a4,s7
8000101c: 016dfe63 bleu s6,s11,80001038 <__divdf3+0x348>
80001020: 019d8db3 add s11,s11,s9
80001024: fffb8713 addi a4,s7,-1
80001028: 019de863 bltu s11,s9,80001038 <__divdf3+0x348>
8000102c: 016df663 bleu s6,s11,80001038 <__divdf3+0x348>
80001030: ffeb8713 addi a4,s7,-2
80001034: 019d8db3 add s11,s11,s9
80001038: 01099693 slli a3,s3,0x10
8000103c: 000104b7 lui s1,0x10
80001040: 00e6e6b3 or a3,a3,a4
80001044: 416d8db3 sub s11,s11,s6
80001048: fff48b13 addi s6,s1,-1 # ffff <_stack_size+0xfbff>
8000104c: 0166f733 and a4,a3,s6
80001050: 016d7b33 and s6,s10,s6
80001054: 00070513 mv a0,a4
80001058: 000b0593 mv a1,s6
8000105c: 0106d413 srli s0,a3,0x10
80001060: 00d12623 sw a3,12(sp)
80001064: 00e12423 sw a4,8(sp)
80001068: 341010ef jal ra,80002ba8 <__mulsi3>
8000106c: 00a12223 sw a0,4(sp)
80001070: 000b0593 mv a1,s6
80001074: 00040513 mv a0,s0
80001078: 331010ef jal ra,80002ba8 <__mulsi3>
8000107c: 010d5b93 srli s7,s10,0x10
80001080: 00050993 mv s3,a0
80001084: 000b8593 mv a1,s7
80001088: 00040513 mv a0,s0
8000108c: 31d010ef jal ra,80002ba8 <__mulsi3>
80001090: 00812703 lw a4,8(sp)
80001094: 00050413 mv s0,a0
80001098: 000b8513 mv a0,s7
8000109c: 00070593 mv a1,a4
800010a0: 309010ef jal ra,80002ba8 <__mulsi3>
800010a4: 00412603 lw a2,4(sp)
800010a8: 01350533 add a0,a0,s3
800010ac: 00c12683 lw a3,12(sp)
800010b0: 01065713 srli a4,a2,0x10
800010b4: 00a70733 add a4,a4,a0
800010b8: 01377463 bleu s3,a4,800010c0 <__divdf3+0x3d0>
800010bc: 00940433 add s0,s0,s1
800010c0: 00010537 lui a0,0x10
800010c4: fff50513 addi a0,a0,-1 # ffff <_stack_size+0xfbff>
800010c8: 01075493 srli s1,a4,0x10
800010cc: 00a779b3 and s3,a4,a0
800010d0: 01099993 slli s3,s3,0x10
800010d4: 00a67633 and a2,a2,a0
800010d8: 008484b3 add s1,s1,s0
800010dc: 00c989b3 add s3,s3,a2
800010e0: 009de863 bltu s11,s1,800010f0 <__divdf3+0x400>
800010e4: 00068413 mv s0,a3
800010e8: 049d9463 bne s11,s1,80001130 <__divdf3+0x440>
800010ec: 053c7263 bleu s3,s8,80001130 <__divdf3+0x440>
800010f0: 01ac0c33 add s8,s8,s10
800010f4: 01ac3733 sltu a4,s8,s10
800010f8: 01970733 add a4,a4,s9
800010fc: 00ed8db3 add s11,s11,a4
80001100: fff68413 addi s0,a3,-1
80001104: 01bce663 bltu s9,s11,80001110 <__divdf3+0x420>
80001108: 03bc9463 bne s9,s11,80001130 <__divdf3+0x440>
8000110c: 03ac6263 bltu s8,s10,80001130 <__divdf3+0x440>
80001110: 009de663 bltu s11,s1,8000111c <__divdf3+0x42c>
80001114: 01b49e63 bne s1,s11,80001130 <__divdf3+0x440>
80001118: 013c7c63 bleu s3,s8,80001130 <__divdf3+0x440>
8000111c: 01ac0c33 add s8,s8,s10
80001120: 01ac3733 sltu a4,s8,s10
80001124: 01970733 add a4,a4,s9
80001128: ffe68413 addi s0,a3,-2
8000112c: 00ed8db3 add s11,s11,a4
80001130: 413c09b3 sub s3,s8,s3
80001134: 409d84b3 sub s1,s11,s1
80001138: 013c37b3 sltu a5,s8,s3
8000113c: 40f484b3 sub s1,s1,a5
80001140: fff00593 li a1,-1
80001144: 1a9c8863 beq s9,s1,800012f4 <__divdf3+0x604>
80001148: 000a8593 mv a1,s5
8000114c: 00048513 mv a0,s1
80001150: 285010ef jal ra,80002bd4 <__udivsi3>
80001154: 00050593 mv a1,a0
80001158: 00a12423 sw a0,8(sp)
8000115c: 010c9513 slli a0,s9,0x10
80001160: 01055513 srli a0,a0,0x10
80001164: 245010ef jal ra,80002ba8 <__mulsi3>
80001168: 00a12223 sw a0,4(sp)
8000116c: 000a8593 mv a1,s5
80001170: 00048513 mv a0,s1
80001174: 2a9010ef jal ra,80002c1c <__umodsi3>
80001178: 00812683 lw a3,8(sp)
8000117c: 00412703 lw a4,4(sp)
80001180: 01051513 slli a0,a0,0x10
80001184: 0109d793 srli a5,s3,0x10
80001188: 00a7e533 or a0,a5,a0
8000118c: 00068d93 mv s11,a3
80001190: 00e57e63 bleu a4,a0,800011ac <__divdf3+0x4bc>
80001194: 01950533 add a0,a0,s9
80001198: fff68d93 addi s11,a3,-1
8000119c: 01956863 bltu a0,s9,800011ac <__divdf3+0x4bc>
800011a0: 00e57663 bleu a4,a0,800011ac <__divdf3+0x4bc>
800011a4: ffe68d93 addi s11,a3,-2
800011a8: 01950533 add a0,a0,s9
800011ac: 40e504b3 sub s1,a0,a4
800011b0: 000a8593 mv a1,s5
800011b4: 00048513 mv a0,s1
800011b8: 21d010ef jal ra,80002bd4 <__udivsi3>
800011bc: 00050593 mv a1,a0
800011c0: 00a12223 sw a0,4(sp)
800011c4: 010c9513 slli a0,s9,0x10
800011c8: 01055513 srli a0,a0,0x10
800011cc: 1dd010ef jal ra,80002ba8 <__mulsi3>
800011d0: 00050c13 mv s8,a0
800011d4: 000a8593 mv a1,s5
800011d8: 00048513 mv a0,s1
800011dc: 241010ef jal ra,80002c1c <__umodsi3>
800011e0: 01099993 slli s3,s3,0x10
800011e4: 00412703 lw a4,4(sp)
800011e8: 01051513 slli a0,a0,0x10
800011ec: 0109d993 srli s3,s3,0x10
800011f0: 00a9e533 or a0,s3,a0
800011f4: 00070793 mv a5,a4
800011f8: 01857e63 bleu s8,a0,80001214 <__divdf3+0x524>
800011fc: 01950533 add a0,a0,s9
80001200: fff70793 addi a5,a4,-1
80001204: 01956863 bltu a0,s9,80001214 <__divdf3+0x524>
80001208: 01857663 bleu s8,a0,80001214 <__divdf3+0x524>
8000120c: ffe70793 addi a5,a4,-2
80001210: 01950533 add a0,a0,s9
80001214: 010d9493 slli s1,s11,0x10
80001218: 00f4e4b3 or s1,s1,a5
8000121c: 01049793 slli a5,s1,0x10
80001220: 0107d793 srli a5,a5,0x10
80001224: 000b0593 mv a1,s6
80001228: 418509b3 sub s3,a0,s8
8000122c: 00078513 mv a0,a5
80001230: 00f12223 sw a5,4(sp)
80001234: 0104dd93 srli s11,s1,0x10
80001238: 171010ef jal ra,80002ba8 <__mulsi3>
8000123c: 000b0593 mv a1,s6
80001240: 00050a93 mv s5,a0
80001244: 000d8513 mv a0,s11
80001248: 161010ef jal ra,80002ba8 <__mulsi3>
8000124c: 00050c13 mv s8,a0
80001250: 000d8593 mv a1,s11
80001254: 000b8513 mv a0,s7
80001258: 151010ef jal ra,80002ba8 <__mulsi3>
8000125c: 00412783 lw a5,4(sp)
80001260: 00050b13 mv s6,a0
80001264: 000b8513 mv a0,s7
80001268: 00078593 mv a1,a5
8000126c: 13d010ef jal ra,80002ba8 <__mulsi3>
80001270: 01850533 add a0,a0,s8
80001274: 010ad793 srli a5,s5,0x10
80001278: 00a78533 add a0,a5,a0
8000127c: 01857663 bleu s8,a0,80001288 <__divdf3+0x598>
80001280: 000107b7 lui a5,0x10
80001284: 00fb0b33 add s6,s6,a5
80001288: 000106b7 lui a3,0x10
8000128c: fff68693 addi a3,a3,-1 # ffff <_stack_size+0xfbff>
80001290: 01055793 srli a5,a0,0x10
80001294: 00d57733 and a4,a0,a3
80001298: 01071713 slli a4,a4,0x10
8000129c: 00dafab3 and s5,s5,a3
800012a0: 016787b3 add a5,a5,s6
800012a4: 01570733 add a4,a4,s5
800012a8: 00f9e863 bltu s3,a5,800012b8 <__divdf3+0x5c8>
800012ac: 00048593 mv a1,s1
800012b0: 04f99063 bne s3,a5,800012f0 <__divdf3+0x600>
800012b4: 04070063 beqz a4,800012f4 <__divdf3+0x604>
800012b8: 013c8533 add a0,s9,s3
800012bc: fff48593 addi a1,s1,-1
800012c0: 03956463 bltu a0,s9,800012e8 <__divdf3+0x5f8>
800012c4: 00f56663 bltu a0,a5,800012d0 <__divdf3+0x5e0>
800012c8: 02f51463 bne a0,a5,800012f0 <__divdf3+0x600>
800012cc: 02ed7063 bleu a4,s10,800012ec <__divdf3+0x5fc>
800012d0: 001d1693 slli a3,s10,0x1
800012d4: 01a6bd33 sltu s10,a3,s10
800012d8: 019d0cb3 add s9,s10,s9
800012dc: ffe48593 addi a1,s1,-2
800012e0: 01950533 add a0,a0,s9
800012e4: 00068d13 mv s10,a3
800012e8: 00f51463 bne a0,a5,800012f0 <__divdf3+0x600>
800012ec: 01a70463 beq a4,s10,800012f4 <__divdf3+0x604>
800012f0: 0015e593 ori a1,a1,1
800012f4: 3ffa0713 addi a4,s4,1023
800012f8: 12e05263 blez a4,8000141c <__divdf3+0x72c>
800012fc: 0075f793 andi a5,a1,7
80001300: 02078063 beqz a5,80001320 <__divdf3+0x630>
80001304: 00f5f793 andi a5,a1,15
80001308: 00400693 li a3,4
8000130c: 00d78a63 beq a5,a3,80001320 <__divdf3+0x630>
80001310: 00458693 addi a3,a1,4
80001314: 00b6b5b3 sltu a1,a3,a1
80001318: 00b40433 add s0,s0,a1
8000131c: 00068593 mv a1,a3
80001320: 00741793 slli a5,s0,0x7
80001324: 0007da63 bgez a5,80001338 <__divdf3+0x648>
80001328: ff0007b7 lui a5,0xff000
8000132c: fff78793 addi a5,a5,-1 # feffffff <_stack_start+0x7eff9b2f>
80001330: 00f47433 and s0,s0,a5
80001334: 400a0713 addi a4,s4,1024
80001338: 7fe00793 li a5,2046
8000133c: 1ae7c263 blt a5,a4,800014e0 <__divdf3+0x7f0>
80001340: 01d41793 slli a5,s0,0x1d
80001344: 0035d593 srli a1,a1,0x3
80001348: 00b7e7b3 or a5,a5,a1
8000134c: 00345413 srli s0,s0,0x3
80001350: 001006b7 lui a3,0x100
80001354: fff68693 addi a3,a3,-1 # fffff <_stack_size+0xffbff>
80001358: 00d47433 and s0,s0,a3
8000135c: 801006b7 lui a3,0x80100
80001360: 7ff77713 andi a4,a4,2047
80001364: fff68693 addi a3,a3,-1 # 800fffff <_stack_start+0xf9b2f>
80001368: 01471713 slli a4,a4,0x14
8000136c: 00d47433 and s0,s0,a3
80001370: 01f91913 slli s2,s2,0x1f
80001374: 00e46433 or s0,s0,a4
80001378: 01246733 or a4,s0,s2
8000137c: 04c12083 lw ra,76(sp)
80001380: 04812403 lw s0,72(sp)
80001384: 04412483 lw s1,68(sp)
80001388: 04012903 lw s2,64(sp)
8000138c: 03c12983 lw s3,60(sp)
80001390: 03812a03 lw s4,56(sp)
80001394: 03412a83 lw s5,52(sp)
80001398: 03012b03 lw s6,48(sp)
8000139c: 02c12b83 lw s7,44(sp)
800013a0: 02812c03 lw s8,40(sp)
800013a4: 02412c83 lw s9,36(sp)
800013a8: 02012d03 lw s10,32(sp)
800013ac: 01c12d83 lw s11,28(sp)
800013b0: 00078513 mv a0,a5
800013b4: 00070593 mv a1,a4
800013b8: 05010113 addi sp,sp,80
800013bc: 00008067 ret
800013c0: fffa0a13 addi s4,s4,-1
800013c4: 00000c13 li s8,0
800013c8: b91ff06f j 80000f58 <__divdf3+0x268>
800013cc: 00098913 mv s2,s3
800013d0: 000b0413 mv s0,s6
800013d4: 00048593 mv a1,s1
800013d8: 000b8793 mv a5,s7
800013dc: 00200713 li a4,2
800013e0: 10e78063 beq a5,a4,800014e0 <__divdf3+0x7f0>
800013e4: 00300713 li a4,3
800013e8: 0ee78263 beq a5,a4,800014cc <__divdf3+0x7dc>
800013ec: 00100713 li a4,1
800013f0: f0e792e3 bne a5,a4,800012f4 <__divdf3+0x604>
800013f4: 00000413 li s0,0
800013f8: 00000793 li a5,0
800013fc: 0940006f j 80001490 <__divdf3+0x7a0>
80001400: 000a8913 mv s2,s5
80001404: fd9ff06f j 800013dc <__divdf3+0x6ec>
80001408: 00080437 lui s0,0x80
8000140c: 00000593 li a1,0
80001410: 00000913 li s2,0
80001414: 00300793 li a5,3
80001418: fc5ff06f j 800013dc <__divdf3+0x6ec>
8000141c: 00100693 li a3,1
80001420: 40e686b3 sub a3,a3,a4
80001424: 03800793 li a5,56
80001428: fcd7c6e3 blt a5,a3,800013f4 <__divdf3+0x704>
8000142c: 01f00793 li a5,31
80001430: 06d7c463 blt a5,a3,80001498 <__divdf3+0x7a8>
80001434: 41ea0a13 addi s4,s4,1054
80001438: 014417b3 sll a5,s0,s4
8000143c: 00d5d733 srl a4,a1,a3
80001440: 01459a33 sll s4,a1,s4
80001444: 00e7e7b3 or a5,a5,a4
80001448: 01403a33 snez s4,s4
8000144c: 0147e7b3 or a5,a5,s4
80001450: 00d45433 srl s0,s0,a3
80001454: 0077f713 andi a4,a5,7
80001458: 02070063 beqz a4,80001478 <__divdf3+0x788>
8000145c: 00f7f713 andi a4,a5,15
80001460: 00400693 li a3,4
80001464: 00d70a63 beq a4,a3,80001478 <__divdf3+0x788>
80001468: 00478713 addi a4,a5,4
8000146c: 00f737b3 sltu a5,a4,a5
80001470: 00f40433 add s0,s0,a5
80001474: 00070793 mv a5,a4
80001478: 00841713 slli a4,s0,0x8
8000147c: 06074a63 bltz a4,800014f0 <__divdf3+0x800>
80001480: 01d41713 slli a4,s0,0x1d
80001484: 0037d793 srli a5,a5,0x3
80001488: 00f767b3 or a5,a4,a5
8000148c: 00345413 srli s0,s0,0x3
80001490: 00000713 li a4,0
80001494: ebdff06f j 80001350 <__divdf3+0x660>
80001498: fe100793 li a5,-31
8000149c: 40e787b3 sub a5,a5,a4
800014a0: 02000713 li a4,32
800014a4: 00f457b3 srl a5,s0,a5
800014a8: 00000513 li a0,0
800014ac: 00e68663 beq a3,a4,800014b8 <__divdf3+0x7c8>
800014b0: 43ea0a13 addi s4,s4,1086
800014b4: 01441533 sll a0,s0,s4
800014b8: 00b56a33 or s4,a0,a1
800014bc: 01403a33 snez s4,s4
800014c0: 0147e7b3 or a5,a5,s4
800014c4: 00000413 li s0,0
800014c8: f8dff06f j 80001454 <__divdf3+0x764>
800014cc: 00080437 lui s0,0x80
800014d0: 00000793 li a5,0
800014d4: 7ff00713 li a4,2047
800014d8: 00000913 li s2,0
800014dc: e75ff06f j 80001350 <__divdf3+0x660>
800014e0: 00000413 li s0,0
800014e4: 00000793 li a5,0
800014e8: 7ff00713 li a4,2047
800014ec: e65ff06f j 80001350 <__divdf3+0x660>
800014f0: 00000413 li s0,0
800014f4: 00000793 li a5,0
800014f8: 00100713 li a4,1
800014fc: e55ff06f j 80001350 <__divdf3+0x660>
80001500 <__muldf3>:
80001500: fa010113 addi sp,sp,-96
80001504: 04812c23 sw s0,88(sp)
80001508: 05312623 sw s3,76(sp)
8000150c: 00100437 lui s0,0x100
80001510: 0145d993 srli s3,a1,0x14
80001514: 04912a23 sw s1,84(sp)
80001518: 05612023 sw s6,64(sp)
8000151c: 03712e23 sw s7,60(sp)
80001520: 03812c23 sw s8,56(sp)
80001524: fff40413 addi s0,s0,-1 # fffff <_stack_size+0xffbff>
80001528: 04112e23 sw ra,92(sp)
8000152c: 05212823 sw s2,80(sp)
80001530: 05412423 sw s4,72(sp)
80001534: 05512223 sw s5,68(sp)
80001538: 03912a23 sw s9,52(sp)
8000153c: 03a12823 sw s10,48(sp)
80001540: 03b12623 sw s11,44(sp)
80001544: 7ff9f993 andi s3,s3,2047
80001548: 00050493 mv s1,a0
8000154c: 00060b93 mv s7,a2
80001550: 00068c13 mv s8,a3
80001554: 00b47433 and s0,s0,a1
80001558: 01f5db13 srli s6,a1,0x1f
8000155c: 0a098863 beqz s3,8000160c <__muldf3+0x10c>
80001560: 7ff00793 li a5,2047
80001564: 10f98663 beq s3,a5,80001670 <__muldf3+0x170>
80001568: 00800937 lui s2,0x800
8000156c: 00341413 slli s0,s0,0x3
80001570: 01246433 or s0,s0,s2
80001574: 01d55913 srli s2,a0,0x1d
80001578: 00896933 or s2,s2,s0
8000157c: 00351d13 slli s10,a0,0x3
80001580: c0198993 addi s3,s3,-1023
80001584: 00000c93 li s9,0
80001588: 014c5513 srli a0,s8,0x14
8000158c: 00100a37 lui s4,0x100
80001590: fffa0a13 addi s4,s4,-1 # fffff <_stack_size+0xffbff>
80001594: 7ff57513 andi a0,a0,2047
80001598: 018a7a33 and s4,s4,s8
8000159c: 000b8493 mv s1,s7
800015a0: 01fc5c13 srli s8,s8,0x1f
800015a4: 10050463 beqz a0,800016ac <__muldf3+0x1ac>
800015a8: 7ff00793 li a5,2047
800015ac: 16f50463 beq a0,a5,80001714 <__muldf3+0x214>
800015b0: 00800437 lui s0,0x800
800015b4: 003a1a13 slli s4,s4,0x3
800015b8: 008a6a33 or s4,s4,s0
800015bc: 01dbd413 srli s0,s7,0x1d
800015c0: 01446433 or s0,s0,s4
800015c4: 003b9493 slli s1,s7,0x3
800015c8: c0150513 addi a0,a0,-1023
800015cc: 00000793 li a5,0
800015d0: 002c9713 slli a4,s9,0x2
800015d4: 00f76733 or a4,a4,a5
800015d8: 00a989b3 add s3,s3,a0
800015dc: fff70713 addi a4,a4,-1
800015e0: 00e00693 li a3,14
800015e4: 018b4bb3 xor s7,s6,s8
800015e8: 00198a93 addi s5,s3,1
800015ec: 16e6e063 bltu a3,a4,8000174c <__muldf3+0x24c>
800015f0: 00002697 auipc a3,0x2
800015f4: cf868693 addi a3,a3,-776 # 800032e8 <end+0x61c>
800015f8: 00271713 slli a4,a4,0x2
800015fc: 00d70733 add a4,a4,a3
80001600: 00072703 lw a4,0(a4)
80001604: 00d70733 add a4,a4,a3
80001608: 00070067 jr a4
8000160c: 00a46933 or s2,s0,a0
80001610: 06090e63 beqz s2,8000168c <__muldf3+0x18c>
80001614: 04040063 beqz s0,80001654 <__muldf3+0x154>
80001618: 00040513 mv a0,s0
8000161c: 664010ef jal ra,80002c80 <__clzsi2>
80001620: ff550793 addi a5,a0,-11
80001624: 01c00713 li a4,28
80001628: 02f74c63 blt a4,a5,80001660 <__muldf3+0x160>
8000162c: 01d00913 li s2,29
80001630: ff850d13 addi s10,a0,-8
80001634: 40f90933 sub s2,s2,a5
80001638: 01a41433 sll s0,s0,s10
8000163c: 0124d933 srl s2,s1,s2
80001640: 00896933 or s2,s2,s0
80001644: 01a49d33 sll s10,s1,s10
80001648: c0d00993 li s3,-1011
8000164c: 40a989b3 sub s3,s3,a0
80001650: f35ff06f j 80001584 <__muldf3+0x84>
80001654: 62c010ef jal ra,80002c80 <__clzsi2>
80001658: 02050513 addi a0,a0,32
8000165c: fc5ff06f j 80001620 <__muldf3+0x120>
80001660: fd850913 addi s2,a0,-40
80001664: 01249933 sll s2,s1,s2
80001668: 00000d13 li s10,0
8000166c: fddff06f j 80001648 <__muldf3+0x148>
80001670: 00a46933 or s2,s0,a0
80001674: 02090463 beqz s2,8000169c <__muldf3+0x19c>
80001678: 00050d13 mv s10,a0
8000167c: 00040913 mv s2,s0
80001680: 7ff00993 li s3,2047
80001684: 00300c93 li s9,3
80001688: f01ff06f j 80001588 <__muldf3+0x88>
8000168c: 00000d13 li s10,0
80001690: 00000993 li s3,0
80001694: 00100c93 li s9,1
80001698: ef1ff06f j 80001588 <__muldf3+0x88>
8000169c: 00000d13 li s10,0
800016a0: 7ff00993 li s3,2047
800016a4: 00200c93 li s9,2
800016a8: ee1ff06f j 80001588 <__muldf3+0x88>
800016ac: 017a6433 or s0,s4,s7
800016b0: 06040e63 beqz s0,8000172c <__muldf3+0x22c>
800016b4: 040a0063 beqz s4,800016f4 <__muldf3+0x1f4>
800016b8: 000a0513 mv a0,s4
800016bc: 5c4010ef jal ra,80002c80 <__clzsi2>
800016c0: ff550793 addi a5,a0,-11
800016c4: 01c00713 li a4,28
800016c8: 02f74e63 blt a4,a5,80001704 <__muldf3+0x204>
800016cc: 01d00413 li s0,29
800016d0: ff850493 addi s1,a0,-8
800016d4: 40f40433 sub s0,s0,a5
800016d8: 009a1a33 sll s4,s4,s1
800016dc: 008bd433 srl s0,s7,s0
800016e0: 01446433 or s0,s0,s4
800016e4: 009b94b3 sll s1,s7,s1
800016e8: c0d00793 li a5,-1011
800016ec: 40a78533 sub a0,a5,a0
800016f0: eddff06f j 800015cc <__muldf3+0xcc>
800016f4: 000b8513 mv a0,s7
800016f8: 588010ef jal ra,80002c80 <__clzsi2>
800016fc: 02050513 addi a0,a0,32
80001700: fc1ff06f j 800016c0 <__muldf3+0x1c0>
80001704: fd850413 addi s0,a0,-40
80001708: 008b9433 sll s0,s7,s0
8000170c: 00000493 li s1,0
80001710: fd9ff06f j 800016e8 <__muldf3+0x1e8>
80001714: 017a6433 or s0,s4,s7
80001718: 02040263 beqz s0,8000173c <__muldf3+0x23c>
8000171c: 000a0413 mv s0,s4
80001720: 7ff00513 li a0,2047
80001724: 00300793 li a5,3
80001728: ea9ff06f j 800015d0 <__muldf3+0xd0>
8000172c: 00000493 li s1,0
80001730: 00000513 li a0,0
80001734: 00100793 li a5,1
80001738: e99ff06f j 800015d0 <__muldf3+0xd0>
8000173c: 00000493 li s1,0
80001740: 7ff00513 li a0,2047
80001744: 00200793 li a5,2
80001748: e89ff06f j 800015d0 <__muldf3+0xd0>
8000174c: 00010737 lui a4,0x10
80001750: fff70a13 addi s4,a4,-1 # ffff <_stack_size+0xfbff>
80001754: 010d5c13 srli s8,s10,0x10
80001758: 0104dd93 srli s11,s1,0x10
8000175c: 014d7d33 and s10,s10,s4
80001760: 0144f4b3 and s1,s1,s4
80001764: 000d0593 mv a1,s10
80001768: 00048513 mv a0,s1
8000176c: 00e12823 sw a4,16(sp)
80001770: 438010ef jal ra,80002ba8 <__mulsi3>
80001774: 00050c93 mv s9,a0
80001778: 00048593 mv a1,s1
8000177c: 000c0513 mv a0,s8
80001780: 428010ef jal ra,80002ba8 <__mulsi3>
80001784: 00a12623 sw a0,12(sp)
80001788: 000d8593 mv a1,s11
8000178c: 000c0513 mv a0,s8
80001790: 418010ef jal ra,80002ba8 <__mulsi3>
80001794: 00050b13 mv s6,a0
80001798: 000d0593 mv a1,s10
8000179c: 000d8513 mv a0,s11
800017a0: 408010ef jal ra,80002ba8 <__mulsi3>
800017a4: 00c12683 lw a3,12(sp)
800017a8: 010cd793 srli a5,s9,0x10
800017ac: 00d50533 add a0,a0,a3
800017b0: 00a78533 add a0,a5,a0
800017b4: 00d57663 bleu a3,a0,800017c0 <__muldf3+0x2c0>
800017b8: 01012703 lw a4,16(sp)
800017bc: 00eb0b33 add s6,s6,a4
800017c0: 01055693 srli a3,a0,0x10
800017c4: 01457533 and a0,a0,s4
800017c8: 014cfcb3 and s9,s9,s4
800017cc: 01051513 slli a0,a0,0x10
800017d0: 019507b3 add a5,a0,s9
800017d4: 01045c93 srli s9,s0,0x10
800017d8: 01447433 and s0,s0,s4
800017dc: 000d0593 mv a1,s10
800017e0: 00040513 mv a0,s0
800017e4: 00d12a23 sw a3,20(sp)
800017e8: 00f12623 sw a5,12(sp)
800017ec: 3bc010ef jal ra,80002ba8 <__mulsi3>
800017f0: 00a12823 sw a0,16(sp)
800017f4: 00040593 mv a1,s0
800017f8: 000c0513 mv a0,s8
800017fc: 3ac010ef jal ra,80002ba8 <__mulsi3>
80001800: 00050a13 mv s4,a0
80001804: 000c8593 mv a1,s9
80001808: 000c0513 mv a0,s8
8000180c: 39c010ef jal ra,80002ba8 <__mulsi3>
80001810: 00050c13 mv s8,a0
80001814: 000d0593 mv a1,s10
80001818: 000c8513 mv a0,s9
8000181c: 38c010ef jal ra,80002ba8 <__mulsi3>
80001820: 01012703 lw a4,16(sp)
80001824: 01450533 add a0,a0,s4
80001828: 01412683 lw a3,20(sp)
8000182c: 01075793 srli a5,a4,0x10
80001830: 00a78533 add a0,a5,a0
80001834: 01457663 bleu s4,a0,80001840 <__muldf3+0x340>
80001838: 000107b7 lui a5,0x10
8000183c: 00fc0c33 add s8,s8,a5
80001840: 00010637 lui a2,0x10
80001844: 01055793 srli a5,a0,0x10
80001848: 01878c33 add s8,a5,s8
8000184c: fff60793 addi a5,a2,-1 # ffff <_stack_size+0xfbff>
80001850: 00f57a33 and s4,a0,a5
80001854: 00f77733 and a4,a4,a5
80001858: 010a1a13 slli s4,s4,0x10
8000185c: 01095d13 srli s10,s2,0x10
80001860: 00ea0a33 add s4,s4,a4
80001864: 00f97933 and s2,s2,a5
80001868: 01468733 add a4,a3,s4
8000186c: 00090593 mv a1,s2
80001870: 00048513 mv a0,s1
80001874: 00e12823 sw a4,16(sp)
80001878: 00c12e23 sw a2,28(sp)
8000187c: 32c010ef jal ra,80002ba8 <__mulsi3>
80001880: 00048593 mv a1,s1
80001884: 00a12c23 sw a0,24(sp)
80001888: 000d0513 mv a0,s10
8000188c: 31c010ef jal ra,80002ba8 <__mulsi3>
80001890: 00a12a23 sw a0,20(sp)
80001894: 000d0593 mv a1,s10
80001898: 000d8513 mv a0,s11
8000189c: 30c010ef jal ra,80002ba8 <__mulsi3>
800018a0: 00050493 mv s1,a0
800018a4: 00090593 mv a1,s2
800018a8: 000d8513 mv a0,s11
800018ac: 2fc010ef jal ra,80002ba8 <__mulsi3>
800018b0: 01412683 lw a3,20(sp)
800018b4: 01812703 lw a4,24(sp)
800018b8: 00d50533 add a0,a0,a3
800018bc: 01075793 srli a5,a4,0x10
800018c0: 00a78533 add a0,a5,a0
800018c4: 00d57663 bleu a3,a0,800018d0 <__muldf3+0x3d0>
800018c8: 01c12603 lw a2,28(sp)
800018cc: 00c484b3 add s1,s1,a2
800018d0: 000106b7 lui a3,0x10
800018d4: fff68793 addi a5,a3,-1 # ffff <_stack_size+0xfbff>
800018d8: 01055d93 srli s11,a0,0x10
800018dc: 009d84b3 add s1,s11,s1
800018e0: 00f57db3 and s11,a0,a5
800018e4: 00f77733 and a4,a4,a5
800018e8: 00090593 mv a1,s2
800018ec: 00040513 mv a0,s0
800018f0: 010d9d93 slli s11,s11,0x10
800018f4: 00ed8db3 add s11,s11,a4
800018f8: 00d12c23 sw a3,24(sp)
800018fc: 2ac010ef jal ra,80002ba8 <__mulsi3>
80001900: 00040593 mv a1,s0
80001904: 00a12a23 sw a0,20(sp)
80001908: 000d0513 mv a0,s10
8000190c: 29c010ef jal ra,80002ba8 <__mulsi3>
80001910: 000d0593 mv a1,s10
80001914: 00050413 mv s0,a0
80001918: 000c8513 mv a0,s9
8000191c: 28c010ef jal ra,80002ba8 <__mulsi3>
80001920: 00050d13 mv s10,a0
80001924: 00090593 mv a1,s2
80001928: 000c8513 mv a0,s9
8000192c: 27c010ef jal ra,80002ba8 <__mulsi3>
80001930: 01412703 lw a4,20(sp)
80001934: 00850533 add a0,a0,s0
80001938: 01075793 srli a5,a4,0x10
8000193c: 00a78533 add a0,a5,a0
80001940: 00857663 bleu s0,a0,8000194c <__muldf3+0x44c>
80001944: 01812683 lw a3,24(sp)
80001948: 00dd0d33 add s10,s10,a3
8000194c: 01012783 lw a5,16(sp)
80001950: 000106b7 lui a3,0x10
80001954: fff68693 addi a3,a3,-1 # ffff <_stack_size+0xfbff>
80001958: 00fb0b33 add s6,s6,a5
8000195c: 00d577b3 and a5,a0,a3
80001960: 00d77733 and a4,a4,a3
80001964: 01079793 slli a5,a5,0x10
80001968: 00e787b3 add a5,a5,a4
8000196c: 014b3a33 sltu s4,s6,s4
80001970: 018787b3 add a5,a5,s8
80001974: 01478433 add s0,a5,s4
80001978: 01bb0b33 add s6,s6,s11
8000197c: 00940733 add a4,s0,s1
80001980: 01bb3db3 sltu s11,s6,s11
80001984: 01b706b3 add a3,a4,s11
80001988: 0187bc33 sltu s8,a5,s8
8000198c: 01443433 sltu s0,s0,s4
80001990: 01055793 srli a5,a0,0x10
80001994: 00973733 sltu a4,a4,s1
80001998: 008c6433 or s0,s8,s0
8000199c: 01b6bdb3 sltu s11,a3,s11
800019a0: 00f40433 add s0,s0,a5
800019a4: 01b76db3 or s11,a4,s11
800019a8: 01b40433 add s0,s0,s11
800019ac: 01a40433 add s0,s0,s10
800019b0: 0176d793 srli a5,a3,0x17
800019b4: 00941413 slli s0,s0,0x9
800019b8: 00f46433 or s0,s0,a5
800019bc: 00c12783 lw a5,12(sp)
800019c0: 009b1493 slli s1,s6,0x9
800019c4: 017b5b13 srli s6,s6,0x17
800019c8: 00f4e4b3 or s1,s1,a5
800019cc: 009034b3 snez s1,s1
800019d0: 00969793 slli a5,a3,0x9
800019d4: 0164e4b3 or s1,s1,s6
800019d8: 00f4e4b3 or s1,s1,a5
800019dc: 00741793 slli a5,s0,0x7
800019e0: 1207d263 bgez a5,80001b04 <__muldf3+0x604>
800019e4: 0014d793 srli a5,s1,0x1
800019e8: 0014f493 andi s1,s1,1
800019ec: 0097e4b3 or s1,a5,s1
800019f0: 01f41793 slli a5,s0,0x1f
800019f4: 00f4e4b3 or s1,s1,a5
800019f8: 00145413 srli s0,s0,0x1
800019fc: 3ffa8713 addi a4,s5,1023
80001a00: 10e05663 blez a4,80001b0c <__muldf3+0x60c>
80001a04: 0074f793 andi a5,s1,7
80001a08: 02078063 beqz a5,80001a28 <__muldf3+0x528>
80001a0c: 00f4f793 andi a5,s1,15
80001a10: 00400693 li a3,4
80001a14: 00d78a63 beq a5,a3,80001a28 <__muldf3+0x528>
80001a18: 00448793 addi a5,s1,4
80001a1c: 0097b4b3 sltu s1,a5,s1
80001a20: 00940433 add s0,s0,s1
80001a24: 00078493 mv s1,a5
80001a28: 00741793 slli a5,s0,0x7
80001a2c: 0007da63 bgez a5,80001a40 <__muldf3+0x540>
80001a30: ff0007b7 lui a5,0xff000
80001a34: fff78793 addi a5,a5,-1 # feffffff <_stack_start+0x7eff9b2f>
80001a38: 00f47433 and s0,s0,a5
80001a3c: 400a8713 addi a4,s5,1024
80001a40: 7fe00793 li a5,2046
80001a44: 18e7c663 blt a5,a4,80001bd0 <__muldf3+0x6d0>
80001a48: 0034da93 srli s5,s1,0x3
80001a4c: 01d41493 slli s1,s0,0x1d
80001a50: 0154e4b3 or s1,s1,s5
80001a54: 00345413 srli s0,s0,0x3
80001a58: 001007b7 lui a5,0x100
80001a5c: fff78793 addi a5,a5,-1 # fffff <_stack_size+0xffbff>
80001a60: 00f47433 and s0,s0,a5
80001a64: 7ff77793 andi a5,a4,2047
80001a68: 80100737 lui a4,0x80100
80001a6c: fff70713 addi a4,a4,-1 # 800fffff <_stack_start+0xf9b2f>
80001a70: 01479793 slli a5,a5,0x14
80001a74: 00e47433 and s0,s0,a4
80001a78: 01fb9b93 slli s7,s7,0x1f
80001a7c: 00f46433 or s0,s0,a5
80001a80: 017467b3 or a5,s0,s7
80001a84: 05c12083 lw ra,92(sp)
80001a88: 05812403 lw s0,88(sp)
80001a8c: 00048513 mv a0,s1
80001a90: 05012903 lw s2,80(sp)
80001a94: 05412483 lw s1,84(sp)
80001a98: 04c12983 lw s3,76(sp)
80001a9c: 04812a03 lw s4,72(sp)
80001aa0: 04412a83 lw s5,68(sp)
80001aa4: 04012b03 lw s6,64(sp)
80001aa8: 03c12b83 lw s7,60(sp)
80001aac: 03812c03 lw s8,56(sp)
80001ab0: 03412c83 lw s9,52(sp)
80001ab4: 03012d03 lw s10,48(sp)
80001ab8: 02c12d83 lw s11,44(sp)
80001abc: 00078593 mv a1,a5
80001ac0: 06010113 addi sp,sp,96
80001ac4: 00008067 ret
80001ac8: 000b0b93 mv s7,s6
80001acc: 00090413 mv s0,s2
80001ad0: 000d0493 mv s1,s10
80001ad4: 000c8793 mv a5,s9
80001ad8: 00200713 li a4,2
80001adc: 0ee78a63 beq a5,a4,80001bd0 <__muldf3+0x6d0>
80001ae0: 00300713 li a4,3
80001ae4: 0ce78c63 beq a5,a4,80001bbc <__muldf3+0x6bc>
80001ae8: 00100713 li a4,1
80001aec: f0e798e3 bne a5,a4,800019fc <__muldf3+0x4fc>
80001af0: 00000413 li s0,0
80001af4: 00000493 li s1,0
80001af8: 0880006f j 80001b80 <__muldf3+0x680>
80001afc: 000c0b93 mv s7,s8
80001b00: fd9ff06f j 80001ad8 <__muldf3+0x5d8>
80001b04: 00098a93 mv s5,s3
80001b08: ef5ff06f j 800019fc <__muldf3+0x4fc>
80001b0c: 00100693 li a3,1
80001b10: 40e686b3 sub a3,a3,a4
80001b14: 03800793 li a5,56
80001b18: fcd7cce3 blt a5,a3,80001af0 <__muldf3+0x5f0>
80001b1c: 01f00793 li a5,31
80001b20: 06d7c463 blt a5,a3,80001b88 <__muldf3+0x688>
80001b24: 41ea8a93 addi s5,s5,1054
80001b28: 015417b3 sll a5,s0,s5
80001b2c: 00d4d733 srl a4,s1,a3
80001b30: 015494b3 sll s1,s1,s5
80001b34: 00e7e7b3 or a5,a5,a4
80001b38: 009034b3 snez s1,s1
80001b3c: 0097e4b3 or s1,a5,s1
80001b40: 00d45433 srl s0,s0,a3
80001b44: 0074f793 andi a5,s1,7
80001b48: 02078063 beqz a5,80001b68 <__muldf3+0x668>
80001b4c: 00f4f793 andi a5,s1,15
80001b50: 00400713 li a4,4
80001b54: 00e78a63 beq a5,a4,80001b68 <__muldf3+0x668>
80001b58: 00448793 addi a5,s1,4
80001b5c: 0097b4b3 sltu s1,a5,s1
80001b60: 00940433 add s0,s0,s1
80001b64: 00078493 mv s1,a5
80001b68: 00841793 slli a5,s0,0x8
80001b6c: 0607ca63 bltz a5,80001be0 <__muldf3+0x6e0>
80001b70: 01d41793 slli a5,s0,0x1d
80001b74: 0034d493 srli s1,s1,0x3
80001b78: 0097e4b3 or s1,a5,s1
80001b7c: 00345413 srli s0,s0,0x3
80001b80: 00000713 li a4,0
80001b84: ed5ff06f j 80001a58 <__muldf3+0x558>
80001b88: fe100793 li a5,-31
80001b8c: 40e787b3 sub a5,a5,a4
80001b90: 02000613 li a2,32
80001b94: 00f457b3 srl a5,s0,a5
80001b98: 00000713 li a4,0
80001b9c: 00c68663 beq a3,a2,80001ba8 <__muldf3+0x6a8>
80001ba0: 43ea8a93 addi s5,s5,1086
80001ba4: 01541733 sll a4,s0,s5
80001ba8: 009764b3 or s1,a4,s1
80001bac: 009034b3 snez s1,s1
80001bb0: 0097e4b3 or s1,a5,s1
80001bb4: 00000413 li s0,0
80001bb8: f8dff06f j 80001b44 <__muldf3+0x644>
80001bbc: 00080437 lui s0,0x80
80001bc0: 00000493 li s1,0
80001bc4: 7ff00713 li a4,2047
80001bc8: 00000b93 li s7,0
80001bcc: e8dff06f j 80001a58 <__muldf3+0x558>
80001bd0: 00000413 li s0,0
80001bd4: 00000493 li s1,0
80001bd8: 7ff00713 li a4,2047
80001bdc: e7dff06f j 80001a58 <__muldf3+0x558>
80001be0: 00000413 li s0,0
80001be4: 00000493 li s1,0
80001be8: 00100713 li a4,1
80001bec: e6dff06f j 80001a58 <__muldf3+0x558>
80001bf0 <__divsf3>:
80001bf0: fd010113 addi sp,sp,-48
80001bf4: 02912223 sw s1,36(sp)
80001bf8: 01512a23 sw s5,20(sp)
80001bfc: 01755493 srli s1,a0,0x17
80001c00: 00800ab7 lui s5,0x800
80001c04: 03212023 sw s2,32(sp)
80001c08: 01612823 sw s6,16(sp)
80001c0c: fffa8a93 addi s5,s5,-1 # 7fffff <_stack_size+0x7ffbff>
80001c10: 02112623 sw ra,44(sp)
80001c14: 02812423 sw s0,40(sp)
80001c18: 01312e23 sw s3,28(sp)
80001c1c: 01412c23 sw s4,24(sp)
80001c20: 01712623 sw s7,12(sp)
80001c24: 01812423 sw s8,8(sp)
80001c28: 0ff4f493 andi s1,s1,255
80001c2c: 00058b13 mv s6,a1
80001c30: 00aafab3 and s5,s5,a0
80001c34: 01f55913 srli s2,a0,0x1f
80001c38: 08048863 beqz s1,80001cc8 <__divsf3+0xd8>
80001c3c: 0ff00793 li a5,255
80001c40: 0af48463 beq s1,a5,80001ce8 <__divsf3+0xf8>
80001c44: 003a9a93 slli s5,s5,0x3
80001c48: 040007b7 lui a5,0x4000
80001c4c: 00faeab3 or s5,s5,a5
80001c50: f8148493 addi s1,s1,-127
80001c54: 00000b93 li s7,0
80001c58: 017b5513 srli a0,s6,0x17
80001c5c: 00800437 lui s0,0x800
80001c60: fff40413 addi s0,s0,-1 # 7fffff <_stack_size+0x7ffbff>
80001c64: 0ff57513 andi a0,a0,255
80001c68: 01647433 and s0,s0,s6
80001c6c: 01fb5b13 srli s6,s6,0x1f
80001c70: 08050c63 beqz a0,80001d08 <__divsf3+0x118>
80001c74: 0ff00793 li a5,255
80001c78: 0af50863 beq a0,a5,80001d28 <__divsf3+0x138>
80001c7c: 00341413 slli s0,s0,0x3
80001c80: 040007b7 lui a5,0x4000
80001c84: 00f46433 or s0,s0,a5
80001c88: f8150513 addi a0,a0,-127
80001c8c: 00000793 li a5,0
80001c90: 002b9713 slli a4,s7,0x2
80001c94: 00f76733 or a4,a4,a5
80001c98: fff70713 addi a4,a4,-1
80001c9c: 00e00693 li a3,14
80001ca0: 016949b3 xor s3,s2,s6
80001ca4: 40a48a33 sub s4,s1,a0
80001ca8: 0ae6e063 bltu a3,a4,80001d48 <__divsf3+0x158>
80001cac: 00001697 auipc a3,0x1
80001cb0: 67868693 addi a3,a3,1656 # 80003324 <end+0x658>
80001cb4: 00271713 slli a4,a4,0x2
80001cb8: 00d70733 add a4,a4,a3
80001cbc: 00072703 lw a4,0(a4)
80001cc0: 00d70733 add a4,a4,a3
80001cc4: 00070067 jr a4
80001cc8: 020a8a63 beqz s5,80001cfc <__divsf3+0x10c>
80001ccc: 000a8513 mv a0,s5
80001cd0: 7b1000ef jal ra,80002c80 <__clzsi2>
80001cd4: ffb50793 addi a5,a0,-5
80001cd8: f8a00493 li s1,-118
80001cdc: 00fa9ab3 sll s5,s5,a5
80001ce0: 40a484b3 sub s1,s1,a0
80001ce4: f71ff06f j 80001c54 <__divsf3+0x64>
80001ce8: 0ff00493 li s1,255
80001cec: 00200b93 li s7,2
80001cf0: f60a84e3 beqz s5,80001c58 <__divsf3+0x68>
80001cf4: 00300b93 li s7,3
80001cf8: f61ff06f j 80001c58 <__divsf3+0x68>
80001cfc: 00000493 li s1,0
80001d00: 00100b93 li s7,1
80001d04: f55ff06f j 80001c58 <__divsf3+0x68>
80001d08: 02040a63 beqz s0,80001d3c <__divsf3+0x14c>
80001d0c: 00040513 mv a0,s0
80001d10: 771000ef jal ra,80002c80 <__clzsi2>
80001d14: ffb50793 addi a5,a0,-5
80001d18: 00f41433 sll s0,s0,a5
80001d1c: f8a00793 li a5,-118
80001d20: 40a78533 sub a0,a5,a0
80001d24: f69ff06f j 80001c8c <__divsf3+0x9c>
80001d28: 0ff00513 li a0,255
80001d2c: 00200793 li a5,2
80001d30: f60400e3 beqz s0,80001c90 <__divsf3+0xa0>
80001d34: 00300793 li a5,3
80001d38: f59ff06f j 80001c90 <__divsf3+0xa0>
80001d3c: 00000513 li a0,0
80001d40: 00100793 li a5,1
80001d44: f4dff06f j 80001c90 <__divsf3+0xa0>
80001d48: 00541b13 slli s6,s0,0x5
80001d4c: 128af663 bleu s0,s5,80001e78 <__divsf3+0x288>
80001d50: fffa0a13 addi s4,s4,-1
80001d54: 00000913 li s2,0
80001d58: 010b5b93 srli s7,s6,0x10
80001d5c: 00010437 lui s0,0x10
80001d60: 000b8593 mv a1,s7
80001d64: fff40413 addi s0,s0,-1 # ffff <_stack_size+0xfbff>
80001d68: 000a8513 mv a0,s5
80001d6c: 669000ef jal ra,80002bd4 <__udivsi3>
80001d70: 008b7433 and s0,s6,s0
80001d74: 00050593 mv a1,a0
80001d78: 00050c13 mv s8,a0
80001d7c: 00040513 mv a0,s0
80001d80: 629000ef jal ra,80002ba8 <__mulsi3>
80001d84: 00050493 mv s1,a0
80001d88: 000b8593 mv a1,s7
80001d8c: 000a8513 mv a0,s5
80001d90: 68d000ef jal ra,80002c1c <__umodsi3>
80001d94: 01095913 srli s2,s2,0x10
80001d98: 01051513 slli a0,a0,0x10
80001d9c: 00a96533 or a0,s2,a0
80001da0: 000c0913 mv s2,s8
80001da4: 00957e63 bleu s1,a0,80001dc0 <__divsf3+0x1d0>
80001da8: 01650533 add a0,a0,s6
80001dac: fffc0913 addi s2,s8,-1
80001db0: 01656863 bltu a0,s6,80001dc0 <__divsf3+0x1d0>
80001db4: 00957663 bleu s1,a0,80001dc0 <__divsf3+0x1d0>
80001db8: ffec0913 addi s2,s8,-2
80001dbc: 01650533 add a0,a0,s6
80001dc0: 409504b3 sub s1,a0,s1
80001dc4: 000b8593 mv a1,s7
80001dc8: 00048513 mv a0,s1
80001dcc: 609000ef jal ra,80002bd4 <__udivsi3>
80001dd0: 00050593 mv a1,a0
80001dd4: 00050c13 mv s8,a0
80001dd8: 00040513 mv a0,s0
80001ddc: 5cd000ef jal ra,80002ba8 <__mulsi3>
80001de0: 00050a93 mv s5,a0
80001de4: 000b8593 mv a1,s7
80001de8: 00048513 mv a0,s1
80001dec: 631000ef jal ra,80002c1c <__umodsi3>
80001df0: 01051513 slli a0,a0,0x10
80001df4: 000c0413 mv s0,s8
80001df8: 01557e63 bleu s5,a0,80001e14 <__divsf3+0x224>
80001dfc: 01650533 add a0,a0,s6
80001e00: fffc0413 addi s0,s8,-1
80001e04: 01656863 bltu a0,s6,80001e14 <__divsf3+0x224>
80001e08: 01557663 bleu s5,a0,80001e14 <__divsf3+0x224>
80001e0c: ffec0413 addi s0,s8,-2
80001e10: 01650533 add a0,a0,s6
80001e14: 01091913 slli s2,s2,0x10
80001e18: 41550533 sub a0,a0,s5
80001e1c: 00896933 or s2,s2,s0
80001e20: 00a03533 snez a0,a0
80001e24: 00a96433 or s0,s2,a0
80001e28: 07fa0713 addi a4,s4,127
80001e2c: 0ae05063 blez a4,80001ecc <__divsf3+0x2dc>
80001e30: 00747793 andi a5,s0,7
80001e34: 00078a63 beqz a5,80001e48 <__divsf3+0x258>
80001e38: 00f47793 andi a5,s0,15
80001e3c: 00400693 li a3,4
80001e40: 00d78463 beq a5,a3,80001e48 <__divsf3+0x258>
80001e44: 00440413 addi s0,s0,4
80001e48: 00441793 slli a5,s0,0x4
80001e4c: 0007da63 bgez a5,80001e60 <__divsf3+0x270>
80001e50: f80007b7 lui a5,0xf8000
80001e54: fff78793 addi a5,a5,-1 # f7ffffff <_stack_start+0x77ff9b2f>
80001e58: 00f47433 and s0,s0,a5
80001e5c: 080a0713 addi a4,s4,128
80001e60: 0fe00793 li a5,254
80001e64: 00345413 srli s0,s0,0x3
80001e68: 0ce7d263 ble a4,a5,80001f2c <__divsf3+0x33c>
80001e6c: 00000413 li s0,0
80001e70: 0ff00713 li a4,255
80001e74: 0b80006f j 80001f2c <__divsf3+0x33c>
80001e78: 01fa9913 slli s2,s5,0x1f
80001e7c: 001ada93 srli s5,s5,0x1
80001e80: ed9ff06f j 80001d58 <__divsf3+0x168>
80001e84: 00090993 mv s3,s2
80001e88: 000a8413 mv s0,s5
80001e8c: 000b8793 mv a5,s7
80001e90: 00200713 li a4,2
80001e94: fce78ce3 beq a5,a4,80001e6c <__divsf3+0x27c>
80001e98: 00300713 li a4,3
80001e9c: 08e78263 beq a5,a4,80001f20 <__divsf3+0x330>
80001ea0: 00100713 li a4,1
80001ea4: f8e792e3 bne a5,a4,80001e28 <__divsf3+0x238>
80001ea8: 00000413 li s0,0
80001eac: 00000713 li a4,0
80001eb0: 07c0006f j 80001f2c <__divsf3+0x33c>
80001eb4: 000b0993 mv s3,s6
80001eb8: fd9ff06f j 80001e90 <__divsf3+0x2a0>
80001ebc: 00400437 lui s0,0x400
80001ec0: 00000993 li s3,0
80001ec4: 00300793 li a5,3
80001ec8: fc9ff06f j 80001e90 <__divsf3+0x2a0>
80001ecc: 00100793 li a5,1
80001ed0: 40e787b3 sub a5,a5,a4
80001ed4: 01b00713 li a4,27
80001ed8: fcf748e3 blt a4,a5,80001ea8 <__divsf3+0x2b8>
80001edc: 09ea0513 addi a0,s4,158
80001ee0: 00f457b3 srl a5,s0,a5
80001ee4: 00a41433 sll s0,s0,a0
80001ee8: 00803433 snez s0,s0
80001eec: 0087e433 or s0,a5,s0
80001ef0: 00747793 andi a5,s0,7
80001ef4: 00078a63 beqz a5,80001f08 <__divsf3+0x318>
80001ef8: 00f47793 andi a5,s0,15
80001efc: 00400713 li a4,4
80001f00: 00e78463 beq a5,a4,80001f08 <__divsf3+0x318>
80001f04: 00440413 addi s0,s0,4 # 400004 <_stack_size+0x3ffc04>
80001f08: 00541793 slli a5,s0,0x5
80001f0c: 00345413 srli s0,s0,0x3
80001f10: f807dee3 bgez a5,80001eac <__divsf3+0x2bc>
80001f14: 00000413 li s0,0
80001f18: 00100713 li a4,1
80001f1c: 0100006f j 80001f2c <__divsf3+0x33c>
80001f20: 00400437 lui s0,0x400
80001f24: 0ff00713 li a4,255
80001f28: 00000993 li s3,0
80001f2c: 00800537 lui a0,0x800
80001f30: fff50513 addi a0,a0,-1 # 7fffff <_stack_size+0x7ffbff>
80001f34: 00a47433 and s0,s0,a0
80001f38: 80800537 lui a0,0x80800
80001f3c: fff50513 addi a0,a0,-1 # 807fffff <_stack_start+0x7f9b2f>
80001f40: 0ff77713 andi a4,a4,255
80001f44: 00a47433 and s0,s0,a0
80001f48: 01771713 slli a4,a4,0x17
80001f4c: 01f99513 slli a0,s3,0x1f
80001f50: 00e46433 or s0,s0,a4
80001f54: 00a46533 or a0,s0,a0
80001f58: 02c12083 lw ra,44(sp)
80001f5c: 02812403 lw s0,40(sp)
80001f60: 02412483 lw s1,36(sp)
80001f64: 02012903 lw s2,32(sp)
80001f68: 01c12983 lw s3,28(sp)
80001f6c: 01812a03 lw s4,24(sp)
80001f70: 01412a83 lw s5,20(sp)
80001f74: 01012b03 lw s6,16(sp)
80001f78: 00c12b83 lw s7,12(sp)
80001f7c: 00812c03 lw s8,8(sp)
80001f80: 03010113 addi sp,sp,48
80001f84: 00008067 ret
80001f88 <__mulsf3>:
80001f88: fd010113 addi sp,sp,-48
80001f8c: 02912223 sw s1,36(sp)
80001f90: 03212023 sw s2,32(sp)
80001f94: 008004b7 lui s1,0x800
80001f98: 01755913 srli s2,a0,0x17
80001f9c: 01312e23 sw s3,28(sp)
80001fa0: 01712623 sw s7,12(sp)
80001fa4: fff48493 addi s1,s1,-1 # 7fffff <_stack_size+0x7ffbff>
80001fa8: 02112623 sw ra,44(sp)
80001fac: 02812423 sw s0,40(sp)
80001fb0: 01412c23 sw s4,24(sp)
80001fb4: 01512a23 sw s5,20(sp)
80001fb8: 01612823 sw s6,16(sp)
80001fbc: 01812423 sw s8,8(sp)
80001fc0: 01912223 sw s9,4(sp)
80001fc4: 0ff97913 andi s2,s2,255
80001fc8: 00058b93 mv s7,a1
80001fcc: 00a4f4b3 and s1,s1,a0
80001fd0: 01f55993 srli s3,a0,0x1f
80001fd4: 08090a63 beqz s2,80002068 <__mulsf3+0xe0>
80001fd8: 0ff00793 li a5,255
80001fdc: 0af90663 beq s2,a5,80002088 <__mulsf3+0x100>
80001fe0: 00349493 slli s1,s1,0x3
80001fe4: 040007b7 lui a5,0x4000
80001fe8: 00f4e4b3 or s1,s1,a5
80001fec: f8190913 addi s2,s2,-127 # 7fff81 <_stack_size+0x7ffb81>
80001ff0: 00000b13 li s6,0
80001ff4: 017bd513 srli a0,s7,0x17
80001ff8: 00800437 lui s0,0x800
80001ffc: fff40413 addi s0,s0,-1 # 7fffff <_stack_size+0x7ffbff>
80002000: 0ff57513 andi a0,a0,255
80002004: 01747433 and s0,s0,s7
80002008: 01fbdb93 srli s7,s7,0x1f
8000200c: 08050e63 beqz a0,800020a8 <__mulsf3+0x120>
80002010: 0ff00793 li a5,255
80002014: 0af50a63 beq a0,a5,800020c8 <__mulsf3+0x140>
80002018: 00341413 slli s0,s0,0x3
8000201c: 040007b7 lui a5,0x4000
80002020: 00f46433 or s0,s0,a5
80002024: f8150513 addi a0,a0,-127
80002028: 00000693 li a3,0
8000202c: 002b1793 slli a5,s6,0x2
80002030: 00d7e7b3 or a5,a5,a3
80002034: 00a90933 add s2,s2,a0
80002038: fff78793 addi a5,a5,-1 # 3ffffff <_stack_size+0x3fffbff>
8000203c: 00e00713 li a4,14
80002040: 0179ca33 xor s4,s3,s7
80002044: 00190a93 addi s5,s2,1
80002048: 0af76063 bltu a4,a5,800020e8 <__mulsf3+0x160>
8000204c: 00001717 auipc a4,0x1
80002050: 31470713 addi a4,a4,788 # 80003360 <end+0x694>
80002054: 00279793 slli a5,a5,0x2
80002058: 00e787b3 add a5,a5,a4
8000205c: 0007a783 lw a5,0(a5)
80002060: 00e787b3 add a5,a5,a4
80002064: 00078067 jr a5
80002068: 02048a63 beqz s1,8000209c <__mulsf3+0x114>
8000206c: 00048513 mv a0,s1
80002070: 411000ef jal ra,80002c80 <__clzsi2>
80002074: ffb50793 addi a5,a0,-5
80002078: f8a00913 li s2,-118
8000207c: 00f494b3 sll s1,s1,a5
80002080: 40a90933 sub s2,s2,a0
80002084: f6dff06f j 80001ff0 <__mulsf3+0x68>
80002088: 0ff00913 li s2,255
8000208c: 00200b13 li s6,2
80002090: f60482e3 beqz s1,80001ff4 <__mulsf3+0x6c>
80002094: 00300b13 li s6,3
80002098: f5dff06f j 80001ff4 <__mulsf3+0x6c>
8000209c: 00000913 li s2,0
800020a0: 00100b13 li s6,1
800020a4: f51ff06f j 80001ff4 <__mulsf3+0x6c>
800020a8: 02040a63 beqz s0,800020dc <__mulsf3+0x154>
800020ac: 00040513 mv a0,s0
800020b0: 3d1000ef jal ra,80002c80 <__clzsi2>
800020b4: ffb50793 addi a5,a0,-5
800020b8: 00f41433 sll s0,s0,a5
800020bc: f8a00793 li a5,-118
800020c0: 40a78533 sub a0,a5,a0
800020c4: f65ff06f j 80002028 <__mulsf3+0xa0>
800020c8: 0ff00513 li a0,255
800020cc: 00200693 li a3,2
800020d0: f4040ee3 beqz s0,8000202c <__mulsf3+0xa4>
800020d4: 00300693 li a3,3
800020d8: f55ff06f j 8000202c <__mulsf3+0xa4>
800020dc: 00000513 li a0,0
800020e0: 00100693 li a3,1
800020e4: f49ff06f j 8000202c <__mulsf3+0xa4>
800020e8: 00010c37 lui s8,0x10
800020ec: fffc0b13 addi s6,s8,-1 # ffff <_stack_size+0xfbff>
800020f0: 0104db93 srli s7,s1,0x10
800020f4: 01045c93 srli s9,s0,0x10
800020f8: 0164f4b3 and s1,s1,s6
800020fc: 01647433 and s0,s0,s6
80002100: 00040593 mv a1,s0
80002104: 00048513 mv a0,s1
80002108: 2a1000ef jal ra,80002ba8 <__mulsi3>
8000210c: 00040593 mv a1,s0
80002110: 00050993 mv s3,a0
80002114: 000b8513 mv a0,s7
80002118: 291000ef jal ra,80002ba8 <__mulsi3>
8000211c: 00050413 mv s0,a0
80002120: 000c8593 mv a1,s9
80002124: 000b8513 mv a0,s7
80002128: 281000ef jal ra,80002ba8 <__mulsi3>
8000212c: 00050b93 mv s7,a0
80002130: 00048593 mv a1,s1
80002134: 000c8513 mv a0,s9
80002138: 271000ef jal ra,80002ba8 <__mulsi3>
8000213c: 00850533 add a0,a0,s0
80002140: 0109d793 srli a5,s3,0x10
80002144: 00a78533 add a0,a5,a0
80002148: 00857463 bleu s0,a0,80002150 <__mulsf3+0x1c8>
8000214c: 018b8bb3 add s7,s7,s8
80002150: 016577b3 and a5,a0,s6
80002154: 01079793 slli a5,a5,0x10
80002158: 0169f9b3 and s3,s3,s6
8000215c: 013787b3 add a5,a5,s3
80002160: 00679413 slli s0,a5,0x6
80002164: 00803433 snez s0,s0
80002168: 01a7d793 srli a5,a5,0x1a
8000216c: 01055513 srli a0,a0,0x10
80002170: 00f467b3 or a5,s0,a5
80002174: 01750433 add s0,a0,s7
80002178: 00641413 slli s0,s0,0x6
8000217c: 00f46433 or s0,s0,a5
80002180: 00441793 slli a5,s0,0x4
80002184: 0e07d663 bgez a5,80002270 <__mulsf3+0x2e8>
80002188: 00145793 srli a5,s0,0x1
8000218c: 00147413 andi s0,s0,1
80002190: 0087e433 or s0,a5,s0
80002194: 07fa8713 addi a4,s5,127
80002198: 0ee05063 blez a4,80002278 <__mulsf3+0x2f0>
8000219c: 00747793 andi a5,s0,7
800021a0: 00078a63 beqz a5,800021b4 <__mulsf3+0x22c>
800021a4: 00f47793 andi a5,s0,15
800021a8: 00400693 li a3,4
800021ac: 00d78463 beq a5,a3,800021b4 <__mulsf3+0x22c>
800021b0: 00440413 addi s0,s0,4
800021b4: 00441793 slli a5,s0,0x4
800021b8: 0007da63 bgez a5,800021cc <__mulsf3+0x244>
800021bc: f80007b7 lui a5,0xf8000
800021c0: fff78793 addi a5,a5,-1 # f7ffffff <_stack_start+0x77ff9b2f>
800021c4: 00f47433 and s0,s0,a5
800021c8: 080a8713 addi a4,s5,128
800021cc: 0fe00793 li a5,254
800021d0: 10e7c463 blt a5,a4,800022d8 <__mulsf3+0x350>
800021d4: 00345793 srli a5,s0,0x3
800021d8: 0300006f j 80002208 <__mulsf3+0x280>
800021dc: 00098a13 mv s4,s3
800021e0: 00048413 mv s0,s1
800021e4: 000b0693 mv a3,s6
800021e8: 00200793 li a5,2
800021ec: 0ef68663 beq a3,a5,800022d8 <__mulsf3+0x350>
800021f0: 00300793 li a5,3
800021f4: 0cf68a63 beq a3,a5,800022c8 <__mulsf3+0x340>
800021f8: 00100613 li a2,1
800021fc: 00000793 li a5,0
80002200: 00000713 li a4,0
80002204: f8c698e3 bne a3,a2,80002194 <__mulsf3+0x20c>
80002208: 00800437 lui s0,0x800
8000220c: fff40413 addi s0,s0,-1 # 7fffff <_stack_size+0x7ffbff>
80002210: 80800537 lui a0,0x80800
80002214: 0087f7b3 and a5,a5,s0
80002218: fff50513 addi a0,a0,-1 # 807fffff <_stack_start+0x7f9b2f>
8000221c: 02c12083 lw ra,44(sp)
80002220: 02812403 lw s0,40(sp)
80002224: 0ff77713 andi a4,a4,255
80002228: 00a7f7b3 and a5,a5,a0
8000222c: 01771713 slli a4,a4,0x17
80002230: 01fa1513 slli a0,s4,0x1f
80002234: 00e7e7b3 or a5,a5,a4
80002238: 02412483 lw s1,36(sp)
8000223c: 02012903 lw s2,32(sp)
80002240: 01c12983 lw s3,28(sp)
80002244: 01812a03 lw s4,24(sp)
80002248: 01412a83 lw s5,20(sp)
8000224c: 01012b03 lw s6,16(sp)
80002250: 00c12b83 lw s7,12(sp)
80002254: 00812c03 lw s8,8(sp)
80002258: 00412c83 lw s9,4(sp)
8000225c: 00a7e533 or a0,a5,a0
80002260: 03010113 addi sp,sp,48
80002264: 00008067 ret
80002268: 000b8a13 mv s4,s7
8000226c: f7dff06f j 800021e8 <__mulsf3+0x260>
80002270: 00090a93 mv s5,s2
80002274: f21ff06f j 80002194 <__mulsf3+0x20c>
80002278: 00100793 li a5,1
8000227c: 40e787b3 sub a5,a5,a4
80002280: 01b00713 li a4,27
80002284: 06f74063 blt a4,a5,800022e4 <__mulsf3+0x35c>
80002288: 09ea8a93 addi s5,s5,158
8000228c: 00f457b3 srl a5,s0,a5
80002290: 01541433 sll s0,s0,s5
80002294: 00803433 snez s0,s0
80002298: 0087e433 or s0,a5,s0
8000229c: 00747793 andi a5,s0,7
800022a0: 00078a63 beqz a5,800022b4 <__mulsf3+0x32c>
800022a4: 00f47793 andi a5,s0,15
800022a8: 00400713 li a4,4
800022ac: 00e78463 beq a5,a4,800022b4 <__mulsf3+0x32c>
800022b0: 00440413 addi s0,s0,4
800022b4: 00541793 slli a5,s0,0x5
800022b8: 0207ca63 bltz a5,800022ec <__mulsf3+0x364>
800022bc: 00345793 srli a5,s0,0x3
800022c0: 00000713 li a4,0
800022c4: f45ff06f j 80002208 <__mulsf3+0x280>
800022c8: 004007b7 lui a5,0x400
800022cc: 0ff00713 li a4,255
800022d0: 00000a13 li s4,0
800022d4: f35ff06f j 80002208 <__mulsf3+0x280>
800022d8: 00000793 li a5,0
800022dc: 0ff00713 li a4,255
800022e0: f29ff06f j 80002208 <__mulsf3+0x280>
800022e4: 00000793 li a5,0
800022e8: fd9ff06f j 800022c0 <__mulsf3+0x338>
800022ec: 00000793 li a5,0
800022f0: 00100713 li a4,1
800022f4: f15ff06f j 80002208 <__mulsf3+0x280>
800022f8 <__subsf3>:
800022f8: 008007b7 lui a5,0x800
800022fc: fff78793 addi a5,a5,-1 # 7fffff <_stack_size+0x7ffbff>
80002300: ff010113 addi sp,sp,-16
80002304: 00a7f733 and a4,a5,a0
80002308: 01755693 srli a3,a0,0x17
8000230c: 0175d613 srli a2,a1,0x17
80002310: 00b7f7b3 and a5,a5,a1
80002314: 00912223 sw s1,4(sp)
80002318: 01212023 sw s2,0(sp)
8000231c: 0ff6f693 andi a3,a3,255
80002320: 00371813 slli a6,a4,0x3
80002324: 0ff67613 andi a2,a2,255
80002328: 00112623 sw ra,12(sp)
8000232c: 00812423 sw s0,8(sp)
80002330: 0ff00713 li a4,255
80002334: 01f55493 srli s1,a0,0x1f
80002338: 00068913 mv s2,a3
8000233c: 00060513 mv a0,a2
80002340: 01f5d593 srli a1,a1,0x1f
80002344: 00379793 slli a5,a5,0x3
80002348: 00e61463 bne a2,a4,80002350 <__subsf3+0x58>
8000234c: 00079463 bnez a5,80002354 <__subsf3+0x5c>
80002350: 0015c593 xori a1,a1,1
80002354: 40c68733 sub a4,a3,a2
80002358: 1a959a63 bne a1,s1,8000250c <__subsf3+0x214>
8000235c: 0ae05663 blez a4,80002408 <__subsf3+0x110>
80002360: 06061663 bnez a2,800023cc <__subsf3+0xd4>
80002364: 00079c63 bnez a5,8000237c <__subsf3+0x84>
80002368: 0ff00793 li a5,255
8000236c: 04f68c63 beq a3,a5,800023c4 <__subsf3+0xcc>
80002370: 00080793 mv a5,a6
80002374: 00068513 mv a0,a3
80002378: 14c0006f j 800024c4 <__subsf3+0x1cc>
8000237c: fff70713 addi a4,a4,-1
80002380: 02071e63 bnez a4,800023bc <__subsf3+0xc4>
80002384: 010787b3 add a5,a5,a6
80002388: 00068513 mv a0,a3
8000238c: 00579713 slli a4,a5,0x5
80002390: 12075a63 bgez a4,800024c4 <__subsf3+0x1cc>
80002394: 00150513 addi a0,a0,1
80002398: 0ff00713 li a4,255
8000239c: 32e50e63 beq a0,a4,800026d8 <__subsf3+0x3e0>
800023a0: 7e000737 lui a4,0x7e000
800023a4: 0017f693 andi a3,a5,1
800023a8: fff70713 addi a4,a4,-1 # 7dffffff <_stack_size+0x7dfffbff>
800023ac: 0017d793 srli a5,a5,0x1
800023b0: 00e7f7b3 and a5,a5,a4
800023b4: 00d7e7b3 or a5,a5,a3
800023b8: 10c0006f j 800024c4 <__subsf3+0x1cc>
800023bc: 0ff00613 li a2,255
800023c0: 00c69e63 bne a3,a2,800023dc <__subsf3+0xe4>
800023c4: 00080793 mv a5,a6
800023c8: 0740006f j 8000243c <__subsf3+0x144>
800023cc: 0ff00613 li a2,255
800023d0: fec68ae3 beq a3,a2,800023c4 <__subsf3+0xcc>
800023d4: 04000637 lui a2,0x4000
800023d8: 00c7e7b3 or a5,a5,a2
800023dc: 01b00613 li a2,27
800023e0: 00e65663 ble a4,a2,800023ec <__subsf3+0xf4>
800023e4: 00100793 li a5,1
800023e8: f9dff06f j 80002384 <__subsf3+0x8c>
800023ec: 02000613 li a2,32
800023f0: 40e60633 sub a2,a2,a4
800023f4: 00e7d5b3 srl a1,a5,a4
800023f8: 00c797b3 sll a5,a5,a2
800023fc: 00f037b3 snez a5,a5
80002400: 00f5e7b3 or a5,a1,a5
80002404: f81ff06f j 80002384 <__subsf3+0x8c>
80002408: 08070063 beqz a4,80002488 <__subsf3+0x190>
8000240c: 02069c63 bnez a3,80002444 <__subsf3+0x14c>
80002410: 00081863 bnez a6,80002420 <__subsf3+0x128>
80002414: 0ff00713 li a4,255
80002418: 0ae61663 bne a2,a4,800024c4 <__subsf3+0x1cc>
8000241c: 0200006f j 8000243c <__subsf3+0x144>
80002420: fff00693 li a3,-1
80002424: 00d71663 bne a4,a3,80002430 <__subsf3+0x138>
80002428: 010787b3 add a5,a5,a6
8000242c: f61ff06f j 8000238c <__subsf3+0x94>
80002430: 0ff00693 li a3,255
80002434: fff74713 not a4,a4
80002438: 02d61063 bne a2,a3,80002458 <__subsf3+0x160>
8000243c: 0ff00513 li a0,255
80002440: 0840006f j 800024c4 <__subsf3+0x1cc>
80002444: 0ff00693 li a3,255
80002448: fed60ae3 beq a2,a3,8000243c <__subsf3+0x144>
8000244c: 040006b7 lui a3,0x4000
80002450: 40e00733 neg a4,a4
80002454: 00d86833 or a6,a6,a3
80002458: 01b00693 li a3,27
8000245c: 00e6d663 ble a4,a3,80002468 <__subsf3+0x170>
80002460: 00100713 li a4,1
80002464: 01c0006f j 80002480 <__subsf3+0x188>
80002468: 02000693 li a3,32
8000246c: 00e85633 srl a2,a6,a4
80002470: 40e68733 sub a4,a3,a4
80002474: 00e81733 sll a4,a6,a4
80002478: 00e03733 snez a4,a4
8000247c: 00e66733 or a4,a2,a4
80002480: 00e787b3 add a5,a5,a4
80002484: f09ff06f j 8000238c <__subsf3+0x94>
80002488: 00168513 addi a0,a3,1 # 4000001 <_stack_size+0x3fffc01>
8000248c: 0ff57613 andi a2,a0,255
80002490: 00100713 li a4,1
80002494: 06c74263 blt a4,a2,800024f8 <__subsf3+0x200>
80002498: 04069463 bnez a3,800024e0 <__subsf3+0x1e8>
8000249c: 00000513 li a0,0
800024a0: 02080263 beqz a6,800024c4 <__subsf3+0x1cc>
800024a4: 22078663 beqz a5,800026d0 <__subsf3+0x3d8>
800024a8: 010787b3 add a5,a5,a6
800024ac: 00579713 slli a4,a5,0x5
800024b0: 00075a63 bgez a4,800024c4 <__subsf3+0x1cc>
800024b4: fc000737 lui a4,0xfc000
800024b8: fff70713 addi a4,a4,-1 # fbffffff <_stack_start+0x7bff9b2f>
800024bc: 00e7f7b3 and a5,a5,a4
800024c0: 00100513 li a0,1
800024c4: 0077f713 andi a4,a5,7
800024c8: 20070a63 beqz a4,800026dc <__subsf3+0x3e4>
800024cc: 00f7f713 andi a4,a5,15
800024d0: 00400693 li a3,4
800024d4: 20d70463 beq a4,a3,800026dc <__subsf3+0x3e4>
800024d8: 00478793 addi a5,a5,4
800024dc: 2000006f j 800026dc <__subsf3+0x3e4>
800024e0: f4080ee3 beqz a6,8000243c <__subsf3+0x144>
800024e4: ee0780e3 beqz a5,800023c4 <__subsf3+0xcc>
800024e8: 020007b7 lui a5,0x2000
800024ec: 0ff00513 li a0,255
800024f0: 00000493 li s1,0
800024f4: 1e80006f j 800026dc <__subsf3+0x3e4>
800024f8: 0ff00713 li a4,255
800024fc: 1ce50e63 beq a0,a4,800026d8 <__subsf3+0x3e0>
80002500: 00f80733 add a4,a6,a5
80002504: 00175793 srli a5,a4,0x1
80002508: fbdff06f j 800024c4 <__subsf3+0x1cc>
8000250c: 08e05063 blez a4,8000258c <__subsf3+0x294>
80002510: 04061663 bnez a2,8000255c <__subsf3+0x264>
80002514: e4078ae3 beqz a5,80002368 <__subsf3+0x70>
80002518: fff70713 addi a4,a4,-1
8000251c: 02071463 bnez a4,80002544 <__subsf3+0x24c>
80002520: 40f807b3 sub a5,a6,a5
80002524: 00068513 mv a0,a3
80002528: 00579713 slli a4,a5,0x5
8000252c: f8075ce3 bgez a4,800024c4 <__subsf3+0x1cc>
80002530: 04000437 lui s0,0x4000
80002534: fff40413 addi s0,s0,-1 # 3ffffff <_stack_size+0x3fffbff>
80002538: 0087f433 and s0,a5,s0
8000253c: 00050913 mv s2,a0
80002540: 1380006f j 80002678 <__subsf3+0x380>
80002544: 0ff00613 li a2,255
80002548: e6c68ee3 beq a3,a2,800023c4 <__subsf3+0xcc>
8000254c: 01b00613 li a2,27
80002550: 02e65063 ble a4,a2,80002570 <__subsf3+0x278>
80002554: 00100793 li a5,1
80002558: fc9ff06f j 80002520 <__subsf3+0x228>
8000255c: 0ff00613 li a2,255
80002560: e6c682e3 beq a3,a2,800023c4 <__subsf3+0xcc>
80002564: 04000637 lui a2,0x4000
80002568: 00c7e7b3 or a5,a5,a2
8000256c: fe1ff06f j 8000254c <__subsf3+0x254>
80002570: 02000613 li a2,32
80002574: 00e7d5b3 srl a1,a5,a4
80002578: 40e60733 sub a4,a2,a4
8000257c: 00e797b3 sll a5,a5,a4
80002580: 00f037b3 snez a5,a5
80002584: 00f5e7b3 or a5,a1,a5
80002588: f99ff06f j 80002520 <__subsf3+0x228>
8000258c: 08070263 beqz a4,80002610 <__subsf3+0x318>
80002590: 02069e63 bnez a3,800025cc <__subsf3+0x2d4>
80002594: 00081863 bnez a6,800025a4 <__subsf3+0x2ac>
80002598: 0ff00713 li a4,255
8000259c: 00058493 mv s1,a1
800025a0: e79ff06f j 80002418 <__subsf3+0x120>
800025a4: fff00693 li a3,-1
800025a8: 00d71863 bne a4,a3,800025b8 <__subsf3+0x2c0>
800025ac: 410787b3 sub a5,a5,a6
800025b0: 00058493 mv s1,a1
800025b4: f75ff06f j 80002528 <__subsf3+0x230>
800025b8: 0ff00693 li a3,255
800025bc: fff74713 not a4,a4
800025c0: 02d61063 bne a2,a3,800025e0 <__subsf3+0x2e8>
800025c4: 00058493 mv s1,a1
800025c8: e75ff06f j 8000243c <__subsf3+0x144>
800025cc: 0ff00693 li a3,255
800025d0: fed60ae3 beq a2,a3,800025c4 <__subsf3+0x2cc>
800025d4: 040006b7 lui a3,0x4000
800025d8: 40e00733 neg a4,a4
800025dc: 00d86833 or a6,a6,a3
800025e0: 01b00693 li a3,27
800025e4: 00e6d663 ble a4,a3,800025f0 <__subsf3+0x2f8>
800025e8: 00100713 li a4,1
800025ec: 01c0006f j 80002608 <__subsf3+0x310>
800025f0: 02000693 li a3,32
800025f4: 00e85633 srl a2,a6,a4
800025f8: 40e68733 sub a4,a3,a4
800025fc: 00e81733 sll a4,a6,a4
80002600: 00e03733 snez a4,a4
80002604: 00e66733 or a4,a2,a4
80002608: 40e787b3 sub a5,a5,a4
8000260c: fa5ff06f j 800025b0 <__subsf3+0x2b8>
80002610: 00168713 addi a4,a3,1 # 4000001 <_stack_size+0x3fffc01>
80002614: 0ff77713 andi a4,a4,255
80002618: 00100613 li a2,1
8000261c: 04e64463 blt a2,a4,80002664 <__subsf3+0x36c>
80002620: 02069c63 bnez a3,80002658 <__subsf3+0x360>
80002624: 00081863 bnez a6,80002634 <__subsf3+0x33c>
80002628: 12079863 bnez a5,80002758 <__subsf3+0x460>
8000262c: 00000513 li a0,0
80002630: ec1ff06f j 800024f0 <__subsf3+0x1f8>
80002634: 12078663 beqz a5,80002760 <__subsf3+0x468>
80002638: 40f80733 sub a4,a6,a5
8000263c: 00571693 slli a3,a4,0x5
80002640: 410787b3 sub a5,a5,a6
80002644: 1006ca63 bltz a3,80002758 <__subsf3+0x460>
80002648: 00070793 mv a5,a4
8000264c: 06071063 bnez a4,800026ac <__subsf3+0x3b4>
80002650: 00000793 li a5,0
80002654: fd9ff06f j 8000262c <__subsf3+0x334>
80002658: e80816e3 bnez a6,800024e4 <__subsf3+0x1ec>
8000265c: f60794e3 bnez a5,800025c4 <__subsf3+0x2cc>
80002660: e89ff06f j 800024e8 <__subsf3+0x1f0>
80002664: 40f80433 sub s0,a6,a5
80002668: 00541713 slli a4,s0,0x5
8000266c: 04075463 bgez a4,800026b4 <__subsf3+0x3bc>
80002670: 41078433 sub s0,a5,a6
80002674: 00058493 mv s1,a1
80002678: 00040513 mv a0,s0
8000267c: 604000ef jal ra,80002c80 <__clzsi2>
80002680: ffb50513 addi a0,a0,-5
80002684: 00a41433 sll s0,s0,a0
80002688: 03254a63 blt a0,s2,800026bc <__subsf3+0x3c4>
8000268c: 41250533 sub a0,a0,s2
80002690: 00150513 addi a0,a0,1
80002694: 02000713 li a4,32
80002698: 00a457b3 srl a5,s0,a0
8000269c: 40a70533 sub a0,a4,a0
800026a0: 00a41433 sll s0,s0,a0
800026a4: 00803433 snez s0,s0
800026a8: 0087e7b3 or a5,a5,s0
800026ac: 00000513 li a0,0
800026b0: e15ff06f j 800024c4 <__subsf3+0x1cc>
800026b4: f8040ee3 beqz s0,80002650 <__subsf3+0x358>
800026b8: fc1ff06f j 80002678 <__subsf3+0x380>
800026bc: fc0007b7 lui a5,0xfc000
800026c0: fff78793 addi a5,a5,-1 # fbffffff <_stack_start+0x7bff9b2f>
800026c4: 40a90533 sub a0,s2,a0
800026c8: 00f477b3 and a5,s0,a5
800026cc: df9ff06f j 800024c4 <__subsf3+0x1cc>
800026d0: 00080793 mv a5,a6
800026d4: df1ff06f j 800024c4 <__subsf3+0x1cc>
800026d8: 00000793 li a5,0
800026dc: 00579713 slli a4,a5,0x5
800026e0: 00075e63 bgez a4,800026fc <__subsf3+0x404>
800026e4: 00150513 addi a0,a0,1
800026e8: 0ff00713 li a4,255
800026ec: 06e50e63 beq a0,a4,80002768 <__subsf3+0x470>
800026f0: fc000737 lui a4,0xfc000
800026f4: fff70713 addi a4,a4,-1 # fbffffff <_stack_start+0x7bff9b2f>
800026f8: 00e7f7b3 and a5,a5,a4
800026fc: 0ff00713 li a4,255
80002700: 0037d793 srli a5,a5,0x3
80002704: 00e51863 bne a0,a4,80002714 <__subsf3+0x41c>
80002708: 00078663 beqz a5,80002714 <__subsf3+0x41c>
8000270c: 004007b7 lui a5,0x400
80002710: 00000493 li s1,0
80002714: 00800737 lui a4,0x800
80002718: fff70713 addi a4,a4,-1 # 7fffff <_stack_size+0x7ffbff>
8000271c: 0ff57513 andi a0,a0,255
80002720: 00e7f7b3 and a5,a5,a4
80002724: 01751713 slli a4,a0,0x17
80002728: 80800537 lui a0,0x80800
8000272c: 00c12083 lw ra,12(sp)
80002730: 00812403 lw s0,8(sp)
80002734: fff50513 addi a0,a0,-1 # 807fffff <_stack_start+0x7f9b2f>
80002738: 00a7f533 and a0,a5,a0
8000273c: 01f49493 slli s1,s1,0x1f
80002740: 00e56533 or a0,a0,a4
80002744: 00956533 or a0,a0,s1
80002748: 00012903 lw s2,0(sp)
8000274c: 00412483 lw s1,4(sp)
80002750: 01010113 addi sp,sp,16
80002754: 00008067 ret
80002758: 00058493 mv s1,a1
8000275c: f51ff06f j 800026ac <__subsf3+0x3b4>
80002760: 00080793 mv a5,a6
80002764: f49ff06f j 800026ac <__subsf3+0x3b4>
80002768: 00000793 li a5,0
8000276c: f91ff06f j 800026fc <__subsf3+0x404>
80002770 <__fixsfsi>:
80002770: 00800637 lui a2,0x800
80002774: 01755713 srli a4,a0,0x17
80002778: fff60793 addi a5,a2,-1 # 7fffff <_stack_size+0x7ffbff>
8000277c: 0ff77713 andi a4,a4,255
80002780: 07e00593 li a1,126
80002784: 00a7f7b3 and a5,a5,a0
80002788: 01f55693 srli a3,a0,0x1f
8000278c: 04e5f663 bleu a4,a1,800027d8 <__fixsfsi+0x68>
80002790: 09d00593 li a1,157
80002794: 00e5fa63 bleu a4,a1,800027a8 <__fixsfsi+0x38>
80002798: 80000537 lui a0,0x80000
8000279c: fff54513 not a0,a0
800027a0: 00a68533 add a0,a3,a0
800027a4: 00008067 ret
800027a8: 00c7e533 or a0,a5,a2
800027ac: 09500793 li a5,149
800027b0: 00e7dc63 ble a4,a5,800027c8 <__fixsfsi+0x58>
800027b4: f6a70713 addi a4,a4,-150
800027b8: 00e51533 sll a0,a0,a4
800027bc: 02068063 beqz a3,800027dc <__fixsfsi+0x6c>
800027c0: 40a00533 neg a0,a0
800027c4: 00008067 ret
800027c8: 09600793 li a5,150
800027cc: 40e78733 sub a4,a5,a4
800027d0: 00e55533 srl a0,a0,a4
800027d4: fe9ff06f j 800027bc <__fixsfsi+0x4c>
800027d8: 00000513 li a0,0
800027dc: 00008067 ret
800027e0 <__floatsisf>:
800027e0: ff010113 addi sp,sp,-16
800027e4: 00112623 sw ra,12(sp)
800027e8: 00812423 sw s0,8(sp)
800027ec: 00912223 sw s1,4(sp)
800027f0: 10050263 beqz a0,800028f4 <__floatsisf+0x114>
800027f4: 00050413 mv s0,a0
800027f8: 01f55493 srli s1,a0,0x1f
800027fc: 00055463 bgez a0,80002804 <__floatsisf+0x24>
80002800: 40a00433 neg s0,a0
80002804: 00040513 mv a0,s0
80002808: 478000ef jal ra,80002c80 <__clzsi2>
8000280c: 09e00793 li a5,158
80002810: 40a787b3 sub a5,a5,a0
80002814: 09600713 li a4,150
80002818: 06f74063 blt a4,a5,80002878 <__floatsisf+0x98>
8000281c: 00800713 li a4,8
80002820: 00a75663 ble a0,a4,8000282c <__floatsisf+0x4c>
80002824: ff850513 addi a0,a0,-8 # 7ffffff8 <_stack_start+0xffff9b28>
80002828: 00a41433 sll s0,s0,a0
8000282c: 00800537 lui a0,0x800
80002830: fff50513 addi a0,a0,-1 # 7fffff <_stack_size+0x7ffbff>
80002834: 0ff7f793 andi a5,a5,255
80002838: 00a47433 and s0,s0,a0
8000283c: 01779513 slli a0,a5,0x17
80002840: 808007b7 lui a5,0x80800
80002844: fff78793 addi a5,a5,-1 # 807fffff <_stack_start+0x7f9b2f>
80002848: 00f47433 and s0,s0,a5
8000284c: 800007b7 lui a5,0x80000
80002850: 00a46433 or s0,s0,a0
80002854: fff7c793 not a5,a5
80002858: 01f49513 slli a0,s1,0x1f
8000285c: 00f47433 and s0,s0,a5
80002860: 00a46533 or a0,s0,a0
80002864: 00c12083 lw ra,12(sp)
80002868: 00812403 lw s0,8(sp)
8000286c: 00412483 lw s1,4(sp)
80002870: 01010113 addi sp,sp,16
80002874: 00008067 ret
80002878: 09900713 li a4,153
8000287c: 02f75063 ble a5,a4,8000289c <__floatsisf+0xbc>
80002880: 00500713 li a4,5
80002884: 40a70733 sub a4,a4,a0
80002888: 01b50693 addi a3,a0,27
8000288c: 00e45733 srl a4,s0,a4
80002890: 00d41433 sll s0,s0,a3
80002894: 00803433 snez s0,s0
80002898: 00876433 or s0,a4,s0
8000289c: 00500713 li a4,5
800028a0: 00a75663 ble a0,a4,800028ac <__floatsisf+0xcc>
800028a4: ffb50713 addi a4,a0,-5
800028a8: 00e41433 sll s0,s0,a4
800028ac: fc000737 lui a4,0xfc000
800028b0: fff70713 addi a4,a4,-1 # fbffffff <_stack_start+0x7bff9b2f>
800028b4: 00747693 andi a3,s0,7
800028b8: 00e47733 and a4,s0,a4
800028bc: 00068a63 beqz a3,800028d0 <__floatsisf+0xf0>
800028c0: 00f47413 andi s0,s0,15
800028c4: 00400693 li a3,4
800028c8: 00d40463 beq s0,a3,800028d0 <__floatsisf+0xf0>
800028cc: 00470713 addi a4,a4,4
800028d0: 00571693 slli a3,a4,0x5
800028d4: 0006dc63 bgez a3,800028ec <__floatsisf+0x10c>
800028d8: fc0007b7 lui a5,0xfc000
800028dc: fff78793 addi a5,a5,-1 # fbffffff <_stack_start+0x7bff9b2f>
800028e0: 00f77733 and a4,a4,a5
800028e4: 09f00793 li a5,159
800028e8: 40a787b3 sub a5,a5,a0
800028ec: 00375413 srli s0,a4,0x3
800028f0: f3dff06f j 8000282c <__floatsisf+0x4c>
800028f4: 00000413 li s0,0
800028f8: 00000793 li a5,0
800028fc: 00000493 li s1,0
80002900: f2dff06f j 8000282c <__floatsisf+0x4c>
80002904 <__extendsfdf2>:
80002904: 01755793 srli a5,a0,0x17
80002908: ff010113 addi sp,sp,-16
8000290c: 0ff7f793 andi a5,a5,255
80002910: 00812423 sw s0,8(sp)
80002914: 00178713 addi a4,a5,1
80002918: 00800437 lui s0,0x800
8000291c: 00912223 sw s1,4(sp)
80002920: fff40413 addi s0,s0,-1 # 7fffff <_stack_size+0x7ffbff>
80002924: 00112623 sw ra,12(sp)
80002928: 0ff77713 andi a4,a4,255
8000292c: 00100693 li a3,1
80002930: 00a47433 and s0,s0,a0
80002934: 01f55493 srli s1,a0,0x1f
80002938: 06e6d263 ble a4,a3,8000299c <__extendsfdf2+0x98>
8000293c: 38078513 addi a0,a5,896
80002940: 00345793 srli a5,s0,0x3
80002944: 01d41413 slli s0,s0,0x1d
80002948: 00100737 lui a4,0x100
8000294c: fff70713 addi a4,a4,-1 # fffff <_stack_size+0xffbff>
80002950: 00e7f7b3 and a5,a5,a4
80002954: 80100737 lui a4,0x80100
80002958: fff70713 addi a4,a4,-1 # 800fffff <_stack_start+0xf9b2f>
8000295c: 7ff57513 andi a0,a0,2047
80002960: 01451513 slli a0,a0,0x14
80002964: 00e7f7b3 and a5,a5,a4
80002968: 80000737 lui a4,0x80000
8000296c: 00a7e7b3 or a5,a5,a0
80002970: fff74713 not a4,a4
80002974: 01f49513 slli a0,s1,0x1f
80002978: 00e7f7b3 and a5,a5,a4
8000297c: 00a7e733 or a4,a5,a0
80002980: 00c12083 lw ra,12(sp)
80002984: 00040513 mv a0,s0
80002988: 00812403 lw s0,8(sp)
8000298c: 00412483 lw s1,4(sp)
80002990: 00070593 mv a1,a4
80002994: 01010113 addi sp,sp,16
80002998: 00008067 ret
8000299c: 04079463 bnez a5,800029e4 <__extendsfdf2+0xe0>
800029a0: 06040263 beqz s0,80002a04 <__extendsfdf2+0x100>
800029a4: 00040513 mv a0,s0
800029a8: 2d8000ef jal ra,80002c80 <__clzsi2>
800029ac: 00a00793 li a5,10
800029b0: 02a7c263 blt a5,a0,800029d4 <__extendsfdf2+0xd0>
800029b4: 00b00793 li a5,11
800029b8: 40a787b3 sub a5,a5,a0
800029bc: 01550713 addi a4,a0,21
800029c0: 00f457b3 srl a5,s0,a5
800029c4: 00e41433 sll s0,s0,a4
800029c8: 38900713 li a4,905
800029cc: 40a70533 sub a0,a4,a0
800029d0: f79ff06f j 80002948 <__extendsfdf2+0x44>
800029d4: ff550793 addi a5,a0,-11
800029d8: 00f417b3 sll a5,s0,a5
800029dc: 00000413 li s0,0
800029e0: fe9ff06f j 800029c8 <__extendsfdf2+0xc4>
800029e4: 00000793 li a5,0
800029e8: 00040a63 beqz s0,800029fc <__extendsfdf2+0xf8>
800029ec: 00345793 srli a5,s0,0x3
800029f0: 00080737 lui a4,0x80
800029f4: 01d41413 slli s0,s0,0x1d
800029f8: 00e7e7b3 or a5,a5,a4
800029fc: 7ff00513 li a0,2047
80002a00: f49ff06f j 80002948 <__extendsfdf2+0x44>
80002a04: 00000793 li a5,0
80002a08: 00000513 li a0,0
80002a0c: f3dff06f j 80002948 <__extendsfdf2+0x44>
80002a10 <__truncdfsf2>:
80002a10: 00100637 lui a2,0x100
80002a14: fff60613 addi a2,a2,-1 # fffff <_stack_size+0xffbff>
80002a18: 00b67633 and a2,a2,a1
80002a1c: 0145d813 srli a6,a1,0x14
80002a20: 01d55793 srli a5,a0,0x1d
80002a24: 7ff87813 andi a6,a6,2047
80002a28: 00361613 slli a2,a2,0x3
80002a2c: 00c7e633 or a2,a5,a2
80002a30: 00180793 addi a5,a6,1
80002a34: 7ff7f793 andi a5,a5,2047
80002a38: 00100693 li a3,1
80002a3c: 01f5d593 srli a1,a1,0x1f
80002a40: 00351713 slli a4,a0,0x3
80002a44: 0af6d663 ble a5,a3,80002af0 <__truncdfsf2+0xe0>
80002a48: c8080693 addi a3,a6,-896
80002a4c: 0fe00793 li a5,254
80002a50: 0cd7c263 blt a5,a3,80002b14 <__truncdfsf2+0x104>
80002a54: 08d04063 bgtz a3,80002ad4 <__truncdfsf2+0xc4>
80002a58: fe900793 li a5,-23
80002a5c: 12f6c463 blt a3,a5,80002b84 <__truncdfsf2+0x174>
80002a60: 008007b7 lui a5,0x800
80002a64: 01e00513 li a0,30
80002a68: 00f66633 or a2,a2,a5
80002a6c: 40d50533 sub a0,a0,a3
80002a70: 01f00793 li a5,31
80002a74: 02a7c863 blt a5,a0,80002aa4 <__truncdfsf2+0x94>
80002a78: c8280813 addi a6,a6,-894
80002a7c: 010717b3 sll a5,a4,a6
80002a80: 00f037b3 snez a5,a5
80002a84: 01061633 sll a2,a2,a6
80002a88: 00a75533 srl a0,a4,a0
80002a8c: 00c7e7b3 or a5,a5,a2
80002a90: 00f567b3 or a5,a0,a5
80002a94: 00000693 li a3,0
80002a98: 0077f713 andi a4,a5,7
80002a9c: 08070063 beqz a4,80002b1c <__truncdfsf2+0x10c>
80002aa0: 0ec0006f j 80002b8c <__truncdfsf2+0x17c>
80002aa4: ffe00793 li a5,-2
80002aa8: 40d786b3 sub a3,a5,a3
80002aac: 02000793 li a5,32
80002ab0: 00d656b3 srl a3,a2,a3
80002ab4: 00000893 li a7,0
80002ab8: 00f50663 beq a0,a5,80002ac4 <__truncdfsf2+0xb4>
80002abc: ca280813 addi a6,a6,-862
80002ac0: 010618b3 sll a7,a2,a6
80002ac4: 00e8e7b3 or a5,a7,a4
80002ac8: 00f037b3 snez a5,a5
80002acc: 00f6e7b3 or a5,a3,a5
80002ad0: fc5ff06f j 80002a94 <__truncdfsf2+0x84>
80002ad4: 00651513 slli a0,a0,0x6
80002ad8: 00a03533 snez a0,a0
80002adc: 00361613 slli a2,a2,0x3
80002ae0: 01d75793 srli a5,a4,0x1d
80002ae4: 00c56633 or a2,a0,a2
80002ae8: 00f667b3 or a5,a2,a5
80002aec: fadff06f j 80002a98 <__truncdfsf2+0x88>
80002af0: 00e667b3 or a5,a2,a4
80002af4: 00081663 bnez a6,80002b00 <__truncdfsf2+0xf0>
80002af8: 00f037b3 snez a5,a5
80002afc: f99ff06f j 80002a94 <__truncdfsf2+0x84>
80002b00: 0ff00693 li a3,255
80002b04: 00078c63 beqz a5,80002b1c <__truncdfsf2+0x10c>
80002b08: 00361613 slli a2,a2,0x3
80002b0c: 020007b7 lui a5,0x2000
80002b10: fd9ff06f j 80002ae8 <__truncdfsf2+0xd8>
80002b14: 00000793 li a5,0
80002b18: 0ff00693 li a3,255
80002b1c: 00579713 slli a4,a5,0x5
80002b20: 00075e63 bgez a4,80002b3c <__truncdfsf2+0x12c>
80002b24: 00168693 addi a3,a3,1
80002b28: 0ff00713 li a4,255
80002b2c: 06e68a63 beq a3,a4,80002ba0 <__truncdfsf2+0x190>
80002b30: fc000737 lui a4,0xfc000
80002b34: fff70713 addi a4,a4,-1 # fbffffff <_stack_start+0x7bff9b2f>
80002b38: 00e7f7b3 and a5,a5,a4
80002b3c: 0ff00713 li a4,255
80002b40: 0037d793 srli a5,a5,0x3
80002b44: 00e69863 bne a3,a4,80002b54 <__truncdfsf2+0x144>
80002b48: 00078663 beqz a5,80002b54 <__truncdfsf2+0x144>
80002b4c: 004007b7 lui a5,0x400
80002b50: 00000593 li a1,0
80002b54: 00800537 lui a0,0x800
80002b58: fff50513 addi a0,a0,-1 # 7fffff <_stack_size+0x7ffbff>
80002b5c: 00a7f7b3 and a5,a5,a0
80002b60: 80800537 lui a0,0x80800
80002b64: fff50513 addi a0,a0,-1 # 807fffff <_stack_start+0x7f9b2f>
80002b68: 0ff6f693 andi a3,a3,255
80002b6c: 01769693 slli a3,a3,0x17
80002b70: 00a7f7b3 and a5,a5,a0
80002b74: 01f59593 slli a1,a1,0x1f
80002b78: 00d7e7b3 or a5,a5,a3
80002b7c: 00b7e533 or a0,a5,a1
80002b80: 00008067 ret
80002b84: 00100793 li a5,1
80002b88: 00000693 li a3,0
80002b8c: 00f7f713 andi a4,a5,15
80002b90: 00400613 li a2,4
80002b94: f8c704e3 beq a4,a2,80002b1c <__truncdfsf2+0x10c>
80002b98: 00478793 addi a5,a5,4 # 400004 <_stack_size+0x3ffc04>
80002b9c: f81ff06f j 80002b1c <__truncdfsf2+0x10c>
80002ba0: 00000793 li a5,0
80002ba4: f99ff06f j 80002b3c <__truncdfsf2+0x12c>
80002ba8 <__mulsi3>:
80002ba8: 00050613 mv a2,a0
80002bac: 00000513 li a0,0
80002bb0: 0015f693 andi a3,a1,1
80002bb4: 00068463 beqz a3,80002bbc <__mulsi3+0x14>
80002bb8: 00c50533 add a0,a0,a2
80002bbc: 0015d593 srli a1,a1,0x1
80002bc0: 00161613 slli a2,a2,0x1
80002bc4: fe0596e3 bnez a1,80002bb0 <__mulsi3+0x8>
80002bc8: 00008067 ret
80002bcc <__divsi3>:
80002bcc: 06054063 bltz a0,80002c2c <__umodsi3+0x10>
80002bd0: 0605c663 bltz a1,80002c3c <__umodsi3+0x20>
80002bd4 <__udivsi3>:
80002bd4: 00058613 mv a2,a1
80002bd8: 00050593 mv a1,a0
80002bdc: fff00513 li a0,-1
80002be0: 02060c63 beqz a2,80002c18 <__udivsi3+0x44>
80002be4: 00100693 li a3,1
80002be8: 00b67a63 bleu a1,a2,80002bfc <__udivsi3+0x28>
80002bec: 00c05863 blez a2,80002bfc <__udivsi3+0x28>
80002bf0: 00161613 slli a2,a2,0x1
80002bf4: 00169693 slli a3,a3,0x1
80002bf8: feb66ae3 bltu a2,a1,80002bec <__udivsi3+0x18>
80002bfc: 00000513 li a0,0
80002c00: 00c5e663 bltu a1,a2,80002c0c <__udivsi3+0x38>
80002c04: 40c585b3 sub a1,a1,a2
80002c08: 00d56533 or a0,a0,a3
80002c0c: 0016d693 srli a3,a3,0x1
80002c10: 00165613 srli a2,a2,0x1
80002c14: fe0696e3 bnez a3,80002c00 <__udivsi3+0x2c>
80002c18: 00008067 ret
80002c1c <__umodsi3>:
80002c1c: 00008293 mv t0,ra
80002c20: fb5ff0ef jal ra,80002bd4 <__udivsi3>
80002c24: 00058513 mv a0,a1
80002c28: 00028067 jr t0
80002c2c: 40a00533 neg a0,a0
80002c30: 0005d863 bgez a1,80002c40 <__umodsi3+0x24>
80002c34: 40b005b3 neg a1,a1
80002c38: f9dff06f j 80002bd4 <__udivsi3>
80002c3c: 40b005b3 neg a1,a1
80002c40: 00008293 mv t0,ra
80002c44: f91ff0ef jal ra,80002bd4 <__udivsi3>
80002c48: 40a00533 neg a0,a0
80002c4c: 00028067 jr t0
80002c50 <__modsi3>:
80002c50: 00008293 mv t0,ra
80002c54: 0005ca63 bltz a1,80002c68 <__modsi3+0x18>
80002c58: 00054c63 bltz a0,80002c70 <__modsi3+0x20>
80002c5c: f79ff0ef jal ra,80002bd4 <__udivsi3>
80002c60: 00058513 mv a0,a1
80002c64: 00028067 jr t0
80002c68: 40b005b3 neg a1,a1
80002c6c: fe0558e3 bgez a0,80002c5c <__modsi3+0xc>
80002c70: 40a00533 neg a0,a0
80002c74: f61ff0ef jal ra,80002bd4 <__udivsi3>
80002c78: 40b00533 neg a0,a1
80002c7c: 00028067 jr t0
80002c80 <__clzsi2>:
80002c80: 000107b7 lui a5,0x10
80002c84: 02f57a63 bleu a5,a0,80002cb8 <__clzsi2+0x38>
80002c88: 0ff00793 li a5,255
80002c8c: 00a7b7b3 sltu a5,a5,a0
80002c90: 00379793 slli a5,a5,0x3
80002c94: 02000713 li a4,32
80002c98: 40f70733 sub a4,a4,a5
80002c9c: 00f557b3 srl a5,a0,a5
80002ca0: 00000517 auipc a0,0x0
80002ca4: 6fc50513 addi a0,a0,1788 # 8000339c <__clz_tab>
80002ca8: 00f507b3 add a5,a0,a5
80002cac: 0007c503 lbu a0,0(a5) # 10000 <_stack_size+0xfc00>
80002cb0: 40a70533 sub a0,a4,a0
80002cb4: 00008067 ret
80002cb8: 01000737 lui a4,0x1000
80002cbc: 01000793 li a5,16
80002cc0: fce56ae3 bltu a0,a4,80002c94 <__clzsi2+0x14>
80002cc4: 01800793 li a5,24
80002cc8: fcdff06f j 80002c94 <__clzsi2+0x14>
Disassembly of section .text.startup:
80002ccc <main>:
int main() {
80002ccc: 1141 addi sp,sp,-16
80002cce: c606 sw ra,12(sp)
main2();
80002cd0: d4cfd0ef jal ra,8000021c <main2>
}
80002cd4: 40b2 lw ra,12(sp)
TEST_COM_BASE[8] = 0;
80002cd6: f01007b7 lui a5,0xf0100
80002cda: f207a023 sw zero,-224(a5) # f00fff20 <_stack_start+0x700f9a50>
}
80002cde: 4501 li a0,0
80002ce0: 0141 addi sp,sp,16
80002ce2: 8082 ret
|
src/Tactic/Cong.agda | L-TChen/agda-prelude | 111 | 4182 | <reponame>L-TChen/agda-prelude<gh_stars>100-1000
-- A tactic that applies congruence and symmetry of equality proofs.
-- Given a hole and a lemma it tries (in order)
-- - refl
-- - lemma
-- - sym lemma
-- - f $β‘ Xβ *β‘ .. *β‘ Xβ and recurses on Xα΅’
-- if the goal is f us β‘ f vs
-- Hidden and instance arguments of f are left alone.
module Tactic.Cong where
open import Prelude
open import Container.Traversable
open import Tactic.Reflection
private
reflβ² : β {a} {A : Set a} (x : A) β x β‘ x
reflβ² _ = refl
pattern `refl a = defβ (quote reflβ²) a
parseEq : Term β Maybe (Term Γ Term)
parseEq (def (quote _β‘_) (hArg _ β· hArg _ β· vArg x β· vArg y β· [])) = just (x , y)
parseEq _ = nothing
-- build-cong f ps = f $β‘ pβ *β‘ .. *β‘ pβ
build-cong : Term β List Term β Term
build-cong f [] = `refl unknown -- we tried this
build-cong f (p β· ps) = foldl ap (defβ (quote cong) f p) ps
where
ap = Ξ» p q β defβ (quote _*β‘_) p q
zipWithM!β : {A B C : Set} β (A β B β C β TC β€) β List A β List B β List C β TC β€
zipWithM!β f (x β· xs) (y β· ys) (z β· zs) = f x y z *> zipWithM!β f xs ys zs
zipWithM!β _ _ _ _ = pure _
module _ (lemma : Term) where
go go-cong : (d : Nat) (lhs rhs hole : Term) β TC β€
go d lhs rhs hole =
checkType hole (defβ (quote _β‘_) lhs rhs) *>
( unify hole (`refl lhs)
<|> unify hole lemma
<|> unify hole (defβ (quote sym) lemma)
<|> go-cong d lhs rhs hole
<|> do lhs β reduce lhs
rhs β reduce rhs
go-cong d lhs rhs hole)
solve : (d : Nat) (hole : Term) β TC β€
solve d hole =
caseM parseEq <$> (reduce =<< inferType hole) of Ξ» where
nothing β typeErrorS "Goal is not an equality type."
(just (lhs , rhs)) β go d lhs rhs hole
go-congβ² : β d f us vs hole β TC β€
go-congβ² d f us vs hole = do
let usβ = map unArg (filter isVisible us)
vsβ = map unArg (filter isVisible vs)
holes β traverse (const newMeta!) usβ
zipWithM!β (go d) usβ vsβ holes
unify hole (build-cong f holes)
go-cong (suc d) (def f us) (def fβ vs) hole = guard (f == fβ) (go-congβ² d (defβ f) us vs hole)
go-cong (suc d) (con c us) (con cβ vs) hole = guard (c == cβ) (go-congβ² d (conβ c) us vs hole)
go-cong (suc d) (var x us) (var xβ vs) hole = guard (x == xβ) (go-congβ² d (varβ x) us vs hole)
go-cong _ lhs rhs _ = empty
macro
by-cong : β {a} {A : Set a} {x y : A} β x β‘ y β Tactic
by-cong {x = x} {y} lemma hole = do
`lemma β quoteTC lemma
ensureNoMetas =<< inferType hole
lemMeta β lemProxy `lemma
solve lemMeta 100 hole <|> typeErrorS "Congruence failed"
unify lemMeta `lemma
where
-- Create a meta for the lemma to avoid retype-checking it in case
-- it's expensive. Don't do this if the lemma is a variable.
lemProxy : Term β TC Term
lemProxy lemma@(var _ []) = pure lemma
lemProxy lemma = newMeta =<< quoteTC (x β‘ y)
|
libsrc/_DEVELOPMENT/stdio/z80/asm_ftell.asm | jpoikela/z88dk | 640 | 172388 |
; ===============================================================
; Jan 2014
; ===============================================================
;
; unsigned long ftell(FILE *stream)
;
; Return current file position.
;
; ===============================================================
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_stdio
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC asm_ftell
EXTERN asm0_ftell_unlocked, __stdio_lock_release
asm_ftell:
; enter : ix = FILE *
;
; exit : ix = FILE *
;
; success
;
; dehl = current file position
; carry reset
;
; fail
;
; dehl = -1
; carry set
;
; uses : all except ix
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_STDIO & $01
EXTERN __stdio_verify_valid_lock, ftell_immediate_error_ebadf
call __stdio_verify_valid_lock
jp c, ftell_immediate_error_ebadf
ELSE
EXTERN __stdio_lock_acquire, ftell_immediate_error_enolck
call __stdio_lock_acquire
jp c, ftell_immediate_error_enolck
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
call asm0_ftell_unlocked
jp __stdio_lock_release
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC asm_ftell
EXTERN asm_ftell_unlocked
defc asm_ftell = asm_ftell_unlocked
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
AlgorithmsFromTheBook/arithmeticExpressionInterpreter.asm | MateoParrado/AlgorithmsFromTheBook | 0 | 102884 | PUBLIC asm_arithmetic_expression_calculator
.386
.model flat, c
.code
;helper proc to the one below, defines the operators as special charachters -1 : -4 to be used by the tokenizer and parser
tokenize PROC
.IF byte ptr [eax] == '*'
mov ebx, -1
.ELSEIF byte ptr [eax] == '/'
mov ebx, -2
.ELSEIF byte ptr [eax] == '-'
mov ebx, -3
.ELSEIF byte ptr [eax] == '+'
mov ebx, -4
.ENDIF
ret
tokenize ENDP
;--------------------------------------------------------
asm_arithmetic_expression_calculator PROC
;
; Function that takes in a char * pointing to a string
; representing an unparenthesized arithmetic expression using
; only the operators + - * or /. It then returns the calculated
; value of that expression. Whitespace may be used. Does not support
; negative numbers. Executes order of operations from left to right,
; meaning that 4 * 2 / 4 returns 0.
;
; Receives:
; a char * pointing to the expression on the stack
;
; Returns:
; EAX: an integer that is the result of calculating the string
;--------------------------------------------------------
push ebp
mov ebp, esp
;eax now holds the pointer to the char
mov eax, [ebp + 8]
dec eax
;point ebp to the right location
sub ebp, 4
;esi = 0, will hold the temp value
xor esi, esi
xor ecx, ecx
xor edx, edx
nextChar:
inc eax
cmp byte ptr [eax], 0
je doneTokenizing
inc ecx
cmp byte ptr [eax], ' '
je nextChar
;dl holds the char
mov dl, byte ptr [eax]
sub dl, '0'
;go to operator if it isnt a number
cmp dl, 9
ja operator
;multiply by ten and add the new char
imul esi, esi, 10
add esi, edx
jmp nextChar
operator:
sub ebp, 4
mov dword ptr [ebp], esi
call tokenize
sub ebp, 4
mov dword ptr [ebp], ebx
xor esi, esi
jmp nextChar
doneTokenizing:
;add the last value on there
sub ebp, 4
mov dword ptr[ebp], esi
;eax is now our return value
mov eax, dword ptr [ebp]
dec ecx
xor edx, edx
keepParsing:
add ebp, 4
mov esi, dword ptr [ebp]
.IF dword ptr [ebp] == -1;multiply
add ebp, 4
mul dword ptr [ebp]
dec ecx
.ELSEIF dword ptr [ebp] == -2;divide
add ebp, 4
mov ebx, eax
mov eax, dword ptr [ebp]
div ebx
dec ecx
.ELSEIF dword ptr [ebp] == -3;subtract
dec ecx
add ebp, 4
;tempval to be added
mov ebx, [ebp]
recheckMultiply:
add ebp, 4
.IF dword ptr [ebp] == -1;multiply
add ebp, 4
imul ebx, dword ptr [ebp]
sub ecx, 2
cmp ecx, 0
jg recheckMultiply
.ELSEIF dword ptr [ebp] == -2;divide
add ebp, 4
push eax
mov eax, dword ptr [ebp]
div ebx
mov ebx, eax
pop eax
sub ecx, 2
cmp ecx, 0
jg recheckMultiply
.ENDIF
sub ebx, eax
mov eax, ebx
dec ecx
sub ebp, 4
.ELSEIF dword ptr[ebp] == -4;add
add ebp, 4
;tempval to be added
mov ebx, [ebp]
checkMultiply:
add ebp, 4
.IF dword ptr [ebp] == -1;multiply
add ebp, 4
imul ebx, dword ptr [ebp]
sub ecx, 2
cmp ecx, 0
jg checkMultiply
.ELSEIF dword ptr [ebp] == -2;divide
add ebp, 4
push eax
mov eax, dword ptr [ebp]
div ebx
mov ebx, eax
pop eax
sub ecx, 2
cmp ecx, 0
jg checkMultiply
.ENDIF
dec ecx
add eax, ebx
sub ebp, 4
.ENDIF
dec ecx
cmp ecx, 0
jg keepParsing
pop ebp
ret
asm_arithmetic_expression_calculator ENDP
end |
programs/oeis/047/A047521.asm | karttu/loda | 1 | 29316 | <reponame>karttu/loda
; A047521: Numbers that are congruent to {0, 7} mod 8.
; 0,7,8,15,16,23,24,31,32,39,40,47,48,55,56,63,64,71,72,79,80,87,88,95,96,103,104,111,112,119,120,127,128,135,136,143,144,151,152,159,160,167,168,175,176,183,184,191,192,199,200,207,208,215,216,223,224,231,232
mov $1,$0
add $1,1
div $1,2
mul $1,6
add $1,$0
|
grammar/sav/PSS.g4 | PSSTools/py-pss-parser | 1 | 7281 | <reponame>PSSTools/py-pss-parser<gh_stars>1-10
/****************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
****************************************************************************/
grammar PSS;
import B01_Package, B02_Action, B03_Struct, B04_PI,
B05_Component, B06_ActivityStatements, B07_Overrides,
B08_DataDeclarations, B09_DataTypes, B09_TemplateTypes,
B10_Constraint,
B11_Coverage, B12_ConditionalCompile, B13_Expressions,
B14_Identifiers, B15_Numbers, B16_LexicalRules,
ImportClass, ExportAction
;
compilation_unit :
portable_stimulus_description* EOF
;
portable_stimulus_description :
package_body_item
| package_declaration
| component_declaration
;
|
alloy4fun_models/trashltl/models/13/DWsbt7uoxgyERtetK.als | Kaixi26/org.alloytools.alloy | 0 | 2722 | open main
pred idDWsbt7uoxgyERtetK_prop14 {
all f : Trash | always (after f not in Protected)
}
pred __repair { idDWsbt7uoxgyERtetK_prop14 }
check __repair { idDWsbt7uoxgyERtetK_prop14 <=> prop14o } |
test/interaction/Issue957.agda | KDr2/agda | 0 | 955 | -- {-# OPTIONS -v impossible:100 -v tc.lhs.imp:100 #-}
-- {-# OPTIONS -v impossible:100 -v tc.cover:20 #-}
-- {-# OPTIONS --copatterns #-} -- Andreas, 2015-08-26 on by default.
module Issue957 where
open import Common.Equality
record _Γ_ (A B : Set) : Set where
constructor _,_
field
fst : A
snd : B
open _Γ_
pair : {A B : Set} β A β B β A Γ B
fst (pair a b) = ?
snd (pair a b) = ?
swap : {A B : Set} β A Γ B β B Γ A
fst (swap p) = ?
snd (swap p) = ?
swap3 : {A B C : Set} β A Γ (B Γ C) β C Γ (B Γ A)
fst (swap3 t) = ?
fst (snd (swap3 t)) = ?
snd (snd (swap3 t)) = ?
-- should also work if we shuffle the clauses
swap4 : {A B C D : Set} β A Γ (B Γ (C Γ D)) β D Γ (C Γ (B Γ A))
fst (snd (swap4 t)) = ?
snd (snd (snd (swap4 t))) = ?
fst (swap4 t) = ?
fst (snd (snd (swap4 t))) = ?
-- multiple clauses with abstractions
fswap3 : {A B C X : Set} β (X β A) Γ ((X β B) Γ C) β (X β C) Γ (X β (B Γ A))
fst (fswap3 t) x = ?
fst (snd (fswap3 t) y) = ?
snd (snd (fswap3 t) z) = ?
-- State monad example
-- The State newtype
record State (S A : Set) : Set where
constructor state
field
runState : S β A Γ S
open State
-- The Monad type class
record Monad (M : Set β Set) : Set1 where
constructor monad
field
return : {A : Set} β A β M A
_>>=_ : {A B : Set} β M A β (A β M B) β M B
module InstanceArgument where
open Monad {{...}}
-- State is an instance of Monad
instance
stateMonad : {S : Set} β Monad (State S)
runState (return {{stateMonad}} a ) s = ?
runState (_>>=_ {{stateMonad}} m k) sβ = ?
|
message/generation/swift-mt-generation/repository/SR2018/grammars/SwiftMtParser_MT510.g4 | Yanick-Salzmann/message-converter-c | 0 | 7001 | <reponame>Yanick-Salzmann/message-converter-c
grammar SwiftMtParser_MT510;
@lexer::header {
#include "repository/ISwiftMtParser.h"
#include "SwiftMtMessage.pb.h"
#include <vector>
#include <string>
#include "BaseErrorListener.h"
}
@parser::header {
#include "repository/ISwiftMtParser.h"
#include "SwiftMtMessage.pb.h"
#include <vector>
#include <string>
#include "BaseErrorListener.h"
#include "SwiftMtParser_MT510Lexer.h"
}
@parser::members {
public:
typedef SwiftMtParser_MT510Lexer tLexer;
typedef SwiftMtParser_MT510Parser tParser;
private:
std::vector<std::string> _errors;
public:
[[nodiscard]] const std::vector<std::string>& errors() const { return _errors; }
private:
class DefaultErrorListener : public antlr4::BaseErrorListener {
private:
std::vector<std::string>& _errors;
public:
explicit DefaultErrorListener(std::vector<std::string>& errors) : _errors(errors) { }
void syntaxError(Recognizer *recognizer, antlr4::Token * offendingSymbol, size_t line, size_t charPositionInLine,
const std::string &msg, std::exception_ptr e) override {
_errors.push_back(msg);
}
};
DefaultErrorListener _error_listener { _errors };
public:
class Helper : public ISwiftMtParser {
public:
bool parse_message(const std::string& message, std::vector<std::string>& errors, SwiftMtMessage& out_message) override {
antlr4::ANTLRInputStream stream{message};
tLexer lexer{&stream};
antlr4::CommonTokenStream token_stream{&lexer};
tParser parser{&token_stream};
return parser.process(errors, out_message);
}
};
private:
SwiftMtMessage _message_builder{};
bool process(std::vector<std::string>& errors, SwiftMtMessage& out_message) {
_errors.clear();
removeErrorListeners();
addErrorListener(&_error_listener);
_message_builder = SwiftMtMessage{};
message();
if(!_errors.empty()) {
errors.insert(errors.end(), _errors.begin(), _errors.end());
return false;
}
out_message = _message_builder;
return true;
}
public:
[[nodiscard]] SwiftMtMessage parsed_message() const {
return _message_builder;
}
}
message : bh ah uh? mt tr? EOF;
bh : TAG_BH bh_content RBRACE ;
bh_content : ~(RBRACE)+ ;
ah : TAG_AH ah_content RBRACE ;
ah_content : ~( RBRACE )+ ;
uh : TAG_UH sys_block RBRACE ;
tr : TAG_TR sys_block RBRACE ;
sys_block : sys_element+ ;
sys_element : LBRACE sys_element_key COLON sys_element_content RBRACE ;
sys_element_key : ~( COLON | RBRACE )+ ;
sys_element_content : ~( RBRACE )+ ;
mt returns [message::definition::swift::mt::MessageText elem] @after { _message_builder.mutable_msg_text()->MergeFrom($elem); }
: TAG_MT seq_A seq_B? seq_C? MT_END;
seq_A returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A"); } :
fld_16R_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A.fld); }
fld_20C_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_A.fld); }
fld_23G_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_23G_A.fld); }
fld_98a_A? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_A.fld); }
seq_A1+ { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_A1.elem); }
seq_A2+ { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_A2.elem); }
fld_16S_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A.fld); }
;
seq_A1 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A1"); } :
fld_16R_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A1.fld); }
fld_13a_A1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13a_A1.fld); }
fld_20C_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_A1.fld); }
fld_16S_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A1.fld); }
;
seq_A2 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A2"); } :
fld_16R_A2 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A2.fld); }
fld_25D_A2 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_25D_A2.fld); }
seq_A2a* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_A2a.elem); }
fld_16S_A2 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A2.fld); }
;
seq_A2a returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A2a"); } :
fld_16R_A2a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A2a.fld); }
fld_24B_A2a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_24B_A2a.fld); }
fld_70D_A2a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_70D_A2a.fld); }
fld_16S_A2a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A2a.fld); }
;
seq_B returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("B"); } :
fld_16R_B { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_B.fld); }
fld_20D_B* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20D_B.fld); }
fld_95a_B* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_B.fld); }
fld_94a_B* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94a_B.fld); }
fld_13B_B* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13B_B.fld); }
fld_98a_B* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_B.fld); }
fld_35B_B? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_35B_B.fld); }
fld_36B_B? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_36B_B.fld); }
fld_97A_B? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_97A_B.fld); }
fld_16S_B { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_B.fld); }
;
seq_C returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("C"); } :
fld_16R_C { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_C.fld); }
fld_95a_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_C.fld); }
fld_16S_C { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_C.fld); }
;
fld_16R_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } :
START_OF_FIELD '16R:' ~(START_OF_FIELD)+;
fld_20C_A returns [message::definition::swift::mt::Field fld] :
fld_20C_A_C { $fld.MergeFrom($fld_20C_A_C.fld); }
;
fld_23G_A returns [message::definition::swift::mt::Field fld] :
fld_23G_A_G { $fld.MergeFrom($fld_23G_A_G.fld); }
;
fld_98a_A returns [message::definition::swift::mt::Field fld] :
fld_98a_A_A { $fld.MergeFrom($fld_98a_A_A.fld); }
| fld_98a_A_C { $fld.MergeFrom($fld_98a_A_C.fld); }
| fld_98a_A_E { $fld.MergeFrom($fld_98a_A_E.fld); }
;
fld_16R_A1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } :
START_OF_FIELD '16R:' ~(START_OF_FIELD)+;
fld_13a_A1 returns [message::definition::swift::mt::Field fld] :
fld_13a_A1_A { $fld.MergeFrom($fld_13a_A1_A.fld); }
| fld_13a_A1_B { $fld.MergeFrom($fld_13a_A1_B.fld); }
;
fld_20C_A1 returns [message::definition::swift::mt::Field fld] :
fld_20C_A1_C { $fld.MergeFrom($fld_20C_A1_C.fld); }
;
fld_16S_A1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } :
START_OF_FIELD '16S:' ~(START_OF_FIELD)+;
fld_16R_A2 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } :
START_OF_FIELD '16R:' ~(START_OF_FIELD)+;
fld_25D_A2 returns [message::definition::swift::mt::Field fld] :
fld_25D_A2_D { $fld.MergeFrom($fld_25D_A2_D.fld); }
;
fld_16R_A2a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } :
START_OF_FIELD '16R:' ~(START_OF_FIELD)+;
fld_24B_A2a returns [message::definition::swift::mt::Field fld] :
fld_24B_A2a_B { $fld.MergeFrom($fld_24B_A2a_B.fld); }
;
fld_70D_A2a returns [message::definition::swift::mt::Field fld] :
fld_70D_A2a_D { $fld.MergeFrom($fld_70D_A2a_D.fld); }
;
fld_16S_A2a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } :
START_OF_FIELD '16S:' ~(START_OF_FIELD)+;
fld_16S_A2 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } :
START_OF_FIELD '16S:' ~(START_OF_FIELD)+;
fld_16S_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } :
START_OF_FIELD '16S:' ~(START_OF_FIELD)+;
fld_16R_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } :
START_OF_FIELD '16R:' ~(START_OF_FIELD)+;
fld_20D_B returns [message::definition::swift::mt::Field fld] :
fld_20D_B_D { $fld.MergeFrom($fld_20D_B_D.fld); }
;
fld_95a_B returns [message::definition::swift::mt::Field fld] :
fld_95a_B_P { $fld.MergeFrom($fld_95a_B_P.fld); }
| fld_95a_B_R { $fld.MergeFrom($fld_95a_B_R.fld); }
| fld_95a_B_S { $fld.MergeFrom($fld_95a_B_S.fld); }
| fld_95a_B_U { $fld.MergeFrom($fld_95a_B_U.fld); }
;
fld_94a_B returns [message::definition::swift::mt::Field fld] :
fld_94a_B_C { $fld.MergeFrom($fld_94a_B_C.fld); }
| fld_94a_B_D { $fld.MergeFrom($fld_94a_B_D.fld); }
| fld_94a_B_G { $fld.MergeFrom($fld_94a_B_G.fld); }
;
fld_13B_B returns [message::definition::swift::mt::Field fld] :
fld_13B_B_B { $fld.MergeFrom($fld_13B_B_B.fld); }
;
fld_98a_B returns [message::definition::swift::mt::Field fld] :
fld_98a_B_A { $fld.MergeFrom($fld_98a_B_A.fld); }
| fld_98a_B_C { $fld.MergeFrom($fld_98a_B_C.fld); }
;
fld_35B_B returns [message::definition::swift::mt::Field fld] :
fld_35B_B_B { $fld.MergeFrom($fld_35B_B_B.fld); }
;
fld_36B_B returns [message::definition::swift::mt::Field fld] :
fld_36B_B_B { $fld.MergeFrom($fld_36B_B_B.fld); }
;
fld_97A_B returns [message::definition::swift::mt::Field fld] :
fld_97A_B_A { $fld.MergeFrom($fld_97A_B_A.fld); }
;
fld_16S_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } :
START_OF_FIELD '16S:' ~(START_OF_FIELD)+;
fld_16R_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } :
START_OF_FIELD '16R:' ~(START_OF_FIELD)+;
fld_95a_C returns [message::definition::swift::mt::Field fld] :
fld_95a_C_P { $fld.MergeFrom($fld_95a_C_P.fld); }
| fld_95a_C_Q { $fld.MergeFrom($fld_95a_C_Q.fld); }
| fld_95a_C_R { $fld.MergeFrom($fld_95a_C_R.fld); }
;
fld_16S_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } :
START_OF_FIELD '16S:' ~(START_OF_FIELD)+;
fld_20C_A_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }:
START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ;
fld_23G_A_G returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("23G"); }:
START_OF_FIELD '23G:' ~(START_OF_FIELD)+ ;
fld_98a_A_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }:
START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ;
fld_98a_A_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }:
START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ;
fld_98a_A_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98E"); }:
START_OF_FIELD '98E:' ~(START_OF_FIELD)+ ;
fld_13a_A1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13A"); }:
START_OF_FIELD '13A:' ~(START_OF_FIELD)+ ;
fld_13a_A1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13B"); }:
START_OF_FIELD '13B:' ~(START_OF_FIELD)+ ;
fld_20C_A1_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }:
START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ;
fld_25D_A2_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("25D"); }:
START_OF_FIELD '25D:' ~(START_OF_FIELD)+ ;
fld_24B_A2a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("24B"); }:
START_OF_FIELD '24B:' ~(START_OF_FIELD)+ ;
fld_70D_A2a_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("70D"); }:
START_OF_FIELD '70D:' ~(START_OF_FIELD)+ ;
fld_20D_B_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20D"); }:
START_OF_FIELD '20D:' ~(START_OF_FIELD)+ ;
fld_95a_B_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }:
START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ;
fld_95a_B_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }:
START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ;
fld_95a_B_S returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95S"); }:
START_OF_FIELD '95S:' ~(START_OF_FIELD)+ ;
fld_95a_B_U returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95U"); }:
START_OF_FIELD '95U:' ~(START_OF_FIELD)+ ;
fld_94a_B_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94C"); }:
START_OF_FIELD '94C:' ~(START_OF_FIELD)+ ;
fld_94a_B_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94D"); }:
START_OF_FIELD '94D:' ~(START_OF_FIELD)+ ;
fld_94a_B_G returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94G"); }:
START_OF_FIELD '94G:' ~(START_OF_FIELD)+ ;
fld_13B_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13B"); }:
START_OF_FIELD '13B:' ~(START_OF_FIELD)+ ;
fld_98a_B_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }:
START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ;
fld_98a_B_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }:
START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ;
fld_35B_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("35B"); }:
START_OF_FIELD '35B:' ~(START_OF_FIELD)+ ;
fld_36B_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("36B"); }:
START_OF_FIELD '36B:' ~(START_OF_FIELD)+ ;
fld_97A_B_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97A"); }:
START_OF_FIELD '97A:' ~(START_OF_FIELD)+ ;
fld_95a_C_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }:
START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ;
fld_95a_C_Q returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95Q"); }:
START_OF_FIELD '95Q:' ~(START_OF_FIELD)+ ;
fld_95a_C_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }:
START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ;
TAG_BH : '{1:' ;
TAG_AH : '{2:' ;
TAG_UH : '{3:' ;
TAG_MT : '{4:' ;
TAG_TR : '{5:' ;
MT_END : '-}';
LBRACE : '{';
RBRACE : '}' ;
COLON : ':';
START_OF_FIELD : '\r'? '\n:' ;
ANY : . ; |
programs/oeis/119/A119581.asm | karttu/loda | 1 | 172321 | ; A119581: (2*n+n^2)*(binomial(2*n,n))/2.
; 0,3,24,150,840,4410,22176,108108,514800,2406690,11085360,50438388,227149104,1014058500,4493059200,19777483800,86555576160,376877404530,1633524354000,7051380128100,30326236340400,129989276677260
mov $1,$0
mov $6,$0
mul $0,2
mul $1,$6
add $1,$0
mov $3,$0
bin $3,$6
mov $4,$1
add $4,$1
mov $1,1
mov $2,$4
mov $5,1
mul $5,$3
mul $2,$5
add $1,$2
div $1,12
mul $1,3
|
test/NatTactic.agda | L-TChen/agda-prelude | 111 | 9399 | module NatTactic where
module _ where
open import Agda.Builtin.Nat
open import Agda.Builtin.List
-- n .. 1
downFrom : Nat β List Nat
downFrom zero = []
downFrom (suc n) = suc n β· downFrom n
module AgdaPreludeTest where
open import Prelude
open import Tactic.Nat
-- All tactics know about addition, multiplication and subtraction
-- of natural numbers, and can prove equalities and inequalities (_<_).
-- The available tactics are:
{-
auto
Prove an equation or inequality.
-}
auto-exampleβ : (a b : Nat) β (a - b) * (a + b) β‘ a ^ 2 - b ^ 2
auto-exampleβ a b = auto
auto-exampleβ : (a b : Nat) β (a + b) ^ 2 β₯ a ^ 2 + b ^ 2
auto-exampleβ a b = auto
{-
by eq
Prove the goal using the given assumption. For equalities it simplifies
the goal and the assumption and checks if they match any of the following
forms (up to symmetry):
a β‘ b β a β‘ b
a + b β‘ 0 β a β‘ 0
For inequalities, to prove a < b -> c < d, it simplifies the assumption and
goal and then tries to prove cβ² β€ aβ² and bβ² β€ dβ².
When proving that an inequality follows from an equality a β‘ b, the equality
is weakened to a β€ b before applying the above procedure.
Proving an equality from an inequality works if the inequality simplifies to
a β€ 0 (or a < 0 in which case it's trivial). It then reduces that to a β‘ 0
and tries to prove the goal from that.
-}
by-exampleβ : (xs ys : List Nat) β sum (xs ++ ys) β‘ sum ys + sum xs
by-exampleβ [] ys = auto
by-exampleβ (x β· xs) ys = by (by-exampleβ xs ys)
by-exampleβ : (a b c : Nat) β a + c < b + c β a < b
by-exampleβ a b c lt = by lt
by-exampleβ : (a b : Nat) β a β‘ b * 2 β a + b < (b + 1) * 3
by-exampleβ a b eq = by eq
by-exampleβ : (a b c : Nat) β a + b + c β€ b β 2 * c β‘ c
by-exampleβ a b c lt = by lt
by-exampleβ
: (a b c : Nat) β a + b β‘ b + c β 2 + a β‘ 1 + c + 1
by-exampleβ
a b c eq = by eq
{-
refute eq
Proves an arbitrary proposition given a false equation. Works for equations
that simplify to 0 β‘ suc n (or symmetric) or n < 0, for some n.
-}
refute-exampleβ : {Anything : Set} (a : Nat) β a β‘ 2 * a + 1 β Anything
refute-exampleβ a eq = refute eq
refute-exampleβ : {Anything : Set} (a b : Nat) β a + b < a β Anything
refute-exampleβ a b lt = refute lt
{-
simplify-goal ?
Simplify the current goal and let you keep working on the new goal.
In most cases 'by prf' works better than
'simplify-goal => prf' since it will also simplify prf. The advantage
of simplify-goal is that it allows holes in prf.
-}
simplify-goal-exampleβ : (a b : Nat) β a - b β‘ b - a β a β‘ b
simplify-goal-exampleβ zero b eq = by eq
simplify-goal-exampleβ (suc a) zero eq = refute eq
simplify-goal-exampleβ (suc a) (suc b) eq =
simplify-goal (simplify-goal-exampleβ a b eq)
-- Old goal: suc a β‘ suc b
-- New goal: a β‘ b
simplify-goal-exampleβ : (a b : Nat) β a - b β‘ b - a β a < suc b
simplify-goal-exampleβ zero b eq = by eq
simplify-goal-exampleβ (suc a) zero eq = refute eq
simplify-goal-exampleβ (suc a) (suc b) eq =
simplify-goal (simplify-goal-exampleβ a b eq)
-- Old goal: suc a β€ suc b
-- New goal: a β€ b
simplify-goal-exampleβ : (a b c : Nat) β a β‘ c β a + b β‘ b + c
simplify-goal-exampleβ a b c eq = simplify-goal eq
{-
simplify eq Ξ» x β ?
Simplify the given equation (and the current goal) and bind the simplified
equation to x in the new goal.
-}
lemmaβ : (a b : Nat) β a + b β‘ 0 β a β‘ 0
lemmaβ zero b eq = refl
lemmaβ (suc a) b eq = refute eq
simplify-exampleβ : β a b β (a + 1) * (b + 1) β‘ a * b + 1 β a β‘ 0
simplify-exampleβ a b eq = simplify eq Ξ» eqβ² β lemmaβ a b eqβ²
lemmaβ : (a b : Nat) β a + b β‘ 0 β a < suc 0
lemmaβ zero b eq = auto
lemmaβ (suc a) b eq = refute eq
simplify-exampleβ : β a b β (a + 1) * (b + 1) β‘ a * b + 1 β a < suc 0
simplify-exampleβ a b eq = simplify eq Ξ» eqβ² β by (lemmaβ a b eqβ²)
simplify-exampleβ : (a b c : Nat) β a + b β‘ b + c β 2 + a β‘ 1 + c + 1
simplify-exampleβ a b c eq = simplify eq Ξ» eqβ² β eqβ²
{-
induction
Prove a goal β n β P n using induction. Applies 'auto' in the base case
and 'by IH' in the step case.
-}
induction-exampleβ : β n β sum (downFrom n) * 2 β‘ n * (n + 1)
induction-exampleβ = induction
induction-exampleβ : β n β sum (downFrom n) * 2 < suc (n * (n + 1))
induction-exampleβ = induction
-- some equivalences needed to adapt Tactic.Nat to the standard library
module EquivalenceOfβ€ where
open import Agda.Builtin.Equality
open import Agda.Builtin.Nat
open import Data.Nat using (less-than-or-equal) renaming (_β€_ to _β€s_)
open import Data.Nat.Properties using (β€ββ€β³; β€β³ββ€)
open import Prelude using (diff; id) renaming (_β€_ to _β€p_)
open import Tactic.Nat.Generic (quote _β€p_) (quote id) (quote id) using (by)
β€pββ€s : β {a b} β a β€p b β a β€s b
β€pββ€s (diff k bβββ‘kββ+a) = β€β³ββ€ (less-than-or-equal {k = k} (by bβββ‘kββ+a))
β€sββ€p : β {a b} β a β€s b β a β€p b
β€sββ€p aβ€sb with β€ββ€β³ aβ€sb
β€sββ€p _ | less-than-or-equal {k = k} a+kβ‘b = diff k (by a+kβ‘b)
module StandardLibraryTest where
open import Agda.Builtin.Equality
open import Data.Nat
open import Data.List hiding (downFrom)
open import Function
private
infixr 8 _^_
_^_ : β β β β β
n ^ zero = 1
n ^ suc m = n ^ m * n
open EquivalenceOfβ€
open import Tactic.Nat.Generic (quote _β€_) (quote β€sββ€p) (quote β€pββ€s)
auto-exampleβ : (a b : β) β (a βΈ b) * (a + b) β‘ a ^ 2 βΈ b ^ 2
auto-exampleβ a b = auto
auto-exampleβ : (a b : β) β (a + b) ^ 2 β₯ a ^ 2 + b ^ 2
auto-exampleβ a b = auto
by-exampleβ : (xs ys : List β) β sum (xs ++ ys) β‘ sum ys + sum xs
by-exampleβ [] ys = auto
by-exampleβ (x β· xs) ys = by (by-exampleβ xs ys)
by-exampleβ : (a b c : β) β a + c < b + c β a < b
by-exampleβ a b c lt = by lt
by-exampleβ : (a b : β) β a β‘ b * 2 β a + b < (b + 1) * 3
by-exampleβ a b eq = by eq
by-exampleβ : (a b c : β) β a + b + c β€ b β 2 * c β‘ c
by-exampleβ a b c lt = by lt
by-exampleβ
: (a b c : β) β a + b β‘ b + c β 2 + a β‘ 1 + c + 1
by-exampleβ
a b c eq = by eq
refute-exampleβ : {Anything : Set} (a : β) β a β‘ 2 * a + 1 β Anything
refute-exampleβ a eq = refute eq
refute-exampleβ : {Anything : Set} (a b : β) β a + b < a β Anything
refute-exampleβ a b lt = refute lt
simplify-goal-exampleβ : (a b : β) β a βΈ b β‘ b βΈ a β a β‘ b
simplify-goal-exampleβ zero b eq = by eq
simplify-goal-exampleβ (suc a) zero eq = refute eq
simplify-goal-exampleβ (suc a) (suc b) eq =
simplify-goal (simplify-goal-exampleβ a b eq)
simplify-goal-exampleβ : (a b : β) β a βΈ b β‘ b βΈ a β a < suc b
simplify-goal-exampleβ zero b eq = by eq
simplify-goal-exampleβ (suc a) zero eq = refute eq
simplify-goal-exampleβ (suc a) (suc b) eq =
simplify-goal (by (simplify-goal-exampleβ a b eq))
simplify-goal-exampleβ : (a b c : β) β a β‘ c β a + b β‘ b + c
simplify-goal-exampleβ a b c eq = simplify-goal eq
lemmaβ : (a b : β) β a + b β‘ 0 β a β‘ 0
lemmaβ zero b eq = refl
lemmaβ (suc a) b eq = refute eq
simplify-exampleβ : β a b β (a + 1) * (b + 1) β‘ a * b + 1 β a β‘ 0
simplify-exampleβ a b eq = simplify eq Ξ» eqβ² β lemmaβ a b eqβ²
lemmaβ : (a b : β) β a + b β‘ 0 β a < suc 0
lemmaβ zero b eq = sβ€s zβ€n
lemmaβ (suc a) b eq = refute eq
simplify-exampleβ : β a b β (a + 1) * (b + 1) β‘ a * b + 1 β a < suc 0
simplify-exampleβ a b eq = simplify eq Ξ» eqβ² β by (lemmaβ a b eqβ²)
simplify-exampleβ : (a b c : β) β a + b β‘ b + c β 2 + a β‘ 1 + c + 1
simplify-exampleβ a b c eq = simplify eq Ξ» eqβ² β eqβ²
induction-exampleβ : β n β sum (downFrom n) * 2 β‘ n * (n + 1)
induction-exampleβ = induction
induction-exampleβ : β n β sum (downFrom n) * 2 < suc (n * (n + 1))
induction-exampleβ = induction
|
tier-1/gmp/source/gmp-discrete.ads | charlie5/cBound | 2 | 21551 |
private with GMP_c.mpz_t;
package GMP.discrete
--
--
--
is
type Integer is private;
-- forge
--
function to_Integer return Integer;
function to_Integer (From : long_long_Integer) return Integer;
function to_Integer (From : discrete.Integer) return Integer;
procedure define (Self : in out Integer);
procedure define (Self : in out Integer; Value : in long_long_Integer);
procedure define (Self : in out Integer; Value : in discrete.Integer);
procedure destroy (Self : in out Integer);
-- attributes
--
function Value (Self : in Integer) return long_long_Integer;
function Image (Self : in Integer) return String;
function hex_Image (Self : in Integer) return String;
function oct_Image (Self : in Integer) return String;
-- operations
--
function "=" (Left, Right : in Integer) return Boolean;
function "<" (Left, Right : in Integer) return Boolean;
function "+" (Left, Right : in Integer) return Integer;
function "-" (Left, Right : in Integer) return Integer;
function "*" (Left, Right : in Integer) return Integer;
function "/" (Left, Right : in Integer) return Integer;
function "**" (Left : in Integer; Right : in long_long_Integer) return Integer;
function "or" (Left, Right : in Integer) return Integer;
function "xor" (Left, Right : in Integer) return Integer;
function "and" (Left, Right : in Integer) return Integer;
function "-" (Self : in Integer) return Integer;
function "not" (Self : in Integer) return Integer;
private
type Integer is
record
Lean : GMP_c.mpz_t.Pointer;
end record;
end GMP.Discrete;
|
notes/thesis/report/CombiningProofs/CommAddGlobalHints.agda | asr/fotc | 11 | 11430 | <gh_stars>10-100
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module CombiningProofs.CommAddGlobalHints where
open import PA.Axiomatic.Standard.Base
+-leftIdentity : β n β zero + n β‘ n
+-leftIdentity = PAβ
+-rightIdentity : β n β n + zero β‘ n
+-rightIdentity = β-ind A A0 is
where
A : β β Set
A i = i + zero β‘ i
{-# ATP definition A #-}
A0 : A zero
A0 = +-leftIdentity zero
postulate is : β i β A i β A (succ i)
{-# ATP prove is #-}
x+Syβ‘S[x+y] : β m n β m + succ n β‘ succ (m + n)
x+Syβ‘S[x+y] m n = β-ind A A0 is m
where
A : β β Set
A i = i + succ n β‘ succ (i + n)
{-# ATP definition A #-}
postulate A0 : A zero
{-# ATP prove A0 #-}
postulate is : β i β A i β A (succ i)
{-# ATP prove is #-}
-- Global hints
{-# ATP hints x+Syβ‘S[x+y] +-rightIdentity #-}
+-comm : β m n β m + n β‘ n + m
+-comm m n = β-ind A A0 is m
where
A : β β Set
A i = i + n β‘ n + i
{-# ATP definition A #-}
postulate A0 : A zero
{-# ATP prove A0 #-}
postulate is : β i β A i β A (succ i)
{-# ATP prove is #-}
|
_build/dispatcher/jmp_ippsRSAEncrypt_PKCSv15_cc10ed28.asm | zyktrcn/ippcp | 1 | 241556 | extern m7_ippsRSAEncrypt_PKCSv15:function
extern n8_ippsRSAEncrypt_PKCSv15:function
extern y8_ippsRSAEncrypt_PKCSv15:function
extern e9_ippsRSAEncrypt_PKCSv15:function
extern l9_ippsRSAEncrypt_PKCSv15:function
extern n0_ippsRSAEncrypt_PKCSv15:function
extern k0_ippsRSAEncrypt_PKCSv15:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsRSAEncrypt_PKCSv15
.Larraddr_ippsRSAEncrypt_PKCSv15:
dq m7_ippsRSAEncrypt_PKCSv15
dq n8_ippsRSAEncrypt_PKCSv15
dq y8_ippsRSAEncrypt_PKCSv15
dq e9_ippsRSAEncrypt_PKCSv15
dq l9_ippsRSAEncrypt_PKCSv15
dq n0_ippsRSAEncrypt_PKCSv15
dq k0_ippsRSAEncrypt_PKCSv15
segment .text
global ippsRSAEncrypt_PKCSv15:function (ippsRSAEncrypt_PKCSv15.LEndippsRSAEncrypt_PKCSv15 - ippsRSAEncrypt_PKCSv15)
.Lin_ippsRSAEncrypt_PKCSv15:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsRSAEncrypt_PKCSv15:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsRSAEncrypt_PKCSv15]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsRSAEncrypt_PKCSv15:
|
Transynther/x86/_processed/AVXALIGN/_ht_st_zr_un_/i9-9900K_12_0xca.log_21829_1623.asm | ljhsiun2/medusa | 9 | 242656 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x6702, %r10
nop
nop
inc %r14
mov (%r10), %r8d
nop
nop
sub $22352, %rax
lea addresses_A_ht+0x17cf2, %r11
cmp $42409, %rax
mov $0x6162636465666768, %r12
movq %r12, %xmm4
movups %xmm4, (%r11)
nop
nop
nop
xor %r12, %r12
lea addresses_UC_ht+0xf2, %rsi
lea addresses_normal_ht+0x175f2, %rdi
nop
nop
nop
nop
nop
inc %rax
mov $111, %rcx
rep movsb
cmp $37241, %rsi
lea addresses_normal_ht+0x15572, %rsi
nop
nop
nop
cmp %r10, %r10
mov $0x6162636465666768, %r11
movq %r11, (%rsi)
nop
nop
nop
xor $38747, %r14
lea addresses_A_ht+0x1efb2, %rsi
lea addresses_WT_ht+0x150a, %rdi
nop
nop
nop
nop
add $33520, %rax
mov $26, %rcx
rep movsq
and %rcx, %rcx
lea addresses_WC_ht+0x612, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
dec %r12
movw $0x6162, (%rsi)
nop
dec %r8
lea addresses_A_ht+0x9272, %rsi
lea addresses_WC_ht+0x60f2, %rdi
clflush (%rsi)
nop
cmp %rax, %rax
mov $31, %rcx
rep movsw
nop
nop
nop
nop
add %r14, %r14
lea addresses_WT_ht+0xe262, %rsi
lea addresses_WT_ht+0x6872, %rdi
clflush (%rsi)
nop
nop
nop
nop
dec %r14
mov $114, %rcx
rep movsw
nop
nop
nop
xor %r14, %r14
lea addresses_UC_ht+0x1ca72, %r11
nop
nop
nop
nop
sub $45711, %rdi
movl $0x61626364, (%r11)
nop
nop
nop
nop
cmp $7067, %r12
lea addresses_WC_ht+0x40f2, %rsi
lea addresses_normal_ht+0x2372, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
add $12959, %r14
mov $105, %rcx
rep movsb
nop
and $36510, %r10
lea addresses_D_ht+0x146f2, %r12
clflush (%r12)
nop
nop
nop
nop
nop
add %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm1
vmovups %ymm1, (%r12)
nop
nop
nop
nop
add %rax, %rax
lea addresses_WT_ht+0x2af2, %rcx
nop
nop
nop
nop
nop
dec %rsi
mov (%rcx), %r10
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x1caf2, %rdi
nop
nop
nop
nop
nop
dec %r12
and $0xffffffffffffffc0, %rdi
vmovaps (%rdi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rcx
nop
nop
nop
sub %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r8
push %r9
push %rdx
push %rsi
// Store
lea addresses_WC+0x1a8f2, %r8
clflush (%r8)
nop
nop
nop
nop
sub %rdx, %rdx
movb $0x51, (%r8)
nop
nop
nop
nop
cmp $48368, %rsi
// Faulty Load
lea addresses_WC+0x1a8f2, %rsi
nop
inc %r8
movntdqa (%rsi), %xmm1
vpextrq $1, %xmm1, %rdx
lea oracles, %r9
and $0xff, %rdx
shlq $12, %rdx
mov (%r9,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %r9
pop %r8
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': True, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': True, 'AVXalign': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_UC_ht', 'congruent': 11}, 'dst': {'same': True, 'type': 'addresses_normal_ht', 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 9}}
{'49': 4, '3f': 48, '6c': 21, '45': 3872, '00': 17456, '48': 428}
00 00 6c 6c 6c 6c 6c 00 00 6c 00 6c 00 00 00 6c 6c 6c 00 6c 00 00 6c 00 6c 6c 6c 6c 6c 00 00 6c 00 00 6c 00 00 00 6c 00 6c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 45 00 00 00 00 00 45 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 45 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 45 45 00 00 45 45 00 45 45 00 45 45 00 45 00 00 45 45 45 00 00 00 00 45 00 00 45 45 00 45 45 00 45 45 00 00 45 45 45 00 45 00 00 45 00 45 00 45 00 00 00 00 00 45 45 45 00 00 45 45 45 45 00 45 00 00 45 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 45 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 45 45 45 00 00 45 45 00 45 45 00 45 00 00 45 00 00 45 45 45 45 45 45 45 45 45 00 00 45 45 45 00 45 45 45 00 00 00 45 00 00 00 00 45 45 00 45 45 45 45 00 45 00 45 45 00 45 45 00 45 00 45 45 00 45 00 45 45 00 00 45 45 45 00 00 45 00 45 00 00 45 45 00 45 00 48 48 00 48 48 48 00 48 48 48 48 48 45 48 45 00 48 00 48 00 00 48 48 00 00 00 48 48 45 00 48 00 48 48 48 48 00 48 00 00 45 00 00 00 00 00 00 00 00 00 48 48 00 48 00 48 00 00 48 45 45 00 48 48 45 00 48 48 48 48 00 48 00 48 00 48 00 00 48 48 00 00 48 48 48 48 48 00 48 00 48 48 00 00 00 00 00 00 00 45 00 48 00 48 48 48 48 48 00 48 48 48 00 48 00 00 48 00 00 48 48 00 48 48 00 00 48 00 00 48 00 48 00 48 48 00 00 00 00 00 00 48 00 48 48 48 48 00 48 48 00 00 00 00 00 00 45 00 45 00 00 00 00 00 00 00 00 00 45 00 00 45 00 45 45 45 45 00 45 00 00 45 00 00 45 45 00 45 00 45 00 45 45 45 00 45 00 45 45 45 00 00 00 45 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 45 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Chapter1/#9.agda | CodaFi/HoTT-Exercises | 0 | 11132 | <reponame>CodaFi/HoTT-Exercises
module #9 where
{-
Define the type family Fin : N β U mentioned at the end of Β§1.3, and the dependent
function fmax : β(n:N) Fin(n + 1) mentioned in Β§1.4.
-}
open import Data.Nat
data Fin : β β Set where
FZ : {n : β} β Fin (suc n)
FS : {n : β} β Fin n β Fin (suc n)
fmax : (n : β) β Fin (n + 1)
fmax zero = FZ
fmax (suc n) = FS (fmax n)
|
src/libriscv-except.ads | Fabien-Chouteau/libriscv | 0 | 28611 | <reponame>Fabien-Chouteau/libriscv
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, <NAME> --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
package LibRISCV.Except is
type Kind is
(
Instruction_Address_Misaligned,
Instruction_Access_Fault,
Illegal_Instruction,
Breakpoint,
Load_Address_Misaligned,
Load_Access_Fault,
Store_AMO_Address_Misaligned,
Store_AMO_Access_Fault,
Environment_Call_From_U_mode,
Environment_Call_From_S_mode,
Environment_Call_From_M_mode,
Instruction_Page_Fault,
Load_Page_Fault,
Store_AMO_Page_Fault,
User_Soft_Int,
Supervisor_Soft_Int,
Hypervisor_Soft_Int,
Machine_Soft_Int,
User_Timer_Int,
Supervisor_Timer_Int,
Hypervisor_Timer_Int,
Machine_Timer_Int,
User_External_Int,
Supervisor_External_Int,
Hypervisor_External_Int,
Machine_External_Int,
Reserved);
Interrupt_Flag : constant := 16#80_00_00_00#;
for Kind use
(
Instruction_Address_Misaligned => 16#00_00_00_00#,
Instruction_Access_Fault => 16#00_00_00_01#,
Illegal_Instruction => 16#00_00_00_02#,
Breakpoint => 16#00_00_00_03#,
Load_Address_Misaligned => 16#00_00_00_04#,
Load_Access_Fault => 16#00_00_00_05#,
Store_AMO_Address_Misaligned => 16#00_00_00_06#,
Store_AMO_Access_Fault => 16#00_00_00_07#,
Environment_Call_From_U_mode => 16#00_00_00_08#,
Environment_Call_From_S_mode => 16#00_00_00_09#,
Environment_Call_From_M_mode => 16#00_00_00_0B#,
Instruction_Page_Fault => 16#00_00_00_0C#,
Load_Page_Fault => 16#00_00_00_0D#,
Store_AMO_Page_Fault => 16#00_00_00_0F#,
User_Soft_Int => 16#80_00_00_00#,
Supervisor_Soft_Int => 16#80_00_00_01#,
Hypervisor_Soft_Int => 16#80_00_00_02#,
Machine_Soft_Int => 16#80_00_00_03#,
User_Timer_Int => 16#80_00_00_04#,
Supervisor_Timer_Int => 16#80_00_00_05#,
Hypervisor_Timer_Int => 16#80_00_00_06#,
Machine_Timer_Int => 16#80_00_00_07#,
User_External_Int => 16#80_00_00_08#,
Supervisor_External_Int => 16#80_00_00_09#,
Hypervisor_External_Int => 16#80_00_00_0A#,
Machine_External_Int => 16#80_00_00_0B#,
Reserved => 16#FF_FF_FF_FF#);
end LibRISCV.Except;
|
src/grammar/mcbLexer.g4 | boon4681/mcb | 3 | 207 | lexer grammar mcbLexer;
import UnicodeClasses;
/*START HEADER GENERATED BY G4GEN*/
tokens {
COMMANDS
}
/*END HEADER GENERATED BY G4GEN*/
Comment: '//' ~[\r\n]* -> channel(HIDDEN);
WS: [\u0020\u0009\u000C] -> channel(HIDDEN);
NL: '\n' | '\r' '\n'?;
fragment Hidden: Comment | WS;
// OPERATIONS
DOT: '.';
COMMA: ',';
LPAREN: '(' -> pushMode(Inside);
RPAREN: ')';
LSQUARE: '[' -> pushMode(DEFAULT_MODE);
RSQUARE: ']';
LCURL: '{' -> pushMode(DEFAULT_MODE);
RCURL: '}';
HASH: '#';
RANGE: (FloatNS | IntegerLiteral) '..' (FloatNS | IntegerLiteral) | (FloatNS | IntegerLiteral) '..' | '..' (FloatNS | IntegerLiteral);
MULT: '*';
MOD: '%';
DIV: '/';
ADD: '+';
SUB: '-';
COLON: ':';
// COLON: ':'-> pushMode(DEFAULT_MODE);
NOT_WS: '!' Hidden;
NOT_NO_WS: '!';
TYPE: 'int' | 'bool' | 'array' | 'map';
CONJ: 'and';
DISJ: 'or';
ASSIGNMENT: '=';
MULT_ASSIGNMENT: '*=';
MOD_ASSIGNMENT: '%=';
DIVINE_ASSIGNMENT: '/=';
ADD_ASSIGNMENT: '+=';
SUB_ASSIGNMENT: '-=';
LANGLE: '<';
RANGLE: '>';
LE: '<=';
GE: '>=';
MC_NOT_EQ: '=!';
AT_N_WS: '@';
AT_P_WS: Hidden '@';
AT_S_WS: '@' Hidden;
AT_B_WS: Hidden '@' Hidden;
// ENTITY: (AT_N_WS|AT_P_WS)[asrep];
ENTITY_SUFFIX: [asrep];
POS: '~';
POS_P_WS: Hidden '~';
POS_S_WS: '~' Hidden;
ANC: '^';
ANC_P_WS: Hidden '^';
ANC_S_WS: '^' Hidden;
// KEYWORDS
FUN: 'fun';
END: 'end';
IF: 'if';
LET: 'let';
K_MATCHES: 'matches';
K_DATA: 'data';
K_ENTITY: 'entity';
K_BLOCK: 'block';
K_STORAGE: 'storage';
K_PREDICATE: 'predicate';
K_SCORE: 'score';
ELSE: 'else';
WHILE: 'while';
REPEAT: 'repeat';
UNTIL: 'until';
FOR: 'for';
IN: 'in';
/*START COMMANDS ZONE GENERATED BY G4GEN*/
COMMANDS: (
'advancement'
| 'attribute'
| 'execute'
| 'bossbar'
| 'clear'
| 'clone'
| 'data'
| 'datapack'
| 'debug'
| 'defaultgamemode'
| 'difficulty'
| 'effect'
| 'me'
| 'enchant'
| 'experience'
| 'xp'
| 'fill'
| 'forceload'
| 'function'
| 'gamemode'
| 'gamerule'
| 'give'
| 'help'
| 'item'
| 'kick'
| 'kill'
| 'list'
| 'locate'
| 'locatebiome'
| 'loot'
| 'msg'
| 'tell'
| 'w'
| 'particle'
| 'placefeature'
| 'playsound'
| 'reload'
| 'recipe'
| 'say'
| 'schedule'
| 'scoreboard'
| 'seed'
| 'setblock'
| 'spawnpoint'
| 'setworldspawn'
| 'spectate'
| 'spreadplayers'
| 'stopsound'
| 'summon'
| 'tag'
| 'team'
| 'teammsg'
| 'tm'
| 'teleport'
| 'tp'
| 'tellraw'
| 'time'
| 'title'
| 'trigger'
| 'weather'
| 'worldborder'
| 'jfr'
| 'ban-ip'
| 'banlist'
| 'ban'
| 'deop'
| 'op'
| 'pardon'
| 'pardon-ip'
| 'perf'
| 'save-all'
| 'save-off'
| 'save-on'
| 'setidletimeout'
| 'stop'
| 'whitelist'
| 'publish'
) -> pushMode(Commands), type(COMMANDS);
/*END COMMANDS ZONE GENERATED BY G4GEN*/
// LITERALS
fragment DIGIT: '0' ..'9';
fragment DigitNoZero: '1' ..'9';
fragment DIGITS: DIGIT DIGIT*;
fragment Double: DIGITS? '.' DIGITS;
RealLiteral: FloatLiteral | DoubleLiteral;
FloatNS: Double;
FloatLiteral: Double [fF];
DoubleLiteral: Double [dD];
IntegerLiteral: DigitNoZero DIGIT* | DIGIT;
fragment UnicodeDigit: UNICODE_CLASS_ND;
fragment Letter:
UNICODE_CLASS_LU
| UNICODE_CLASS_LL
| UNICODE_CLASS_LT
| UNICODE_CLASS_LM
| UNICODE_CLASS_LO;
Identifier: (Letter | '_' | '#' | '.') (
Letter
| '_'
| '#'
| '.'
| '@'
| UnicodeDigit
)*;
QUOTE_OPEN: '"' -> pushMode(LineString);
mode LineString;
QUOTE_CLOSE: '"' -> popMode;
LineStrText: ~('"')+;
mode Commands;
COMMANDS_END: NL -> popMode;
CommandStr: ~([\n\r])+ -> popMode;
mode Inside;
I_RPAREN: RPAREN -> popMode, type(RPAREN);
I_RSQUARE: RSQUARE -> popMode, type(RSQUARE);
I_LPAREN: LPAREN -> pushMode(Inside), type(LPAREN);
I_LSQUARE: LSQUARE -> pushMode(Inside), type(LSQUARE);
I_LCURL: LCURL -> pushMode(DEFAULT_MODE), type(LCURL);
I_RCURL: RCURL -> popMode, type(RCURL);
I_DOT: DOT -> type(DOT);
I_COMMA: COMMA -> type(COMMA);
I_MULT: MULT -> type(MULT);
I_MOD: MOD -> type(MOD);
I_DIV: DIV -> type(DIV);
I_ADD: ADD -> type(ADD);
I_SUB: SUB -> type(SUB);
I_COLON: COLON -> type(COLON);
I_HASH: HASH -> type(HASH);
I_NOT_WS: NOT_WS -> type(NOT_WS);
I_NOT_NO_WS: NOT_NO_WS -> type(NOT_NO_WS);
I_MC_NOT_EQ: MC_NOT_EQ -> type(MC_NOT_EQ);
I_CONJ: CONJ -> type(CONJ);
I_DISJ: DISJ -> type(DISJ);
I_REPEAT: REPEAT -> type(REPEAT);
I_UNTIL: UNTIL -> type(UNTIL);
I_FOR: FOR -> type(FOR);
I_IN: IN -> type(IN);
I_POS: POS -> type(POS);
I_POS_P_WS: POS_P_WS -> type(POS_P_WS);
I_POS_S_WS: POS_S_WS -> type(POS_S_WS);
I_ANC: ANC -> type(ANC);
I_ANC_P_WS: ANC_P_WS -> type(ANC_P_WS);
I_ANC_S_WS: ANC_S_WS -> type(ANC_S_WS);
I_ASSIGNMENT: ASSIGNMENT -> type(ASSIGNMENT);
I_MULT_ASSIGNMENT: MULT_ASSIGNMENT -> type(MULT_ASSIGNMENT);
I_MOD_ASSIGNMENT: MOD_ASSIGNMENT -> type(MOD_ASSIGNMENT);
I_DIVINE_ASSIGNMENT:
DIVINE_ASSIGNMENT -> type(DIVINE_ASSIGNMENT);
I_ADD_ASSIGNMENT: ADD_ASSIGNMENT -> type(ADD_ASSIGNMENT);
I_SUB_ASSIGNMENT: SUB_ASSIGNMENT -> type(SUB_ASSIGNMENT);
I_RANGE: RANGE -> type(RANGE);
I_AT_N_WS: AT_N_WS -> type(AT_N_WS);
IAT_S_WS: AT_S_WS -> type(AT_S_WS);
I_AT_P_WS: AT_P_WS -> type(AT_P_WS);
I_AT_B_WS: AT_B_WS -> type(AT_B_WS);
// I_ENTITY: ENTITY -> type(ENTITY);
I_ENTITY_SUFFIX: ENTITY_SUFFIX -> type(ENTITY_SUFFIX);
I_LANGLE: LANGLE -> type(LANGLE);
I_RANGLE: RANGLE -> type(RANGLE);
I_LE: LE -> type(LE);
I_GE: GE -> type(GE);
/*START I_COMMANDS ZONE GENERATED BY G4GEN*/
I_COMMANDS: COMMANDS -> pushMode(Commands), type(COMMANDS);
/*END I_COMMANDS ZONE GENERATED BY G4GEN*/
I_QUOTE_OPEN:
QUOTE_OPEN -> pushMode(LineString), type(QUOTE_OPEN);
I_FUN: FUN -> type(FUN);
I_IF: IF -> type(IF);
I_ELSE: ELSE -> type(ELSE);
I_LET: LET -> type(LET);
I_TYPE: TYPE -> type(TYPE);
I_K_MATCHES: K_MATCHES -> type(K_MATCHES);
I_K_DATA: K_DATA -> type(K_DATA);
I_K_ENTITY: K_ENTITY -> type(K_ENTITY);
I_K_BLOCK: K_BLOCK -> type(K_BLOCK);
I_K_STORAGE: K_STORAGE -> type(K_STORAGE);
I_K_PREDICATE: K_PREDICATE -> type(K_PREDICATE);
I_K_SCORE: K_SCORE -> type(K_SCORE);
// I_END: END -> popMode, type(END);
I_END: END -> type(END);
I_WHILE: WHILE -> type(WHILE);
I_RealLiteral: RealLiteral -> type(RealLiteral);
I_IntegerLiteral: IntegerLiteral -> type(IntegerLiteral);
I_Identifier: Identifier -> type(Identifier);
I_Comment: Comment -> channel(HIDDEN);
I_WS: WS -> channel(HIDDEN);
I_NL: NL -> channel(HIDDEN);
mode DEFAULT_MODE;
ErrorCharacter: .; |
src/LibraBFT/Impl/Handle/InitProperties.agda | LaudateCorpus1/bft-consensus-agda | 0 | 5111 | <reponame>LaudateCorpus1/bft-consensus-agda<gh_stars>0
{- 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 Dijkstra.EitherD
open import LibraBFT.Impl.Consensus.EpochManagerTypes
open import LibraBFT.Impl.Handle
open InitHandler
import LibraBFT.Impl.IO.OBM.GenKeyFile as GenKeyFile
import LibraBFT.Impl.IO.OBM.Properties.Start as Start
import LibraBFT.Impl.Properties.Util as Util
import LibraBFT.Impl.Types.BlockInfo as BlockInfo
import LibraBFT.Impl.Types.ValidatorSigner as ValidatorSigner
open import LibraBFT.ImplShared.Consensus.Types
open import LibraBFT.ImplShared.Consensus.Types.EpochIndep
open import LibraBFT.ImplShared.Interface.Output
open import Optics.All
open import Util.Prelude
open import Yasm.Types as YT
module LibraBFT.Impl.Handle.InitProperties where
------------------------------------------------------------------------------
------------------------------------------------------------------------------
open Util.Invariants
open Util.InitProofDefs
module getEmRmSpec
(em : EpochManager)
where
Contract : EitherD-Post ErrLog RoundManager
Contract (Left x) = β€
Contract (Right rm) = rm IsNormalRoundManagerOf em
contract' : EitherD-weakestPre (getEmRm-ed-abs em) Contract
contract' rewrite getEmRm-ed-absβ‘
with em ^β emProcessor | inspect (_^β emProcessor) em
...| nothing | _ = tt
...| just (RoundProcessorRecovery x) | _ = tt
...| just (RoundProcessorNormal x) | [ refl ] = refl
module initializeSpec
(now : Instant)
(nfl : GenKeyFile.NfLiwsVsVvPe)
where
contract' : EitherD-weakestPre (initialize-ed-abs now nfl) (InitContract nothing)
contract' rewrite initialize-ed-absβ‘ =
Start.startViaConsensusProviderSpec.contract'
now
nfl
(TxTypeDependentStuffForNetworkβnew proposalGenerator (StateComputerβnew BlockInfo.gENESIS_VERSION))
module initEMWithOutputSpec
(bsi : BootstrapInfo)
(vs : ValidatorSigner)
where
contract' : EitherD-weakestPre (initEMWithOutput-ed-abs bsi vs) (InitContract nothing)
contract' rewrite initEMWithOutput-ed-absβ‘ = initializeSpec.contract' now (mkNfLiwsVsVvPe bsi vs)
module initRMWithOutputSpec
(bsi : BootstrapInfo)
(vs : ValidatorSigner)
where
Contract : EitherD-Post ErrLog (RoundManager Γ List Output)
Contract (Left x) = β€
Contract (Right (rm , outs)) = InitContractOk nothing rm outs
open initRMWithOutput-ed bsi vs
contract-stepβ : β {em lo}
β EMInitCond nothing (em , lo)
β EitherD-weakestPre (stepβ (em , lo)) Contract
contract-stepβ {em} {lo} (rm , inrm , cntrctOk) =
EitherD-β-bind (getEmRm-ed-abs em)
(getEmRmSpec.contract' em)
PβQ
where
PβQ : EitherD-Post-β (getEmRmSpec.Contract em)
(EitherD-weakestPre-bindPost (Ξ» rm β RightD (rm , lo)) Contract)
PβQ (Left x) _ = tt
PβQ (Right rm') pf .rm' refl rewrite IsNormalRoundManagerOf-inj {em} inrm pf = cntrctOk
contract' : EitherD-weakestPre (initRMWithOutput-ed-abs bsi vs) Contract
contract' rewrite initRMWithOutput-ed-absβ‘ =
EitherD-β-bind (initEMWithOutput-ed-abs bsi vs)
(initEMWithOutputSpec.contract' bsi vs)
PβQ
where
PβQ : EitherD-Post-β (InitContract nothing) _
PβQ (Left x) _ = tt
PβQ (Right (em , lo)) pf .(em , lo) refl = contract-stepβ pf
contract : Contract (initRMWithOutput-e-abs bsi vs)
contract rewrite initRMWithOutputβ‘ {bsi} {vs} =
EitherD-contract (initRMWithOutput-ed-abs bsi vs) Contract contract'
------------------------------------------------------------------------------
module initHandlerSpec
(pid : Author)
(bsi : BootstrapInfo)
where
record ContractOk (rm : RoundManager) (acts : List (YT.Action NetworkMsg)) : Set where
constructor mkContractOk
field
rmInv : Util.Invariants.RoundManagerInv rm
sdLVnothing : InitSdLVβ‘ rm nothing
sigsβbs : InitSigsβbs rm
isInitPM : InitIsInitPM acts
-- TODO-3: We will eventually need to know that our ValidatorSigner is for the correct peer,
-- because it will be needed to prove impl-sps-avp : StepPeerState-AllValidParts
Contract : Maybe (RoundManager Γ List (YT.Action NetworkMsg)) β Set
Contract nothing = β€
Contract (just (rm , acts)) = ContractOk rm acts
-- TODO-2: this property is more succinctly/elegantly stated as Contract (initHandler pid bsi),
-- and can be proved by starting the proof as follows:
--
-- contract : Contract (initHandler pid bsi)
-- contract with initHandler pid bsi | inspect (initHandler pid) bsi
-- ...| nothing | _ = tt
-- ...| just (rm , acts) | [ hndlβ‘just ]
--
-- However, this breaks a bunch of proofs that use this, so not doing it for now.
contract : β {x} β initHandler pid bsi β‘ x β Contract x
contract {nothing} hndlβ‘nothing rewrite sym hndlβ‘nothing = tt
contract {just (rm , acts)} hndlβ‘just
with ValidatorSigner.obmGetValidatorSigner pid (bsi ^β bsiVSS)
...| Left _ = absurd nothing β‘ just _ case hndlβ‘just of Ξ» ()
...| Right vs
with initRMWithOutputSpec.contract bsi vs
...| initRMWithOutputContractOk
with initRMWithOutput-e-abs bsi vs
...| Left _ = absurd nothing β‘ just (rm , acts) case hndlβ‘just of Ξ» ()
...| Right rmΓouts rewrite sym (cong projβ (just-injective hndlβ‘just)) |
(cong projβ (just-injective hndlβ‘just)) =
mkContractOk
(InitContractOk.rmInv initRMWithOutputContractOk)
(InitContractOk.sdLVβ‘ initRMWithOutputContractOk)
(InitContractOk.sigsβbs initRMWithOutputContractOk)
(InitContractOk.isInitPM initRMWithOutputContractOk)
|
so/overlay/src/test.asm | bmnascimento/von-neumann-simulator | 0 | 24442 | <gh_stars>0
; comentario
@ 10
os fff
hm
#
|
Main.asm | DevEd2/JetpackDude | 4 | 102924 | ; ================================================================
; Jetpack Dude - a Game Boy game by DevEd
; ================================================================
; Debug flag
; If set to 1, enable debugging features.
DebugFlag set 1
; ================================================================
; Project includes
; ================================================================
include "Variables.asm"
include "Constants.asm"
include "Macros.asm"
include "hardware.inc"
; ================================================================
; Reset vectors (actual ROM starts here)
; ================================================================
SECTION "Reset $00",HOME[$00]
Reset00: ret
SECTION "Reset $08",HOME[$08]
Reset08: ret
SECTION "Reset $10",HOME[$10]
Reset10: ret
SECTION "Reset $18",HOME[$18]
Reset18: ret
SECTION "Reset $20",HOME[$20]
Reset20: ret
SECTION "Reset $28",HOME[$28]
Reset28: ret
SECTION "Reset $30",HOME[$30]
Reset30: ret
SECTION "Reset $38",HOME[$38]
Reset38: jp ErrorHandler
; ================================================================
; Interrupt vectors
; ================================================================
SECTION "VBlank interrupt",HOME[$40]
IRQ_VBlank:
call DoVBlank
reti
SECTION "LCD STAT interrupt",HOME[$48]
IRQ_STAT:
reti
SECTION "Timer interrupt",HOME[$50]
IRQ_Timer:
reti
SECTION "Serial interrupt",HOME[$58]
IRQ_Serial:
reti
SECTION "Joypad interrupt",Home[$60]
IRQ_Joypad:
reti
; ================================================================
; System routines
; ================================================================
include "SystemRoutines.asm"
; ================================================================
; ROM header
; ================================================================
SECTION "ROM header",HOME[$100]
EntryPoint:
nop
jp ProgramStart
NintendoLogo: ; DO NOT MODIFY!!!
db $ce,$ed,$66,$66,$cc,$0d,$00,$0b,$03,$73,$00,$83,$00,$0c,$00,$0d
db $00,$08,$11,$1f,$88,$89,$00,$0e,$dc,$cc,$6e,$e6,$dd,$dd,$d9,$99
db $bb,$bb,$67,$63,$6e,$0e,$ec,$cc,$dd,$dc,$99,$9f,$bb,$b9,$33,$3e
ROMTitle: db "JETPACKDUDE" ; ROM title (11 bytes)
ProductCode: db "AJDE" ; Product code (4 bytes)
GBCSupport: db 0 ; GBC support (0 = DMG only, $80 = DMG/GBC, $C0 = GBC only)
NewLicenseCode: dw 0 ; new license code (2 bytes)
SGBSupport: db 0 ; SGB support
CartType: db $19 ; Cart type, see hardware.inc for a list of values
ROMSize: ds 1 ; ROM size (handled by post-linking tool)
RAMSize: db 0 ; RAM size
DestCode: db 1 ; Destination code (0 = Japan, 1 = All others)
OldLicenseCode: db $33 ; Old license code (if $33, check new license code)
ROMVersion: db 0 ; ROM version
HeaderChecksum: ds 1 ; Header checksum (handled by post-linking tool)
ROMChecksum: ds 2 ; ROM checksum (2 bytes) (handled by post-linking tool)
; ================================================================
; Start of program code
; ================================================================
ProgramStart:
di ; disable interrupts
push af
and a ; same as cp 0
jr z,.dontCheckGBType ; if GBType check has already run, don't do it again
ld a,IEF_VBLANK
ldh [rIE],a ; set VBlank interrupt flag
call ClearWRAM
ld a,%11100100
ldh [rBGP],a
ei
call PalFadeOut
ld a,%00000000
ldh [rBGP],a
halt
xor a
ld [rLCDC],a ; disable LCD
di
call ClearVRAM
; clear HRAM
ld a,0
ld bc,$6060
.loop
ld [c],a
inc c
dec b
jr nz,.loop
ld a,%11100100
ldh [rBGP],a ; set background palette
; Routine to check which Game Boy model we're running on
pop af
ld hl,GBType
cp $11 ; check for GBC
jr z,.gbc ; if on GBC, jump
cp $FF ; check for GBP
jr z,.gbp ; if on GBP, jump
.dmg ; if not on GBC or GBP, assume DMG
; call TestSGB ; check for SGB (NYI)
; jr z,.sgb ; if on SGB, jump (NYI)
xor a ; GBType = 0 (DMG)
jr .setSystem
.gbp
; call TestSGB ; check for SGB2 (NYI)
; jr z,.sgb2 ; if on SGB2, jump (NYI)
ld a,1 ; GBType = 1 (GBP)
jr .setSystem
.gbc
bit 0,b ; check for GBA
ld a,2 ; GBType = 2 (GBC)
jr z,.setSystem ; if not on GBA, jump
inc a ; GBType = 3 (GBA)
.setSystem
ld [hl+],a
ld a,1
ld [hl],a
.dontCheckGBType
call CopyOAMDMARoutine
if DebugFlag==1
xor a ; set game mode to 0 (debug menu)
else
ld a,GM_SplashScreen
endc
call SetGameMode
; call InitPlayer
; call StartMusic
ei ; enable interrupts
; ================================================================
; Main game loop
; ================================================================
MainLoop:
; call UpdateMusic
ld a,[GameMode]
cp 7
jr c,.continue ; if current game mode is less than 7, jump
jp MainLoop_end
.continue
add a
add a,GameModeProcTable%256
ld l,a
adc a,GameModeProcTable/256
sub l
ld h,a
ld a,[hl+]
ld h,[hl]
ld l,a
jp [hl] ; jump to main program processing routine
MainLoop_end:
halt
jp MainLoop
; ================================================================
; Game mode initialization
; ================================================================
SetGameMode:
ld [GameMode],a ; store current game mode
cp 7
jr c,.init ; if current game mode is less than 7, jump
ret ; else, return
.init
ld a,[rLCDC]
or a
jr z,.continue
xor a
ldh [rLCDC],a
.continue
call ClearScreen
ld a,[GameMode]
add a
add a,GameModeInitTable%256
ld l,a
adc a,GameModeInitTable/256
sub l
ld h,a
ld a,[hl+]
ld h,[hl]
ld l,a
jp [hl]
GameModeInitTable:
dw InitDebugMenu
dw InitSplashScreen
dw InitTestScreen
dw InitSoundTest
dw InitTitleScreen
dw InitLevelSelect
dw InitOptionsMenu
dw InitPasswordMenu
dw InitLevel
InitDebugMenu:
call StopMusic
xor a
ldh [rSCY],a
ldh [rSCX],a
ld [CurrentMenuItem],a
or %11100100
ldh [rBGP],a ; set palette
call ClearScreen
CopyTileset1BPP Font,0,(Font_End-Font)/8
ld hl,DebugMenuText
call LoadMapText
jp InitDone
InitSplashScreen:
call StopSound
xor a
ldh [rSCY],a
ldh [rSCX],a
ldh [rBGP],a ; clear palette
ld [FadeState],a
call ClearScreen
CopyTileset SplashScreenGFX,0,79
ld hl,SplashScreenTilemap
call LoadMap
ld a,$f0
ld [ScreenTimer],a
ld a,6
ld [FadeTimer],a
jp InitDone
InitTestScreen:
call StopSound
ld a,$70
ldh [rSCX],a
ldh [rSCY],a
ld a,%11100100
ldh [rBGP],a ; set palette
call ClearScreen
ld a,1
ld [rROMB0],a
CopyTileset TestTileset,0,30
ld hl,TestTilemap
call LoadMapFull
call ParTile_Init
jp InitDone
InitSoundTest:
call StopSound
xor a
ldh [rSCY],a
ldh [rSCX],a
ld [CurrentMenuItem],a
or %11100100
ldh [rBGP],a ; set palette
call ClearScreen
CopyTileset1BPP Font,0,97
ld hl,SoundTestTilemap
call LoadMapText
jp InitDone
InitTitleScreen:
call StopSound
xor a
ldh [rSCY],a
ldh [rSCX],a
or %11100100
ldh [rBGP],a ; set palette
call ClearScreen
CopyTileset1BPP Font,0,97
ld hl,TitleScreenTilemap
call LoadMapText
jp InitDone
InitLevelSelect:
call StopSound
xor a
ldh [rSCY],a
ldh [rSCX],a
ld [CurrentMenuItem],a
or %11100100
ldh [rBGP],a ; set palette
call ClearScreen
CopyTileset1BPP Font,0,97
ld hl,LevelSelectTilemap
call LoadMapText
jp InitDone
InitOptionsMenu:
call StopSound
xor a
ldh [rSCY],a
ldh [rSCX],a
ld [CurrentMenuItem],a
or %11100100
ldh [rBGP],a ; set palette
call ClearScreen
CopyTileset1BPP Font,0,97
ld hl,OptionsMenuTilemap
call LoadMapText
jp InitDone
InitPasswordMenu:
call StopSound
xor a
ldh [rSCY],a
ldh [rSCX],a
or %11100100
ldh [rBGP],a ; set palette
call ClearScreen
CopyTileset1BPP Font,0,97
ld hl,PasswordMenuTilemap
call LoadMapText
jp InitDone
InitLevel:
call StopSound
xor a
ldh [rSCY],a
ldh [rSCX],a
or %11100100
ldh [rBGP],a ; set palette
call ClearScreen
CopyTileset1BPP Font,0,97
ld hl,LevelErrorTilemap
call LoadMapText
InitDone:
ld a,%10010001
ldh [rLCDC],a
ret
; ================================================================
; Game mode processing table
; ================================================================
GameModeProcTable:
dw ProcessDebugMenu
dw ProcessSplashScreen
dw ProcessTestScreen
dw ProcessSoundTest
dw ProcessTitleScreen
dw ProcessLevelSelect
dw ProcessOptionsMenu
dw ProcessPasswordMenu
dw ProcessLevel
; ================================================================
; Process debug menu
; ================================================================
ProcessDebugMenu:
call CheckInput
ld a,[sys_btnPress]
bit btnUp,a
jp nz,.prevItem
bit btnDown,a
jp nz,.nextItem
bit btnA,a
jp nz,.selectItem
bit btnB,a
jp nz,.exit
bit btnStart,a
jp nz,.selectItem
bit btnSelect,a
jp nz,.nextItem
jp .continue
.prevItem
ld a,[CurrentMenuItem]
ld [OldMenuItem],a
or a
jr z,.iszero
dec a
jr .setitem
.iszero
ld a,4
jr .setitem
.nextItem
ld a,[CurrentMenuItem]
ld [OldMenuItem],a
cp 4
jr z,.ismax
inc a
jr .setitem
.ismax
xor a
.setitem
ld [CurrentMenuItem],a
jr .continue
.selectItem
ld a,[CurrentMenuItem]
add a,a
add a,DebugMenuItemList%256
ld l,a
adc a,DebugMenuItemList/256
sub l
ld h,a
ld a,[hl]
inc hl
ld h,[hl]
ld l,a
call .executeItem
jr .continue
.executeItem
jp [hl]
.exit
; TODO
.continue
ld a,[GameMode]
or a
jr z,.debug
jp MainLoop_end
.debug
ld hl,$9880
call ClearCursor
ld hl,$9880
call DrawCursor
ld a,[DebugEnabled]
ld hl,$9912
call DrawCheckbox
jp MainLoop_end
DebugMenuItemList:
dw .startGame
dw .testScreen
dw .levelSelect
dw .soundTest
dw .toggleDebug
.startGame
call PalFadeOut
ld a,GM_SplashScreen
call SetGameMode
ret
.testScreen
ld a,GM_TestScreen
call SetGameMode
ret
.levelSelect
call PalFadeOut
ld a,GM_LevelSelect
call SetGameMode
ret
.soundTest
call PalFadeOut
ld a,GM_SoundTest
call SetGameMode
ret
.toggleDebug
ld a,[DebugEnabled]
xor 1
ld [DebugEnabled],a
ret
; ================================================================
; Process splash screen
; ================================================================
ProcessSplashScreen:
call PalFadeIn
Splash_Wait:
halt
call CheckInput
ld a,[sys_btnPress]
bit btnStart,a
jr nz,.fadeOut
ld a,[ScreenTimer]
dec a
ld [ScreenTimer],a
and a
jr nz,Splash_Wait
.fadeOut
call PalFadeOut
.exit
ld a,GM_TitleScreen
call SetGameMode
.continue
jp MainLoop_end
; ================================================================
; Process test screen
; ================================================================
ProcessTestScreen:
call CheckInput
ld a,[sys_btnPress]
bit btnB,a
jr nz,.exit ; if user presses B, return to debug menu
; Update the ParallaxTile.
; For every two pixels the camera moves, shift the tile one pixel in the
; opposite direction. Note that this implmentation is pretty much hardcoded
; so it will only work if the camera moves two pixels per frame.
; TODO: Modify this so the camera can move at any arbitrary speed and it will
; still work properly.
ld a,rSCY-$ff00
ld c,a ; c = SCY
ld a,[sys_btnHold]
bit btnUp,a
call nz,.decSCY
bit btnDown,a
call nz,.incSCY
inc c ; c = SCX
bit btnLeft,a
call nz,.decSCX
bit btnRight,a
call nz,.incSCX
jr .continue
.decSCY
ld a,[c]
sub 2
ld [c],a
call ParTile_ShiftUp
ld a,[sys_btnHold]
ret
.incSCY
ld a,[c]
add 2
ld [c],a
call ParTile_ShiftDown
ld a,[sys_btnHold]
ret
.decSCX
ld a,[c]
sub 2
ld [c],a
call ParTile_ShiftLeft
ld a,[sys_btnHold]
ret
.incSCX
ld a,[c]
add 2
ld [c],a
call ParTile_ShiftRight
ld a,[sys_btnHold]
ret
.exit
ld a,GM_DebugMenu
call SetGameMode
.continue
jp MainLoop_end
; ================================================================
; Process sound test menu
; ================================================================
ProcessSoundTest:
call CheckInput
ld a,[sys_btnPress]
bit btnUp,a
jp nz,.prevItem
bit btnDown,a
jp nz,.nextItem
bit btnLeft,a
jp nz,.prevSound
bit btnRight,a
jp nz,.nextSound
bit btnA,a
jp nz,.selectItem
bit btnB,a
jp nz,.stopSound
bit btnStart,a
jp nz,.exit
bit btnSelect,a
jp nz,.nextItem
jp .continue
.prevItem
ld a,[CurrentMenuItem]
ld [OldMenuItem],a
or a
jr z,.iszero
dec a
jr .setitem
.iszero
ld a,2
jr .setitem
.nextItem
ld a,[CurrentMenuItem]
ld [OldMenuItem],a
cp 2
jr z,.ismax
inc a
jr .setitem
.ismax
xor a
.setitem
ld [CurrentMenuItem],a
jr .continue
.nextSound
ld a,[CurrentMenuItem]
and a
jr z,.nextSong
dec a
jr z,.nextSFX
dec a
jr z,.continue
.nextSong
ld a,[SoundTestMusicID]
inc a
ld [SoundTestMusicID],a
jr .continue
.nextSFX
ld a,[SoundTestSFXID]
inc a
ld [SoundTestSFXID],a
jr .continue
.prevSound
ld a,[CurrentMenuItem]
and a
jr z,.prevSong
dec a
jr z,.prevSFX
dec a
jr z,.continue
.prevSong
ld a,[SoundTestMusicID]
dec a
ld [SoundTestMusicID],a
jr .continue
.prevSFX
ld a,[SoundTestSFXID]
dec a
ld [SoundTestSFXID],a
jr .continue
.selectItem
ld a,[CurrentMenuItem]
add a,a
add a,SoundTestItemList%256
ld l,a
adc a,SoundTestItemList/256
sub l
ld h,a
ld a,[hl]
inc hl
ld h,[hl]
ld l,a
call .executeItem
jr .continue
.stopSound
call StopSound
jr .continue
.executeItem
jp [hl]
.exit
call PalFadeOut
ld a,GM_DebugMenu
call SetGameMode
.continue
ld a,[GameMode]
cp GM_SoundTest
jr z,.isSoundTest
jp MainLoop_end
.isSoundTest
ld a,[SoundTestMusicID]
ld hl,$9849
call DrawHex
ld a,[SoundTestSFXID]
ld hl,$9869
call DrawHex
ld hl,$9840
call ClearCursor
ld hl,$9840
call DrawCursor
call PrintSongName
call PrintAuthorName
jp MainLoop_end
SoundTestItemList:
dw .playSong
dw .playSFX
dw .exit
.playSong
ld a,[SoundTestMusicID]
call PlaySong
ret
.playSFX
ld a,[SoundTestSFXID]
call PlaySFX
ret
.exit
call PalFadeOut
ld a,GM_DebugMenu
call SetGameMode
ret
PrintSongName:
ld a,[SoundTestMusicID]
add a,a
add a,SongNameTable%256
ld l,a
adc a,SongNameTable/256
sub l
ld h,a
ld a,[hl]
inc hl
ld h,[hl]
ld l,a
ld de,$9900
call PrintLine
ret
PrintAuthorName:
ld a,[SoundTestMusicID]
add a,a
add a,AuthorNameTable%256
ld l,a
adc a,AuthorNameTable/256
sub l
ld h,a
ld a,[hl]
inc hl
ld h,[hl]
ld l,a
ld de,$9920
call PrintLine
ret
SongNameTable:
dw SongName_Introtune
dw SongName_MenuTheme
dw SongName_Fruitless
dw SongName_Soundcheck
dw SongName_Train
dw SongName_Oldschool
dw SongName_Fruitful
dw SongName_FishFiles
dw SongName_LoOp
dw SongName_20y
dw SongName_Gejmbaj
dw SongName_Oh
dw SongName_Pocket
dw SongName_Demotronic
SongName_Introtune: db "Introtune",0
SongName_MenuTheme: db "Menu theme",0
SongName_Fruitless: db "Fruitless",0
SongName_Soundcheck: db "Soundcheck",0
SongName_Train: db "Train",0
SongName_Oldschool: db "Oldschool",0
SongName_Fruitful: db "Fruitful",0
SongName_FishFiles: db "The Fish Files",0
SongName_LoOp: db "LoOp",0
SongName_20y: db "20y",0
SongName_Gejmbaj: db "Gejmbaj",0
SongName_Oh: db "Oh!",0
SongName_Pocket: db "Demo in Pocket?",0
SongName_Demotronic: db "Demotronic",0
AuthorNameTable:
dw AuthorName_DevEd
dw AuthorName_DevEd
dw AuthorName_Heatbeat
dw AuthorName_Heatbeat
dw AuthorName_Heatbeat
dw AuthorName_Heatbeat
dw AuthorName_Heatbeat
dw AuthorName_SimoneC
dw AuthorName_Piksi
dw AuthorName_Nordloef
dw AuthorName_Nordloef
dw AuthorName_Nordloef
dw AuthorName_Nordloef
dw AuthorName_Unknown
AuthorName_DevEd: db "<NAME> (DevEd)",0
AuthorName_Heatbeat: db "<NAME>",0
AuthorName_SimoneC: db "<NAME>",0
AuthorName_Piksi: db "Piksi",0
AuthorName_Nordloef: db "Nordloef",0
AuthorName_Unknown: db "Unknown",0
; ================================================================
; Process title screen
; ================================================================
ProcessTitleScreen:
call CheckInput
ld a,[sys_btnPress]
bit btnB,a
jr nz,.exit
jr .continue
.exit
ld a,GM_DebugMenu
call SetGameMode
.continue
jp MainLoop_end
; ================================================================
; Process level select menu
; ================================================================
ProcessLevelSelect:
call CheckInput
ld a,[sys_btnPress]
bit btnB,a
jr nz,.exit
jr .continue
.exit
ld a,GM_DebugMenu
call SetGameMode
.continue
jp MainLoop_end
; ================================================================
; Process options menu
; ================================================================
ProcessOptionsMenu:
call CheckInput
ld a,[sys_btnPress]
bit btnB,a
jr nz,.exit
jr .continue
.exit
ld a,GM_DebugMenu
call SetGameMode
.continue
jp MainLoop_end
; ================================================================
; Process password menu
; ================================================================
ProcessPasswordMenu:
call CheckInput
ld a,[sys_btnPress]
bit btnB,a
jr nz,.exit
jr .continue
.exit
ld a,GM_DebugMenu
call SetGameMode
.continue
jp MainLoop_end
; ================================================================
; Level processing
; ================================================================
ProcessLevel:
call CheckInput
ld a,[sys_btnPress]
bit btnB,a
jr nz,.exit
jr .continue
.exit
ld a,GM_DebugMenu
call SetGameMode
.continue
jp MainLoop_end
SECTION "Other routines",HOME
; ================================================================
; Other routines
; ================================================================
; ================================================================
; Fade in from white
; ================================================================
PalFadeIn:
xor a
ldh [rBGP],a ; clear palette
ld [FadeState],a
add 6
ld [FadeTimer],a
.loop
halt ; wait for VBlank
ld a,[FadeTimer]
dec a
ld [FadeTimer],a
and a
jr nz,.loop
ld a,6
ld [FadeTimer],a
ld a,[FadeState]
inc a
ld [FadeState],a
cp 1
jr z,.state0
cp 2
jr z,.state1
cp 3
jr z,.state2
ret
.state0
ld a,%01000000
jr .setpal
.state1
ld a,%10010000
jr .setpal
.state2
ld a,%11100100
.setpal
ldh [rBGP],a
jr .loop
; ================================================================
; Fade out to white
; ================================================================
PalFadeOut:
ld a,3
ld [FadeState],a
add a
ld [FadeTimer],a
ld a,%11100100
ldh [rBGP],a
.loop
halt ; wait for VBlank
ld a,[FadeTimer]
dec a
ld [FadeTimer],a
and a
jr nz,.loop
ld a,6
ld [FadeTimer],a
ld a,[FadeState]
dec a
ld [FadeState],a
and a
jr z,.state0
cp 1
jr z,.state1
cp 2
jr z,.state2
cp $ff
jr z,.endfade
jr .loop
.state0
ld a,%00010001
ldh [rNR50],a
ld a,%00000000
jr .setpal
.state1
ld a,%00110011
ldh [rNR50],a
ld a,%01000000
jr .setpal
.state2
ld a,%01010101
ldh [rNR50],a
ld a,%10010000
.setpal
ldh [rBGP],a
jr .loop
.endfade
ldh [rBGP],a
ret
; ================================================================
; Fade in from black
; ================================================================
PalFadeInBlack:
ld a,$ff
ldh [rBGP],a ; clear palette
inc a
ld [FadeState],a
add 6
ld [FadeTimer],a
.loop
halt ; wait for VBlank
ld a,[FadeTimer]
dec a
ld [FadeTimer],a
and a
jr nz,.loop
ld a,6
ld [FadeTimer],a
ld a,[FadeState]
inc a
ld [FadeState],a
cp 1
jr z,.state0
cp 2
jr z,.state1
cp 3
jr z,.state2
ret
.state0
ld a,%11111110
jr .setpal
.state1
ld a,%11111001
jr .setpal
.state2
ld a,%11100100
.setpal
ldh [rBGP],a
jr .loop
; ================================================================
; Fade out to black
; ================================================================
PalFadeOutBlack:
ld a,3
ld [FadeState],a
add a
ld [FadeTimer],a
ld a,%11100100
ldh [rBGP],a
.loop
halt ; wait for VBlank
ld a,[FadeTimer]
dec a
ld [FadeTimer],a
and a
jr nz,.loop
ld a,6
ld [FadeTimer],a
ld a,[FadeState]
dec a
ld [FadeState],a
and a
jr z,.state0
cp 1
jr z,.state1
cp 2
jr z,.state2
cp $ff
jr z,.endfade
jr .loop
.state0
ld a,%00010001
ldh [rNR50],a
ld a,%11111111
jr .setpal
.state1
ld a,%00110011
ldh [rNR50],a
ld a,%11111110
jr .setpal
.state2
ld a,%01010101
ldh [rNR50],a
ld a,%11111001
.setpal
ldh [rBGP],a
jr .loop
.endfade
ldh [rBGP],a
ret
; ================================================================
; Load a text tilemap
; ================================================================
LoadMapText:
ld de,_SCRN0
ld b,$12
ld c,$14
.loop
ld a,[hl+]
sub 32
ld [de],a
inc de
dec c
jr nz,.loop
ld c,$14
ld a,e
add $C
jr nc,.continue
inc d
.continue
ld e,a
dec b
jr nz,.loop
ret
; ================================================================
; Draw a menu cursor starting at address HL
; ================================================================
DrawCursor:
ld a,[CurrentMenuItem]
swap a
rl a
add l
ld l,a
jr nc,.nocarry
inc h
ld a,h
.nocarry
ld a,">" - 32
ld [hl],a
ret
; ================================================================
; Clear a menu cursor
; ================================================================
ClearCursor:
ld a,[OldMenuItem]
swap a
rl a
add l
ld l,a
jr nc,.nocarry
inc h
ld a,h
.nocarry
ld a," " - 32
ld [hl],a
ret
; ================================================================
; Draw a checkbox at HL with value A
; ================================================================
DrawCheckbox:
bit 0,a
ld a,$5f
jr nz,.checked
jr .draw
.checked
inc a
.draw
ld [hl],a
ret
; ================================================================
; Do VBlank stuff
; ================================================================
DoVBlank:
push af
ld a,2
ld [rROMB0],a
call $4006 ; update SFX
ld a,[PlayMusic]
and a
jr z,.incFrame
ld a,[MusicBank]
ld [rROMB0],a
call $4100 ; update music
.incFrame:
ld a,[CurrentFrame]
inc a
ld [CurrentFrame],a
.updateParTile
ld a,[GameMode]
cp GM_TestScreen
jr nz,.dontUpdate
call ParTile_CopyToVRAM
.dontUpdate
pop af
ret
; ================================================================
; Print a line of text
; INPUT: hl = address of text, de = destination address
; ================================================================
PrintLine:
ld a,20
ld b,a
.loop
ld a,[hl+]
and a
jr z,.endOfString
sub 32
ld [de],a
inc de
dec b
jr nz,.loop
.endOfString
xor a
.loop2
ld [de],a
inc de
dec b
jr nz,.loop2
ret
; ================================================================
; Play a song
; INPUT: a = song ID
; ================================================================
PlaySong:
add 3
ld [MusicBank],a
ld [rROMB0],a
call $4003
ld a,1
ld [PlayMusic],a
ld a,%01110111
ldh [rNR50],a
ret
; ================================================================
; Stop playing a song
; ================================================================
StopSong:
ld a,[MusicBank]
ld [rROMB0],a
call $4006
xor a
ld [PlayMusic],a
ret
; ================================================================
; Play a sound effect
; INPUT: a = SFX ID
; ================================================================
PlaySFX:
push af
ld a,2
ld [rROMB0],a
pop af
call $4000 ; play sound effect
ld a,%01110111
ldh [rNR50],a
ret
; ================================================================
; Stop playing a sound effect
; ================================================================
StopSFX:
ld a,2
ld [rROMB0],a
call $4003 ; stop sound effect
ret
; ================================================================
; Stop all sound
; ================================================================
StopSound:
xor a
ld [PlayMusic],a
ld a,3
ld [rROMB0],a
call $4006
ld a,2
ld [rROMB0],a
call $4003
ret
; ================================================================
; Main font
; ================================================================
Font: incbin "Data/Font_1BPP.bin"
Font_End:
SplashScreenGFX: incbin "Data/SplashScreenGFX.bin"
; ================================================================
; Tilemaps
; ================================================================
SECTION "Tilemaps",HOME
DebugMenuText:
; ####################
db " Jetpack Dude v0.1 "
db " by DevEd "
db " <EMAIL> "
db " "
db " Start game "
db " Test screen "
db " Level select "
db " Sound test "
db " Debug mode ? " ; "?" is replaced with check box graphic
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
SplashScreenTilemap:
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$01,$02,$05,$00,$00,$00,$00,$00,$00,$26,$29,$2a,$00,$00,$43,$00,$00,$00
db $00,$00,$03,$04,$06,$07,$00,$00,$00,$00,$27,$28,$00,$00,$00,$3b,$44,$00,$00,$00
db $00,$00,$08,$09,$0b,$0c,$17,$18,$00,$1f,$2b,$2c,$2f,$30,$00,$3c,$45,$00,$00,$00
db $00,$00,$0a,$00,$0d,$0e,$19,$1a,$20,$21,$2d,$2e,$31,$32,$3d,$3e,$46,$00,$00,$00
db $00,$00,$0f,$10,$13,$14,$1b,$1c,$22,$23,$33,$34,$37,$38,$3f,$40,$47,$00,$00,$00
db $00,$00,$11,$12,$15,$16,$1d,$1e,$24,$25,$35,$36,$39,$3a,$41,$42,$48,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$49,$4a,$4b,$4c,$4b,$4d,$4e,$4c,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
TestScreenTilemap:
; ####################
db "Placeholder for "
db "test screen. "
db " "
db "Press B to return to"
db "the debug menu. "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
SoundTestTilemap:
; ####################
db "Sound test "
db " "
db " Music $?? " ; ?? is replaced with music ID
db " SFX $?? " ; ?? is replaced with SFX ID
db " Exit "
db " "
db " "
db "Now playing: "
db " " ; song name goes here
db " " ; author goes here
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
TitleScreenTilemap:
; ####################
db "Placeholder for "
db "title screen. "
db " "
db "Press B to return to"
db "the debug menu. "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
LevelSelectTilemap:
; ####################
db "Placeholder for "
db "level select screen."
db " "
db "Press B to return to"
db "the debug menu. "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
OptionsMenuTilemap:
; ####################
db "Placeholder for "
db "options menu. "
db " "
db "Press B to return to"
db "the debug menu. "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
PasswordMenuTilemap:
; ####################
db "Placeholder for "
db "password screen. "
db " "
db "Press B to return to"
db "the debug menu. "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
LevelErrorTilemap:
; ####################
db " - ERROR - "
db " "
db "Level ?? does not " ; ?? is replaced with level number
db "exist. "
db " "
db "Press B to return to"
db "the debug menu. "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
db " "
; ####################
; ================================================================
; Error handler
; ================================================================
SECTION "Error handler",HOME
ErrorHandler:
; store stack pointer
ld [tempSP],sp
push hl
push af
; store AF
pop hl
ld a,h
ldh [tempAF],a
ld a,l
ldh [tempAF+1],a
; store BC
ld a,b
ldh [tempBC],a
ld a,c
ldh [tempBC+1],a
; store DE
ld a,d
ldh [tempDE],a
ld a,e
ldh [tempDE+1],a
; store HL
pop hl
ld a,h
ldh [tempHL],a
ld a,l
ldh [tempHL+1],a
; store PC
pop hl ; hl = old program counter
ld a,h
ldh [tempPC],a
ld a,l
ldh [tempPC+1],a
; store IF
ldh a,[rIF]
ldh [tempIF],a
; store IE
ldh a,[rIE]
ldh [tempIE],a
.wait ; wait for VBlank before disabling the LCD
ldh a,[rLY]
cp $90
jr nz,.wait
; Note that it probably isn't a good idea to use halt to wait for VBlank
; because interrupts may not be enabled when an error occurs.
xor a
ldh [rLCDC],a ; disable LCD
call ClearVRAM
CopyTileset1BPP Font,0,97
ld hl,ErrorHandlerTilemap
call LoadMapText
DrawRegisterValues:
ld de,tempAF
ld hl,$9965
ld a,[de]
inc de
call DrawHex
ld a,[de]
inc de
call DrawHex
ld hl,$996f
ld a,[de]
inc de
call DrawHex
ld a,[de]
inc de
call DrawHex
ld hl,$9985
ld a,[de]
inc de
call DrawHex
ld a,[de]
inc de
call DrawHex
ld hl,$998f
ld a,[de]
inc de
call DrawHex
ld a,[de]
inc de
call DrawHex
inc de
inc de
ld hl,$99af
ld a,[de]
inc de
call DrawHex
ld a,[de]
inc de
call DrawHex
ld hl,$99a5
ld a,[tempSP+1]
call DrawHex
ld a,[tempSP]
call DrawHex
; TODO: Draw IF and IE
ld a,[rIF]
ld b,a
ld hl,$99c8
call DrawBin
ld a,[rIE]
ld b,a
ld hl,$99e8
call DrawBin
ld a,%10010001
ldh [rLCDC],a
call StopSound
ErrorHandler_loop:
call CheckInput
ld a,[sys_btnPress]
bit btnStart,a
jr z,.continue
jp ProgramStart
.continue
halt
jr ErrorHandler_loop
DrawBin:
bit 7,b
call nz,.draw1
call z,.draw0
bit 6,b
call nz,.draw1
call z,.draw0
bit 5,b
call nz,.draw1
call z,.draw0
bit 4,b
call nz,.draw1
call z,.draw0
bit 3,b
call nz,.draw1
call z,.draw0
bit 2,b
call nz,.draw1
call z,.draw0
bit 1,b
call nz,.draw1
call z,.draw0
bit 0,b
call nz,.draw1
ret nz
.draw0
ld a,"0" - 32
ld [hl+],a
ret
.draw1
ld a,"1" - 32
ld [hl+],a
ret
ErrorHandlerTilemap:
; ####################
db " - ERROR - "
db " "
db "An error has occured"
db "and the game cannot "
db "continue. Contact "
db "the following email "
db "address to report "
db "this error: "
db " <EMAIL> " ; you can replace this with your own email address
db " "
db "Registers: "
db " AF=$???? BC=$???? "
db " DE=$???? HL=$???? "
db " SP=$???? PC=$???? "
db " IF=%XXXXXXXX "
db " IE=%XXXXXXXX "
db " "
db "Press Start to exit."
; ####################
; ================================================================
; Load a map which takes up the entire tilemap area rather than
; just the visible screen area
; ================================================================
LoadMapFull:
ld de,_SCRN0
ld bc,$2020
.loop
ld a,[hl+]
ld [de],a
inc de
dec c
jr nz,.loop
ld c,$20
dec b
jr nz,.loop
ret
; ================================================================
; Parallax tile functions
; ================================================================
ParTileID equ 1
ParTile_Init:
ld a,1
ld [rROMB0],a
ld hl,TestTileset+(ParTileID*$10)
ld de,ParTileBuffer
call ParTile_CopyLoop
ld hl,TestTileset+$10
call ParTile_CopyLoop
ret
ParTile_CopyToVRAM:
; normal parallax tile
ld hl,ParTileBuffer
ld de,$8010
call ParTile_CopyLoop
; dark parallax tile
ld hl,ParTileBuffer
ld de,$8120
ld a,$10
ld b,a
.loop
ld a,[hl+]
xor %11111111
ld [de],a
inc de
dec b
jr nz,.loop
ret
ParTile_CopyToFirstBuffer:
ld hl,ParTileBuffer+$10
ld de,ParTileBuffer
call ParTile_CopyLoop
ret
ParTile_CopyToSecondBuffer:
ld hl,ParTileBuffer
ld de,ParTileBuffer+$10
call ParTile_CopyLoop
ret
ParTile_ShiftUp:
push bc
push hl
push de
ld hl,ParTileBuffer+$10 ; parallax tile source
ld de,ParTileBuffer ; parallax tile destination
push hl
inc hl
inc hl
ld a,14
ld b,a
.loop
ld a,[hl+]
ld [de],a
inc de
dec b
jr nz,.loop
pop hl
ld a,2
ld b,a
.loop2
ld a,[hl+]
ld [de],a
inc de
dec b
jr nz,.loop2
call ParTile_CopyToSecondBuffer
pop de
pop hl
pop bc
ret
ParTile_ShiftDown:
push bc
push hl
push de
ld hl,ParTileBuffer+$10 ; parallax tile source
ld de,ParTileBuffer ; parallax tile destination
push hl
ld a,14
add l
ld l,a
jr nc,.nocarry
inc h
.nocarry
ld a,2
ld b,a
.loop
ld a,[hl+]
ld [de],a
inc de
dec b
jr nz,.loop
pop hl
ld a,14
ld b,a
.loop2
ld a,[hl+]
ld [de],a
inc de
dec b
jr nz,.loop2
call ParTile_CopyToSecondBuffer
pop de
pop hl
pop bc
ret
ParTile_ShiftLeft:
push bc
push hl
push de
ld hl,ParTileBuffer ; parallax tile source
ld de,ParTileBuffer ; parallax tile destination
ld a,16
ld b,a
.loop
ld a,[hl+]
rlc a
jr nc,.nocarry
set 0,a
.nocarry
ld [de],a
inc de
dec b
jr nz,.loop
call ParTile_CopyToSecondBuffer
pop de
pop hl
pop bc
ret
ParTile_ShiftRight:
push bc
push hl
push de
ld hl,ParTileBuffer ; parallax tile source
ld de,ParTileBuffer ; parallax tile destination
ld a,16
ld b,a
.loop
ld a,[hl+]
rrc a
jr nc,.nocarry
set 7,a
.nocarry
ld [de],a
inc de
dec b
jr nz,.loop
call ParTile_CopyToSecondBuffer
pop de
pop hl
pop bc
ret
ParTile_CopyLoop:
ld a,$10
ld b,a
.loop
ld a,[hl+]
ld [de],a
inc de
dec b
jr nz,.loop
ret
; ================================================================
; OAM DMA routine
; ================================================================
CopyOAMDMARoutine:
ld hl,_OAM_DMA
ld de,OAM_DMA
ld a,_OAM_DMA_End-_OAM_DMA
ld b,a
.loop
ld a,[hl+]
ld [de],a
inc de
dec b
jr nz,.loop
ret
_OAM_DMA:
ldh [rDMA],a
ld a,$28
.loop
dec a
jr nz,.loop
ret
_OAM_DMA_End:
; ================================================================
; Graphics data
; ================================================================
SECTION "Graphics data",ROMX,BANK[1]
TestTileset: incbin "Data/TestTileset.bin"
TestTilemap: incbin "Data/TestTilemap.bin"
; ================================================================
; SFX data
; ================================================================
SECTION "SFX data",ROMX,BANK[2]
SFXData: incbin "SFXData.bin"
; ================================================================
; Music data
; ================================================================
SECTION "Introtune",ROMX,BANK[3]
Music_Introtune: incbin "Music/Introtune.bin"
SECTION "Menu Theme",ROMX,BANK[4]
Music_MenuTheme: incbin "Music/MenuTheme.bin"
SECTION "Fruitless",ROMX,BANK[5]
Music_Fruitless: incbin "Music/Fruitless.bin"
SECTION "Soundcheck",ROMX,BANK[6]
Music_Soundcheck: incbin "Music/Soundcheck.bin"
SECTION "Train",ROMX,BANK[7]
Music_Train: incbin "Music/Train.bin"
SECTION "Oldschool",ROMX,BANK[8]
Music_Oldschool: incbin "Music/Oldschool.bin"
SECTION "Fruitful",ROMX,BANK[9]
Music_Fruitful: incbin "Music/Fruitful.bin"
SECTION "The Fish Files",ROMX,BANK[$a]
Music_FishFiles: incbin "Music/FishFiles.bin"
SECTION "LoOp",ROMX,BANK[$b]
Music_LoOp: incbin "Music/LoOp.bin"
SECTION "20y",ROMX,BANK[$c]
Music_20y: incbin "Music/20y.bin"
SECTION "Gejmbaj",ROMX,BANK[$d]
Music_Gejmbaj: incbin "Music/Gejmbaj.bin"
SECTION "Oh!",ROMX,BANK[$e]
Music_Oh: incbin "Music/Oh.bin"
SECTION "Is That A Demo In Your Pocket?",ROMX,BANK[$f]
Music_Pocket: incbin "Music/Pocket.bin"
SECTION "Demotronic",ROMX,BANK[$10]
Music_Demotronic: incbin "Music/Demotronic.bin"
|
libsrc/z80_crt0s/z80/sccz80/l_long_and.asm | jpoikela/z88dk | 38 | 101561 | ; Z88 Small C+ Run Time Library
; Long functions
;
SECTION code_crt0_sccz80
PUBLIC l_long_and
; primary = dehl
; stack = secondary, ret
; 90 cycles
.l_long_and
pop ix
pop bc
ld a,c
and l
ld l,a
ld a,b
and h
ld h,a
pop bc
ld a,c
and e
ld e,a
ld a,b
and d
ld d,a
jp (ix)
; 127 cycles
;
;.l_long_and
; ld a,d
; exx ;primary
; pop bc;
; pop hl
; pop de
; push bc
; and d
; ld d,a
; ld a,e
; exx ;2nd
; and e
; exx ;1st
; ld e,a
; ld a,h
; exx ;2nd
; and h
; exx ;1st
; ld h,a
; ld a,l
; exx ;2nd
; and l
; exx ;1st
; ld l,a
; ret
; primary = dehl
; stack = secondary, ret addr
; 141 cycles but doesn't use EXX
;
;.l_long_and
;
; pop bc
; ex de,hl
; ex (sp),hl
; ld a,l
; and e
; ld l,a
; ld a,h
; and d
; ld h,a
; pop de
; ex (sp),hl
; ld a,l
; and e
; ld e,a
; ld a,h
; and d
; ld d,a
; pop hl
; push bc
; ret
|
oeis/196/A196678.asm | neoneye/loda-programs | 11 | 92092 | <reponame>neoneye/loda-programs
; A196678: a(n) = 5*binomial(4*n+5,n)/(4*n+5).
; Submitted by <NAME>
; 1,5,30,200,1425,10626,81900,647280,5217300,42724825,354465254,2973052680,25168220350,214762810500,1845308367000,15951899986272,138638564739180,1210677947695620,10617706139119000,93477423115076000,825846068580413265,7319332249607500650,65058648497791638300,579823436203778286000,5180264647136387581500,46386581423327457224094,416240901187149363553620,3742350934663932150849520,33708053316912234339176300,304130532025753862448520200,2748377326828388491467969584,24873670044221008486134648000
mov $1,$0
mul $0,2
mov $2,5
add $2,$0
add $0,$2
bin $0,$1
mul $0,10
mul $1,2
add $2,$1
div $0,$2
div $0,2
|
Install_iTunes_12.6_in_High_Sierra.scpt | b0gdanw/iTunes | 0 | 3897 | --Script to install iTunes 12.6.5.3 in macOS High Sierra, along iTunes 12.8.2
--Download iTunes 12.6.5.3 dmg from https://support.apple.com/kb/HT208079
set theDMG to choose file with prompt "Please select iTunes dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "cd ~/tmp/iTunesX.pkg; cat Payload | gunzip -dc |cpio -i; ditto ~/tmp/iTunesX.pkg/Applications/iTunes.app /Applications/iTunes12.6.app;"
do shell script "rm -rf ~/tmp"
display dialog "iTunes12.6.app was copied to /Applications" buttons {"Ok"}
|
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_1568.asm | ljhsiun2/medusa | 9 | 6519 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rax
push %rbx
lea addresses_A_ht+0xc14, %rax
nop
nop
nop
add %r9, %r9
movb $0x61, (%rax)
add $8719, %rbx
pop %rbx
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_PSE+0x1bc18, %rdi
nop
inc %r8
mov $0x5152535455565758, %r9
movq %r9, %xmm3
vmovups %ymm3, (%rdi)
nop
nop
nop
cmp $43072, %r8
// REPMOV
lea addresses_normal+0x4a18, %rsi
lea addresses_A+0x13818, %rdi
nop
add %rbp, %rbp
mov $18, %rcx
rep movsb
nop
nop
nop
nop
nop
and %r13, %r13
// Store
lea addresses_RW+0x2218, %rbp
nop
add %rcx, %rcx
mov $0x5152535455565758, %r8
movq %r8, %xmm2
vmovups %ymm2, (%rbp)
and %rsi, %rsi
// Faulty Load
lea addresses_PSE+0x1bc18, %rdi
nop
nop
nop
xor %r8, %r8
mov (%rdi), %r9w
lea oracles, %r8
and $0xff, %r9
shlq $12, %r9
mov (%r8,%r9,1), %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
master/gr_common/core/utility/T4_src/checksum/rx/cksum_rx_little.asm | tarosay/v2wrbbfirm | 0 | 246246 | .ifdef __RX
.SECTION P,CODE
.glb __cksum
.else
.file "cksum_rx_little.asm"
.section .text.ck
.global __cksum
.endif
__cksum: ; function: _cksum
.ifdef __RX
.stack __cksum=4
.else
;uint16 _cksum(uchar *data, uint16 nbytes, uint16 sum0);
and #0ffffh, r2 ;arg2 uint16
and #0ffffh, r3 ;arg3 uint16
.endif
cmp #0, r2
beq CKSUM_ZERO_EXIT
btst #0, r1
beq CKSUM_EVEN
; data is odd
add #-1, r1
movu.w [r1+], r4
revw r3, r3
revw r4, r4
and #0ffH, r4
revw r4, r4
add r4, r3
add #-1, r2
shlr #3, r2, r15
beq CKSUM_ODD_NEXT4
?:
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
movu.w [r1+], r5
add r4, r3
movu.w [r1+], r4
add r5, r3
add r4, r3
sub #1, r15
bne ?-
CKSUM_ODD_NEXT4:
btst #2, r2
beq CKSUM_ODD_NEXT2
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
add r4, r3
CKSUM_ODD_NEXT2:
btst #1, r2
beq CKSUM_ODD_NEXT1
movu.w [r1+], r5
add r5, r3
CKSUM_ODD_NEXT1:
btst #0, r2
beq CKSUM_ODD_NBYTES_NOT_ODD
movu.w [r1], r5
revw r5, r5
and #0ff00H, r5
revw r5, r5
add r5, r3
CKSUM_ODD_NBYTES_NOT_ODD:
mov.l #0000ffffh, r4
shlr #16, r3, r5
and r4, r3
add r5, r3
shlr #16, r3, r5
and r4, r3
add r5, r3
revw r3, r1
revw r1, r1
not r1
movu.w r1, r1
rts
CKSUM_EVEN:
shlr #3, r2, r15
beq CKSUM_EVEN_NEXT4
?:
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
movu.w [r1+], r5
add r4, r3
movu.w [r1+], r4
add r5, r3
add r4, r3
sub #1, r15
bne ?-
CKSUM_EVEN_NEXT4:
btst #2, r2
beq CKSUM_EVEN_NEXT2
movu.w [r1+], r5
movu.w [r1+], r4
add r5, r3
add r4, r3
CKSUM_EVEN_NEXT2:
btst #1, r2
beq CKSUM_EVEN_NEXT1
movu.w [r1+], r5
add r5, r3
CKSUM_EVEN_NEXT1:
btst #0, r2
beq CKSUM_EVEN_NBYTES_NOT_ODD
movu.w [r1], r5
revw r5, r5
and #0ff00H, r5
revw r5, r5
add r5, r3
CKSUM_EVEN_NBYTES_NOT_ODD:
mov.l #0000ffffh, r4
shlr #16, r3, r5
and r4, r3
add r5, r3
shlr #16, r3, r5
and r4, r3
add r5, r3
CKSUM_EXIT:
revw r3, r3
not r3
movu.w r3, r1
rts
CKSUM_ZERO_EXIT:
revw r3, r3
not r3, r1
movu.w r1, r1
rts
.end
|
src/resources/music_main.asm | h1romas4/z88dk-msx-template | 5 | 93237 | <gh_stars>1-10
; license:MIT License
; copyright-holders:<NAME>
_music_main:
DB 0
DW _music_main_trk1
DW _music_main_trk2
DW $0000
_music_main_trk1:
DB 201, %10, 200, 15 , 52 , 7 , 200, 0 , 0 , 7 , 200, 15 , 52 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 52 , 7 , 200, 0 , 0 , 7 , 200, 15 , 52 , 21 , 200, 0
DB 0 , 7 , 200, 15 , 52 , 7 , 200, 0 , 0 , 7 , 200, 15 , 52 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 52 , 21 , 200, 0 , 0 , 7 , 200, 15 , 50 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 50 , 28 , 41 , 14 , 46 , 14 , 50 , 28 , 200, 0 , 0 , 14
DB 200, 15 , 48 , 7 , 200, 0 , 0 , 7 , 200, 15 , 48 , 7 , 200, 0 , 0 , 7
DB 200, 15 , 48 , 7 , 200, 0 , 0 , 7 , 200, 15 , 48 , 21 , 200, 0 , 0 , 7
DB 200, 15 , 48 , 7 , 200, 0 , 0 , 7 , 200, 15 , 48 , 28 , 50 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 50 , 28 , 48 , 14 , 50 , 42 , 200, 0 , 0 , 14 , 200, 15
DB 52 , 7 , 200, 0 , 0 , 7 , 200, 15 , 52 , 7 , 200, 0 , 0 , 7 , 200, 15
DB 52 , 7 , 200, 0 , 0 , 7 , 200, 15 , 52 , 21 , 200, 0 , 0 , 7 , 200, 15
DB 52 , 7 , 200, 0 , 0 , 7 , 200, 15 , 52 , 28 , 50 , 7 , 200, 0 , 0 , 7
DB 200, 15 , 50 , 28 , 55 , 14 , 53 , 14 , 48 , 7 , 50 , 21 , 45 , 14 , 47 , 14
DB 48 , 42 , 41 , 14 , 45 , 14 , 48 , 14 , 55 , 56 , 53 , 28 , 52 , 14 , 50 , 14
DB 48 , 7 , 200, 0 , 0 , 7 , 200, 15 , 48 , 7 , 200, 0 , 0 , 7 , 200, 15
DB 48 , 7 , 200, 0 , 0 , 7 , 200, 15 , 48 , 28 , 52 , 28 , 50 , 42 , 200, 0
DB 0 , 14 , 200, 15 , 50 , 28 , 47 , 42 , 40 , 56 , 43 , 14 , 45 , 14 , 47 , 14
DB 48 , 63 , 200, 0 , 0 , 21 , 200, 15 , 48 , 14 , 47 , 14 , 48 , 14 , 48 , 112
DB 50 , 21 , 200, 0 , 0 , 7 , 200, 15 , 50 , 28 , 48 , 14 , 47 , 14 , 48 , 7
DB 47 , 7 , 48 , 14 , 48 , 112, 200, 0 , 0 , 112
DB 254
_music_main_trk2:
DB 201, %10, 200, 15 , 12 , 21 , 200, 0 , 0 , 7 , 200, 15 , 24 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 12 , 7 , 24 , 7 , 12 , 21 , 200, 0 , 0 , 7 , 200, 15
DB 24 , 7 , 200, 0 , 0 , 7 , 200, 15 , 12 , 7 , 24 , 7 , 10 , 21 , 200, 0
DB 0 , 7 , 200, 15 , 22 , 14 , 10 , 14 , 22 , 7 , 200, 0 , 0 , 7 , 200, 15
DB 10 , 7 , 22 , 7 , 10 , 7 , 22 , 7 , 10 , 14 , 17 , 21 , 200, 0 , 0 , 7
DB 200, 15 , 29 , 7 , 200, 0 , 0 , 7 , 200, 15 , 17 , 7 , 29 , 7 , 17 , 21
DB 200, 0 , 0 , 7 , 200, 15 , 29 , 7 , 200, 0 , 0 , 7 , 200, 15 , 17 , 7
DB 29 , 7 , 19 , 21 , 200, 0 , 0 , 7 , 200, 15 , 31 , 14 , 19 , 14 , 31 , 7
DB 200, 0 , 0 , 7 , 200, 15 , 19 , 7 , 31 , 7 , 19 , 7 , 31 , 7 , 19 , 14
DB 12 , 21 , 200, 0 , 0 , 7 , 200, 15 , 24 , 7 , 200, 0 , 0 , 7 , 200, 15
DB 12 , 7 , 24 , 7 , 12 , 21 , 200, 0 , 0 , 7 , 200, 15 , 24 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 12 , 7 , 24 , 7 , 10 , 21 , 200, 0 , 0 , 7 , 200, 15
DB 22 , 14 , 10 , 14 , 22 , 7 , 200, 0 , 0 , 7 , 200, 15 , 10 , 7 , 22 , 7
DB 10 , 7 , 22 , 7 , 10 , 14 , 17 , 21 , 200, 0 , 0 , 7 , 200, 15 , 29 , 7
DB 200, 0 , 0 , 7 , 200, 15 , 17 , 7 , 29 , 7 , 17 , 21 , 200, 0 , 0 , 7
DB 200, 15 , 29 , 7 , 200, 0 , 0 , 7 , 200, 15 , 17 , 7 , 29 , 7 , 19 , 21
DB 200, 0 , 0 , 7 , 200, 15 , 31 , 14 , 19 , 28 , 23 , 14 , 19 , 7 , 23 , 7
DB 19 , 14 , 17 , 14 , 21 , 7 , 200, 0 , 0 , 7 , 200, 15 , 24 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 17 , 28 , 21 , 14 , 24 , 14 , 29 , 14 , 19 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 31 , 7 , 200, 0 , 0 , 7 , 200, 15 , 19 , 14 , 31 , 14
DB 19 , 14 , 31 , 14 , 19 , 14 , 31 , 14 , 16 , 7 , 200, 0 , 0 , 7 , 200, 15
DB 28 , 7 , 200, 0 , 0 , 7 , 200, 15 , 16 , 14 , 28 , 14 , 16 , 14 , 28 , 14
DB 16 , 14 , 28 , 14 , 21 , 7 , 200, 0 , 0 , 7 , 200, 15 , 33 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 21 , 14 , 33 , 14 , 21 , 14 , 33 , 14 , 21 , 7 , 28 , 7
DB 21 , 14 , 17 , 14 , 21 , 7 , 200, 0 , 0 , 7 , 200, 15 , 24 , 7 , 200, 0
DB 0 , 7 , 200, 15 , 17 , 28 , 21 , 14 , 24 , 14 , 17 , 14 , 19 , 21 , 200, 0
DB 0 , 7 , 200, 15 , 31 , 7 , 200, 0 , 0 , 7 , 200, 15 , 31 , 28 , 23 , 7
DB 31 , 7 , 26 , 14 , 19 , 7 , 31 , 7 , 12 , 21 , 200, 0 , 0 , 7 , 200, 15
DB 24 , 7 , 200, 0 , 0 , 7 , 200, 15 , 12 , 7 , 24 , 7 , 12 , 21 , 200, 0
DB 0 , 7 , 200, 15 , 24 , 7 , 200, 0 , 0 , 7 , 200, 15 , 12 , 7 , 24 , 7
DB 12 , 21 , 200, 0 , 0 , 7 , 200, 15 , 24 , 7 , 200, 0 , 0 , 7 , 200, 15
DB 12 , 7 , 24 , 7 , 12 , 14 , 7 , 14 , 12 , 14 , 19 , 7 , 24 , 7
DB 254
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1030.asm | ljhsiun2/medusa | 9 | 4662 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x152ed, %r12
nop
add $45369, %rax
mov $0x6162636465666768, %r13
movq %r13, (%r12)
nop
add %r14, %r14
lea addresses_normal_ht+0x1d71d, %r12
nop
nop
nop
inc %r14
movb (%r12), %r8b
nop
dec %r12
lea addresses_D_ht+0x38fd, %rsi
lea addresses_WC_ht+0x373d, %rdi
nop
nop
nop
nop
nop
and %r14, %r14
mov $107, %rcx
rep movsq
nop
nop
nop
xor $28001, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r15
push %rax
push %rbx
push %rdi
// Store
lea addresses_D+0x2f3d, %rdi
cmp $1367, %r14
mov $0x5152535455565758, %r15
movq %r15, %xmm5
vmovups %ymm5, (%rdi)
nop
nop
xor $15875, %r14
// Load
lea addresses_WC+0x19ae5, %r14
nop
nop
nop
nop
nop
add $12488, %rbx
movb (%r14), %r11b
nop
nop
xor $5964, %r14
// Store
lea addresses_A+0x191fd, %rdi
nop
nop
nop
inc %r11
movw $0x5152, (%rdi)
and $51706, %r10
// Store
lea addresses_WT+0x130dd, %rax
sub %r11, %r11
movb $0x51, (%rax)
nop
nop
add %rdi, %rdi
// Load
lea addresses_D+0x1e1bd, %r15
nop
nop
cmp %rdi, %rdi
mov (%r15), %bx
nop
nop
xor %rax, %rax
// Faulty Load
lea addresses_normal+0xcf3d, %r11
nop
sub $42657, %r15
movups (%r11), %xmm4
vpextrq $0, %xmm4, %r14
lea oracles, %rax
and $0xff, %r14
shlq $12, %r14
mov (%rax,%r14,1), %r14
pop %rdi
pop %rbx
pop %rax
pop %r15
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'src': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
bin/AppleMailLoadRemoteImages.scpt | jduprey/dotfiles | 0 | 2715 | tell application "Mail"
try
if first window is window of front message viewer then
my messageViewer()
else
my regularmessage()
end if
on error theError
my regularmessage()
end try
end tell
on messageViewer()
tell application "System Events" to tell process "Mail"
set mainWindow to the first window
set rootSplitter to the first splitter group of the mainWindow
set firstSplitter to the last splitter group of the rootSplitter
set scrollArea to the last scroll area of the firstSplitter
set scrollGroup to the first group of the scrollArea
if number of groups of the scrollGroup is greater than 1 then
set maybeRemoteContentGroup to the first group of the scrollGroup
if number of buttons of the maybeRemoteContentGroup is greater than or equal to 1 then
set maybeRemoteContentButton to the last button of the maybeRemoteContentGroup
if name of the maybeRemoteContentButton contains "load remote content" then
click the maybeRemoteContentButton
else
name of the maybeRemoteContentButton
end if
else
UI elements of maybeRemoteContentGroup
end if
else
UI elements of the scrollGroup
end if
end tell
end messageViewer
on regularmessage()
tell application "System Events" to tell process "Mail"
set mainWindow to the first window
set mainScrollGroup to the first scroll area of the mainWindow
set everyMessage to every group of the mainScrollGroup
log (number of everyMessage)
repeat with currentMessage in everyMessage
set loadRemoteContentButton to the first button of the first group in the currentMessage
click the loadRemoteContentButton
end repeat
end tell
end regularmessage
|
source/image/required/s-valuns.ads | ytomino/drake | 33 | 7512 | <reponame>ytomino/drake<filename>source/image/required/s-valuns.ads<gh_stars>10-100
pragma License (Unrestricted);
-- implementation unit required by compiler
with System.Unsigned_Types;
package System.Val_Uns is
pragma Pure;
-- required for Modular'Value by compiler (s-valuns.ads)
function Value_Unsigned (Str : String) return Unsigned_Types.Unsigned;
end System.Val_Uns;
|
programs/oeis/275/A275151.asm | jmorken/loda | 1 | 28007 | <reponame>jmorken/loda
; A275151: a(1) = 8; a(n) = 3*a(n-1) + 2*sqrt(2*a(n-1)*(a(n-1)-7)) - 7 for n > 1.
; 8,25,128,729,4232,24649,143648,837225,4879688,28440889,165765632,966152889,5631151688,32820757225,191293391648,1114939592649,6498344164232,37875125392729,220752408192128,1286639323760025,7499083534368008,43707861882448009
mul $0,2
add $0,3
mov $2,3
mov $3,3
lpb $0
sub $0,2
trn $0,1
add $0,2
add $3,1
mov $1,$3
add $1,3
add $2,$3
mov $3,$2
add $2,$1
add $1,2
sub $2,2
lpe
sub $1,1
|
oeis/140/A140584.asm | neoneye/loda-programs | 11 | 11991 | ; A140584: Row sums of A140583.
; 1,3,5,6,9,10,13,12,15,18,21,20,25,26
mov $1,$0
mov $2,$0
seq $2,171462 ; Number of hands a bartender needs to have in order to win at the blind bartender's problem with n glasses in a cycle.
add $1,$2
mov $0,$1
add $0,1
|
Sample/Cpu/Pentium/CpuIo/RuntimeDxe/Ia32/CpuIoAccess.asm | bitcrystal/edk | 14 | 102692 | <reponame>bitcrystal/edk<filename>Sample/Cpu/Pentium/CpuIo/RuntimeDxe/Ia32/CpuIoAccess.asm
title CpuIoAccess.asm
;------------------------------------------------------------------------------
;*
;* Copyright (c) 2005, Intel Corporation
;* All rights reserved. This program and the accompanying materials
;* are licensed and made available under the terms and conditions of the BSD License
;* which accompanies this distribution. The full text of the license may be found at
;* http://opensource.org/licenses/bsd-license.php
;*
;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;*
;* Module Name:
;* CpuIoAccess.asm
;*
;* Abstract:
;* Supports IA32 CPU IO operation
;*
;------------------------------------------------------------------------------
;
;
;------------------------------------------------------------------------------
.686
.MODEL FLAT,C
.CODE
UINT8 TYPEDEF BYTE
UINT16 TYPEDEF WORD
UINT32 TYPEDEF DWORD
UINT64 TYPEDEF QWORD
UINTN TYPEDEF UINT32
;------------------------------------------------------------------------------
; UINT8
; CpuIoRead8 (
; IN UINT16 Port
; )
;------------------------------------------------------------------------------
CpuIoRead8 PROC PUBLIC Port:UINT16
mov dx, Port
in al, dx
ret
CpuIoRead8 ENDP
;------------------------------------------------------------------------------
; UINT16
; CpuIoRead16 (
; IN UINT16 Port
; )
;------------------------------------------------------------------------------
CpuIoRead16 PROC PUBLIC Port:UINT16
mov dx, Port
in ax, dx
ret
CpuIoRead16 ENDP
;------------------------------------------------------------------------------
; UINT32
; CpuIoRead32 (
; IN UINT16 Port
; )
;------------------------------------------------------------------------------
CpuIoRead32 PROC PUBLIC Port:UINT16
mov dx, Port
in eax, dx
ret
CpuIoRead32 ENDP
;------------------------------------------------------------------------------
; VOID
; CpuIoWrite8 (
; IN UINT16 Port,
; IN UINT32 Data
; )
;------------------------------------------------------------------------------
CpuIoWrite8 PROC PUBLIC Port:UINT16, Data:UINT32
mov eax, Data
mov dx, Port
out dx, al
ret
CpuIoWrite8 ENDP
;------------------------------------------------------------------------------
; VOID
; CpuIoWrite16 (
; IN UINT16 Port,
; IN UINT32 Data
; )
;------------------------------------------------------------------------------
CpuIoWrite16 PROC PUBLIC Port:UINT16, Data:UINT32
mov eax, Data
mov dx, Port
out dx, ax
ret
CpuIoWrite16 ENDP
;------------------------------------------------------------------------------
; VOID
; CpuIoWrite32 (
; IN UINT16 Port,
; IN UINT32 Data
; )
;------------------------------------------------------------------------------
CpuIoWrite32 PROC PUBLIC Port:UINT16, Data:UINT32
mov eax, Data
mov dx, Port
out dx, eax
ret
CpuIoWrite32 ENDP
END |
oeis/022/A022357.asm | neoneye/loda-programs | 11 | 6663 | <reponame>neoneye/loda-programs
; A022357: Fibonacci sequence beginning 0, 23.
; Submitted by <NAME>
; 0,23,23,46,69,115,184,299,483,782,1265,2047,3312,5359,8671,14030,22701,36731,59432,96163,155595,251758,407353,659111,1066464,1725575,2792039,4517614,7309653,11827267,19136920,30964187,50101107,81065294,131166401,212231695,343398096,555629791,899027887,1454657678,2353685565,3808343243,6162028808,9970372051,16132400859,26102772910,42235173769,68337946679,110573120448,178911067127,289484187575,468395254702,757879442277,1226274696979,1984154139256,3210428836235,5194582975491,8405011811726
mov $3,1
lpb $0
sub $0,1
mov $2,$3
add $3,$1
mov $1,$2
lpe
mov $0,$1
mul $0,23
|
src/swagger-streams-forms.adb | jquorning/swagger-ada | 17 | 20572 | -----------------------------------------------------------------------
-- swagger-streams-forms -- x-www-form-urlencoded streams
-- Copyright (C) 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Swagger.Streams.Forms is
procedure Initialize (Stream : in out Output_Stream;
Buffer : in Util.Streams.Texts.Print_Stream_Access) is
begin
Stream.Stream := Buffer;
end Initialize;
-- ------------------------------
-- Flush the buffer (if any) to the sink.
-- ------------------------------
overriding
procedure Flush (Stream : in out Output_Stream) is
begin
Stream.Stream.Flush;
end Flush;
-- ------------------------------
-- Close the sink.
-- ------------------------------
overriding
procedure Close (Stream : in out Output_Stream) is
begin
Stream.Stream.Close;
end Close;
-- ------------------------------
-- Write the buffer array to the output stream.
-- ------------------------------
overriding
procedure Write (Stream : in out Output_Stream;
Buffer : in Ada.Streams.Stream_Element_Array) is
begin
Stream.Stream.Write (Buffer);
end Write;
-- Write the attribute name/value pair.
overriding
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in String) is
begin
if Stream.Has_Param then
Stream.Stream.Write ('&');
end if;
Stream.Has_Param := True;
Stream.Stream.Write (Name);
Stream.Stream.Write ('=');
Stream.Stream.Write (Value);
end Write_Attribute;
overriding
procedure Write_Wide_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Wide_Wide_String) is
begin
if Stream.Has_Param then
Stream.Stream.Write ('&');
end if;
Stream.Has_Param := True;
Stream.Stream.Write (Name);
Stream.Stream.Write ('=');
for C of Value loop
Stream.Stream.Write_Wide (C);
end loop;
end Write_Wide_Attribute;
overriding
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Integer) is
begin
if Stream.Has_Param then
Stream.Stream.Write ('&');
end if;
Stream.Has_Param := True;
Stream.Stream.Write (Name);
Stream.Stream.Write ('=');
Stream.Stream.Write (Util.Strings.Image (Value));
end Write_Attribute;
overriding
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Boolean) is
begin
if Stream.Has_Param then
Stream.Stream.Write ('&');
end if;
Stream.Has_Param := True;
Stream.Stream.Write (Name);
Stream.Stream.Write ('=');
Stream.Stream.Write (if Value then "true" else "false");
end Write_Attribute;
overriding
procedure Write_Attribute (Stream : in out Output_Stream;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
null;
end Write_Attribute;
-- Write the attribute with a null value.
overriding
procedure Write_Null_Attribute (Stream : in out Output_Stream;
Name : in String) is
begin
null;
end Write_Null_Attribute;
-- Write the entity value.
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in String) is
begin
Stream.Write_Attribute (Name, Value);
end Write_Entity;
overriding
procedure Write_Wide_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Wide_Wide_String) is
begin
Stream.Write_Wide_Attribute (Name, Value);
end Write_Wide_Entity;
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Boolean) is
begin
Stream.Write_Attribute (Name, Value);
end Write_Entity;
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Integer) is
begin
Stream.Write_Attribute (Name, Value);
end Write_Entity;
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Ada.Calendar.Time) is
begin
null;
end Write_Entity;
overriding
procedure Write_Long_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Long_Long_Integer) is
begin
null;
end Write_Long_Entity;
overriding
procedure Write_Enum_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in String) is
begin
null;
end Write_Enum_Entity;
overriding
procedure Write_Entity (Stream : in out Output_Stream;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
null;
end Write_Entity;
-- Write an entity with a null value.
overriding
procedure Write_Null_Entity (Stream : in out Output_Stream;
Name : in String) is
begin
null;
end Write_Null_Entity;
end Swagger.Streams.Forms;
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2.log_113_205.asm | ljhsiun2/medusa | 9 | 160239 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r9
push %rax
push %rcx
push %rdx
// Store
lea addresses_WC+0x8cec, %r10
nop
sub $61857, %r12
mov $0x5152535455565758, %rcx
movq %rcx, %xmm1
movups %xmm1, (%r10)
nop
nop
nop
nop
cmp $33050, %r10
// Store
lea addresses_PSE+0x2cec, %r14
nop
nop
nop
nop
nop
and $57744, %rax
movl $0x51525354, (%r14)
nop
dec %r14
// Load
lea addresses_RW+0xcfa4, %r10
clflush (%r10)
nop
nop
nop
nop
and $17817, %rdx
mov (%r10), %r14
nop
nop
nop
nop
add $28222, %r12
// Faulty Load
lea addresses_PSE+0x2cec, %r12
cmp %rdx, %rdx
movb (%r12), %r14b
lea oracles, %r12
and $0xff, %r14
shlq $12, %r14
mov (%r12,%r14,1), %r14
pop %rdx
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'54': 113}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
|
oeis/190/A190970.asm | neoneye/loda-programs | 11 | 166996 | <reponame>neoneye/loda-programs
; A190970: a(n) = 5*a(n-1) - 9*a(n-2), with a(0)=0, a(1)=1.
; Submitted by <NAME>
; 0,1,5,16,35,31,-160,-1079,-3955,-10064,-14725,16951,217280,933841,2713685,5163856,1396115,-39494129,-210035680,-694731239,-1583335075,-1664094224,5929544555,44624570791,169756952960,447163627681,708005561765,-484444840304
mov $2,1
lpb $0
sub $0,1
mul $3,3
add $3,$2
mul $2,3
sub $2,$3
lpe
mov $0,$3
|
libtool/src/gmp-6.1.2/mpn/x86/k6/gcd_1.asm | kroggen/aergo | 278 | 22926 | dnl AMD K6 mpn_gcd_1 -- mpn by 1 gcd.
dnl Copyright 2000-2002, 2004, 2014 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C K6: 9.5 cycles/bit (approx) 1x1 gcd
C 11.0 cycles/limb Nx1 reduction (modexact_1_odd)
C mp_limb_t mpn_gcd_1 (mp_srcptr src, mp_size_t size, mp_limb_t y);
C
C This code is nothing very special, but offers a speedup over what gcc 2.95
C can do with mpn/generic/gcd_1.c.
C
C Future:
C
C Using a lookup table to count trailing zeros seems a touch quicker, but
C after a slightly longer startup. Might be worthwhile if an mpn_gcd_2 used
C it too.
dnl If size==1 and x (the larger operand) is more than DIV_THRESHOLD bits
dnl bigger than y, then a division x%y is done to reduce it.
dnl
dnl A divl is 20 cycles and the loop runs at about 9.5 cycles/bitpair so
dnl there should be an advantage in the divl at about 4 or 5 bits, which is
dnl what's found.
deflit(DIV_THRESHOLD, 5)
defframe(PARAM_LIMB, 12)
defframe(PARAM_SIZE, 8)
defframe(PARAM_SRC, 4)
TEXT
ALIGN(16)
PROLOGUE(mpn_gcd_1)
deflit(`FRAME',0)
ASSERT(ne, `cmpl $0, PARAM_LIMB')
ASSERT(ae, `cmpl $1, PARAM_SIZE')
movl PARAM_SRC, %eax
pushl %ebx FRAME_pushl()
movl PARAM_LIMB, %edx
movl $-1, %ecx
movl (%eax), %ebx C src low limb
movl %ebx, %eax C src low limb
orl %edx, %ebx
L(common_twos):
shrl %ebx
incl %ecx
jnc L(common_twos) C 1/4 chance on random data
shrl %cl, %edx C y
cmpl $1, PARAM_SIZE
ja L(size_two_or_more)
ASSERT(nz, `orl %eax, %eax') C should have src limb != 0
shrl %cl, %eax C x
C Swap if necessary to make x>=y. Measures a touch quicker as a
C jump than a branch free calculation.
C
C eax x
C ebx
C ecx common twos
C edx y
movl %eax, %ebx
cmpl %eax, %edx
jb L(noswap)
movl %edx, %eax
movl %ebx, %edx
movl %eax, %ebx
L(noswap):
C See if it's worth reducing x with a divl.
C
C eax x
C ebx x
C ecx common twos
C edx y
shrl $DIV_THRESHOLD, %ebx
cmpl %ebx, %edx
ja L(nodiv)
C Reduce x to x%y.
C
C eax x
C ebx
C ecx common twos
C edx y
movl %edx, %ebx
xorl %edx, %edx
divl %ebx
orl %edx, %edx C y
nop C code alignment
movl %ebx, %eax C x
jz L(done_shll)
L(nodiv):
C eax x
C ebx
C ecx common twos
C edx y
C esi
C edi
C ebp
L(strip_y):
shrl %edx
jnc L(strip_y)
leal 1(%edx,%edx), %edx
movl %ecx, %ebx C common twos
leal 1(%eax), %ecx
jmp L(strip_x_and)
C Calculating a %cl shift based on the low bit 0 or 1 avoids doing a branch
C on a 50/50 chance of 0 or 1. The chance of the next bit also being 0 is
C only 1/4.
C
C A second computed %cl shift was tried, but that measured a touch slower
C than branching back.
C
C A branch-free abs(x-y) and min(x,y) calculation was tried, but that
C measured about 1 cycle/bit slower.
C eax x
C ebx common twos
C ecx scratch
C edx y
ALIGN(4)
L(swap):
addl %eax, %edx C x-y+y = x
negl %eax C -(x-y) = y-x
L(strip_x):
shrl %eax C odd-odd = even, so always one to strip
ASSERT(nz)
L(strip_x_leal):
leal 1(%eax), %ecx
L(strip_x_and):
andl $1, %ecx C (x^1)&1
shrl %cl, %eax C shift if x even
testb $1, %al
jz L(strip_x)
ASSERT(nz,`testl $1, %eax') C x, y odd
ASSERT(nz,`testl $1, %edx')
subl %edx, %eax
jb L(swap)
ja L(strip_x)
movl %edx, %eax
movl %ebx, %ecx
L(done_shll):
shll %cl, %eax
popl %ebx
ret
C -----------------------------------------------------------------------------
C Two or more limbs.
C
C x={src,size} is reduced modulo y using either a plain mod_1 style
C remainder, or a modexact_1 style exact division.
deflit(MODEXACT_THRESHOLD, ifdef(`PIC', 4, 4))
ALIGN(8)
L(size_two_or_more):
C eax
C ebx
C ecx common twos
C edx y, without common twos
C esi
C edi
C ebp
deflit(FRAME_TWO_OR_MORE, FRAME)
pushl %edi defframe_pushl(SAVE_EDI)
movl PARAM_SRC, %ebx
L(y_twos):
shrl %edx
jnc L(y_twos)
movl %ecx, %edi C common twos
movl PARAM_SIZE, %ecx
pushl %esi defframe_pushl(SAVE_ESI)
leal 1(%edx,%edx), %esi C y (odd)
movl -4(%ebx,%ecx,4), %eax C src high limb
cmpl %edx, %eax C carry if high<divisor
sbbl %edx, %edx C -1 if high<divisor
addl %edx, %ecx C skip one limb if high<divisor
andl %eax, %edx
cmpl $MODEXACT_THRESHOLD, %ecx
jae L(modexact)
L(divide_top):
C eax scratch (quotient)
C ebx src
C ecx counter, size-1 to 1
C edx carry (remainder)
C esi divisor (odd)
C edi
C ebp
movl -4(%ebx,%ecx,4), %eax
divl %esi
loop L(divide_top)
movl %edx, %eax C x
movl %esi, %edx C y (odd)
movl %edi, %ebx C common twos
popl %esi
popl %edi
leal 1(%eax), %ecx
orl %eax, %eax
jnz L(strip_x_and)
movl %ebx, %ecx
movl %edx, %eax
shll %cl, %eax
popl %ebx
ret
ALIGN(8)
L(modexact):
C eax
C ebx src ptr
C ecx size or size-1
C edx
C esi y odd
C edi common twos
C ebp
movl PARAM_SIZE, %eax
pushl %esi FRAME_pushl()
pushl %eax FRAME_pushl()
pushl %ebx FRAME_pushl()
ifdef(`PIC_WITH_EBX',`
nop C code alignment
call L(movl_eip_ebx)
add $_GLOBAL_OFFSET_TABLE_, %ebx
')
CALL( mpn_modexact_1_odd)
movl %esi, %edx C y odd
movl SAVE_ESI, %esi
movl %edi, %ebx C common twos
movl SAVE_EDI, %edi
addl $eval(FRAME - FRAME_TWO_OR_MORE), %esp
orl %eax, %eax
leal 1(%eax), %ecx
jnz L(strip_x_and)
movl %ebx, %ecx
movl %edx, %eax
shll %cl, %eax
popl %ebx
ret
ifdef(`PIC_WITH_EBX',`
L(movl_eip_ebx):
movl (%esp), %ebx
ret_internal
')
EPILOGUE()
|
programs/oeis/056/A056738.asm | neoneye/loda | 22 | 172844 | ; A056738: Positions where 2's occur in A056731.
; 1,4,8,13,20,28,37,47,59,72,86,101,117,135,154,174,195,217,240,264,290,317,345,374,404,435,467,500,535,571,608,646,685,725,766,808,851,896,942,989,1037,1086,1136,1187,1239,1292,1346,1402,1459,1517,1576,1636
mov $1,$0
mul $0,2
add $1,1
seq $1,109592 ; Sequence and first differences include all even numbers exactly once and no odd numbers.
sub $1,$0
mov $0,$1
div $0,2
sub $0,2
|
AAAAnimation/utils.asm | nlouo/AAAAnimation | 17 | 10071 | <reponame>nlouo/AAAAnimation<filename>AAAAnimation/utils.asm
wait_until_smaller PROTO
; arguments
; xmm0: REAL4 a REAL4 variable need to be compared
; rdx: SQWORD PTR a SQWORD pointer which value be pointed would increase
; this procedure would block the thread until the condition is fulfilled
; Caution: it may cause the thread is blocked by a infinite loop
.CODE
wait_until_smaller PROC
push rbp
mov rbp, rsp
compare:
cvtsi2ss xmm1, SQWORD PTR [rdx] ; convert rdx to REAL4 type and store it in xmm1
comiss xmm0,xmm1 ; compare xmm0 with xmm1
jbe fufilled ; jump to fufilled if xmm0 <= xmm1
jmp compare ; jump to compare if xmm0 > xmm1
fufilled:
leave
ret
wait_until_smaller ENDP
END |
13.BcdtoBinary.asm | tamim87/Assembly-Samples | 0 | 87859 | ;bcd to binary
org 100h
mov al,num1
mov bl,04h
call bcdToBinary ;calling the function bcdToBinary
mov num2,al
jmp done
bcdToBinary proc near
pushf ;pushing flag values to stack
push ax ;pushing ax values to stack
push bx ;pushing bx values to stack
push dx ;pushing dx values to stack
mov bl,al ;copy al to bl
and bl,0fh ;bitwise AND operation with 0fh which will keep first nibble same and make second nibble zero through masking
and al,0f0h ;bitwise AND operation with 0f0h which will keep second nibble same and make first nibble zero through masking
ror al,04h ;rotate left 4 times
mov dl,0ah ;moving 0ah to dl
mul dl ;multiplying 05h stored in al with dl
add al,bl ;adding 032h and 06h and storing to al
pop dx ;poping dx values from stack
pop bx ;poping bx values from stack
pop ax ;poping ax values from stack
popf ;poping flag values from stack
ret
bcdToBinary endp ;ending the process bcdToBinary
done:
ret
num1 db 056h
num2 db 0
|
programs/oeis/178/A178672.asm | karttu/loda | 1 | 94088 | <reponame>karttu/loda
; A178672: a(n) = 6^n - 6.
; 0,30,210,1290,7770,46650,279930,1679610,10077690,60466170,362797050,2176782330,13060694010,78364164090,470184984570,2821109907450,16926659444730,101559956668410,609359740010490,3656158440062970,21936950640377850
mov $1,6
pow $1,$0
div $1,5
mul $1,30
|
test/Succeed/BuiltinAmbiguousConstructor.agda | asr/eagda | 1 | 7036 | <reponame>asr/eagda<gh_stars>1-10
-- Andreas, 2017-09-09
-- Builtin constructors may be ambiguous / overloaded.
data Semmel : Set where
false : Semmel
data Bool : Set where
true : Bool
false : Bool
{-# BUILTIN BOOL Bool #-}
{-# BUILTIN TRUE true #-}
{-# BUILTIN FALSE false #-} -- This is accepted.
data Brezel A : Set where
_β·_ : (x : A) (xs : Brezel A) β Brezel A
data Listβ A : Set where
[] : Listβ A
_β·_ : (x : A) (xs : Listβ A) β Listβ A
data List {a} (A : Set a) : Set a where
[] : List A
_β·_ : (x : A) (xs : List A) β List A
{-# BUILTIN LIST Listβ #-}
|
Transynther/x86/_processed/NC/_ht_zr_un_/i3-7100_9_0xca_notsx.log_5214_968.asm | ljhsiun2/medusa | 9 | 175761 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1e91a, %rsi
lea addresses_A_ht+0x7dfd, %rdi
clflush (%rdi)
nop
xor $59718, %r13
mov $15, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %r9, %r9
lea addresses_A_ht+0x173ce, %rdi
nop
nop
nop
nop
nop
inc %r14
mov (%rdi), %rcx
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_WC_ht+0x1a79a, %r14
nop
nop
nop
nop
inc %r8
mov (%r14), %r13
nop
nop
nop
add %r14, %r14
lea addresses_normal_ht+0x941a, %rcx
clflush (%rcx)
nop
nop
add %r9, %r9
movups (%rcx), %xmm2
vpextrq $0, %xmm2, %rsi
nop
nop
nop
nop
xor $12787, %r8
lea addresses_WC_ht+0x1c94c, %rsi
lea addresses_D_ht+0x23ea, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
cmp $40143, %r14
mov $3, %rcx
rep movsl
nop
sub $63410, %r9
lea addresses_D_ht+0x1731a, %r8
nop
nop
nop
nop
nop
sub $55709, %r14
mov $0x6162636465666768, %rcx
movq %rcx, (%r8)
nop
inc %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %r9
push %rbp
push %rbx
push %rsi
// Store
lea addresses_normal+0x6b9a, %rbx
nop
nop
nop
nop
nop
cmp %r12, %r12
movw $0x5152, (%rbx)
nop
nop
nop
cmp %r8, %r8
// Store
lea addresses_WC+0x959a, %rbp
nop
nop
nop
and $19982, %rbx
movb $0x51, (%rbp)
nop
nop
add %r9, %r9
// Faulty Load
mov $0x4dceb2000000079a, %r9
xor $8857, %r14
vmovups (%r9), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rsi
lea oracles, %r8
and $0xff, %rsi
shlq $12, %rsi
mov (%r8,%rsi,1), %rsi
pop %rsi
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 11, 'NT': True, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 7, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}}
{'45': 3, '40': 2, 'f6': 8, 'ff': 1, '9d': 1, '48': 774, '00': 3640, '02': 1, '44': 783, '81': 1}
44 44 00 00 48 00 00 00 00 48 44 00 00 00 00 44 44 44 48 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 44 00 44 00 00 00 00 00 00 00 44 00 00 44 00 44 00 00 00 00 00 48 00 00 44 00 44 00 48 00 44 00 00 48 00 00 00 00 48 00 00 00 00 44 00 00 00 00 00 00 00 44 48 00 00 44 44 00 44 48 00 48 00 00 00 00 48 00 00 00 00 00 44 48 00 00 44 00 48 00 48 00 00 00 44 00 00 00 00 48 00 48 00 00 00 00 00 00 48 48 00 00 00 44 00 00 48 00 44 00 00 00 48 44 00 48 48 00 00 44 44 00 00 00 00 44 48 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 48 48 00 00 00 44 00 00 00 00 00 00 00 00 00 48 48 44 00 00 48 00 44 00 00 00 44 00 44 44 44 44 00 00 00 00 00 00 00 00 00 00 48 00 44 00 00 00 00 00 00 44 44 00 00 00 44 00 00 48 00 00 48 44 48 00 00 00 48 48 00 48 00 00 00 00 48 00 48 00 44 00 00 00 00 48 00 00 00 44 00 00 44 48 48 00 00 48 00 00 00 00 48 48 00 00 00 00 00 00 00 44 00 00 48 00 00 44 00 44 48 00 00 48 00 00 48 00 00 00 44 48 48 00 00 44 00 00 48 48 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 44 00 48 00 48 00 00 00 00 00 48 00 00 00 00 00 00 00 00 44 44 44 00 48 48 00 00 00 00 00 00 44 48 48 44 48 48 00 00 00 00 48 00 48 00 48 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 48 00 44 00 00 44 48 00 44 00 00 00 44 44 44 00 44 00 48 48 00 00 00 48 00 00 00 00 00 44 00 44 44 00 44 00 00 00 00 00 00 00 48 00 00 00 48 00 00 00 f6 00 00 00 00 00 00 00 00 00 00 00 48 48 00 00 00 48 48 00 00 00 48 00 00 44 00 00 44 00 00 48 00 00 00 44 00 48 00 00 48 00 00 00 44 48 00 00 00 00 00 00 00 44 00 00 00 44 02 44 44 00 00 00 00 00 00 00 00 00 00 44 00 00 48 00 48 48 00 48 00 48 00 00 00 00 00 00 00 00 48 00 00 00 00 48 00 00 00 00 00 00 00 48 00 44 00 44 00 00 00 48 00 00 00 00 40 44 00 00 44 48 00 44 48 00 00 00 00 44 44 44 00 00 00 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 48 44 48 00 44 44 00 00 00 00 00 00 48 f6 48 00 44 00 44 48 00 00 48 00 48 00 48 48 44 48 00 00 44 00 00 00 48 00 00 00 00 48 00 44 00 48 00 48 00 00 00 00 00 00 00 48 00 00 00 48 44 00 44 00 00 00 48 00 00 44 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 00 44 48 00 00 44 00 00 44 00 00 00 00 00 44 48 48 00 48 48 00 00 00 00 00 00 44 00 48 44 44 00 44 00 00 00 00 00 00 00 48 00 00 00 44 00 00 00 00 00 00 48 40 00 00 44 00 44 44 44 00 00 00 00 00 48 00 48 00 44 44 44 44 00 00 00 00 00 44 00 44 00 00 48 00 44 00 00 44 00 00 44 44 00 00 48 48 00 00 44 00 00 48 00 00 00 00 00 00 00 44 00 00 00 44 00 48 00 00 00 00 00 00 00 00 48 00 44 00 00 00 00 48 00 00 00 00 00 48 00 44 44 00 48 44 00 00 00 00 44 00 00 44 00 00 00 44 44 00 00 44 00 00 00 44 48 00 00 00 00 00 48 44 00 48 48 44 00 00 48 00 48 00 00 48 00 00 44 00 00 00 00 00 44 00 00 00 00 00 00 00 44 00 44 00 00 48 44 00 00 00 00 00 00 00 00 00 44 48 00 48 44 44 00 00 00 00 44 00 48 00 44 00 48 00 00 00 48 48 00 00 00 44 48 00 00 44 48 00 00 48 00 00 48 00 00 00 00 00 44 00 00 00 44 00 00 00 44 00 00 44 48 00 00 00 00 00 f6 00 00 00
*/
|
src/canvas.asm | rodriados/pacman-x86 | 1 | 103682 | ; Pacman-x86: a Pacman implementation in pure x86 assembly.
; @file The game's canvas renderer and manager.
; @author <NAME> <<EMAIL>>
; @copyright 2021-present <NAME>
bits 64
%use fp
%include "debug.inc"
%include "color.inc"
%include "opengl.inc"
%include "window.inc"
extern game.DrawFrameCallback
extern window
global canvas.RenderCallback:function
global canvas.ReshapeCallback:function
global canvas.GetAspectRatio:function
global canvas.SetBackgroundColor:function
section .text
; The game's window re-paint event handler.
; Manages the game's canvas rendering.
; @param (none)
canvas.RenderCallback:
push rbp
mov rbp, rsp
; Clearing the window canvas.
; Clears the color buffers in the whole game's window canvas, and sets it to
; the clear color previously defined.
mov edi, GL_COLOR_BUFFER_BIT
call glClear
; Delegates frame redering to the game logic.
; Calls the game logic module to draw a frame when it is time to perform a window
; repaint. This delegation achieves centralizing all logic related to the game's
; controls, progress and drawing in a single module.
call game.DrawFrameCallback
pop rbp
ret
; The game's window reshape event handler.
; Adjusts the window's properties whenever it is resized.
; @param rdi The window's new width.
; @param rsi The window's new height.
canvas.ReshapeCallback:
push rbp
mov rbp, rsp
sub rsp, 0x10
cmp esi, 0x00
mov eax, 0x01
cmove esi, eax
mov dword [rbp - 4], edi
mov dword [rbp - 8], esi
mov dword [window + windowT.shapeX], edi
mov dword [window + windowT.shapeY], esi
; Configuring the game's window viewport.
; The viewport refers to the display area on the screen.
mov edi, 0x00
mov esi, 0x00
mov edx, dword [rbp - 4]
mov ecx, dword [rbp - 8]
call glViewport
; Configuring the window's clipping area.
; The clipping area refers to the area that is captured by the camera and, therefore
; it is the area that can be seen on the window.
mov edi, GL_PROJECTION
call glMatrixMode
call glLoadIdentity
; Mapping the clipping area to the viewport.
; Calculates the window's new aspect ratio and adjusts the mapping between the
; window's clipping area and its viewport.
call canvas.GetAspectRatio
call _.canvas.SetCanvasOrthographicMatrix
leave
ret
; Informs the window's current aspect ratio.
; @return xmm0 The window's aspect ratio.
canvas.GetAspectRatio:
pxor xmm0, xmm0
pxor xmm1, xmm1
cvtsi2sd xmm0, dword [window + windowT.shapeX]
cvtsi2sd xmm1, dword [window + windowT.shapeY]
divsd xmm0, xmm1
movsd qword [window + windowT.aspect], xmm0
ret
; Defines the game's background color.
; @param rdi The color to paint the background with.
canvas.SetBackgroundColor:
movss xmm0, [rdi + colorT.r]
movss xmm1, [rdi + colorT.g]
movss xmm2, [rdi + colorT.b]
movss xmm3, [rdi + colorT.a]
call glClearColor
ret
; Multiplies the current clipping matrix with an orthographic matrix.
; @param xmm0 The window's new aspect ratio.
_.canvas.SetCanvasOrthographicMatrix:
movsd xmm2, qword [neg1f]
movsd xmm3, qword [pos1f]
movsd xmm4, xmm2
movsd xmm5, xmm3
movsd xmm6, xmm0
comisd xmm0, xmm3
jb .taller
; If the window's width is bigger than its height, as usually, then we must
; control the viewport's area accordingly.
.wider:
mulsd xmm0, xmm2
movsd xmm1, xmm6
jmp .ready
; If the window's height is bigger than its width, then we must control the
; viewport's area accordingly, leaving blank vertical spaces if needed.
.taller:
movsd xmm0, xmm2
movsd xmm1, xmm3
divsd xmm2, xmm6
divsd xmm3, xmm6
.ready:
call glOrtho
ret
section .rodata
neg1f: dq float64(-1.0)
pos1f: dq float64(+1.0)
|
HoTT/Identity/Unit.agda | michaelforney/hott | 0 | 8233 | <reponame>michaelforney/hott<gh_stars>0
{-# OPTIONS --without-K #-}
open import HoTT.Base
open import HoTT.Equivalence
module HoTT.Identity.Unit where
open variables
=π-equiv : {x y : π {i}} β (x == y) β π {j}
=π-equiv {i} {j} {β
} {β
} = f , qinvβisequiv (g , Ξ· , Ξ΅)
where
f : {x y : π} β x == y β π {j}
f _ = β
g : {x y : π} β π {j} β x == y
g {β
} {β
} _ = refl
Ξ· : g β f ~ id
Ξ· refl = refl
Ξ΅ : f β g {β
} {β
} ~ id
Ξ΅ β
= refl
|
Things3/OpenAndComplete.applescript | nickdominguez/Applescripts | 0 | 2384 | <reponame>nickdominguez/Applescripts<filename>Things3/OpenAndComplete.applescript
on run
tell application "Things3"
repeat with todo in selected to dos
set completion date of todo to (current date)
set theNotes to notes of todo
repeat with todoParagraph in paragraphs of theNotes
if todoParagraph contains "://" then
do shell script "open " & quoted form of todoParagraph
end if
end repeat
end repeat
end tell
end run |
syslinux/memdisk/memdisk_iso_512.asm | TooDumbForAName/modern-boot-floppy | 0 | 160871 | <gh_stars>0
[map all memdisk_iso_512.map]
%define EDD 1
%define ELTORITO 1
%define SECTORSIZE_LG2 9 ; log2(sector size)
%include "memdisk.inc"
|
Counter with display/Display_SRC.asm | bardia-p/ARM-Processor-Simulator | 0 | 245137 | <reponame>bardia-p/ARM-Processor-Simulator
EQU breakpoint, #0xFFFFFFFF
EQU endOfStack, #0x800
B Main
; All I/O addresses are predefined by the Debugger:
IOswitchAddress DCD #0x80000200 ; Address to query the Switch IO component
IOhexControlAddress DCD #0x80000300 ; Address to toggle the Hex Display IO component on or off
IOhexDataAddress DCD #0x80000301 ; Address to change the Hex Display values
; This subroutine needs to be called once to turn the Digit Displays on.
ToggleDisplayOn
PUSH { R0, R1, R14 }
LDR R0, [ IOhexControlAddress ]; get Hex Display IO address
MOV R1, #0b11 ; 2 bits on = turns both hex digit displays on
STR R1, [R0] ; Send the 2 bits control signal to the display
POP { R0, R1, R15 }
Main
MOV R13, endOfStack ; initialize Stack Pointer
MOV R1 , #0 ; R1 is the ticks counter. Initialize to 0
BL ToggleDisplayOn ; Turn the Display on (once)
; for (R1 = 0; -1<R1<100; R1++ or R1-- depending on Switch state) {
TickAgain
; BCD-encoding [ same as your Fragment 1 soln ]
DIV R0 , R1 , #10 ; generate BCD digits (review DIV instruction in lab doc if needed)
AND R4 , R0, #0xFFFF ; Store the tens digit in R4
LSR R12, R0, #16 ; Store the units digit in R12
; Format the decimal digits (R4, R12) for the Hex Display IO component
LSL R6 , R4 , #4 ; shift the tens digits to second-least significant nybble
ADD R6 , R6, R12 ; combine both digits into R6's least significant byte
; Bits 0-3: units digit. Bits 4-7: tens digit.
LDR R3, [ IOhexDataAddress ] ; load Hex Display data control address
STR R6, [R3] ; display the formatted value
; Detect current Switch IO component state [from Fragment 2 solution]
LDR R3, [IOswitchAddress] ; load IOswitch address into R3
LDR R2, [R3] ; read Switch state (0 or 1) into R2
CMP R2, #1 ; (0=increment ticks; 1=decrement ticks)
BEQ decrement
; Loop test [ same as your Fragment 1 soln ]
ADD R1, R1, #1 ; Increment ticks count
CMP R1, #100 ; Under 100 ticks?
BNE TickAgain ; If so: tick again
MOV R1, #0 ; else: reset counter to 0
B TickAgain ; then tick again
decrement
; insert complete instructions (with their respective operands)
SUB R1, R1, #1 ; Decrement ticks count
CMP R1, #0 ; Greater than or equal to 0 ticks?
BGE TickAgain ; If so: tick again
MOV R1, #99 ; else: reset counter to 99
B TickAgain ; then tick again
; } end for loop
DCD breakpoint ; Equivalent to DCD #0xFFFFFFFF
|
OpenBrowser/OpenBraveIncognito.applescript | SaiWebApps/AppleScriptUtils | 3 | 37 | tell application "System Events" to set listOfProcesses to (name of every process where background only is false)
if "Brave Browser" is not in listOfProcesses then
tell application "Brave Browser"
close windows
make new window with properties {mode:"incognito"}
tell application "System Events" to keystroke "f" using {control down, command down}
end tell
end if
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1841.asm | ljhsiun2/medusa | 9 | 242558 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r8
push %r9
push %rax
push %rdi
lea addresses_WC_ht+0x13f0e, %rdi
add %r11, %r11
movl $0x61626364, (%rdi)
nop
nop
nop
dec %rdi
lea addresses_UC_ht+0x1310e, %r8
nop
nop
mfence
mov $0x6162636465666768, %r9
movq %r9, %xmm6
vmovups %ymm6, (%r8)
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x1314a, %r9
nop
and %rax, %rax
movl $0x61626364, (%r9)
nop
nop
nop
add %rax, %rax
lea addresses_WT_ht+0xa20e, %r9
nop
nop
add %r10, %r10
movw $0x6162, (%r9)
xor $21102, %r10
lea addresses_UC_ht+0x1b50e, %r10
nop
nop
nop
nop
xor %r11, %r11
mov (%r10), %r8
nop
nop
inc %r8
pop %rdi
pop %rax
pop %r9
pop %r8
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r9
push %rax
push %rbx
push %rdi
// Store
lea addresses_normal+0x1f30e, %rdi
nop
nop
nop
nop
nop
sub %r13, %r13
movl $0x51525354, (%rdi)
nop
nop
nop
sub $50528, %r13
// Store
mov $0x401df70000000b2e, %rax
nop
nop
nop
nop
nop
and $30097, %r9
mov $0x5152535455565758, %rbx
movq %rbx, %xmm0
vmovntdq %ymm0, (%rax)
nop
nop
cmp %r11, %r11
// Load
lea addresses_D+0xa70e, %r9
add %r11, %r11
mov (%r9), %r15
inc %rdi
// Faulty Load
lea addresses_D+0xa70e, %rdi
nop
nop
nop
nop
nop
xor $14679, %r11
movb (%rdi), %al
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_NC', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 6}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_2246.asm | ljhsiun2/medusa | 9 | 88139 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %rax
push %rcx
push %rdi
lea addresses_UC_ht+0x16665, %r13
nop
lfence
mov $0x6162636465666768, %r14
movq %r14, %xmm7
movups %xmm7, (%r13)
nop
xor $55875, %r12
lea addresses_WT_ht+0x11a65, %rcx
nop
nop
nop
nop
nop
cmp %r14, %r14
mov $0x6162636465666768, %r12
movq %r12, (%rcx)
xor $11386, %r13
lea addresses_WT_ht+0x1c60c, %rax
clflush (%rax)
nop
nop
nop
nop
nop
dec %r12
mov (%rax), %di
and %r13, %r13
pop %rdi
pop %rcx
pop %rax
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %r9
push %rsi
// Faulty Load
lea addresses_PSE+0x17e65, %r9
nop
nop
nop
sub $60950, %r10
mov (%r9), %esi
lea oracles, %r9
and $0xff, %rsi
shlq $12, %rsi
mov (%r9,%rsi,1), %rsi
pop %rsi
pop %r9
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
Cubical/Data/Bool/Base.agda | limemloh/cubical | 0 | 416 | {-# OPTIONS --cubical --safe #-}
module Cubical.Data.Bool.Base where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Data.Empty
open import Cubical.Relation.Nullary
open import Cubical.Relation.Nullary.DecidableEq
-- Obtain the booleans
open import Agda.Builtin.Bool public
infixr 6 _and_
infixr 5 _or_
not : Bool β Bool
not true = false
not false = true
_or_ : Bool β Bool β Bool
false or false = false
false or true = true
true or false = true
true or true = true
_and_ : Bool β Bool β Bool
false and false = false
false and true = false
true and false = false
true and true = true
caseBool : β {β} β {A : Type β} β (a0 aS : A) β Bool β A
caseBool att aff true = att
caseBool att aff false = aff
_β_ : Discrete Bool
false β false = yes refl
false β true = no Ξ» p β subst (caseBool β₯ Bool) p true
true β false = no Ξ» p β subst (caseBool Bool β₯) p true
true β true = yes refl
DecβBool : β {β} {A : Type β} β Dec A β Bool
DecβBool (yes p) = true
DecβBool (no Β¬p) = false
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_4.asm | ljhsiun2/medusa | 9 | 97341 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x12b9a, %r8
nop
nop
nop
sub $34892, %r10
movl $0x61626364, (%r8)
nop
nop
nop
nop
nop
cmp $23113, %r8
lea addresses_D_ht+0xd39a, %r12
nop
nop
and %r9, %r9
movb $0x61, (%r12)
and %r12, %r12
lea addresses_UC_ht+0xf1ce, %rsi
lea addresses_D_ht+0x1339a, %rdi
clflush (%rdi)
sub $18413, %r8
mov $30, %rcx
rep movsb
xor $59612, %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r9
push %rbp
push %rbx
push %rcx
push %rsi
// Load
lea addresses_WT+0x739a, %rcx
nop
nop
add %r9, %r9
mov (%rcx), %esi
nop
nop
nop
inc %rsi
// Faulty Load
lea addresses_normal+0x17b9a, %r13
nop
dec %rbp
vmovups (%r13), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %r9
lea oracles, %rcx
and $0xff, %r9
shlq $12, %r9
mov (%rcx,%r9,1), %r9
pop %rsi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
c2000/C2000Ware_1_00_06_00/libraries/dsp/FixedPoint/c28/source/CFFT32_mag.asm | ramok/Themis_ForHPSDR | 0 | 244271 | <gh_stars>0
;;#############################################################################
;;! \file source/CFFT32_mag.asm
;;!
;;! \brief Magnitude function for the complex FFT
;;!
;;! \date Nov 2, 2010
;;!
;;
;; Group: C2000
;; Target Family: C28x
;;
;;#############################################################################
;;$TI Release: C28x Fixed Point DSP Library v1.20.00.00 $
;;$Release Date: Thu Oct 18 15:57:22 CDT 2018 $
;;$Copyright: Copyright (C) 2014-2018 Texas Instruments Incorporated -
;; http://www.ti.com/ ALL RIGHTS RESERVED $
;;#############################################################################
;;
;;
;;*****************************************************************************
;; includes
;;*****************************************************************************
;;
;;*****************************************************************************
;; globals
;;*****************************************************************************
; Module definition for external reference
.def _CFFT32_mag
;; Module Structure
;; typedef struct { <--------- XAR4
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
;; int16_t size; /* +4 Size of the FFT */
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
;; int16_t *winptr; /* +8 Pointer to the sampling window */
;; int16_t peakmag; /* +10 Peak magnitude value */
;; int16_t peakfrq; /* +11 Peak Frequency */
;; int16_t ratio; /* +12 Twiddles Skip factor */
;; void (*init)(void); /* +14 Pointer to the initialization () */
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
;; void (*win)(void *); /* +22 Pointer to the windowing () */
;;}CFFT32;
;;=============================================================================
;; Routine Type : C Callable
;; Description :
;; void CFFT32_mag(CFFT32_Handle)
;; This function computes the magnitude square of complex FFT outputs. Allows in-place
;; and off-place storage of the magnitude square results.
;;
_CFFT32_mag:
SETC SXM
MOVL XAR7,*XAR4 ; XAR5=ipcbptr
MOVL XAR6,*+XAR4[6] ; XAR6=magptr
MOVZ AR0,*+XAR4[4] ; AR7=size
SUBB XAR0,#1 ; AR0=size-1
MAG_LP:
ZAPA ; ACC=0, P=0
QMACL P,*XAR7,*XAR7++ ; Q15*Q15=Q30
QMACL P,*XAR7,*XAR7++ ; Q15*Q15+Q30=Q30
ADDL ACC,P
MOVL *XAR6++,ACC ; Store in Q30
BANZ MAG_LP,AR0--
; Find maximum magnitude
ADDB XAR4,#4 ; XAR4->size
MOVB ACC,#0
MOVL *+XAR4[6],ACC ; peakmag=0
MOVZ AR0,*XAR4 ; AR0=size
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
MOV ACC,#0
SUBB XAR0,#1 ; AR0=size-1
;Find the maximum value among the FFT Magnitudes
RPT AR0
|| MAXL ACC,*XAR5++
MOVL *+XAR4[6],ACC ; update peak magnitude
MOVB XAR7,#0 ; XAR7=0
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
;Find the spectral bin corresponding to maximum magnitude.
NEXT_BIN:
MAXL ACC,*XAR5++
NOP *XAR7++
SBF NEXT_BIN,NEQ
NOP *--XAR7
ADDB XAR4,#8 ; XAR4->peakfrq
MOV *XAR4,AR7 ; update peak magnitude
LRETR
;;#############################################################################
;; End of File
;;#############################################################################
|
Homework/HW2.asm | Ping6666/Assembly-Language-Projects | 4 | 81115 | <gh_stars>1-10
TITLE Homework02 (Student ID:)
INCLUDE Irvine32.inc
.data
ChStrs BYTE " "
BYTE " **** "
BYTE " * "
BYTE " * "
BYTE " **** "
BYTE " * "
BYTE " * "
BYTE " **** "
BitStrs BYTE 8 dup(?)
.code
change PROC USES ecx ; store ecx in stack
mov ecx, 8h ; ecx = 8 (times to loop)
mov edx, 0h ; edx = 0
L2:
shl edx, 1 ; edx = edx * 2
mov bl, [esi] ; bl = [esi]
cmp bl, 2Ah ; compare bl and "*"
je L3 ; jump to L3 if equal
add edx, 0h ; edx = edx + 0
jmp L4 ; jump to L4
L3:
add edx, 1h ; edx = edx + 1
L4:
inc esi ; esi = esi + 1
loop L2 ; loop L2 until ecx = 0
mov [edi], edx ; [edi] = edx
ret ; return
change ENDP
start@0 PROC
mov esi, OFFSET ChStrs ; esi = address of ChStrs
mov edi, OFFSET BitStrs ; edi = address of BitStrs
mov ecx, 8h ; ecx = 8 (times to loop)
L1:
call change ; call change
mov al, [edi] ; al = [edi]
mov ebx, TYPE BYTE ; make sure print type byte
call WriteBinB ; print
call Crlf ; change line
inc edi ; edi = edi + 1
loop L1 ; loop L1 until ecx = 0
call WaitMsg ; make the cmd wait
exit
start@0 ENDP
END start@0 |
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_73_356.asm | ljhsiun2/medusa | 9 | 4440 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x11fd9, %rsi
lea addresses_A_ht+0x107c1, %rdi
clflush (%rdi)
and %r9, %r9
mov $19, %rcx
rep movsb
add $298, %r13
lea addresses_WC_ht+0x1c49, %rsi
lea addresses_UC_ht+0x7e, %rdi
nop
and $65311, %r9
mov $77, %rcx
rep movsq
nop
nop
nop
nop
inc %rdi
lea addresses_A_ht+0x10019, %rsi
lea addresses_normal_ht+0x19c99, %rdi
nop
cmp %r11, %r11
mov $69, %rcx
rep movsq
nop
nop
and $63855, %r9
lea addresses_UC_ht+0x1199, %r9
nop
nop
and $49061, %rax
mov $0x6162636465666768, %r11
movq %r11, %xmm1
vmovups %ymm1, (%r9)
nop
nop
nop
cmp $64812, %r11
lea addresses_UC_ht+0x13c59, %r11
nop
nop
nop
nop
and $42482, %rsi
vmovups (%r11), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %rax
nop
nop
nop
nop
and $24771, %r11
lea addresses_A_ht+0x12d99, %rsi
lea addresses_normal_ht+0x1c199, %rdi
nop
nop
nop
nop
sub %r11, %r11
mov $26, %rcx
rep movsb
nop
nop
nop
nop
cmp $44683, %r11
lea addresses_normal_ht+0x14d99, %rax
nop
nop
nop
nop
nop
xor %rsi, %rsi
mov (%rax), %ecx
dec %r9
lea addresses_A_ht+0x6079, %r9
nop
nop
nop
nop
dec %rcx
movl $0x61626364, (%r9)
nop
nop
nop
nop
sub $29447, %r9
lea addresses_WT_ht+0xa279, %rsi
lea addresses_UC_ht+0x89f9, %rdi
clflush (%rdi)
nop
nop
nop
and $4521, %rbp
mov $95, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %r13
lea addresses_A_ht+0x17bad, %rcx
nop
inc %rbp
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
and $0xffffffffffffffc0, %rcx
movntdq %xmm3, (%rcx)
nop
and %r11, %r11
lea addresses_normal_ht+0xe891, %r11
and $38481, %r13
movw $0x6162, (%r11)
nop
nop
nop
cmp %r11, %r11
lea addresses_WC_ht+0x2319, %rax
dec %r9
movw $0x6162, (%rax)
nop
nop
nop
nop
cmp %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %rbp
push %rbx
push %rcx
push %rsi
// Store
lea addresses_UC+0x17019, %rbp
nop
nop
sub %rsi, %rsi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
movups %xmm0, (%rbp)
nop
xor %rcx, %rcx
// Store
lea addresses_normal+0x6739, %r8
nop
nop
nop
sub $64831, %rcx
mov $0x5152535455565758, %r12
movq %r12, %xmm1
vmovups %ymm1, (%r8)
nop
nop
nop
nop
cmp $21306, %rbp
// Store
lea addresses_PSE+0xd6b1, %rcx
nop
nop
nop
nop
inc %r14
mov $0x5152535455565758, %r8
movq %r8, %xmm1
movntdq %xmm1, (%rcx)
nop
nop
nop
and $17955, %rcx
// Store
lea addresses_WT+0x17d19, %rcx
nop
nop
nop
nop
nop
dec %rbp
movl $0x51525354, (%rcx)
nop
sub %r14, %r14
// Faulty Load
lea addresses_D+0x1d999, %r12
clflush (%r12)
nop
nop
nop
nop
nop
inc %rbp
vmovups (%r12), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %r14
lea oracles, %r8
and $0xff, %r14
shlq $12, %r14
mov (%r8,%r14,1), %r14
pop %rsi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': True, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'36': 73}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
sources/ippcp/asm_intel64/pcprij128cmace9as.asm | ntyukaev/ipp-crypto | 30 | 95799 | ;===============================================================================
; Copyright 2018-2020 Intel Corporation
;
; 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.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; Rijndael Cipher function
;
; Content:
; cpAESCMAC_Update_AES_NI()
;
;
%include "asmdefs.inc"
%include "ia_32e.inc"
%include "ia_32e_regs.inc"
%include "pcpvariant.inc"
%if (_AES_NI_ENABLING_ == _FEATURE_ON_) || (_AES_NI_ENABLING_ == _FEATURE_TICKTOCK_)
%if (_IPP32E >= _IPP32E_Y8)
segment .text align=IPP_ALIGN_FACTOR
;***************************************************************
;* Purpose: AES-CMAC update
;*
;* void cpAESCMAC_Update_AES_NI(Ipp8u* digest,
;* const Ipp8u* input,
;* int inpLen,
;* int nr,
;* const Ipp32u* pRKey)
;***************************************************************
;;
;; Lib = Y8
;;
;; Caller = ippsAES_CMACUpdate
;;
align IPP_ALIGN_FACTOR
IPPASM cpAESCMAC_Update_AES_NI,PUBLIC
%assign LOCAL_FRAME 0
USES_GPR rsi,rdi
USES_XMM
COMP_ABI 5
;; rdi: pDigest: DWORD, ; input blocks address
;; rsi: pInput: DWORD, ; output blocks address
;; rdx: length: DWORD, ; lenght in bytes (multiple 16)
;; rcx: nr: DWORD ; number of rounds
;; r8: pRKey: DWORD ; pointer to keys
%xdefine SC (4)
%assign BYTES_PER_BLK (16)
movsxd rdx, edx ; input length
movdqu xmm0, oword [rdi] ; digest
align IPP_ALIGN_FACTOR
;;
;; pseudo-pipelined processing
;;
.blks_loop:
movdqu xmm1, oword [rsi] ; input block
movdqa xmm4, oword [r8]
mov r9, r8 ; save pointer to the key material
pxor xmm0, xmm1 ; digest ^ src[]
pxor xmm0, xmm4 ; whitening
movdqa xmm4, oword [r9+16]
add r9, 16
mov r10, rcx ; counter depending on key length
sub r10, 1
align IPP_ALIGN_FACTOR
.cipher_loop:
aesenc xmm0, xmm4 ; regular round
movdqa xmm4, oword [r9+16]
add r9, 16
dec r10
jnz .cipher_loop
aesenclast xmm0, xmm4 ; irregular round
add rsi, BYTES_PER_BLK ; advance pointers
sub rdx, BYTES_PER_BLK ; decrease counter
jnz .blks_loop
pxor xmm4, xmm4
movdqu oword [rdi], xmm0 ; store updated digest digest
REST_XMM
REST_GPR
ret
ENDFUNC cpAESCMAC_Update_AES_NI
%endif
%endif ;; _AES_NI_ENABLING_
|
_build/dispatcher/jmp_ippsARCFourUnpack_f0624d84.asm | zyktrcn/ippcp | 1 | 160392 | extern m7_ippsARCFourUnpack:function
extern n8_ippsARCFourUnpack:function
extern y8_ippsARCFourUnpack:function
extern e9_ippsARCFourUnpack:function
extern l9_ippsARCFourUnpack:function
extern n0_ippsARCFourUnpack:function
extern k0_ippsARCFourUnpack:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsARCFourUnpack
.Larraddr_ippsARCFourUnpack:
dq m7_ippsARCFourUnpack
dq n8_ippsARCFourUnpack
dq y8_ippsARCFourUnpack
dq e9_ippsARCFourUnpack
dq l9_ippsARCFourUnpack
dq n0_ippsARCFourUnpack
dq k0_ippsARCFourUnpack
segment .text
global ippsARCFourUnpack:function (ippsARCFourUnpack.LEndippsARCFourUnpack - ippsARCFourUnpack)
.Lin_ippsARCFourUnpack:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsARCFourUnpack:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsARCFourUnpack]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsARCFourUnpack:
|
programs/oeis/010/A010961.asm | jmorken/loda | 1 | 24652 | ; A010961: Binomial coefficient C(45,n).
; 1,45,990,14190,148995,1221759,8145060,45379620,215553195,886163135,3190187286,10150595910,28760021745,73006209045,166871334960,344867425584,646626422970,1103068603890,1715884494940,2438362177020,3169870830126,3773655750150
mov $1,45
bin $1,$0
|
src/Partiality-monad/Coinductive/Alternative.agda | nad/partiality-monad | 2 | 7918 | ------------------------------------------------------------------------
-- An alternative definition of the partiality monad: a variant of the
-- delay monad quotiented by a notion of weak bisimilarity
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --sized-types #-}
module Partiality-monad.Coinductive.Alternative where
open import Equality.Propositional.Cubical
open import Logical-equivalence using (_β_)
open import Prelude hiding (β₯)
open import Bijection equality-with-J using (_β_)
open import Function-universe equality-with-J hiding (β₯ββ₯)
open import H-level equality-with-J
open import H-level.Truncation.Propositional equality-with-paths
open import Quotient equality-with-paths
import Delay-monad.Alternative as A
import Delay-monad.Alternative.Equivalence as A
import Delay-monad.Alternative.Weak-bisimilarity as A
import Delay-monad.Bisimilarity as B
import Partiality-monad.Coinductive as C
-- The partiality monad, defined as the alternative definition of the
-- delay monad quotiented by weak bisimilarity.
_β₯ : β {a} β Type a β Type a
A β₯ = A.Delay A / A._β_
-- The partiality monad is a set.
β₯-is-set : β {a} {A : Type a} β Is-set (A β₯)
β₯-is-set = /-is-set
-- This definition of the partiality monad is isomorphic to the one in
-- Partiality-monad.Coinductive, for sets, assuming extensionality.
β₯ββ₯ : β {a} {A : Type a} β
Is-set A β
B.Extensionality a β
A β₯ β A C.β₯
β₯ββ₯ {A = A} A-set delay-ext = DβD /-cong lemma
where
DβD = A.DelayβDelay delay-ext
lemma : (x y : A.Delay A) β
x A.β y β β₯ _β_.to DβD x B.β _β_.to DβD y β₯
lemma x y =
x A.β y ββ¨ inverse $ β₯β₯β (A.β-propositional x y) β©
β₯ x A.β y β₯ ββ¨ β₯β₯-cong-β (A.βββ A-set x y) β©β‘
β₯ _β_.to DβD x B.β _β_.to DβD y β₯ β‘
|
programs/oeis/302/A302302.asm | karttu/loda | 1 | 172917 | <filename>programs/oeis/302/A302302.asm
; A302302: Number of triples (i,j,k) such that i+j+k > 0 with -n <= i,j,k <= n.
; 0,10,53,153,334,620,1035,1603,2348,3294,4465,5885,7578,9568,11879,14535,17560,20978,24813,29089,33830,39060,44803,51083,57924,65350,73385,82053,91378,101384,112095,123535,135728,148698,162469,177065,192510,208828,226043
mul $0,8
add $0,2
mov $2,$0
mov $3,$0
add $0,3
mul $2,$3
mul $0,$2
mov $1,$0
div $1,128
|
sources/ippcp/asm_intel64/pcprij128encryptctrpipee9as.asm | idesai/ipp-crypto | 1 | 178292 | ;===============================================================================
; Copyright 2015-2018 Intel Corporation
; All Rights Reserved.
;
; If this software was obtained under the Intel Simplified Software License,
; the following terms apply:
;
; The source code, information and material ("Material") contained herein is
; owned by Intel Corporation or its suppliers or licensors, and title to such
; Material remains with Intel Corporation or its suppliers or licensors. The
; Material contains proprietary information of Intel or its suppliers and
; licensors. The Material is protected by worldwide copyright laws and treaty
; provisions. No part of the Material may be used, copied, reproduced,
; modified, published, uploaded, posted, transmitted, distributed or disclosed
; in any way without Intel's prior express written permission. No license under
; any patent, copyright or other intellectual property rights in the Material
; is granted to or conferred upon you, either expressly, by implication,
; inducement, estoppel or otherwise. Any license under such intellectual
; property rights must be express and approved by Intel in writing.
;
; Unless otherwise agreed by Intel in writing, you may not remove or alter this
; notice or any other notice embedded in Materials by Intel or Intel's
; suppliers or licensors in any way.
;
;
; If this software was obtained under the Apache License, Version 2.0 (the
; "License"), the following terms apply:
;
; 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.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; Rijndael Cipher function
;
; Content:
; EncryptCTR_RIJ128pipe_AES_NI()
;
;
include asmdefs.inc
include ia_32e.inc
include ia_32e_regs.inc
include pcpvariant.inc
IF (_AES_NI_ENABLING_ EQ _FEATURE_ON_) OR (_AES_NI_ENABLING_ EQ _FEATURE_TICKTOCK_)
IF (_IPP32E GE _IPP32E_Y8)
IPPCODE SEGMENT 'CODE' ALIGN (IPP_ALIGN_FACTOR)
ALIGN IPP_ALIGN_FACTOR
u128_str DB 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
;***************************************************************
;* Purpose: pipelined RIJ128 CTR encryption/decryption
;*
;* void EncryptCTR_RIJ128pipe_AES_NI(const Ipp32u* inpBlk,
;* Ipp32u* outBlk,
;* int nr,
;* const Ipp32u* pRKey,
;* int length,
;* Ipp8u* pCtrValue,
;* Ipp8u* pCtrBitMask)
;***************************************************************
;;
;; Lib = Y8
;;
;; Caller = ippsAESEncryptCTR
;;
ALIGN IPP_ALIGN_FACTOR
IPPASM EncryptCTR_RIJ128pipe_AES_NI PROC PUBLIC FRAME
USES_GPR rsi,rdi,rbx
LOCAL_FRAME = 0
USES_XMM xmm6,xmm7,xmm8,xmm9
COMP_ABI 7
;; rdi: pInpBlk: PTR DWORD, ; pointer to the input
;; rsi: pOutBlk: PTR DWORD, ; pointer to the output
;; rdx: nr: DWORD, ; number of rounds
;; rcx pKey: PTR DWORD ; key material address
;; r8d length: DWORD ; length of the input
;; r9 pCtrValue: PTR BYTED ; pointer to the Counter
;; [rsp+ARG_7] pCtrBitMask: PTR BYTE ; pointer to the Counter Bit Mask
SC equ (4)
BLKS_PER_LOOP = (4)
BYTES_PER_BLK = (16)
BYTES_PER_LOOP = (BYTES_PER_BLK*BLKS_PER_LOOP)
mov rax, [rsp+ARG_7]
movdqu xmm8, oword ptr[rax] ; counter bit mask
movdqu xmm0, oword ptr[r9] ; initial counter
movdqa xmm9, xmm8
pandn xmm9, xmm0 ; counter template
;;
;; init counter
;;
mov rbx, qword ptr[r9] ; initial counter (BE)
mov rax, qword ptr[r9+8]
bswap rbx
bswap rax
movsxd r8, r8d
sub r8, BYTES_PER_LOOP
jl short_input
;;
;; pipelined processing
;;
blks_loop:
movdqa xmm4,oword ptr u128_str
pinsrq xmm0, rax, 0 ; get counter value
pinsrq xmm0, rbx, 1
pshufb xmm0, xmm4 ; convert int the octet string
pand xmm0, xmm8 ; select counter bits
por xmm0, xmm9 ; add unchanged bits
add rax, 1
adc rbx, 0
pinsrq xmm1, rax, 0
pinsrq xmm1, rbx, 1
pshufb xmm1, xmm4
pand xmm1, xmm8
por xmm1, xmm9
add rax, 1
adc rbx, 0
pinsrq xmm2, rax, 0
pinsrq xmm2, rbx, 1
pshufb xmm2, xmm4
pand xmm2, xmm8
por xmm2, xmm9
add rax, 1
adc rbx, 0
pinsrq xmm3, rax, 0
pinsrq xmm3, rbx, 1
pshufb xmm3, xmm4
pand xmm3, xmm8
por xmm3, xmm9
movdqa xmm4, oword ptr[rcx]
mov r10, rcx ; set pointer to the key material
pxor xmm0, xmm4 ; whitening
pxor xmm1, xmm4
pxor xmm2, xmm4
pxor xmm3, xmm4
movdqa xmm4, oword ptr[r10+16]
add r10, 16
mov r11, rdx ; counter depending on key length
sub r11, 1
cipher_loop:
aesenc xmm0, xmm4 ; regular round
aesenc xmm1, xmm4
aesenc xmm2, xmm4
aesenc xmm3, xmm4
movdqa xmm4, oword ptr[r10+16]
add r10, 16
dec r11
jnz cipher_loop
aesenclast xmm0, xmm4 ; irregular round
aesenclast xmm1, xmm4
aesenclast xmm2, xmm4
aesenclast xmm3, xmm4
movdqu xmm4, oword ptr[rdi+0*BYTES_PER_BLK] ; 4 input blocks
movdqu xmm5, oword ptr[rdi+1*BYTES_PER_BLK]
movdqu xmm6, oword ptr[rdi+2*BYTES_PER_BLK]
movdqu xmm7, oword ptr[rdi+3*BYTES_PER_BLK]
add rdi, BYTES_PER_LOOP
pxor xmm0, xmm4 ; 4 output blocks
movdqu oword ptr[rsi+0*BYTES_PER_BLK], xmm0
pxor xmm1, xmm5
movdqu oword ptr[rsi+1*BYTES_PER_BLK], xmm1
pxor xmm2, xmm6
movdqu oword ptr[rsi+2*BYTES_PER_BLK], xmm2
pxor xmm3, xmm7
movdqu oword ptr[rsi+3*BYTES_PER_BLK], xmm3
add rax, 1 ; advance counter
adc rbx, 0
add rsi, BYTES_PER_LOOP
sub r8, BYTES_PER_LOOP
jge blks_loop
;;
;; block-by-block processing
;;
short_input:
add r8, BYTES_PER_LOOP
jz quit
; get actual address of key material: pRKeys += (nr-9) * SC
lea r10,[rdx*4]
lea r10, [rcx+r10*4-9*(SC)*4] ; AES-128 round keys
single_blk_loop:
pinsrq xmm0, rax, 0 ; get counter value
pinsrq xmm0, rbx, 1
pshufb xmm0, oword ptr u128_str ; convert int the octet string
pand xmm0, xmm8 ; select counter bits
por xmm0, xmm9 ; add unchanged bits
pxor xmm0, oword ptr[rcx] ; whitening
cmp rdx,12 ; switch according to number of rounds
jl key_128_s
jz key_192_s
key_256_s:
aesenc xmm0,oword ptr[r10-4*4*SC]
aesenc xmm0,oword ptr[r10-3*4*SC]
key_192_s:
aesenc xmm0,oword ptr[r10-2*4*SC]
aesenc xmm0,oword ptr[r10-1*4*SC]
key_128_s:
aesenc xmm0,oword ptr[r10+0*4*SC]
aesenc xmm0,oword ptr[r10+1*4*SC]
aesenc xmm0,oword ptr[r10+2*4*SC]
aesenc xmm0,oword ptr[r10+3*4*SC]
aesenc xmm0,oword ptr[r10+4*4*SC]
aesenc xmm0,oword ptr[r10+5*4*SC]
aesenc xmm0,oword ptr[r10+6*4*SC]
aesenc xmm0,oword ptr[r10+7*4*SC]
aesenc xmm0,oword ptr[r10+8*4*SC]
aesenclast xmm0,oword ptr[r10+9*4*SC]
add rax, 1 ; update counter
adc rbx, 0
sub r8, BYTES_PER_BLK
jl partial_block
movdqu xmm4, oword ptr[rdi] ; input block
pxor xmm0, xmm4 ; output block
movdqu oword ptr[rsi], xmm0 ; save output block
add rdi, BYTES_PER_BLK
add rsi, BYTES_PER_BLK
cmp r8, 0
jz quit
jmp single_blk_loop
partial_block:
add r8, BYTES_PER_BLK
partial_block_loop:
pextrb r10d, xmm0, 0
psrldq xmm0, 1
movzx r11d, byte ptr[rdi]
xor r10, r11
mov byte ptr[rsi], r10b
inc rdi
inc rsi
dec r8
jnz partial_block_loop
quit:
pinsrq xmm0, rax, 0 ; get counter value
pinsrq xmm0, rbx, 1
pshufb xmm0, oword ptr u128_str ; convert int the octet string
pand xmm0, xmm8 ; select counter bits
por xmm0, xmm9 ; add unchanged bits
movdqu oword ptr[r9], xmm0 ; return updated counter
REST_XMM
REST_GPR
ret
IPPASM EncryptCTR_RIJ128pipe_AES_NI ENDP
ENDIF
ENDIF ;; _AES_NI_ENABLING_
END
|
boot/config.asm | Drip-startup/pidi-os | 41 | 177195 | <filename>boot/config.asm<gh_stars>10-100
KERNEL_SIZE db 33 ; ammount of sectors in which the kernel is located
STACK_OFFSET db 9000
KERNEL_OFFSET equ 0x1000
MSG_REAL_MODE db "Started in 16-bit Real Mode", 0
MSG_PROT_MODE db "Landed in 32-bit Protected Mode", 0
MSG_LOAD_KERNEL db "Loading kernel into memory...", 0
MSG_CRASH_KERNEL db "[KERNEL PANIC] Nothing to do!!!", 0
|
programs/oeis/089/A089026.asm | neoneye/loda | 22 | 20012 | ; A089026: a(n) = n if n is a prime, otherwise a(n) = 1.
; 1,2,3,1,5,1,7,1,1,1,11,1,13,1,1,1,17,1,19,1,1,1,23,1,1,1,1,1,29,1,31,1,1,1,1,1,37,1,1,1,41,1,43,1,1,1,47,1,1,1,1,1,53,1,1,1,1,1,59,1,61,1,1,1,1,1,67,1,1,1,71,1,73,1,1,1,1,1,79,1,1,1,83,1,1,1,1,1,89,1,1,1,1,1,1,1,97,1,1,1
mov $1,$0
seq $1,80339 ; Characteristic function of {1} union {primes}: 1 if n is 1 or a prime, else 0.
mul $0,$1
add $0,1
|
iconset_generator.scpt | tenqyu/icon-generator-ios | 0 | 3638 | (* Script for creating App Icon Images:
icon_16x16.png
[email protected]
icon_32x32.png
[email protected]
icon_128x128.png
[email protected]
icon_256x256.png
[email protected]
icon_512x512.png
[email protected]
Author: <NAME> @ Tenqyu 2015
License: Feel free to use it, modify it and spread it.
Complaints: > /dev/null 2>&1
Praises: Contact
*)
on run
try
(* Let the user choose a original file to down-size and a folder where the new files are saved *)
tell application "Finder"
activate
set fileOriginal to (choose file with prompt "Please choose the original image file:" without multiple selections allowed) as string
set folderIconFiles to (choose folder with prompt "Please choose the folder to save the newly created icon-images into:" without multiple selections allowed) as string
end tell
tell application "Adobe Photoshop CS6"
activate
open file fileOriginal
end tell
(* Resize the current document and save it *)
#set pathToDesktop to path to the desktop as text
(* iPhone App - iOS 7,8 60pt*)
(* iPhone SpotLight - iOS 5-8 29pt*)
(* iPhone SpotLight - iOS 7,8 40pt*)
(* iPhone App - iOS 5,6 50pt*)
(* iPhone App - iOS 5,6 57pt*)
#Needs to go from the largest to the smallest
tell me to resizeAndSave(folderIconFiles, "iTunesArtwork", 512, "x", 512, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "iTunesArtwork", 512, "x", 512, "", 1, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-60", 60, "x", 60, "@", 3, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-76", 76, "x", 76, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-72", 72, "x", 72, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-60", 60, "x", 60, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small-40", 40, "x", 40, "@", 3, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon", 57, "x", 57, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small-50", 50, "x", 50, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small", 29, "x", 29, "@", 3, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small-40", 40, "x", 40, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-76", 76, "x", 76, "", 1, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-72", 72, "x", 72, "", 1, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small", 29, "x", 29, "@", 2, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon", 57, "x", 57, "", 1, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small-50", 50, "x", 50, "", 1, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small-40", 40, "x", 40, "", 1, ".png")
tell me to resizeAndSave(folderIconFiles, "Icon-Small", 29, "x", 29, "", 1, ".png")
(* Close the original file *)
tell application "Adobe Photoshop CS6"
close current document saving no
end tell
on error (e)
log "Error: " & e
end try
end run
on resizeAndSave(path, prefix, sizex, dingsda, sizey, dingsbums, factor, suffix)
log "entered resizeAndSave"
if (factor as integer) = 1 then
(* Like this: [email protected] *)
set newFileName to prefix & suffix
else if (factor as integer) = 2 then
(* Like this: [email protected] *)
set newFileName to prefix & dingsbums & factor & dingsda & suffix
else if (factor as integer) = 3 then
(* Like this: [email protected] *)
set newFileName to prefix & dingsbums & factor & dingsda & suffix
else
display dialog "Invalid factor." buttons {"Does not compute?"}
return
end if
set filePath to path & ":" & newFileName
tell application "Adobe Photoshop CS6"
set UserPrefs to properties of settings
set ruler units of settings to pixel units
tell current document
width as pixels
height as pixels
resize image width (sizex * factor) height (sizey * factor) resample method bicubic
save in file filePath as PNG copying yes
end tell
end tell
end resizeAndSave
|
examples/src/examples-text_rewrites.adb | TNO/Rejuvenation-Ada | 1 | 9189 | <gh_stars>1-10
with Ada.Text_IO; use Ada.Text_IO;
with Libadalang.Analysis; use Libadalang.Analysis;
with Libadalang.Common; use Libadalang.Common;
with Rejuvenation; use Rejuvenation;
with Rejuvenation.Factory; use Rejuvenation.Factory;
with Rejuvenation.Finder; use Rejuvenation.Finder;
with Rejuvenation.Text_Rewrites; use Rejuvenation.Text_Rewrites;
with Rejuvenation.Utils; use Rejuvenation.Utils;
package body Examples.Text_Rewrites is
procedure Demo_Text_Rewrite (Unit : Analysis_Unit);
procedure Demo (File_Name : String) is
Unit : constant Analysis_Unit := Open_File (File_Name);
begin
Put_Line ("=== Examples of Text_Rewrite =======");
New_Line;
Put_Line
("--- Example insert comment (before + after Call Statement) -------");
New_Line;
Demo_Text_Rewrite (Unit);
New_Line;
end Demo;
procedure Demo_Text_Rewrite (Unit : Analysis_Unit) is
TR : Text_Rewrite_Unit := Make_Text_Rewrite_Unit (Unit);
begin
-- Insert comments before/after call statements
for Node of Find (Unit.Root, Ada_Call_Stmt) loop
TR.Prepend
(Node,
"-- inserted comment before " & Node.Image & " / " &
Raw_Signature (Node) & ASCII.CR & ASCII.LF & " ");
TR.Append
(Node,
ASCII.CR & ASCII.LF & " -- inserted comment after " &
Node.Image & " / " & Raw_Signature (Node) & ASCII.CR & ASCII.LF);
end loop;
-- Apply all rewrite operations
Put_Line (TR.ApplyToString);
end Demo_Text_Rewrite;
end Examples.Text_Rewrites;
|
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_355.asm | ljhsiun2/medusa | 9 | 15838 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r15
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x1923f, %r13
nop
nop
nop
nop
nop
inc %r15
mov (%r13), %r11
nop
xor $56523, %r13
lea addresses_D_ht+0xcbef, %rdx
nop
and $54509, %r8
mov (%rdx), %r12w
nop
and %r13, %r13
lea addresses_WT_ht+0x3cbf, %rsi
lea addresses_D_ht+0xfcbf, %rdi
nop
sub %r13, %r13
mov $14, %rcx
rep movsq
nop
nop
nop
add $47884, %rcx
lea addresses_normal_ht+0xd5cc, %rsi
lea addresses_UC_ht+0x1ea0f, %rdi
clflush (%rdi)
nop
nop
xor $4369, %r15
mov $13, %rcx
rep movsq
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0xa062, %rsi
lea addresses_A_ht+0x77ba, %rdi
nop
nop
nop
nop
and $51408, %r12
mov $28, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %r12, %r12
lea addresses_A_ht+0x1b985, %r12
nop
xor $62567, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
movups %xmm3, (%r12)
nop
nop
nop
nop
cmp $62399, %r8
lea addresses_WT_ht+0x1bda3, %r12
nop
nop
dec %r13
vmovups (%r12), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdx
nop
nop
add %r8, %r8
lea addresses_WC_ht+0x4cbf, %rsi
lea addresses_WC_ht+0x1efbf, %rdi
nop
nop
nop
nop
cmp $1071, %r15
mov $61, %rcx
rep movsb
nop
nop
nop
nop
add %rdx, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r8
push %r9
push %rbp
push %rcx
push %rsi
// Load
lea addresses_WC+0x10a3b, %r13
nop
nop
nop
nop
xor %r9, %r9
movb (%r13), %cl
nop
cmp $42347, %rbp
// Load
lea addresses_WC+0x13153, %r10
nop
cmp $35122, %r8
movups (%r10), %xmm4
vpextrq $1, %xmm4, %rcx
sub $21754, %r13
// Store
lea addresses_A+0x1b9bf, %r10
nop
nop
nop
nop
nop
cmp $56417, %r9
mov $0x5152535455565758, %rsi
movq %rsi, %xmm6
vmovups %ymm6, (%r10)
nop
xor %r13, %r13
// Store
lea addresses_normal+0x1347f, %r13
nop
nop
nop
nop
nop
cmp %r9, %r9
mov $0x5152535455565758, %r8
movq %r8, %xmm1
movntdq %xmm1, (%r13)
and $3450, %r13
// Load
lea addresses_WC+0xecbf, %r8
xor %rbp, %rbp
vmovaps (%r8), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r9
sub $21438, %r10
// Faulty Load
lea addresses_PSE+0x1d4bf, %r9
xor %r8, %r8
mov (%r9), %rsi
lea oracles, %r9
and $0xff, %rsi
shlq $12, %rsi
mov (%r9,%rsi,1), %rsi
pop %rsi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_normal'}}
{'src': {'congruent': 9, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
Driver/Socket/IRLAP/irlapInitExit.asm | steakknife/pcgeos | 504 | 13182 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1994 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: intialization routines for IRLAP
FILE: irlapInitExit.asm
AUTHOR: <NAME>, Apr 15, 1994
REVISION HISTORY:
Name Date Description
---- ---- -----------
CK 4/15/94 Initial revision
DESCRIPTION:
Init and exit procedures for IRLAP driver.
$Id: irlapInitExit.asm,v 1.1 97/04/18 11:56:55 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapCommonCode segment resource
; ****************************************************************************
;
; INIT ROUTINES
;
; ****************************************************************************
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapAllocClientEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Find a free entry in dgroup:irlapClientTable
CALLED BY: IrlapAddStation
PASS: es = dgroup
RETURN: di = offset to free client table entry
carry set if all entries are filled
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 8/17/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapAllocClientEntry proc far
uses cx
.enter
mov di, offset irlapClientTable
; The client table can't start at 0
EC < cmp di, 0 >
EC < ERROR_Z -1 >
mov cx, IRLAP_MAX_NUM_CLIENTS ; counter
;
; Linear search through the table until we find an entry with
; ICF_active bit clear
;
searchLoop:
test es:[di].IC_flags, mask ICF_RESERVED
jnz next
test es:[di].IC_flags, mask ICF_ACTIVE
clc
jz done
next:
add di, size IrlapClient
loop searchLoop
stc
done:
.leave
ret
IrlapAllocClientEntry endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapLinkInit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize the link
CALLED BY: IrlapSetupPhysicalLayer
PASS: es = dgroup
ds = station
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Get the random seed
Generate random device address
REVISION HISTORY:
Name Date Description
---- ---- -----------
CK 3/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapLinkInit proc near
uses ax
.enter
;
; Initialize the random number generator
;
call TimerGetCount ; initialize the random # generator
mov es:[randomSeed], ax
;
; Generate device address
;
call IrlapGenerateRandom32 ; dxax = 32 bit addr
movdw ds:IS_devAddr, dxax
.leave
ret
IrlapLinkInit endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapInitStation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: do misc initialization for a station that is not defined
in any state
Later may be we incorporate all the initialization in this
routine
CALLED BY: IrlapNativeRegister
PASS: ds = station
es = dgroup
cx = serial port to use (or IRLAP_DEFAULT_PORT)
RETURN: carry set if error
the only error condition is "media busy"
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
CK 5/ 6/94 Initial version
SJ 8/ 2/94 re-organized for dynamic allocation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapInitStation proc far
uses ax, bx, bx, bp, di, cx
.enter
;
; Set initial values to be read in from geos.ini file
;
call IrlapGetParamsFromInitFile
;
; Initialize threads
;
call IrlapSetupServerThread ; nothing changed
jc mediaBusy
call IrlapSetupEventThread ; nothing changed
call ApplyDefaultConnectionParams ; nothing changed
call InitConnectionState
mov ds:IS_sleepTime, IRLAP_SLEEP_TIMEOUT_TICKS
;
; Set initial state
;
ChangeState NDM, ds
mediaBusy:
.leave
ret
IrlapInitStation endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapGetParamsFromInitFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize IS_serialPort and IS_connectionParams from the
initfile or hard-coded defaults.
CALLED BY: IrlapInitStation
PASS: ds = IrlapStation segment
cx = serial port to use (or IRLAP_DEFAULT_PORT)
RETURN: These are initialized:
ds:IS_serialPort
ds:IS_connectionParams
DESTROYED: nothing
CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 9/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapGetParamsFromInitFile proc near
uses ax,cx,dx,si,di,bp,ds,es
.enter
segmov es, ds, ax ; es = station
if _SOCKET_INTERFACE
;
; get link mgt mode
;
clr es:[IS_linkMgtMode]
endif ;_SOCKET_INTERFACE
;
; get serial port, unless one is already specified
;
mov bx, handle IrlapStrings
call MemLock
mov ds, ax
cmp cx, IRLAP_DEFAULT_PORT
je getPort
mov es:[IS_serialPort], cx
jmp getAddress
getPort:
;
; Get necessary strings from IrlapStrings
;
mov cx, ds
mov si, offset portKeyword
mov dx, ds:[si] ;cx:dx = portKeyword
mov si, offset irlapCategory
mov si, ds:[si] ;ds:si = irlapCategory
mov ax, SERIAL_COM1
call InitFileReadInteger ;ax = integer
mov es:[IS_serialPort], ax
getAddress:
if _SOCKET_INTERFACE
;
; If we are not socket client, skip this and leave whatever is
; currently in DiscoveryInfo section of XID frame alone
;
test es:IS_status, mask ISS_SOCKET_CLIENT
jz skipAddress
;
; ds = IrlapStrings segment
; ds:si = irlapCategory
;
mov si, offset irlapCategory
mov si, ds:[si] ; ds:si = irlapCategory
mov cx, ds
;
; read in address for the device
; keyword = "address"
;
mov di, offset addressKeyword
mov dx, ds:[di] ; cx:dx = portKeyword
mov di, offset IS_discoveryXIDFrame +\
offset IDXF_discoveryInfo
mov bp, IRLAP_ADDRESS_LEN
call InitFileReadString ;-> es:di = filled in; bx destroyed
; bx = destroyed
jnc addressFound ; cx = num bytes read
;
; address not found( default address = "UNKNOWN" )
;
mov si, offset defaultAddressStr
mov si, ds:[si] ; ds:si = default addr
mov cx, (8 / 2) ; length of default addr
mov_tr dx, di
rep movsw
mov_tr di, dx
mov cx, 7
addressFound:
;
; es:di = IDXF_discoveryInfo field in IS_discoveryXIDFrame
; cx = length of address string
;
cmp cx, IRLAP_ADDRESS_LEN; the max lenght of address field
jb rightSize
dec cx ; truncate last character if cx = 16
rightSize:
add di, cx
clr {byte}es:[di] ; store null terminator for string
skipAddress:
endif ;_SOCKET_INTERFACE
;
; es = station, ds = IrlapStrings segment
;
;
; Get default negotiation parameters
;
call InitializeNegotiationParams
;
; Unlock string block
;
mov bx, handle IrlapStrings
call MemUnlock
.leave
ret
IrlapGetParamsFromInitFile endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitializeNegotiationParams
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get default connection parameters from .ini file or by other
means, and put them into station structure in
IS_connectionParams field.
CALLED BY: IrlapGetParamsFromInitFile
PrepareNegotiationParams
PASS: es = station
ds = IrlapStrings segment
RETURN: nothing( IS_connectionParams filled in with connection params )
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 9/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitializeNegotiationParams proc far
uses ax, bx, si, di, cx, dx, bp
.enter
;
; Parameters gotten from .ini file:
;
; Parameter Default
; --------- -------
; baudRate 9600 bps
; maxTurnaround 500 ms
; dataSize 64 bytes
; windowSize 1 frame
; numBOFs 5
; minTurnaround 10 ms
; linkDisconnect 3 secs
;
mov di, offset IS_connectionParams ;es:di = IS_connParams
mov si, offset irlapCategory
mov si, ds:[si] ;ds:si = category str
mov cx, ds ;cx = IrlapStrings seg
;
; baudrate
;
mov bp, offset baudrateKeyword
mov dx, ds:[bp]
mov ax, mask IPBR_9600BPS
call InitFileReadInteger
mov es:[di].ICP_baudRate, al
;
; max turnaround
;
mov bp, offset maxTurnaroundKeyword
mov dx, ds:[bp]
mov ax, mask IPMTA_500MS
call InitFileReadInteger
mov es:[di].ICP_maxTurnAround, al
;
; data size
;
mov bp, offset dataSizeKeyword
mov dx, ds:[bp]
mov ax, mask IPDS_64BYTES
call InitFileReadInteger
mov es:[di].ICP_dataSizeIn, al
;
; window size
;
mov bp, offset windowSizeKeyword
mov dx, ds:[bp]
mov ax, mask IPWS_1FRAME
call InitFileReadInteger
mov es:[di].ICP_windowSizeIn, al
;
; number of BOFs
;
mov bp, offset numBOFsKeyword
mov dx, ds:[bp]
mov ax, mask IPNB_5BOF
call InitFileReadInteger
mov es:[di].ICP_numBof, al
;
; minimum turnaround
;
mov bp, offset minTurnaroundKeyword
mov dx, ds:[bp]
mov ax, mask IPMT_10MS
call InitFileReadInteger
mov es:[di].ICP_minTurnAround, al
;
; link disconnect
;
mov bp, offset linkDisconnectKeyword
mov dx, ds:[bp]
mov ax, mask IPLTT_3SEC
call InitFileReadInteger
mov es:[di].ICP_linkDisconnect, al
.leave
ret
InitializeNegotiationParams endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapSetupEventThread
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Setup event thread if there isn't already one running.
CALLED BY: IrlapInitStation, IrlapConnectRequest
PASS: ds = station
es = dgroup
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
If there is no thread running for this station,
create an event thread with IRLAP as the owner
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 8/ 2/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapSetupEventThread proc far
uses ax,bx,cx,dx,si,di,bp,ds,es
.enter
;
; Check if there is already a thread running here
;
tst ds:IS_eventThreadHandle
jnz skip
;
; sets up event-driven thread of IrlapProcessClass for the
; state machine.
;
push ds
mov bx, handle ui
mov bp, 400h ;use a 1k stack
movfptr cxdx, IrlapProcessClass
mov si, handle 0
mov di, mask MF_CALL
mov ax, MSG_PROCESS_CREATE_EVENT_THREAD_WITH_OWNER
call ObjMessage
pop ds ; restore station
mov ds:IS_eventThreadHandle, ax ; save thread handle
;
; Increase the priority of the event thread.
;
mov bx, ax ;bx = thread handle
mov ah, mask TMF_BASE_PRIO
mov al, PRIORITY_HIGH
call ThreadModify ;bx = thread handle
mov ax, TGIT_QUEUE_HANDLE
call ThreadGetInfo
mov ds:IS_eventQueue, ax
;
; Allocate a queue for pending events (freed in IDCDetach)
;
push bx ;save thread handle
call GeodeAllocQueue
mov ax, handle 0 ;set owner to irlap
call HandleModifyOwner
mov ds:IS_pendingEventQueue, bx
pop bx ;bx = thread
;
; ds = station segment
; This is done because MSG_META_ATTACH has no way to get params
; (MSG_META_ATTACH is
; the first msg)
;
mov ax, ds ; ax = station segment
mov di, mask MF_FORCE_QUEUE
call ObjMessage
skip:
.leave
ret
IrlapSetupEventThread endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapSetupServerThread
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Setup a server thread so that irlap state machine can start
receiving events. If there is already a thread running for
this station, don't create it.
CALLED BY: IrlapInitStation
IrlapEnableReceiver
PASS: ds = IrlapStation
es = dgroup
RETURN: carry set if error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Create a thread that runs server loop in IrlapResidentCode
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 8/ 2/94 Initial version
jwu 12/13/94 Added serial lurker changes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapSetupServerThread proc far
uses ax,bx,cx,dx,bp
.enter
;
; Check if there is already a server thread running, if so skip
; creating the thread
;
tst_clc ds:[IS_serverThreadHandle]
jnz exit
and ds:[IS_status], not mask ISS_GOING_AWAY
;
; Open serial connection
;
mov ax, mask SOF_TIMEOUT
mov bx, ds:[IS_serialPort]
mov cx, IRLAP_INPUT_BUFFER_SIZE
mov dx, IRLAP_OUTPUT_BUFFER_SIZE
mov bp, IRLAP_SERIAL_OPEN_TIMEOUT
mov di, DR_SERIAL_OPEN_FOR_DRIVER
mov si, handle 0
call es:[serialStrategy]
jc openFailed
;
; setup the recv thread of the station
;
mov al, PRIORITY_TIME_CRITICAL
mov di, IRLAP_RECV_STACK_SIZE
movfptr cxdx, IrlapRecvLoop
mov bx, ds ; pass this to cx of RecvLoop
mov bp, handle 0 ; owner = IRLAP
call ThreadCreate ; -> bx = thread handle, cx = 0
EC < ERROR_C IRLAP_UNABLE_TO_CREATE_THREAD >
mov ds:[IS_serverThreadHandle], bx
clc
exit:
.leave
ret
openFailed:
;
; Notify lurker that port was preempted by another geode, if
; lurker loaded this driver.
;
clr dl
xchg dl, es:[lurkerUsed]
tst_clc dl
je done
mov dx, GWNT_LOST_SERIAL_CONNECTION
call IrlapNotifyLurker
done:
stc
jmp exit
IrlapSetupServerThread endp
; ****************************************************************************
; ****************************************************************************
; *********************** EXIT ROUTINES ***************************
; ****************************************************************************
; ****************************************************************************
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapCleanupServerThread
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Kills the server thread
CALLED BY: IrlapNativeUnregister
PASS: ds = station
es = dgroup
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 8/ 8/94 Initial version
jwu 12/13/94 Added serial lurker changes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapCleanupServerThread proc near
uses ax,bx,cx,dx,di
.enter
;
; Set goingAway flag
;
BitSet ds:IS_status, ISS_GOING_AWAY
;
; Wait untile server thread is done using serial driver.
; or give enough time for the flag to be read by server thread
;
mov bx, ds:IS_serialSem
mov cx, IRLAP_SERIAL_SEM_TIMEOUT
call ThreadPTimedSem ; ax destroyed
call ThreadVSem
;
; Close the port so that any threads blocking on it will exit
;
clr bx
xchg bx, ds:IS_serialPort
mov ax, STREAM_DISCARD
mov di, DR_STREAM_CLOSE
call es:serialStrategy
;
; Return port to serial lurker, if necessary.
;
clr dl
xchg dl, es:lurkerUsed
tst dl
je exit
mov dx, GWNT_END_SERIAL_CONNECTION
call IrlapNotifyLurker
exit:
.leave
ret
IrlapCleanupServerThread endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapCleanupEventThread
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Kills the thread that runs event loop
CALLED BY: IrlapSocketUnregister
PASS: ds = station
es = dgroup
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 8/ 8/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapCleanupEventThread proc near
uses ax,bx,cx,dx,si,di,bp,ds
.enter
;
; Set disconnected state, as we're a goner
;
ChangeState NDM, ds
;
; Send dummy event to flush pending real events
;
mov bx, ds:IS_eventThreadHandle
mov ax, (ILE_CONTROL shl 8) or IDC_CHECK_STORED_EVENTS
mov di, mask MF_FORCE_QUEUE
call ObjMessage
;
; Send a MSG_META_DETACH to event thread
;
clr bx
xchg bx, ds:IS_eventThreadHandle
mov ah, ILE_CONTROL
mov al, IDC_DETACH
mov di, mask MF_FORCE_QUEUE
call ObjMessage
;
; Stop all the timers so that the kernel doesn't send message to a
; dead thread
;
movdw axbx, ds:IS_pTimer
call TimerStop
movdw axbx, ds:IS_fTimer
call TimerStop
.leave
ret
IrlapCleanupEventThread endp
;
; Sniff open utilities
;
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapDisableReceiver
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Closes serial port
CALLED BY: SniffTImerExpiredSNIFF
PASS: ds = station
RETURN: nothing
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 9/29/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapDisableReceiver proc far
uses ax
.enter
;
; Kill server thread
;
GetDgroup es, ax
call IrlapCleanupServerThread
.leave
ret
IrlapDisableReceiver endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapEnableReceiver
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Open serial port
Start server thread
CALLED BY: IDCAbortSniff
SleepTimerExpiredSLEEP
PASS: ds = station segment
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Open serial port
Setup server thread accroding to the configuration of
the station
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 9/29/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapEnableReceiver proc far
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Setup server thread
;
GetDgroup es, ax
call IrlapSetupServerThread
call ApplyConnectionParameters
.leave
ret
IrlapEnableReceiver endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IrlapNotifyLurker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send the serial lurker a notification about the port.
CALLED BY: IrlapSetupServerThread
IrlapCleanupServerThread
PASS: dx = GWNT_END_SERIAL_CONNECTION or
GWNT_LOST_SERIAL_CONNECTION
es = dgroup
ds = station
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jwu 12/13/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
IrlapNotifyLurker proc near
uses ax,bx,cx,dx,si,di,bp
.enter
clrdw bxsi ; no optr
mov cx, MANUFACTURER_ID_GEOWORKS
mov bp, ds:[IS_serialPort]
mov ax, MSG_META_NOTIFY
mov di, mask MF_RECORD
call ObjMessage ; di = event handle
mov bx, MANUFACTURER_ID_GEOWORKS
mov ax, GCNSLT_NOTIFY_SERIAL_LURKER
mov cx, di ; cx = event handle
clr dx, bp ; no data nor flags
call GCNListSend
.leave
ret
IrlapNotifyLurker endp
IrlapCommonCode ends
|
libsrc/spectrum/zx_multiface.asm | dex4er/deb-z88dk | 1 | 27420 | ;
; ZX Spectrum specific routines
; by <NAME>, 14/09/2006
;
; int zx_multiface();
;
; The result is:
; - 1 (true) if the MultiFace is connected
; - 0 (false) otherwise
;
; $Id: zx_multiface.asm,v 1.1 2006/12/01 16:58:30 stefano Exp $
;
XLIB zx_multiface
zx_multiface:
ld hl,0
in a,($bf)
in a,($9f)
ld a,(200)
ld b,a
in a,($3f)
in a,($1f)
ld a,(200)
cp b
ret z
inc hl
ret
|
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_810_1810.asm | ljhsiun2/medusa | 9 | 246131 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x17c17, %r15
nop
nop
and $3500, %r13
mov (%r15), %r10d
nop
nop
and %rbx, %rbx
lea addresses_WT_ht+0x17, %rsi
lea addresses_normal_ht+0x3218, %rdi
nop
nop
sub %r15, %r15
mov $22, %rcx
rep movsb
xor %rsi, %rsi
lea addresses_A_ht+0x1223b, %r15
nop
nop
nop
xor %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm1
vmovups %ymm1, (%r15)
nop
nop
sub %r10, %r10
lea addresses_WT_ht+0x18217, %rsi
lea addresses_normal_ht+0x13a17, %rdi
nop
nop
dec %rdx
mov $20, %rcx
rep movsb
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x1a097, %r15
nop
and $61116, %rcx
and $0xffffffffffffffc0, %r15
vmovaps (%r15), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rbx
nop
nop
cmp $45186, %rdi
lea addresses_WC_ht+0x1d497, %r15
nop
nop
nop
nop
nop
cmp $28811, %rcx
mov (%r15), %r13d
nop
nop
nop
nop
add %r15, %r15
lea addresses_UC_ht+0x82b3, %rsi
lea addresses_A_ht+0xa0b7, %rdi
nop
nop
nop
nop
nop
and %r10, %r10
mov $115, %rcx
rep movsb
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WC_ht+0x13417, %rbx
nop
nop
nop
add %rcx, %rcx
mov (%rbx), %rsi
nop
inc %rbx
lea addresses_WT_ht+0x1417, %rdx
clflush (%rdx)
nop
sub $64398, %r15
movl $0x61626364, (%rdx)
nop
nop
nop
inc %rdx
lea addresses_UC_ht+0x1c017, %rsi
lea addresses_D_ht+0x9c17, %rdi
nop
nop
nop
sub $53371, %r10
mov $68, %rcx
rep movsb
nop
nop
cmp %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r9
push %rax
push %rbp
push %rbx
push %rdx
push %rsi
// Load
lea addresses_WT+0x199, %rdx
nop
nop
sub $10789, %rsi
movups (%rdx), %xmm6
vpextrq $0, %xmm6, %rax
dec %rbp
// Store
lea addresses_WC+0x15df7, %rax
clflush (%rax)
nop
xor %r9, %r9
mov $0x5152535455565758, %r10
movq %r10, %xmm2
vmovups %ymm2, (%rax)
sub %r10, %r10
// Store
lea addresses_normal+0x1217, %rbp
nop
nop
nop
xor %rbx, %rbx
movl $0x51525354, (%rbp)
nop
nop
nop
sub $57758, %rdx
// Load
lea addresses_PSE+0xe417, %r9
nop
nop
nop
and $31842, %r10
mov (%r9), %si
nop
nop
nop
add %r10, %r10
// Store
lea addresses_RW+0x18c17, %rdx
nop
nop
nop
nop
nop
and %rsi, %rsi
movl $0x51525354, (%rdx)
dec %rbp
// Store
lea addresses_normal+0x18ed7, %rbp
nop
cmp $10114, %rdx
mov $0x5152535455565758, %rax
movq %rax, %xmm6
movups %xmm6, (%rbp)
and $4688, %rbx
// Store
lea addresses_A+0x14c17, %rbx
sub %rax, %rax
mov $0x5152535455565758, %rbp
movq %rbp, (%rbx)
nop
nop
nop
nop
xor %rbx, %rbx
// Faulty Load
lea addresses_A+0x12417, %r10
nop
add %rbp, %rbp
mov (%r10), %edx
lea oracles, %rbx
and $0xff, %rdx
shlq $12, %rdx
mov (%rbx,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 4, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': True, 'type': 'addresses_normal', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_PSE', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': True, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_A', 'size': 8, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': True, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'00': 810}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
x86/SeeTest.asm | lantonov/asm | 150 | 166594 | ;// Test whether see(m) >= value.
;int see_test(Pos *pos, Move m, int value)
;{
; if (type_of_m(m) == CASTLING)
; return 0 >= value;
;
; Square from = from_sq(m), to = to_sq(m);
; Bitboard occ = pieces();
;
; int swap = PieceValue[MG][piece_on(to)] - value;
; if (type_of_m(m) == ENPASSANT) {
; assert(pos_stm() == color_of(piece_on(from)));
; occ ^= sq_bb(to - pawn_push(pos_stm())); // Remove the captured pawn
; swap += PieceValue[MG][PAWN];
; }
; if (swap < 0)
; return 0;
;
; swap = PieceValue[MG][piece_on(from)] - swap;
; if (swap <= 0)
; return 1;
;
; occ ^= sq_bb(from) ^ sq_bb(to);
; Bitboard attackers = attackers_to_occ(to, occ) & occ;
; int stm = color_of(piece_on(from)) ^ 1;
; int res = 1;
; Bitboard stmAttackers;
;
; while (1) {
; stmAttackers = attackers & pieces_c(stm);
; if ( (stmAttackers & pinned_pieces(pos, stm))
; && (pos->st->pinnersForKing[stm] & occ) == pos->st->pinnersForKing[stm])
; stmAttackers &= ~pinned_pieces(pos, stm);
; if (!stmAttackers) break;
; Bitboard bb;
; int captured;
; for (captured = PAWN; captured < KING; captured++)
; if ((bb = stmAttackers & pieces_p(captured)))
; break;
; if (captured == KING) {
; stm ^= 1;
; stmAttackers = attackers & pieces_c(stm);
; // Introduce error also present in official Stockfish.
; if ( (stmAttackers & pinned_pieces(pos, stm))
; && (pos->st->pinnersForKing[stm] & occ) == pos->st->pinnersForKing[stm])
; stmAttackers &= ~pinned_pieces(pos, stm);
; return stmAttackers ? res : res ^ 1;
; }
; swap = PieceValue[MG][captured] - swap;
; res ^= 1;
; // Next line tests alternately for swap < 0 and swap <= 0.
; if (swap < res) return res;
; occ ^= (bb & -bb);
; if (captured & 1) // PAWN, BISHOP, QUEEN
; attackers |= attacks_bb_bishop(to, occ) & pieces_pp(BISHOP, QUEEN);
; if (captured & 4) // ROOK, QUEEN
; attackers |= attacks_bb_rook(to, occ) & pieces_pp(ROOK, QUEEN);
; attackers &= occ;
; stm ^= 1;
; }
;
; return res;
;}
calign 16, SeeTestGe.HaveFromTo
SeeTestGe:
; in: rbp address of Pos
; rbx address of State
; ecx capture move
; edx value
; out: eax = 1 if see >= edx
; eax = 0 if see < edx
from equ r8
from_d equ r8d
to equ r9
to_d equ r9d
stm equ rsi
stm_d equ esi
attackers equ r15
occupied equ r14
bb equ r13
stmAttackers equ r12
swap equ edx
res equ eax
; r8 = from
; r9 = to
mov r8d, ecx
shr r8d, 6
and r8d, 63
mov r9d, ecx
and r9d, 63
.HaveFromTo:
push r12 r13 r14 r15 rsi rdi
mov occupied, qword[rbp+Pos.typeBB+8*White]
or occupied, qword[rbp+Pos.typeBB+8*Black]
btr occupied, from
btc occupied, to
; r10 = bishops + queens
; r11 = rooks + queens
mov rdi, qword[rbp+Pos.typeBB+8*Queen]
mov r10, qword[rbp+Pos.typeBB+8*Bishop]
mov r11, qword[rbp+Pos.typeBB+8*Rook]
or r10, rdi
or r11, rdi
neg swap
xor res, res
test ecx, 0xFFFFF000
jnz .Special
movzx ecx, byte[rbp+Pos.board+to]
add swap, dword[PieceValue_MG+4*rcx]
cmp swap, res
jl .Return ; 2.35%
.EpCaptureRet:
xor res, 1 ; .res = 1
neg swap
movzx stm_d, byte[rbp+Pos.board+from]
add swap, dword[PieceValue_MG+4*stm] ; use piece_on(from)
and stm_d, 8
cmp swap, res
jl .Return ; 13.63%
; at this point .from register r8 is free
; rdi, rcx are also free
mov attackers, qword[KingAttacks+8*to]
and attackers, qword[rbp+Pos.typeBB+8*King]
mov rdi, qword[BlackPawnAttacks+8*to]
and rdi, qword[rbp+Pos.typeBB+8*White]
and rdi, qword[rbp+Pos.typeBB+8*Pawn]
or attackers, rdi
mov rdi, qword[WhitePawnAttacks+8*to]
and rdi, qword[rbp+Pos.typeBB+8*Black]
and rdi, qword[rbp+Pos.typeBB+8*Pawn]
or attackers, rdi
mov rdi, qword[KnightAttacks+8*to]
and rdi, qword[rbp+Pos.typeBB+8*Knight]
or attackers, rdi
RookAttacks rdi, to, occupied, r8
and rdi, r11
or attackers, rdi
BishopAttacks rdi, to, occupied, r8
and rdi, r10
or attackers, rdi
.Loop: ; while (1) {
xor stm_d, 8
and attackers, occupied
; modified old
mov stmAttackers, qword[rbp+Pos.typeBB+stm]
and stmAttackers, attackers
jz .Return ; 44.45%
test stmAttackers, qword[rbx+State.blockersForKing+stm]
jz @f ; 98.90%
mov rdi, qword[rbx+State.pinnersForKing+stm]
and rdi, occupied
cmp rdi, qword[rbx+State.pinnersForKing+stm]
jne @f ; 53.42%
mov rcx, qword[rbx+State.blockersForKing+stm]
not rcx
and stmAttackers, rcx
jz .Return ; 45.06%
@@:
; ; new 0.3% speed loss with or without branches
; xor ecx, ecx
; mov stmAttackers, qword[rbp+Pos.typeBB+stm]
; and stmAttackers, attackers
; andn rdi, occupied, qword[rbx+State.pinnersForKing+stm]
; cmovz rcx, qword[rbx+State.blockersForKing+stm]
; andn stmAttackers, rcx, stmAttackers
; jz .Return
neg swap
xor res, 1
mov bb, qword[rbp+Pos.typeBB+8*Pawn]
and bb, stmAttackers
jnz .FoundPawn
mov bb, qword[rbp+Pos.typeBB+8*Knight]
and bb, stmAttackers
jnz .FoundKnight
mov bb, qword[rbp+Pos.typeBB+8*Bishop]
and bb, stmAttackers
jnz .FoundBishop
mov bb, qword[rbp+Pos.typeBB+8*Rook]
and bb, stmAttackers
jnz .FoundRook
mov bb, qword[rbp+Pos.typeBB+8*Queen]
and bb, stmAttackers
jnz .FoundQueen
.FoundKing:
xor stm_d, 8
mov stmAttackers, qword[rbp+Pos.typeBB+stm]
and stmAttackers, attackers
; .res has already been flipped so we must do
; return stmAttackers ? res^1 : res;
neg stmAttackers
adc res, 0
and res, 1
.Return:
pop rdi rsi r15 r14 r13 r12
ret
calign 8
.FoundQueen:
add swap, QueenValueMg
cmp swap, res
jl .Return
_blsi bb, bb, r8
xor occupied, bb
BishopAttacks rdi, to, occupied, r8
and rdi, r10
or attackers, rdi
RookAttacks rdi, to, occupied, r8
and rdi, r11
or attackers, rdi
jmp .Loop
.FoundRook:
add swap, RookValueMg
cmp swap, res
jl .Return
_blsi bb, bb, r8
xor occupied, bb
RookAttacks rdi, to, occupied, r8
and rdi, r11
or attackers, rdi
jmp .Loop
calign 8
.FoundBishop:
add swap, BishopValueMg-PawnValueMg
.FoundPawn:
add swap, PawnValueMg
cmp swap, res
jl .Return
_blsi bb, bb, rcx
xor occupied, bb
BishopAttacks rdi, to, occupied, r8
and rdi, r10
or attackers, rdi
jmp .Loop
calign 8
.FoundKnight:
add swap, KnightValueMg
cmp swap, res
jl .Return
_blsi bb, bb, rcx
xor occupied, bb
jmp .Loop
calign 8
.Special:
; if we get here, swap = -value and res = 0
cmp swap, 0x80000000
adc res, res
pop rdi rsi r15 r14 r13 r12
ret
restore from
restore from_d
restore to
restore to_d
restore stm
restore stm_d
restore attackers
restore occupied
restore bb
restore stmAttackers
restore swap
restore res
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2.log_723_932.asm | ljhsiun2/medusa | 9 | 98473 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x10aea, %r8
nop
nop
nop
nop
nop
dec %r11
movw $0x6162, (%r8)
nop
nop
nop
sub $16725, %rcx
lea addresses_WC_ht+0xb2ea, %rax
nop
nop
nop
nop
nop
add $3915, %rdx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm2
movups %xmm2, (%rax)
nop
nop
nop
inc %rax
lea addresses_UC_ht+0x122ea, %rsi
lea addresses_WC_ht+0xceea, %rdi
clflush (%rdi)
nop
nop
nop
cmp $59223, %r8
mov $60, %rcx
rep movsq
nop
nop
and $62393, %r8
lea addresses_UC_ht+0x712a, %rbp
nop
nop
nop
nop
inc %rdx
movups (%rbp), %xmm1
vpextrq $1, %xmm1, %rcx
nop
nop
nop
cmp %rbp, %rbp
lea addresses_normal_ht+0x6ea, %rcx
nop
nop
and %rax, %rax
movw $0x6162, (%rcx)
inc %r8
lea addresses_normal_ht+0x1d6ea, %rsi
lea addresses_D_ht+0xcfea, %rdi
clflush (%rsi)
nop
nop
inc %rdx
mov $120, %rcx
rep movsq
nop
nop
inc %rcx
lea addresses_A_ht+0x13d2a, %rbp
nop
nop
nop
nop
sub $11109, %rcx
movb $0x61, (%rbp)
nop
nop
nop
mfence
lea addresses_normal_ht+0x1ae19, %rsi
lea addresses_WT_ht+0x4b4e, %rdi
nop
sub $30242, %r8
mov $127, %rcx
rep movsl
nop
nop
nop
nop
add %r11, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %rbp
push %rbx
push %rcx
push %rsi
// Store
lea addresses_PSE+0x2eea, %r8
nop
nop
nop
xor $34228, %r15
movl $0x51525354, (%r8)
nop
nop
nop
add %r10, %r10
// Store
lea addresses_RW+0x3e6a, %rsi
nop
nop
nop
nop
add $27093, %rbp
movb $0x51, (%rsi)
nop
nop
and %r15, %r15
// Store
mov $0x5a6b880000000b0a, %rsi
nop
nop
nop
xor $15842, %rbx
movl $0x51525354, (%rsi)
nop
nop
nop
nop
cmp %rbx, %rbx
// Load
lea addresses_WT+0xb8ea, %rbp
and $40348, %rsi
mov (%rbp), %r15w
nop
nop
nop
nop
cmp %r10, %r10
// Store
lea addresses_WT+0x438a, %r8
nop
nop
nop
nop
sub $17953, %r10
movb $0x51, (%r8)
nop
nop
add %r10, %r10
// Faulty Load
lea addresses_PSE+0x2eea, %rcx
nop
nop
nop
nop
nop
and $6045, %rbx
mov (%rcx), %bp
lea oracles, %rcx
and $0xff, %rbp
shlq $12, %rbp
mov (%rcx,%rbp,1), %rbp
pop %rsi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'54': 723}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
|
programs/oeis/168/A168125.asm | neoneye/loda | 22 | 93570 | <filename>programs/oeis/168/A168125.asm
; A168125: a(n) = n^2*(n^7+1)/2.
; 0,1,258,9846,131080,976575,5038866,20176828,67108896,193710285,500000050,1178973906,2579890248,5302249771,10330523490,19221679800,34359738496,59293938393,99179645346,161343849070,256000000200,397140023511,603634609138,900576330996,1320903770400,1907348633125,2714751839826,3812798742858,5289227977096,7253572988355,9841500000450,13219811080816,17592186044928,23205742201521,30358496383810,39407819336550,50779978334856,64980869898223,82608050632146,104364180580140,131072000000800,163690967197821,203335691925618,251296305969346,309060919755720,378340321290075,461095081335586,559565236552488,676302730298496,814206798956425,976562500001250,1167082586546526,1389952941819208,1649881795902471,1952152956158130,2302683291993700,2708084724074016,3175730977693653,3713829369824146,4331497909329210,5038848000001800,5847073046418931,6768543273133698,7816907078428896,9007199254743040,10355956418947425,11881340006902146,13603267198149718,15543550148217096,17726043917790495,20176803500002450,22924250359227036,25999348907117088,29435793354136621,33270205387542450,37542343139651250,42295321923291976,47575847224588683,53434460456645346,59925797991312280,67108864000003200,75047317648502841,83809775204857378,93470127633773646,104107874265468360,115808473141605175,128663708655835506,142772077121518548,158239190914436896,175178201853746565,193710244500004050,213964900064898346,236080681643282568,260205541494247971,286497401114312770,315124704862309200,346266997912244736,380115529327287313,416873881065079746,456758623741825350
mov $1,$0
pow $0,2
pow $1,9
add $0,$1
div $0,2
|
oeis/267/A267898.asm | neoneye/loda-programs | 11 | 81760 | ; A267898: a(n) = prime(n)! + prime(n).
; 4,9,125,5047,39916811,6227020813,355687428096017,121645100408832019,25852016738884976640023,8841761993739701954543616000029,8222838654177922817725562880000031,13763753091226345046315979581580902400000037
seq $0,40 ; The prime numbers.
add $1,$0
seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
mov $2,$1
add $2,$0
mov $0,$2
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1395.asm | ljhsiun2/medusa | 9 | 13739 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x9e98, %rdi
nop
nop
nop
nop
xor $53683, %r10
movb $0x61, (%rdi)
nop
nop
nop
nop
xor $29896, %rax
lea addresses_WC_ht+0x1ab98, %rsi
lea addresses_D_ht+0x110c8, %rdi
nop
nop
inc %r13
mov $40, %rcx
rep movsw
nop
nop
nop
nop
nop
dec %r13
lea addresses_WT_ht+0xad80, %rdi
add %r10, %r10
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%rdi)
nop
nop
nop
and %r13, %r13
lea addresses_WT_ht+0x8398, %r10
nop
nop
nop
nop
cmp %r12, %r12
movl $0x61626364, (%r10)
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x13398, %r12
nop
nop
nop
nop
dec %rsi
movb $0x61, (%r12)
nop
and $13343, %r12
lea addresses_D_ht+0x1bf50, %rax
nop
nop
nop
add $61643, %r12
mov (%rax), %r13d
nop
nop
dec %r12
lea addresses_D_ht+0x1bf3a, %rsi
lea addresses_WT_ht+0x1948c, %rdi
nop
nop
nop
xor $32581, %rbp
mov $89, %rcx
rep movsb
nop
nop
sub %rax, %rax
lea addresses_WT_ht+0x16a98, %r12
nop
nop
sub $48125, %rsi
mov $0x6162636465666768, %r13
movq %r13, %xmm0
vmovups %ymm0, (%r12)
nop
cmp $8414, %rcx
lea addresses_UC_ht+0x1b898, %r10
nop
nop
cmp %rax, %rax
mov (%r10), %r12w
nop
nop
nop
nop
nop
inc %r13
lea addresses_WC_ht+0x20a8, %rsi
lea addresses_WT_ht+0x10398, %rdi
nop
sub $8170, %rax
mov $89, %rcx
rep movsw
nop
nop
add %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r15
push %rbx
push %rdi
push %rsi
// Faulty Load
lea addresses_UC+0x12b98, %rsi
nop
nop
add $58145, %rdi
mov (%rsi), %r15w
lea oracles, %r14
and $0xff, %r15
shlq $12, %r15
mov (%r14,%r15,1), %r15
pop %rsi
pop %rdi
pop %rbx
pop %r15
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
|
parsers-multiline_source-text_io.adb | jrcarter/Ada_GUI | 19 | 10424 | <filename>parsers-multiline_source-text_io.adb
-- --
-- package Copyright (c) <NAME> --
-- Parsers.Multiline_Source.Text_IO Luebeck --
-- Implementation Winter, 2004 --
-- --
-- Last revision : 13:13 14 Sep 2019 --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU 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 --
-- General Public License for more details. You should have --
-- received a copy of the GNU 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. --
-- --
-- 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. --
--____________________________________________________________________--
package body Parsers.Multiline_Source.Text_IO is
Increment : constant Integer := 512;
procedure Get_Line (Code : in out Source) is
Size : Natural;
begin
if Code.Buffer = null then
raise End_Error;
end if;
Get_Line (Code.File.all, Code.Buffer.all, Size);
Code.Length := Size;
while Code.Length = Code.Buffer'Last loop
declare
Old_Line : String_Ptr := Code.Buffer;
begin
Code.Buffer := new String (1..Old_Line'Length + Increment);
Code.Buffer (1..Old_Line'Length) := Old_Line.all;
Free (Old_Line);
end;
Get_Line
( Code.File.all,
Code.Buffer (Code.Length + 1..Code.Buffer'Last),
Size
);
Code.Length := Size;
end loop;
exception
when others =>
Free (Code.Buffer);
raise;
end Get_Line;
end Parsers.Multiline_Source.Text_IO;
|
pwnlib/shellcraft/templates/arm/linux/exit.asm | IMULMUL/python3-pwntools | 325 | 12571 | <%
from pwnlib.shellcraft.arm.linux import syscall
%>
<%page args="status"/>
<%docstring>
Invokes the syscall exit. See 'man 2 exit' for more information.
Arguments:
status(int): status
</%docstring>
${syscall('SYS_exit', status)}
|
user/set_priority.asm | tanmay-pro/modified-xv6 | 0 | 91562 | <reponame>tanmay-pro/modified-xv6<filename>user/set_priority.asm
user/_set_priority: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <main>:
#include "kernel/stat.h"
#include "user/user.h"
#include "kernel/fcntl.h"
int main(int argc, char **argv)
{
0: 1101 addi sp,sp,-32
2: ec06 sd ra,24(sp)
4: e822 sd s0,16(sp)
6: e426 sd s1,8(sp)
8: e04a sd s2,0(sp)
a: 1000 addi s0,sp,32
if (argc != 3)
c: 478d li a5,3
e: 00f50f63 beq a0,a5,2c <main+0x2c>
{
printf("Usage: set_priority <pid> <priority>\n");
12: 00001517 auipc a0,0x1
16: 82e50513 addi a0,a0,-2002 # 840 <malloc+0xe8>
1a: 00000097 auipc ra,0x0
1e: 680080e7 jalr 1664(ra) # 69a <printf>
exit(1);
22: 4505 li a0,1
24: 00000097 auipc ra,0x0
28: 2e6080e7 jalr 742(ra) # 30a <exit>
2c: 84ae mv s1,a1
}
int pid = atoi(argv[2]);
2e: 6988 ld a0,16(a1)
30: 00000097 auipc ra,0x0
34: 1da080e7 jalr 474(ra) # 20a <atoi>
38: 892a mv s2,a0
int priority = atoi(argv[1]);
3a: 6488 ld a0,8(s1)
3c: 00000097 auipc ra,0x0
40: 1ce080e7 jalr 462(ra) # 20a <atoi>
44: 84aa mv s1,a0
if(priority < 0 || priority > 100)
46: 0005071b sext.w a4,a0
4a: 06400793 li a5,100
4e: 00e7ff63 bgeu a5,a4,6c <main+0x6c>
{
printf("Invalid priority\n");
52: 00001517 auipc a0,0x1
56: 81650513 addi a0,a0,-2026 # 868 <malloc+0x110>
5a: 00000097 auipc ra,0x0
5e: 640080e7 jalr 1600(ra) # 69a <printf>
exit(1);
62: 4505 li a0,1
64: 00000097 auipc ra,0x0
68: 2a6080e7 jalr 678(ra) # 30a <exit>
}
int result = set_priority(priority, pid);
6c: 85ca mv a1,s2
6e: 00000097 auipc ra,0x0
72: 34c080e7 jalr 844(ra) # 3ba <set_priority>
76: 85aa mv a1,a0
printf("Prioirty changed from %d to %d\n", result, priority);
78: 8626 mv a2,s1
7a: 00001517 auipc a0,0x1
7e: 80650513 addi a0,a0,-2042 # 880 <malloc+0x128>
82: 00000097 auipc ra,0x0
86: 618080e7 jalr 1560(ra) # 69a <printf>
exit(0);
8a: 4501 li a0,0
8c: 00000097 auipc ra,0x0
90: 27e080e7 jalr 638(ra) # 30a <exit>
0000000000000094 <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
94: 1141 addi sp,sp,-16
96: e422 sd s0,8(sp)
98: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
9a: 87aa mv a5,a0
9c: 0585 addi a1,a1,1
9e: 0785 addi a5,a5,1
a0: fff5c703 lbu a4,-1(a1)
a4: fee78fa3 sb a4,-1(a5)
a8: fb75 bnez a4,9c <strcpy+0x8>
;
return os;
}
aa: 6422 ld s0,8(sp)
ac: 0141 addi sp,sp,16
ae: 8082 ret
00000000000000b0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
b0: 1141 addi sp,sp,-16
b2: e422 sd s0,8(sp)
b4: 0800 addi s0,sp,16
while(*p && *p == *q)
b6: 00054783 lbu a5,0(a0)
ba: cb91 beqz a5,ce <strcmp+0x1e>
bc: 0005c703 lbu a4,0(a1)
c0: 00f71763 bne a4,a5,ce <strcmp+0x1e>
p++, q++;
c4: 0505 addi a0,a0,1
c6: 0585 addi a1,a1,1
while(*p && *p == *q)
c8: 00054783 lbu a5,0(a0)
cc: fbe5 bnez a5,bc <strcmp+0xc>
return (uchar)*p - (uchar)*q;
ce: 0005c503 lbu a0,0(a1)
}
d2: 40a7853b subw a0,a5,a0
d6: 6422 ld s0,8(sp)
d8: 0141 addi sp,sp,16
da: 8082 ret
00000000000000dc <strlen>:
uint
strlen(const char *s)
{
dc: 1141 addi sp,sp,-16
de: e422 sd s0,8(sp)
e0: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
e2: 00054783 lbu a5,0(a0)
e6: cf91 beqz a5,102 <strlen+0x26>
e8: 0505 addi a0,a0,1
ea: 87aa mv a5,a0
ec: 4685 li a3,1
ee: 9e89 subw a3,a3,a0
f0: 00f6853b addw a0,a3,a5
f4: 0785 addi a5,a5,1
f6: fff7c703 lbu a4,-1(a5)
fa: fb7d bnez a4,f0 <strlen+0x14>
;
return n;
}
fc: 6422 ld s0,8(sp)
fe: 0141 addi sp,sp,16
100: 8082 ret
for(n = 0; s[n]; n++)
102: 4501 li a0,0
104: bfe5 j fc <strlen+0x20>
0000000000000106 <memset>:
void*
memset(void *dst, int c, uint n)
{
106: 1141 addi sp,sp,-16
108: e422 sd s0,8(sp)
10a: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
10c: ce09 beqz a2,126 <memset+0x20>
10e: 87aa mv a5,a0
110: fff6071b addiw a4,a2,-1
114: 1702 slli a4,a4,0x20
116: 9301 srli a4,a4,0x20
118: 0705 addi a4,a4,1
11a: 972a add a4,a4,a0
cdst[i] = c;
11c: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
120: 0785 addi a5,a5,1
122: fee79de3 bne a5,a4,11c <memset+0x16>
}
return dst;
}
126: 6422 ld s0,8(sp)
128: 0141 addi sp,sp,16
12a: 8082 ret
000000000000012c <strchr>:
char*
strchr(const char *s, char c)
{
12c: 1141 addi sp,sp,-16
12e: e422 sd s0,8(sp)
130: 0800 addi s0,sp,16
for(; *s; s++)
132: 00054783 lbu a5,0(a0)
136: cb99 beqz a5,14c <strchr+0x20>
if(*s == c)
138: 00f58763 beq a1,a5,146 <strchr+0x1a>
for(; *s; s++)
13c: 0505 addi a0,a0,1
13e: 00054783 lbu a5,0(a0)
142: fbfd bnez a5,138 <strchr+0xc>
return (char*)s;
return 0;
144: 4501 li a0,0
}
146: 6422 ld s0,8(sp)
148: 0141 addi sp,sp,16
14a: 8082 ret
return 0;
14c: 4501 li a0,0
14e: bfe5 j 146 <strchr+0x1a>
0000000000000150 <gets>:
char*
gets(char *buf, int max)
{
150: 711d addi sp,sp,-96
152: ec86 sd ra,88(sp)
154: e8a2 sd s0,80(sp)
156: e4a6 sd s1,72(sp)
158: e0ca sd s2,64(sp)
15a: fc4e sd s3,56(sp)
15c: f852 sd s4,48(sp)
15e: f456 sd s5,40(sp)
160: f05a sd s6,32(sp)
162: ec5e sd s7,24(sp)
164: 1080 addi s0,sp,96
166: 8baa mv s7,a0
168: 8a2e mv s4,a1
int i, cc;
char c;
for(i=0; i+1 < max; ){
16a: 892a mv s2,a0
16c: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
16e: 4aa9 li s5,10
170: 4b35 li s6,13
for(i=0; i+1 < max; ){
172: 89a6 mv s3,s1
174: 2485 addiw s1,s1,1
176: 0344d863 bge s1,s4,1a6 <gets+0x56>
cc = read(0, &c, 1);
17a: 4605 li a2,1
17c: faf40593 addi a1,s0,-81
180: 4501 li a0,0
182: 00000097 auipc ra,0x0
186: 1a0080e7 jalr 416(ra) # 322 <read>
if(cc < 1)
18a: 00a05e63 blez a0,1a6 <gets+0x56>
buf[i++] = c;
18e: faf44783 lbu a5,-81(s0)
192: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
196: 01578763 beq a5,s5,1a4 <gets+0x54>
19a: 0905 addi s2,s2,1
19c: fd679be3 bne a5,s6,172 <gets+0x22>
for(i=0; i+1 < max; ){
1a0: 89a6 mv s3,s1
1a2: a011 j 1a6 <gets+0x56>
1a4: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
1a6: 99de add s3,s3,s7
1a8: 00098023 sb zero,0(s3)
return buf;
}
1ac: 855e mv a0,s7
1ae: 60e6 ld ra,88(sp)
1b0: 6446 ld s0,80(sp)
1b2: 64a6 ld s1,72(sp)
1b4: 6906 ld s2,64(sp)
1b6: 79e2 ld s3,56(sp)
1b8: 7a42 ld s4,48(sp)
1ba: 7aa2 ld s5,40(sp)
1bc: 7b02 ld s6,32(sp)
1be: 6be2 ld s7,24(sp)
1c0: 6125 addi sp,sp,96
1c2: 8082 ret
00000000000001c4 <stat>:
int
stat(const char *n, struct stat *st)
{
1c4: 1101 addi sp,sp,-32
1c6: ec06 sd ra,24(sp)
1c8: e822 sd s0,16(sp)
1ca: e426 sd s1,8(sp)
1cc: e04a sd s2,0(sp)
1ce: 1000 addi s0,sp,32
1d0: 892e mv s2,a1
int fd;
int r;
fd = open(n, O_RDONLY);
1d2: 4581 li a1,0
1d4: 00000097 auipc ra,0x0
1d8: 176080e7 jalr 374(ra) # 34a <open>
if(fd < 0)
1dc: 02054563 bltz a0,206 <stat+0x42>
1e0: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
1e2: 85ca mv a1,s2
1e4: 00000097 auipc ra,0x0
1e8: 17e080e7 jalr 382(ra) # 362 <fstat>
1ec: 892a mv s2,a0
close(fd);
1ee: 8526 mv a0,s1
1f0: 00000097 auipc ra,0x0
1f4: 142080e7 jalr 322(ra) # 332 <close>
return r;
}
1f8: 854a mv a0,s2
1fa: 60e2 ld ra,24(sp)
1fc: 6442 ld s0,16(sp)
1fe: 64a2 ld s1,8(sp)
200: 6902 ld s2,0(sp)
202: 6105 addi sp,sp,32
204: 8082 ret
return -1;
206: 597d li s2,-1
208: bfc5 j 1f8 <stat+0x34>
000000000000020a <atoi>:
int
atoi(const char *s)
{
20a: 1141 addi sp,sp,-16
20c: e422 sd s0,8(sp)
20e: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
210: 00054603 lbu a2,0(a0)
214: fd06079b addiw a5,a2,-48
218: 0ff7f793 andi a5,a5,255
21c: 4725 li a4,9
21e: 02f76963 bltu a4,a5,250 <atoi+0x46>
222: 86aa mv a3,a0
n = 0;
224: 4501 li a0,0
while('0' <= *s && *s <= '9')
226: 45a5 li a1,9
n = n*10 + *s++ - '0';
228: 0685 addi a3,a3,1
22a: 0025179b slliw a5,a0,0x2
22e: 9fa9 addw a5,a5,a0
230: 0017979b slliw a5,a5,0x1
234: 9fb1 addw a5,a5,a2
236: fd07851b addiw a0,a5,-48
while('0' <= *s && *s <= '9')
23a: 0006c603 lbu a2,0(a3)
23e: fd06071b addiw a4,a2,-48
242: 0ff77713 andi a4,a4,255
246: fee5f1e3 bgeu a1,a4,228 <atoi+0x1e>
return n;
}
24a: 6422 ld s0,8(sp)
24c: 0141 addi sp,sp,16
24e: 8082 ret
n = 0;
250: 4501 li a0,0
252: bfe5 j 24a <atoi+0x40>
0000000000000254 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
254: 1141 addi sp,sp,-16
256: e422 sd s0,8(sp)
258: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
25a: 02b57663 bgeu a0,a1,286 <memmove+0x32>
while(n-- > 0)
25e: 02c05163 blez a2,280 <memmove+0x2c>
262: fff6079b addiw a5,a2,-1
266: 1782 slli a5,a5,0x20
268: 9381 srli a5,a5,0x20
26a: 0785 addi a5,a5,1
26c: 97aa add a5,a5,a0
dst = vdst;
26e: 872a mv a4,a0
*dst++ = *src++;
270: 0585 addi a1,a1,1
272: 0705 addi a4,a4,1
274: fff5c683 lbu a3,-1(a1)
278: fed70fa3 sb a3,-1(a4)
while(n-- > 0)
27c: fee79ae3 bne a5,a4,270 <memmove+0x1c>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
280: 6422 ld s0,8(sp)
282: 0141 addi sp,sp,16
284: 8082 ret
dst += n;
286: 00c50733 add a4,a0,a2
src += n;
28a: 95b2 add a1,a1,a2
while(n-- > 0)
28c: fec05ae3 blez a2,280 <memmove+0x2c>
290: fff6079b addiw a5,a2,-1
294: 1782 slli a5,a5,0x20
296: 9381 srli a5,a5,0x20
298: fff7c793 not a5,a5
29c: 97ba add a5,a5,a4
*--dst = *--src;
29e: 15fd addi a1,a1,-1
2a0: 177d addi a4,a4,-1
2a2: 0005c683 lbu a3,0(a1)
2a6: 00d70023 sb a3,0(a4)
while(n-- > 0)
2aa: fee79ae3 bne a5,a4,29e <memmove+0x4a>
2ae: bfc9 j 280 <memmove+0x2c>
00000000000002b0 <memcmp>:
int
memcmp(const void *s1, const void *s2, uint n)
{
2b0: 1141 addi sp,sp,-16
2b2: e422 sd s0,8(sp)
2b4: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
2b6: ca05 beqz a2,2e6 <memcmp+0x36>
2b8: fff6069b addiw a3,a2,-1
2bc: 1682 slli a3,a3,0x20
2be: 9281 srli a3,a3,0x20
2c0: 0685 addi a3,a3,1
2c2: 96aa add a3,a3,a0
if (*p1 != *p2) {
2c4: 00054783 lbu a5,0(a0)
2c8: 0005c703 lbu a4,0(a1)
2cc: 00e79863 bne a5,a4,2dc <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
2d0: 0505 addi a0,a0,1
p2++;
2d2: 0585 addi a1,a1,1
while (n-- > 0) {
2d4: fed518e3 bne a0,a3,2c4 <memcmp+0x14>
}
return 0;
2d8: 4501 li a0,0
2da: a019 j 2e0 <memcmp+0x30>
return *p1 - *p2;
2dc: 40e7853b subw a0,a5,a4
}
2e0: 6422 ld s0,8(sp)
2e2: 0141 addi sp,sp,16
2e4: 8082 ret
return 0;
2e6: 4501 li a0,0
2e8: bfe5 j 2e0 <memcmp+0x30>
00000000000002ea <memcpy>:
void *
memcpy(void *dst, const void *src, uint n)
{
2ea: 1141 addi sp,sp,-16
2ec: e406 sd ra,8(sp)
2ee: e022 sd s0,0(sp)
2f0: 0800 addi s0,sp,16
return memmove(dst, src, n);
2f2: 00000097 auipc ra,0x0
2f6: f62080e7 jalr -158(ra) # 254 <memmove>
}
2fa: 60a2 ld ra,8(sp)
2fc: 6402 ld s0,0(sp)
2fe: 0141 addi sp,sp,16
300: 8082 ret
0000000000000302 <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
302: 4885 li a7,1
ecall
304: 00000073 ecall
ret
308: 8082 ret
000000000000030a <exit>:
.global exit
exit:
li a7, SYS_exit
30a: 4889 li a7,2
ecall
30c: 00000073 ecall
ret
310: 8082 ret
0000000000000312 <wait>:
.global wait
wait:
li a7, SYS_wait
312: 488d li a7,3
ecall
314: 00000073 ecall
ret
318: 8082 ret
000000000000031a <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
31a: 4891 li a7,4
ecall
31c: 00000073 ecall
ret
320: 8082 ret
0000000000000322 <read>:
.global read
read:
li a7, SYS_read
322: 4895 li a7,5
ecall
324: 00000073 ecall
ret
328: 8082 ret
000000000000032a <write>:
.global write
write:
li a7, SYS_write
32a: 48c1 li a7,16
ecall
32c: 00000073 ecall
ret
330: 8082 ret
0000000000000332 <close>:
.global close
close:
li a7, SYS_close
332: 48d5 li a7,21
ecall
334: 00000073 ecall
ret
338: 8082 ret
000000000000033a <kill>:
.global kill
kill:
li a7, SYS_kill
33a: 4899 li a7,6
ecall
33c: 00000073 ecall
ret
340: 8082 ret
0000000000000342 <exec>:
.global exec
exec:
li a7, SYS_exec
342: 489d li a7,7
ecall
344: 00000073 ecall
ret
348: 8082 ret
000000000000034a <open>:
.global open
open:
li a7, SYS_open
34a: 48bd li a7,15
ecall
34c: 00000073 ecall
ret
350: 8082 ret
0000000000000352 <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
352: 48c5 li a7,17
ecall
354: 00000073 ecall
ret
358: 8082 ret
000000000000035a <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
35a: 48c9 li a7,18
ecall
35c: 00000073 ecall
ret
360: 8082 ret
0000000000000362 <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
362: 48a1 li a7,8
ecall
364: 00000073 ecall
ret
368: 8082 ret
000000000000036a <link>:
.global link
link:
li a7, SYS_link
36a: 48cd li a7,19
ecall
36c: 00000073 ecall
ret
370: 8082 ret
0000000000000372 <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
372: 48d1 li a7,20
ecall
374: 00000073 ecall
ret
378: 8082 ret
000000000000037a <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
37a: 48a5 li a7,9
ecall
37c: 00000073 ecall
ret
380: 8082 ret
0000000000000382 <dup>:
.global dup
dup:
li a7, SYS_dup
382: 48a9 li a7,10
ecall
384: 00000073 ecall
ret
388: 8082 ret
000000000000038a <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
38a: 48ad li a7,11
ecall
38c: 00000073 ecall
ret
390: 8082 ret
0000000000000392 <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
392: 48b1 li a7,12
ecall
394: 00000073 ecall
ret
398: 8082 ret
000000000000039a <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
39a: 48b5 li a7,13
ecall
39c: 00000073 ecall
ret
3a0: 8082 ret
00000000000003a2 <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
3a2: 48b9 li a7,14
ecall
3a4: 00000073 ecall
ret
3a8: 8082 ret
00000000000003aa <trace>:
.global trace
trace:
li a7, SYS_trace
3aa: 48d9 li a7,22
ecall
3ac: 00000073 ecall
ret
3b0: 8082 ret
00000000000003b2 <waitx>:
.global waitx
waitx:
li a7, SYS_waitx
3b2: 48dd li a7,23
ecall
3b4: 00000073 ecall
ret
3b8: 8082 ret
00000000000003ba <set_priority>:
.global set_priority
set_priority:
li a7, SYS_set_priority
3ba: 48e1 li a7,24
ecall
3bc: 00000073 ecall
ret
3c0: 8082 ret
00000000000003c2 <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
3c2: 1101 addi sp,sp,-32
3c4: ec06 sd ra,24(sp)
3c6: e822 sd s0,16(sp)
3c8: 1000 addi s0,sp,32
3ca: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
3ce: 4605 li a2,1
3d0: fef40593 addi a1,s0,-17
3d4: 00000097 auipc ra,0x0
3d8: f56080e7 jalr -170(ra) # 32a <write>
}
3dc: 60e2 ld ra,24(sp)
3de: 6442 ld s0,16(sp)
3e0: 6105 addi sp,sp,32
3e2: 8082 ret
00000000000003e4 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
3e4: 7139 addi sp,sp,-64
3e6: fc06 sd ra,56(sp)
3e8: f822 sd s0,48(sp)
3ea: f426 sd s1,40(sp)
3ec: f04a sd s2,32(sp)
3ee: ec4e sd s3,24(sp)
3f0: 0080 addi s0,sp,64
3f2: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
3f4: c299 beqz a3,3fa <printint+0x16>
3f6: 0805c863 bltz a1,486 <printint+0xa2>
neg = 1;
x = -xx;
} else {
x = xx;
3fa: 2581 sext.w a1,a1
neg = 0;
3fc: 4881 li a7,0
3fe: fc040693 addi a3,s0,-64
}
i = 0;
402: 4701 li a4,0
do{
buf[i++] = digits[x % base];
404: 2601 sext.w a2,a2
406: 00000517 auipc a0,0x0
40a: 4a250513 addi a0,a0,1186 # 8a8 <digits>
40e: 883a mv a6,a4
410: 2705 addiw a4,a4,1
412: 02c5f7bb remuw a5,a1,a2
416: 1782 slli a5,a5,0x20
418: 9381 srli a5,a5,0x20
41a: 97aa add a5,a5,a0
41c: 0007c783 lbu a5,0(a5)
420: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
424: 0005879b sext.w a5,a1
428: 02c5d5bb divuw a1,a1,a2
42c: 0685 addi a3,a3,1
42e: fec7f0e3 bgeu a5,a2,40e <printint+0x2a>
if(neg)
432: 00088b63 beqz a7,448 <printint+0x64>
buf[i++] = '-';
436: fd040793 addi a5,s0,-48
43a: 973e add a4,a4,a5
43c: 02d00793 li a5,45
440: fef70823 sb a5,-16(a4)
444: 0028071b addiw a4,a6,2
while(--i >= 0)
448: 02e05863 blez a4,478 <printint+0x94>
44c: fc040793 addi a5,s0,-64
450: 00e78933 add s2,a5,a4
454: fff78993 addi s3,a5,-1
458: 99ba add s3,s3,a4
45a: 377d addiw a4,a4,-1
45c: 1702 slli a4,a4,0x20
45e: 9301 srli a4,a4,0x20
460: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
464: fff94583 lbu a1,-1(s2)
468: 8526 mv a0,s1
46a: 00000097 auipc ra,0x0
46e: f58080e7 jalr -168(ra) # 3c2 <putc>
while(--i >= 0)
472: 197d addi s2,s2,-1
474: ff3918e3 bne s2,s3,464 <printint+0x80>
}
478: 70e2 ld ra,56(sp)
47a: 7442 ld s0,48(sp)
47c: 74a2 ld s1,40(sp)
47e: 7902 ld s2,32(sp)
480: 69e2 ld s3,24(sp)
482: 6121 addi sp,sp,64
484: 8082 ret
x = -xx;
486: 40b005bb negw a1,a1
neg = 1;
48a: 4885 li a7,1
x = -xx;
48c: bf8d j 3fe <printint+0x1a>
000000000000048e <vprintf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
48e: 7119 addi sp,sp,-128
490: fc86 sd ra,120(sp)
492: f8a2 sd s0,112(sp)
494: f4a6 sd s1,104(sp)
496: f0ca sd s2,96(sp)
498: ecce sd s3,88(sp)
49a: e8d2 sd s4,80(sp)
49c: e4d6 sd s5,72(sp)
49e: e0da sd s6,64(sp)
4a0: fc5e sd s7,56(sp)
4a2: f862 sd s8,48(sp)
4a4: f466 sd s9,40(sp)
4a6: f06a sd s10,32(sp)
4a8: ec6e sd s11,24(sp)
4aa: 0100 addi s0,sp,128
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
4ac: 0005c903 lbu s2,0(a1)
4b0: 18090f63 beqz s2,64e <vprintf+0x1c0>
4b4: 8aaa mv s5,a0
4b6: 8b32 mv s6,a2
4b8: 00158493 addi s1,a1,1
state = 0;
4bc: 4981 li s3,0
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
4be: 02500a13 li s4,37
if(c == 'd'){
4c2: 06400c13 li s8,100
printint(fd, va_arg(ap, int), 10, 1);
} else if(c == 'l') {
4c6: 06c00c93 li s9,108
printint(fd, va_arg(ap, uint64), 10, 0);
} else if(c == 'x') {
4ca: 07800d13 li s10,120
printint(fd, va_arg(ap, int), 16, 0);
} else if(c == 'p') {
4ce: 07000d93 li s11,112
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
4d2: 00000b97 auipc s7,0x0
4d6: 3d6b8b93 addi s7,s7,982 # 8a8 <digits>
4da: a839 j 4f8 <vprintf+0x6a>
putc(fd, c);
4dc: 85ca mv a1,s2
4de: 8556 mv a0,s5
4e0: 00000097 auipc ra,0x0
4e4: ee2080e7 jalr -286(ra) # 3c2 <putc>
4e8: a019 j 4ee <vprintf+0x60>
} else if(state == '%'){
4ea: 01498f63 beq s3,s4,508 <vprintf+0x7a>
for(i = 0; fmt[i]; i++){
4ee: 0485 addi s1,s1,1
4f0: fff4c903 lbu s2,-1(s1)
4f4: 14090d63 beqz s2,64e <vprintf+0x1c0>
c = fmt[i] & 0xff;
4f8: 0009079b sext.w a5,s2
if(state == 0){
4fc: fe0997e3 bnez s3,4ea <vprintf+0x5c>
if(c == '%'){
500: fd479ee3 bne a5,s4,4dc <vprintf+0x4e>
state = '%';
504: 89be mv s3,a5
506: b7e5 j 4ee <vprintf+0x60>
if(c == 'd'){
508: 05878063 beq a5,s8,548 <vprintf+0xba>
} else if(c == 'l') {
50c: 05978c63 beq a5,s9,564 <vprintf+0xd6>
} else if(c == 'x') {
510: 07a78863 beq a5,s10,580 <vprintf+0xf2>
} else if(c == 'p') {
514: 09b78463 beq a5,s11,59c <vprintf+0x10e>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
518: 07300713 li a4,115
51c: 0ce78663 beq a5,a4,5e8 <vprintf+0x15a>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
520: 06300713 li a4,99
524: 0ee78e63 beq a5,a4,620 <vprintf+0x192>
putc(fd, va_arg(ap, uint));
} else if(c == '%'){
528: 11478863 beq a5,s4,638 <vprintf+0x1aa>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
52c: 85d2 mv a1,s4
52e: 8556 mv a0,s5
530: 00000097 auipc ra,0x0
534: e92080e7 jalr -366(ra) # 3c2 <putc>
putc(fd, c);
538: 85ca mv a1,s2
53a: 8556 mv a0,s5
53c: 00000097 auipc ra,0x0
540: e86080e7 jalr -378(ra) # 3c2 <putc>
}
state = 0;
544: 4981 li s3,0
546: b765 j 4ee <vprintf+0x60>
printint(fd, va_arg(ap, int), 10, 1);
548: 008b0913 addi s2,s6,8
54c: 4685 li a3,1
54e: 4629 li a2,10
550: 000b2583 lw a1,0(s6)
554: 8556 mv a0,s5
556: 00000097 auipc ra,0x0
55a: e8e080e7 jalr -370(ra) # 3e4 <printint>
55e: 8b4a mv s6,s2
state = 0;
560: 4981 li s3,0
562: b771 j 4ee <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
564: 008b0913 addi s2,s6,8
568: 4681 li a3,0
56a: 4629 li a2,10
56c: 000b2583 lw a1,0(s6)
570: 8556 mv a0,s5
572: 00000097 auipc ra,0x0
576: e72080e7 jalr -398(ra) # 3e4 <printint>
57a: 8b4a mv s6,s2
state = 0;
57c: 4981 li s3,0
57e: bf85 j 4ee <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
580: 008b0913 addi s2,s6,8
584: 4681 li a3,0
586: 4641 li a2,16
588: 000b2583 lw a1,0(s6)
58c: 8556 mv a0,s5
58e: 00000097 auipc ra,0x0
592: e56080e7 jalr -426(ra) # 3e4 <printint>
596: 8b4a mv s6,s2
state = 0;
598: 4981 li s3,0
59a: bf91 j 4ee <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
59c: 008b0793 addi a5,s6,8
5a0: f8f43423 sd a5,-120(s0)
5a4: 000b3983 ld s3,0(s6)
putc(fd, '0');
5a8: 03000593 li a1,48
5ac: 8556 mv a0,s5
5ae: 00000097 auipc ra,0x0
5b2: e14080e7 jalr -492(ra) # 3c2 <putc>
putc(fd, 'x');
5b6: 85ea mv a1,s10
5b8: 8556 mv a0,s5
5ba: 00000097 auipc ra,0x0
5be: e08080e7 jalr -504(ra) # 3c2 <putc>
5c2: 4941 li s2,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
5c4: 03c9d793 srli a5,s3,0x3c
5c8: 97de add a5,a5,s7
5ca: 0007c583 lbu a1,0(a5)
5ce: 8556 mv a0,s5
5d0: 00000097 auipc ra,0x0
5d4: df2080e7 jalr -526(ra) # 3c2 <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
5d8: 0992 slli s3,s3,0x4
5da: 397d addiw s2,s2,-1
5dc: fe0914e3 bnez s2,5c4 <vprintf+0x136>
printptr(fd, va_arg(ap, uint64));
5e0: f8843b03 ld s6,-120(s0)
state = 0;
5e4: 4981 li s3,0
5e6: b721 j 4ee <vprintf+0x60>
s = va_arg(ap, char*);
5e8: 008b0993 addi s3,s6,8
5ec: 000b3903 ld s2,0(s6)
if(s == 0)
5f0: 02090163 beqz s2,612 <vprintf+0x184>
while(*s != 0){
5f4: 00094583 lbu a1,0(s2)
5f8: c9a1 beqz a1,648 <vprintf+0x1ba>
putc(fd, *s);
5fa: 8556 mv a0,s5
5fc: 00000097 auipc ra,0x0
600: dc6080e7 jalr -570(ra) # 3c2 <putc>
s++;
604: 0905 addi s2,s2,1
while(*s != 0){
606: 00094583 lbu a1,0(s2)
60a: f9e5 bnez a1,5fa <vprintf+0x16c>
s = va_arg(ap, char*);
60c: 8b4e mv s6,s3
state = 0;
60e: 4981 li s3,0
610: bdf9 j 4ee <vprintf+0x60>
s = "(null)";
612: 00000917 auipc s2,0x0
616: 28e90913 addi s2,s2,654 # 8a0 <malloc+0x148>
while(*s != 0){
61a: 02800593 li a1,40
61e: bff1 j 5fa <vprintf+0x16c>
putc(fd, va_arg(ap, uint));
620: 008b0913 addi s2,s6,8
624: 000b4583 lbu a1,0(s6)
628: 8556 mv a0,s5
62a: 00000097 auipc ra,0x0
62e: d98080e7 jalr -616(ra) # 3c2 <putc>
632: 8b4a mv s6,s2
state = 0;
634: 4981 li s3,0
636: bd65 j 4ee <vprintf+0x60>
putc(fd, c);
638: 85d2 mv a1,s4
63a: 8556 mv a0,s5
63c: 00000097 auipc ra,0x0
640: d86080e7 jalr -634(ra) # 3c2 <putc>
state = 0;
644: 4981 li s3,0
646: b565 j 4ee <vprintf+0x60>
s = va_arg(ap, char*);
648: 8b4e mv s6,s3
state = 0;
64a: 4981 li s3,0
64c: b54d j 4ee <vprintf+0x60>
}
}
}
64e: 70e6 ld ra,120(sp)
650: 7446 ld s0,112(sp)
652: 74a6 ld s1,104(sp)
654: 7906 ld s2,96(sp)
656: 69e6 ld s3,88(sp)
658: 6a46 ld s4,80(sp)
65a: 6aa6 ld s5,72(sp)
65c: 6b06 ld s6,64(sp)
65e: 7be2 ld s7,56(sp)
660: 7c42 ld s8,48(sp)
662: 7ca2 ld s9,40(sp)
664: 7d02 ld s10,32(sp)
666: 6de2 ld s11,24(sp)
668: 6109 addi sp,sp,128
66a: 8082 ret
000000000000066c <fprintf>:
void
fprintf(int fd, const char *fmt, ...)
{
66c: 715d addi sp,sp,-80
66e: ec06 sd ra,24(sp)
670: e822 sd s0,16(sp)
672: 1000 addi s0,sp,32
674: e010 sd a2,0(s0)
676: e414 sd a3,8(s0)
678: e818 sd a4,16(s0)
67a: ec1c sd a5,24(s0)
67c: 03043023 sd a6,32(s0)
680: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
684: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
688: 8622 mv a2,s0
68a: 00000097 auipc ra,0x0
68e: e04080e7 jalr -508(ra) # 48e <vprintf>
}
692: 60e2 ld ra,24(sp)
694: 6442 ld s0,16(sp)
696: 6161 addi sp,sp,80
698: 8082 ret
000000000000069a <printf>:
void
printf(const char *fmt, ...)
{
69a: 711d addi sp,sp,-96
69c: ec06 sd ra,24(sp)
69e: e822 sd s0,16(sp)
6a0: 1000 addi s0,sp,32
6a2: e40c sd a1,8(s0)
6a4: e810 sd a2,16(s0)
6a6: ec14 sd a3,24(s0)
6a8: f018 sd a4,32(s0)
6aa: f41c sd a5,40(s0)
6ac: 03043823 sd a6,48(s0)
6b0: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
6b4: 00840613 addi a2,s0,8
6b8: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
6bc: 85aa mv a1,a0
6be: 4505 li a0,1
6c0: 00000097 auipc ra,0x0
6c4: dce080e7 jalr -562(ra) # 48e <vprintf>
}
6c8: 60e2 ld ra,24(sp)
6ca: 6442 ld s0,16(sp)
6cc: 6125 addi sp,sp,96
6ce: 8082 ret
00000000000006d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6d0: 1141 addi sp,sp,-16
6d2: e422 sd s0,8(sp)
6d4: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header*)ap - 1;
6d6: ff050693 addi a3,a0,-16
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6da: 00000797 auipc a5,0x0
6de: 1e67b783 ld a5,486(a5) # 8c0 <freep>
6e2: a805 j 712 <free+0x42>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
6e4: 4618 lw a4,8(a2)
6e6: 9db9 addw a1,a1,a4
6e8: feb52c23 sw a1,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
6ec: 6398 ld a4,0(a5)
6ee: 6318 ld a4,0(a4)
6f0: fee53823 sd a4,-16(a0)
6f4: a091 j 738 <free+0x68>
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
6f6: ff852703 lw a4,-8(a0)
6fa: 9e39 addw a2,a2,a4
6fc: c790 sw a2,8(a5)
p->s.ptr = bp->s.ptr;
6fe: ff053703 ld a4,-16(a0)
702: e398 sd a4,0(a5)
704: a099 j 74a <free+0x7a>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
706: 6398 ld a4,0(a5)
708: 00e7e463 bltu a5,a4,710 <free+0x40>
70c: 00e6ea63 bltu a3,a4,720 <free+0x50>
{
710: 87ba mv a5,a4
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
712: fed7fae3 bgeu a5,a3,706 <free+0x36>
716: 6398 ld a4,0(a5)
718: 00e6e463 bltu a3,a4,720 <free+0x50>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
71c: fee7eae3 bltu a5,a4,710 <free+0x40>
if(bp + bp->s.size == p->s.ptr){
720: ff852583 lw a1,-8(a0)
724: 6390 ld a2,0(a5)
726: 02059713 slli a4,a1,0x20
72a: 9301 srli a4,a4,0x20
72c: 0712 slli a4,a4,0x4
72e: 9736 add a4,a4,a3
730: fae60ae3 beq a2,a4,6e4 <free+0x14>
bp->s.ptr = p->s.ptr;
734: fec53823 sd a2,-16(a0)
if(p + p->s.size == bp){
738: 4790 lw a2,8(a5)
73a: 02061713 slli a4,a2,0x20
73e: 9301 srli a4,a4,0x20
740: 0712 slli a4,a4,0x4
742: 973e add a4,a4,a5
744: fae689e3 beq a3,a4,6f6 <free+0x26>
} else
p->s.ptr = bp;
748: e394 sd a3,0(a5)
freep = p;
74a: 00000717 auipc a4,0x0
74e: 16f73b23 sd a5,374(a4) # 8c0 <freep>
}
752: 6422 ld s0,8(sp)
754: 0141 addi sp,sp,16
756: 8082 ret
0000000000000758 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
758: 7139 addi sp,sp,-64
75a: fc06 sd ra,56(sp)
75c: f822 sd s0,48(sp)
75e: f426 sd s1,40(sp)
760: f04a sd s2,32(sp)
762: ec4e sd s3,24(sp)
764: e852 sd s4,16(sp)
766: e456 sd s5,8(sp)
768: e05a sd s6,0(sp)
76a: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
76c: 02051493 slli s1,a0,0x20
770: 9081 srli s1,s1,0x20
772: 04bd addi s1,s1,15
774: 8091 srli s1,s1,0x4
776: 0014899b addiw s3,s1,1
77a: 0485 addi s1,s1,1
if((prevp = freep) == 0){
77c: 00000517 auipc a0,0x0
780: 14453503 ld a0,324(a0) # 8c0 <freep>
784: c515 beqz a0,7b0 <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
786: 611c ld a5,0(a0)
if(p->s.size >= nunits){
788: 4798 lw a4,8(a5)
78a: 02977f63 bgeu a4,s1,7c8 <malloc+0x70>
78e: 8a4e mv s4,s3
790: 0009871b sext.w a4,s3
794: 6685 lui a3,0x1
796: 00d77363 bgeu a4,a3,79c <malloc+0x44>
79a: 6a05 lui s4,0x1
79c: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
7a0: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
7a4: 00000917 auipc s2,0x0
7a8: 11c90913 addi s2,s2,284 # 8c0 <freep>
if(p == (char*)-1)
7ac: 5afd li s5,-1
7ae: a88d j 820 <malloc+0xc8>
base.s.ptr = freep = prevp = &base;
7b0: 00000797 auipc a5,0x0
7b4: 11878793 addi a5,a5,280 # 8c8 <base>
7b8: 00000717 auipc a4,0x0
7bc: 10f73423 sd a5,264(a4) # 8c0 <freep>
7c0: e39c sd a5,0(a5)
base.s.size = 0;
7c2: 0007a423 sw zero,8(a5)
if(p->s.size >= nunits){
7c6: b7e1 j 78e <malloc+0x36>
if(p->s.size == nunits)
7c8: 02e48b63 beq s1,a4,7fe <malloc+0xa6>
p->s.size -= nunits;
7cc: 4137073b subw a4,a4,s3
7d0: c798 sw a4,8(a5)
p += p->s.size;
7d2: 1702 slli a4,a4,0x20
7d4: 9301 srli a4,a4,0x20
7d6: 0712 slli a4,a4,0x4
7d8: 97ba add a5,a5,a4
p->s.size = nunits;
7da: 0137a423 sw s3,8(a5)
freep = prevp;
7de: 00000717 auipc a4,0x0
7e2: 0ea73123 sd a0,226(a4) # 8c0 <freep>
return (void*)(p + 1);
7e6: 01078513 addi a0,a5,16
if((p = morecore(nunits)) == 0)
return 0;
}
}
7ea: 70e2 ld ra,56(sp)
7ec: 7442 ld s0,48(sp)
7ee: 74a2 ld s1,40(sp)
7f0: 7902 ld s2,32(sp)
7f2: 69e2 ld s3,24(sp)
7f4: 6a42 ld s4,16(sp)
7f6: 6aa2 ld s5,8(sp)
7f8: 6b02 ld s6,0(sp)
7fa: 6121 addi sp,sp,64
7fc: 8082 ret
prevp->s.ptr = p->s.ptr;
7fe: 6398 ld a4,0(a5)
800: e118 sd a4,0(a0)
802: bff1 j 7de <malloc+0x86>
hp->s.size = nu;
804: 01652423 sw s6,8(a0)
free((void*)(hp + 1));
808: 0541 addi a0,a0,16
80a: 00000097 auipc ra,0x0
80e: ec6080e7 jalr -314(ra) # 6d0 <free>
return freep;
812: 00093503 ld a0,0(s2)
if((p = morecore(nunits)) == 0)
816: d971 beqz a0,7ea <malloc+0x92>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
818: 611c ld a5,0(a0)
if(p->s.size >= nunits){
81a: 4798 lw a4,8(a5)
81c: fa9776e3 bgeu a4,s1,7c8 <malloc+0x70>
if(p == freep)
820: 00093703 ld a4,0(s2)
824: 853e mv a0,a5
826: fef719e3 bne a4,a5,818 <malloc+0xc0>
p = sbrk(nu * sizeof(Header));
82a: 8552 mv a0,s4
82c: 00000097 auipc ra,0x0
830: b66080e7 jalr -1178(ra) # 392 <sbrk>
if(p == (char*)-1)
834: fd5518e3 bne a0,s5,804 <malloc+0xac>
return 0;
838: 4501 li a0,0
83a: bf45 j 7ea <malloc+0x92>
|
verify/alfy/2_simple/sum.alfy.asm | alexandruradovici/alf-alfy-asm-public | 0 | 11337 |
; script
start:
; asm
readnumber r2
; x: r3
set r3 0
store r3 r2
; asm
readnumber r2
; y: r3
set r3 4
store r3 r2
; attribution
; expression +
; x: r3
set r3 0
load r3 r3
; y: r4
set r4 4
load r4 r4
add r2 r3 r4
; s: r3
set r3 8
store r3 r2
; asm
; s: r2
set r2 8
load r2 r2
writenumber r2
stop |
src/Syntax.agda | andrejbauer/dependent-type-theory-syntax | 7 | 14286 | <reponame>andrejbauer/dependent-type-theory-syntax<gh_stars>1-10
open import Agda.Primitive using (lzero; lsuc; _β_; Level)
open import Relation.Binary.PropositionalEquality using (_β‘_; refl; subst)
open import Relation.Binary using (Setoid)
-- A formalization of raw syntax
module Syntax where
-- Syntactic classes
data ObjectClass : Set where
Ty Tm : ObjectClass
data Class : Set where
obj : ObjectClass β Class
EqTy EqTm : Class
-- Variable context shape
infixl 6 _β_
data VShape : Set where
π : VShape
π : VShape
_β_ : VShape β VShape β VShape
data var : VShape β Set where
var-here : var π
var-left : β {Ξ³ Ξ΄} β var Ξ³ β var (Ξ³ β Ξ΄)
var-right : β {Ξ³ Ξ΄} β var Ξ΄ β var (Ξ³ β Ξ΄)
-- Metavariable context shapes
infixl 9 _βα΅α΅_
data MShape : Set where
πα΅α΅ : MShape
πα΅α΅ : β (cl : Class) (Ξ³ : VShape) β MShape
_βα΅α΅_ : MShape β MShape β MShape
infix 8 [_,_]β_
data [_,_]β_ : Class β VShape β MShape β Set where
mv-here : β cl Ξ³ β [ cl , Ξ³ ]β πα΅α΅ cl Ξ³
mv-left : β {π π} cl Ξ³ β [ cl , Ξ³ ]β π β [ cl , Ξ³ ]β π βα΅α΅ π
mv-right : β {π π} cl Ξ³ β [ cl , Ξ³ ]β π β [ cl , Ξ³ ]β π βα΅α΅ π
-- Symbol signature
record Signature : Setβ where
field
symb : ObjectClass β Set -- a set of symbol names, one for each class
symb-arg : β {cl} β symb cl β MShape
-- Expressions
module Expression (π : Signature) where
open Signature π
data Expr : Class β (π : MShape) β (Ξ³ : VShape) β Set
Arg : β (cl : Class) (π : MShape) (Ξ³ : VShape) (Ξ΄ : VShape) β Set
Arg cl π Ξ³ Ξ΄ = Expr cl π (Ξ³ β Ξ΄)
ExprObj : β (cl : ObjectClass) (π : MShape) (Ξ³ : VShape) β Set
ExprObj cl = Expr (obj cl)
ExprTm = ExprObj Tm
ExprTy = ExprObj Ty
data Expr where
expr-var : β {π} {Ξ³} (x : var Ξ³) β ExprTm π Ξ³
expr-symb : β {cl π Ξ³} (S : symb cl) β
(es : β {clβ± Ξ³β±} (i : [ clβ± , Ξ³β± ]β symb-arg S) β Arg clβ± π Ξ³ Ξ³β±) β
ExprObj cl π Ξ³
expr-meta : β {cl π Ξ³} {Ξ³α΄Ή} (M : [ obj cl , Ξ³α΄Ή ]β π) β (ts : β (i : var Ξ³α΄Ή) β ExprTm π Ξ³) β ExprObj cl π Ξ³
expr-eqty : β {Ξ³} {π} β Expr EqTy π Ξ³
expr-eqtm : β {Ξ³} {π} β Expr EqTm π Ξ³
expr-meta-generic : β {π} {cl} {Ξ³ Ξ³α΄Ή} (M : [ cl , Ξ³α΄Ή ]β π) β Arg cl π Ξ³ Ξ³α΄Ή
expr-meta-generic {cl = obj _} M = expr-meta M (Ξ» i β expr-var (var-right i))
expr-meta-generic {cl = EqTy} M = expr-eqty
expr-meta-generic {cl = EqTm} M = expr-eqtm
-- Syntactic equality
module Equality {π : Signature} where
open Signature π
open Expression π
infix 4 _β_
data _β_ : β {cl π Ξ³} β Expr cl π Ξ³ β Expr cl π Ξ³ β Set where
β-β‘ : β {cl π Ξ³} {t u : Expr cl π Ξ³} (ΞΎ : t β‘ u) β t β u
β-symb : β {cl π Ξ³} {S : symb cl} β
{ds es : β {cβ± Ξ³β±} (i : [ cβ± , Ξ³β± ]β symb-arg S) β Arg cβ± π Ξ³ Ξ³β±}
(ΞΎ : β {cβ± Ξ³β±} (i : [ cβ± , Ξ³β± ]β symb-arg S) β ds i β es i) β expr-symb S ds β expr-symb S es
β-meta : β {cl π Ξ³} {Ξ³α΄Ή} {M : [ obj cl , Ξ³α΄Ή ]β π} β {ts us : β (i : var Ξ³α΄Ή) β ExprTm π Ξ³}
(ΞΎ : β i β ts i β us i) β expr-meta M ts β expr-meta M us
β-refl : β {cl π Ξ³} {t : Expr cl π Ξ³} β t β t
β-refl = β-β‘ refl
β-eqty : β {π Ξ³} {s t : Expr EqTy π Ξ³} β s β t
β-eqty {s = expr-eqty} {t = expr-eqty} = β-refl
β-eqtm : β {π Ξ³} {s t : Expr EqTm π Ξ³} β s β t
β-eqtm {s = expr-eqtm} {t = expr-eqtm} = β-refl
β-sym : β {cl π Ξ³} {t u : Expr cl π Ξ³} β t β u β u β t
β-sym (β-β‘ refl) = β-β‘ refl
β-sym (β-symb Ξ΅) = β-symb (Ξ» i β β-sym (Ξ΅ i))
β-sym (β-meta Ξ΅) = β-meta (Ξ» i β β-sym (Ξ΅ i))
β-trans : β {cl π Ξ³} {t u v : Expr cl π Ξ³} β t β u β u β v β t β v
β-trans (β-β‘ refl) ΞΎ = ΞΎ
β-trans (β-symb ΞΆ) (β-β‘ refl) = β-symb ΞΆ
β-trans (β-symb ΞΆ) (β-symb ΞΎ) = β-symb (Ξ» i β β-trans (ΞΆ i) (ΞΎ i))
β-trans (β-meta ΞΆ) (β-β‘ refl) = β-meta ΞΆ
β-trans (β-meta ΞΆ) (β-meta ΞΎ) = β-meta (Ξ» i β β-trans (ΞΆ i) (ΞΎ i))
-- the setoid of expressions
Expr-setoid : β (cl : Class) (π : MShape) (Ξ³ : VShape) β Setoid lzero lzero
Expr-setoid cl π Ξ³ =
record
{ Carrier = Expr cl π Ξ³
; _β_ = _β_
; isEquivalence = record { refl = β-refl ; sym = β-sym ; trans = β-trans }
}
infix 4 _%_β_
_%_β_ : β (π : Signature) {cl π Ξ³} β (t u : Expression.Expr π cl π Ξ³) β Set
_%_β_ π = Equality._β_ {π = π}
|
src/main/antlr/ClassSchedulingParser.g4 | wijayaerick/dsl-class-scheduler | 0 | 5237 | parser grammar ClassSchedulingParser;
options {tokenVocab=ClassSchedulingLexer;}
key
: WORD;
value
: (WORD)+ | (map)+;
map
: key COLON value;
line
: (TAB)* map;
createParam
: line+;
// Course
createCourse
: COURSE COLON createParam;
// Class
createClass
: CLASS COLON createParam;
// Classroom
createClassroom
: CLASSROOM COLON createParam;
// Lecturer
createLecturer
: LECTURER COLON createParam;
file
: (createCourse | createClass | createClassroom | createLecturer)*;
|
programs/oeis/126/A126564.asm | karttu/loda | 0 | 16921 | <reponame>karttu/loda
; A126564: Floor( sin(n)*cos(n) ).
; 0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,-1,0,-1,-1,0,-1,-1,0,-1,-1,0,0
mov $2,$0
mov $3,6
mul $3,$0
add $2,$3
mov $4,1
lpb $0,1
div $2,11
gcd $2,2
mov $3,$5
add $3,1
mul $3,2
sub $2,$3
mov $0,$2
mov $5,$4
lpe
mov $1,$0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.