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 |
|---|---|---|---|---|
molecules.asm | tphan022/CS153assn2_p1 | 0 | 176878 |
_molecules: file format elf32-i386
Disassembly of section .text:
00000000 <initialize_sem>:
lock_t the_lock;
int number;
struct queue qu;
};
void initialize_sem(int value, struct semaphore* sem) {
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 ec 18 sub $0x18,%esp
init_q(&sem->qu);
6: 8b 45 0c mov 0xc(%ebp),%eax
9: 83 c0 08 add $0x8,%eax
c: 89 04 24 mov %eax,(%esp)
f: e8 28 0d 00 00 call d3c <init_q>
lock_init(&sem->the_lock);
14: 8b 45 0c mov 0xc(%ebp),%eax
17: 89 04 24 mov %eax,(%esp)
1a: e8 db 0b 00 00 call bfa <lock_init>
sem->number = value;
1f: 8b 45 0c mov 0xc(%ebp),%eax
22: 8b 55 08 mov 0x8(%ebp),%edx
25: 89 50 04 mov %edx,0x4(%eax)
};
28: c9 leave
29: c3 ret
0000002a <sem_acquire>:
void sem_acquire(struct semaphore* sem) {
2a: 55 push %ebp
2b: 89 e5 mov %esp,%ebp
2d: 83 ec 18 sub $0x18,%esp
lock_acquire(&sem->the_lock);
30: 8b 45 08 mov 0x8(%ebp),%eax
33: 89 04 24 mov %eax,(%esp)
36: e8 cd 0b 00 00 call c08 <lock_acquire>
if(sem->number > 0) {
3b: 8b 45 08 mov 0x8(%ebp),%eax
3e: 8b 40 04 mov 0x4(%eax),%eax
41: 85 c0 test %eax,%eax
43: 7e 1c jle 61 <sem_acquire+0x37>
sem->number--;
45: 8b 45 08 mov 0x8(%ebp),%eax
48: 8b 40 04 mov 0x4(%eax),%eax
4b: 8d 50 ff lea -0x1(%eax),%edx
4e: 8b 45 08 mov 0x8(%ebp),%eax
51: 89 50 04 mov %edx,0x4(%eax)
lock_release(&sem->the_lock);
54: 8b 45 08 mov 0x8(%ebp),%eax
57: 89 04 24 mov %eax,(%esp)
5a: e8 c8 0b 00 00 call c27 <lock_release>
return;
5f: eb 27 jmp 88 <sem_acquire+0x5e>
}
else {
add_q(&sem->qu, getpid());
61: e8 9a 06 00 00 call 700 <getpid>
66: 8b 55 08 mov 0x8(%ebp),%edx
69: 83 c2 08 add $0x8,%edx
6c: 89 44 24 04 mov %eax,0x4(%esp)
70: 89 14 24 mov %edx,(%esp)
73: e8 e6 0c 00 00 call d5e <add_q>
lock_release(&sem->the_lock);
78: 8b 45 08 mov 0x8(%ebp),%eax
7b: 89 04 24 mov %eax,(%esp)
7e: e8 a4 0b 00 00 call c27 <lock_release>
tsleep();
83: e8 a8 06 00 00 call 730 <tsleep>
}
};
88: c9 leave
89: c3 ret
0000008a <sem_signal>:
void sem_signal(struct semaphore* sem) {
8a: 55 push %ebp
8b: 89 e5 mov %esp,%ebp
8d: 83 ec 28 sub $0x28,%esp
lock_acquire(&sem->the_lock);
90: 8b 45 08 mov 0x8(%ebp),%eax
93: 89 04 24 mov %eax,(%esp)
96: e8 6d 0b 00 00 call c08 <lock_acquire>
if(empty_q(&sem->qu) == 1) {
9b: 8b 45 08 mov 0x8(%ebp),%eax
9e: 83 c0 08 add $0x8,%eax
a1: 89 04 24 mov %eax,(%esp)
a4: e8 15 0d 00 00 call dbe <empty_q>
a9: 83 f8 01 cmp $0x1,%eax
ac: 75 11 jne bf <sem_signal+0x35>
sem->number++;
ae: 8b 45 08 mov 0x8(%ebp),%eax
b1: 8b 40 04 mov 0x4(%eax),%eax
b4: 8d 50 01 lea 0x1(%eax),%edx
b7: 8b 45 08 mov 0x8(%ebp),%eax
ba: 89 50 04 mov %edx,0x4(%eax)
bd: eb 1c jmp db <sem_signal+0x51>
}
else {
int tid = pop_q(&sem->qu);
bf: 8b 45 08 mov 0x8(%ebp),%eax
c2: 83 c0 08 add $0x8,%eax
c5: 89 04 24 mov %eax,(%esp)
c8: e8 0b 0d 00 00 call dd8 <pop_q>
cd: 89 45 f4 mov %eax,-0xc(%ebp)
twakeup(tid);
d0: 8b 45 f4 mov -0xc(%ebp),%eax
d3: 89 04 24 mov %eax,(%esp)
d6: e8 5d 06 00 00 call 738 <twakeup>
}
lock_release(&sem->the_lock);
db: 8b 45 08 mov 0x8(%ebp),%eax
de: 89 04 24 mov %eax,(%esp)
e1: e8 41 0b 00 00 call c27 <lock_release>
};
e6: c9 leave
e7: c3 ret
000000e8 <h_acquire>:
struct mutex {
lock_t lock;
} mutex;
void h_acquire(void* arg_ptr) {
e8: 55 push %ebp
e9: 89 e5 mov %esp,%ebp
eb: 83 ec 18 sub $0x18,%esp
printf(1, "Hydrogen formed.\n");
ee: c7 44 24 04 54 0e 00 movl $0xe54,0x4(%esp)
f5: 00
f6: c7 04 24 01 00 00 00 movl $0x1,(%esp)
fd: e8 17 07 00 00 call 819 <printf>
sem_signal(&h_sem);
102: c7 04 24 5c 0f 00 00 movl $0xf5c,(%esp)
109: e8 7c ff ff ff call 8a <sem_signal>
sem_acquire(&o_sem);
10e: c7 04 24 70 0f 00 00 movl $0xf70,(%esp)
115: e8 10 ff ff ff call 2a <sem_acquire>
texit();
11a: e8 09 06 00 00 call 728 <texit>
0000011f <o_acquire>:
}
void o_acquire(void* arg_ptr) {
11f: 55 push %ebp
120: 89 e5 mov %esp,%ebp
122: 83 ec 18 sub $0x18,%esp
printf(1, "Oxygen formed.\n");
125: c7 44 24 04 66 0e 00 movl $0xe66,0x4(%esp)
12c: 00
12d: c7 04 24 01 00 00 00 movl $0x1,(%esp)
134: e8 e0 06 00 00 call 819 <printf>
sem_acquire(&h_sem);
139: c7 04 24 5c 0f 00 00 movl $0xf5c,(%esp)
140: e8 e5 fe ff ff call 2a <sem_acquire>
sem_acquire(&h_sem);
145: c7 04 24 5c 0f 00 00 movl $0xf5c,(%esp)
14c: e8 d9 fe ff ff call 2a <sem_acquire>
sem_signal(&o_sem);
151: c7 04 24 70 0f 00 00 movl $0xf70,(%esp)
158: e8 2d ff ff ff call 8a <sem_signal>
sem_signal(&o_sem);
15d: c7 04 24 70 0f 00 00 movl $0xf70,(%esp)
164: e8 21 ff ff ff call 8a <sem_signal>
lock_acquire(&mutex.lock);
169: c7 04 24 58 0f 00 00 movl $0xf58,(%esp)
170: e8 93 0a 00 00 call c08 <lock_acquire>
number++;
175: a1 48 0f 00 00 mov 0xf48,%eax
17a: 83 c0 01 add $0x1,%eax
17d: a3 48 0f 00 00 mov %eax,0xf48
printf(1, "Atoms combined, molecule has formed.\n");
182: c7 44 24 04 78 0e 00 movl $0xe78,0x4(%esp)
189: 00
18a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
191: e8 83 06 00 00 call 819 <printf>
lock_release(&mutex.lock);
196: c7 04 24 58 0f 00 00 movl $0xf58,(%esp)
19d: e8 85 0a 00 00 call c27 <lock_release>
texit();
1a2: e8 81 05 00 00 call 728 <texit>
000001a7 <main>:
}
int main(void) {
1a7: 55 push %ebp
1a8: 89 e5 mov %esp,%ebp
1aa: 83 e4 f0 and $0xfffffff0,%esp
1ad: 83 ec 40 sub $0x40,%esp
initialize_sem(0, &h_sem);
1b0: c7 44 24 04 5c 0f 00 movl $0xf5c,0x4(%esp)
1b7: 00
1b8: c7 04 24 00 00 00 00 movl $0x0,(%esp)
1bf: e8 3c fe ff ff call 0 <initialize_sem>
initialize_sem(0, &o_sem);
1c4: c7 44 24 04 70 0f 00 movl $0xf70,0x4(%esp)
1cb: 00
1cc: c7 04 24 00 00 00 00 movl $0x0,(%esp)
1d3: e8 28 fe ff ff call 0 <initialize_sem>
lock_init(&mutex.lock);
1d8: c7 04 24 58 0f 00 00 movl $0xf58,(%esp)
1df: e8 16 0a 00 00 call bfa <lock_init>
printf(1, "program: Molecules, started\n");
1e4: c7 44 24 04 9e 0e 00 movl $0xe9e,0x4(%esp)
1eb: 00
1ec: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1f3: e8 21 06 00 00 call 819 <printf>
void* tid_1 = thread_create(h_acquire, (void*) 0);
1f8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
1ff: 00
200: c7 04 24 e8 00 00 00 movl $0xe8,(%esp)
207: e8 36 0a 00 00 call c42 <thread_create>
20c: 89 44 24 1c mov %eax,0x1c(%esp)
if(tid_1 == 0) {
210: 83 7c 24 1c 00 cmpl $0x0,0x1c(%esp)
215: 75 19 jne 230 <main+0x89>
printf(1, "Error, thread creation failed.\n");
217: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
21e: 00
21f: c7 04 24 01 00 00 00 movl $0x1,(%esp)
226: e8 ee 05 00 00 call 819 <printf>
exit();
22b: e8 50 04 00 00 call 680 <exit>
}
void* tid_2 = thread_create(h_acquire, (void*) 0);
230: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
237: 00
238: c7 04 24 e8 00 00 00 movl $0xe8,(%esp)
23f: e8 fe 09 00 00 call c42 <thread_create>
244: 89 44 24 20 mov %eax,0x20(%esp)
if(tid_2 == 0) {
248: 83 7c 24 20 00 cmpl $0x0,0x20(%esp)
24d: 75 19 jne 268 <main+0xc1>
printf(1, "Error, thread creation failed.\n");
24f: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
256: 00
257: c7 04 24 01 00 00 00 movl $0x1,(%esp)
25e: e8 b6 05 00 00 call 819 <printf>
exit();
263: e8 18 04 00 00 call 680 <exit>
}
void* tid_3 = thread_create(o_acquire, (void*) 0);
268: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
26f: 00
270: c7 04 24 1f 01 00 00 movl $0x11f,(%esp)
277: e8 c6 09 00 00 call c42 <thread_create>
27c: 89 44 24 24 mov %eax,0x24(%esp)
if(tid_3 == 0) {
280: 83 7c 24 24 00 cmpl $0x0,0x24(%esp)
285: 75 19 jne 2a0 <main+0xf9>
printf(1, "Error, thread creation failed.\n");
287: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
28e: 00
28f: c7 04 24 01 00 00 00 movl $0x1,(%esp)
296: e8 7e 05 00 00 call 819 <printf>
exit();
29b: e8 e0 03 00 00 call 680 <exit>
}
void* tid_4 = thread_create(o_acquire, (void*) 0);
2a0: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2a7: 00
2a8: c7 04 24 1f 01 00 00 movl $0x11f,(%esp)
2af: e8 8e 09 00 00 call c42 <thread_create>
2b4: 89 44 24 28 mov %eax,0x28(%esp)
if(tid_4 == 0) {
2b8: 83 7c 24 28 00 cmpl $0x0,0x28(%esp)
2bd: 75 19 jne 2d8 <main+0x131>
printf(1, "Error, thread creation failed.\n");
2bf: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
2c6: 00
2c7: c7 04 24 01 00 00 00 movl $0x1,(%esp)
2ce: e8 46 05 00 00 call 819 <printf>
exit();
2d3: e8 a8 03 00 00 call 680 <exit>
}
void* tid_5 = thread_create(h_acquire, (void*) 0);
2d8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2df: 00
2e0: c7 04 24 e8 00 00 00 movl $0xe8,(%esp)
2e7: e8 56 09 00 00 call c42 <thread_create>
2ec: 89 44 24 2c mov %eax,0x2c(%esp)
if(tid_5 == 0) {
2f0: 83 7c 24 2c 00 cmpl $0x0,0x2c(%esp)
2f5: 75 19 jne 310 <main+0x169>
printf(1, "Error, thread creation failed.\n");
2f7: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
2fe: 00
2ff: c7 04 24 01 00 00 00 movl $0x1,(%esp)
306: e8 0e 05 00 00 call 819 <printf>
exit();
30b: e8 70 03 00 00 call 680 <exit>
}
void* tid_6 = thread_create(h_acquire, (void*) 0);
310: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
317: 00
318: c7 04 24 e8 00 00 00 movl $0xe8,(%esp)
31f: e8 1e 09 00 00 call c42 <thread_create>
324: 89 44 24 30 mov %eax,0x30(%esp)
if(tid_6 == 0) {
328: 83 7c 24 30 00 cmpl $0x0,0x30(%esp)
32d: 75 19 jne 348 <main+0x1a1>
printf(1, "Error, thread creation failed.\n");
32f: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
336: 00
337: c7 04 24 01 00 00 00 movl $0x1,(%esp)
33e: e8 d6 04 00 00 call 819 <printf>
exit();
343: e8 38 03 00 00 call 680 <exit>
}
void* tid_7 = thread_create(h_acquire, (void*) 0);
348: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
34f: 00
350: c7 04 24 e8 00 00 00 movl $0xe8,(%esp)
357: e8 e6 08 00 00 call c42 <thread_create>
35c: 89 44 24 34 mov %eax,0x34(%esp)
if(tid_7 == 0) {
360: 83 7c 24 34 00 cmpl $0x0,0x34(%esp)
365: 75 19 jne 380 <main+0x1d9>
printf(1, "Error, thread creation failed.\n");
367: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
36e: 00
36f: c7 04 24 01 00 00 00 movl $0x1,(%esp)
376: e8 9e 04 00 00 call 819 <printf>
exit();
37b: e8 00 03 00 00 call 680 <exit>
}
void* tid_8 = thread_create(o_acquire, (void*) 0);
380: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
387: 00
388: c7 04 24 1f 01 00 00 movl $0x11f,(%esp)
38f: e8 ae 08 00 00 call c42 <thread_create>
394: 89 44 24 38 mov %eax,0x38(%esp)
if(tid_8 == 0) {
398: 83 7c 24 38 00 cmpl $0x0,0x38(%esp)
39d: 75 19 jne 3b8 <main+0x211>
printf(1, "Error, thread creation failed.\n");
39f: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
3a6: 00
3a7: c7 04 24 01 00 00 00 movl $0x1,(%esp)
3ae: e8 66 04 00 00 call 819 <printf>
exit();
3b3: e8 c8 02 00 00 call 680 <exit>
}
void* tid_9 = thread_create(h_acquire, (void*) 0);
3b8: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
3bf: 00
3c0: c7 04 24 e8 00 00 00 movl $0xe8,(%esp)
3c7: e8 76 08 00 00 call c42 <thread_create>
3cc: 89 44 24 3c mov %eax,0x3c(%esp)
if(tid_9 == 0) {
3d0: 83 7c 24 3c 00 cmpl $0x0,0x3c(%esp)
3d5: 75 19 jne 3f0 <main+0x249>
printf(1, "Error, thread creation failed.\n");
3d7: c7 44 24 04 bc 0e 00 movl $0xebc,0x4(%esp)
3de: 00
3df: c7 04 24 01 00 00 00 movl $0x1,(%esp)
3e6: e8 2e 04 00 00 call 819 <printf>
exit();
3eb: e8 90 02 00 00 call 680 <exit>
}
while(wait() > 0);
3f0: e8 93 02 00 00 call 688 <wait>
3f5: 85 c0 test %eax,%eax
3f7: 7f f7 jg 3f0 <main+0x249>
printf(1, "number of molecules formed: %d\n", number);
3f9: a1 48 0f 00 00 mov 0xf48,%eax
3fe: 89 44 24 08 mov %eax,0x8(%esp)
402: c7 44 24 04 dc 0e 00 movl $0xedc,0x4(%esp)
409: 00
40a: c7 04 24 01 00 00 00 movl $0x1,(%esp)
411: e8 03 04 00 00 call 819 <printf>
exit();
416: e8 65 02 00 00 call 680 <exit>
41b: 90 nop
0000041c <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
41c: 55 push %ebp
41d: 89 e5 mov %esp,%ebp
41f: 57 push %edi
420: 53 push %ebx
asm volatile("cld; rep stosb" :
421: 8b 4d 08 mov 0x8(%ebp),%ecx
424: 8b 55 10 mov 0x10(%ebp),%edx
427: 8b 45 0c mov 0xc(%ebp),%eax
42a: 89 cb mov %ecx,%ebx
42c: 89 df mov %ebx,%edi
42e: 89 d1 mov %edx,%ecx
430: fc cld
431: f3 aa rep stos %al,%es:(%edi)
433: 89 ca mov %ecx,%edx
435: 89 fb mov %edi,%ebx
437: 89 5d 08 mov %ebx,0x8(%ebp)
43a: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
43d: 5b pop %ebx
43e: 5f pop %edi
43f: 5d pop %ebp
440: c3 ret
00000441 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
441: 55 push %ebp
442: 89 e5 mov %esp,%ebp
444: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
447: 8b 45 08 mov 0x8(%ebp),%eax
44a: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
44d: 8b 45 0c mov 0xc(%ebp),%eax
450: 0f b6 10 movzbl (%eax),%edx
453: 8b 45 08 mov 0x8(%ebp),%eax
456: 88 10 mov %dl,(%eax)
458: 8b 45 08 mov 0x8(%ebp),%eax
45b: 0f b6 00 movzbl (%eax),%eax
45e: 84 c0 test %al,%al
460: 0f 95 c0 setne %al
463: 83 45 08 01 addl $0x1,0x8(%ebp)
467: 83 45 0c 01 addl $0x1,0xc(%ebp)
46b: 84 c0 test %al,%al
46d: 75 de jne 44d <strcpy+0xc>
;
return os;
46f: 8b 45 fc mov -0x4(%ebp),%eax
}
472: c9 leave
473: c3 ret
00000474 <strcmp>:
int
strcmp(const char *p, const char *q)
{
474: 55 push %ebp
475: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
477: eb 08 jmp 481 <strcmp+0xd>
p++, q++;
479: 83 45 08 01 addl $0x1,0x8(%ebp)
47d: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
481: 8b 45 08 mov 0x8(%ebp),%eax
484: 0f b6 00 movzbl (%eax),%eax
487: 84 c0 test %al,%al
489: 74 10 je 49b <strcmp+0x27>
48b: 8b 45 08 mov 0x8(%ebp),%eax
48e: 0f b6 10 movzbl (%eax),%edx
491: 8b 45 0c mov 0xc(%ebp),%eax
494: 0f b6 00 movzbl (%eax),%eax
497: 38 c2 cmp %al,%dl
499: 74 de je 479 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
49b: 8b 45 08 mov 0x8(%ebp),%eax
49e: 0f b6 00 movzbl (%eax),%eax
4a1: 0f b6 d0 movzbl %al,%edx
4a4: 8b 45 0c mov 0xc(%ebp),%eax
4a7: 0f b6 00 movzbl (%eax),%eax
4aa: 0f b6 c0 movzbl %al,%eax
4ad: 89 d1 mov %edx,%ecx
4af: 29 c1 sub %eax,%ecx
4b1: 89 c8 mov %ecx,%eax
}
4b3: 5d pop %ebp
4b4: c3 ret
000004b5 <strlen>:
uint
strlen(char *s)
{
4b5: 55 push %ebp
4b6: 89 e5 mov %esp,%ebp
4b8: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
4bb: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
4c2: eb 04 jmp 4c8 <strlen+0x13>
4c4: 83 45 fc 01 addl $0x1,-0x4(%ebp)
4c8: 8b 45 fc mov -0x4(%ebp),%eax
4cb: 03 45 08 add 0x8(%ebp),%eax
4ce: 0f b6 00 movzbl (%eax),%eax
4d1: 84 c0 test %al,%al
4d3: 75 ef jne 4c4 <strlen+0xf>
;
return n;
4d5: 8b 45 fc mov -0x4(%ebp),%eax
}
4d8: c9 leave
4d9: c3 ret
000004da <memset>:
void*
memset(void *dst, int c, uint n)
{
4da: 55 push %ebp
4db: 89 e5 mov %esp,%ebp
4dd: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
4e0: 8b 45 10 mov 0x10(%ebp),%eax
4e3: 89 44 24 08 mov %eax,0x8(%esp)
4e7: 8b 45 0c mov 0xc(%ebp),%eax
4ea: 89 44 24 04 mov %eax,0x4(%esp)
4ee: 8b 45 08 mov 0x8(%ebp),%eax
4f1: 89 04 24 mov %eax,(%esp)
4f4: e8 23 ff ff ff call 41c <stosb>
return dst;
4f9: 8b 45 08 mov 0x8(%ebp),%eax
}
4fc: c9 leave
4fd: c3 ret
000004fe <strchr>:
char*
strchr(const char *s, char c)
{
4fe: 55 push %ebp
4ff: 89 e5 mov %esp,%ebp
501: 83 ec 04 sub $0x4,%esp
504: 8b 45 0c mov 0xc(%ebp),%eax
507: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
50a: eb 14 jmp 520 <strchr+0x22>
if(*s == c)
50c: 8b 45 08 mov 0x8(%ebp),%eax
50f: 0f b6 00 movzbl (%eax),%eax
512: 3a 45 fc cmp -0x4(%ebp),%al
515: 75 05 jne 51c <strchr+0x1e>
return (char*)s;
517: 8b 45 08 mov 0x8(%ebp),%eax
51a: eb 13 jmp 52f <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
51c: 83 45 08 01 addl $0x1,0x8(%ebp)
520: 8b 45 08 mov 0x8(%ebp),%eax
523: 0f b6 00 movzbl (%eax),%eax
526: 84 c0 test %al,%al
528: 75 e2 jne 50c <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
52a: b8 00 00 00 00 mov $0x0,%eax
}
52f: c9 leave
530: c3 ret
00000531 <gets>:
char*
gets(char *buf, int max)
{
531: 55 push %ebp
532: 89 e5 mov %esp,%ebp
534: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
537: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
53e: eb 44 jmp 584 <gets+0x53>
cc = read(0, &c, 1);
540: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
547: 00
548: 8d 45 ef lea -0x11(%ebp),%eax
54b: 89 44 24 04 mov %eax,0x4(%esp)
54f: c7 04 24 00 00 00 00 movl $0x0,(%esp)
556: e8 3d 01 00 00 call 698 <read>
55b: 89 45 f4 mov %eax,-0xc(%ebp)
if(cc < 1)
55e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
562: 7e 2d jle 591 <gets+0x60>
break;
buf[i++] = c;
564: 8b 45 f0 mov -0x10(%ebp),%eax
567: 03 45 08 add 0x8(%ebp),%eax
56a: 0f b6 55 ef movzbl -0x11(%ebp),%edx
56e: 88 10 mov %dl,(%eax)
570: 83 45 f0 01 addl $0x1,-0x10(%ebp)
if(c == '\n' || c == '\r')
574: 0f b6 45 ef movzbl -0x11(%ebp),%eax
578: 3c 0a cmp $0xa,%al
57a: 74 16 je 592 <gets+0x61>
57c: 0f b6 45 ef movzbl -0x11(%ebp),%eax
580: 3c 0d cmp $0xd,%al
582: 74 0e je 592 <gets+0x61>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
584: 8b 45 f0 mov -0x10(%ebp),%eax
587: 83 c0 01 add $0x1,%eax
58a: 3b 45 0c cmp 0xc(%ebp),%eax
58d: 7c b1 jl 540 <gets+0xf>
58f: eb 01 jmp 592 <gets+0x61>
cc = read(0, &c, 1);
if(cc < 1)
break;
591: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
592: 8b 45 f0 mov -0x10(%ebp),%eax
595: 03 45 08 add 0x8(%ebp),%eax
598: c6 00 00 movb $0x0,(%eax)
return buf;
59b: 8b 45 08 mov 0x8(%ebp),%eax
}
59e: c9 leave
59f: c3 ret
000005a0 <stat>:
int
stat(char *n, struct stat *st)
{
5a0: 55 push %ebp
5a1: 89 e5 mov %esp,%ebp
5a3: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
5a6: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
5ad: 00
5ae: 8b 45 08 mov 0x8(%ebp),%eax
5b1: 89 04 24 mov %eax,(%esp)
5b4: e8 07 01 00 00 call 6c0 <open>
5b9: 89 45 f0 mov %eax,-0x10(%ebp)
if(fd < 0)
5bc: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
5c0: 79 07 jns 5c9 <stat+0x29>
return -1;
5c2: b8 ff ff ff ff mov $0xffffffff,%eax
5c7: eb 23 jmp 5ec <stat+0x4c>
r = fstat(fd, st);
5c9: 8b 45 0c mov 0xc(%ebp),%eax
5cc: 89 44 24 04 mov %eax,0x4(%esp)
5d0: 8b 45 f0 mov -0x10(%ebp),%eax
5d3: 89 04 24 mov %eax,(%esp)
5d6: e8 fd 00 00 00 call 6d8 <fstat>
5db: 89 45 f4 mov %eax,-0xc(%ebp)
close(fd);
5de: 8b 45 f0 mov -0x10(%ebp),%eax
5e1: 89 04 24 mov %eax,(%esp)
5e4: e8 bf 00 00 00 call 6a8 <close>
return r;
5e9: 8b 45 f4 mov -0xc(%ebp),%eax
}
5ec: c9 leave
5ed: c3 ret
000005ee <atoi>:
int
atoi(const char *s)
{
5ee: 55 push %ebp
5ef: 89 e5 mov %esp,%ebp
5f1: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
5f4: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
5fb: eb 24 jmp 621 <atoi+0x33>
n = n*10 + *s++ - '0';
5fd: 8b 55 fc mov -0x4(%ebp),%edx
600: 89 d0 mov %edx,%eax
602: c1 e0 02 shl $0x2,%eax
605: 01 d0 add %edx,%eax
607: 01 c0 add %eax,%eax
609: 89 c2 mov %eax,%edx
60b: 8b 45 08 mov 0x8(%ebp),%eax
60e: 0f b6 00 movzbl (%eax),%eax
611: 0f be c0 movsbl %al,%eax
614: 8d 04 02 lea (%edx,%eax,1),%eax
617: 83 e8 30 sub $0x30,%eax
61a: 89 45 fc mov %eax,-0x4(%ebp)
61d: 83 45 08 01 addl $0x1,0x8(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
621: 8b 45 08 mov 0x8(%ebp),%eax
624: 0f b6 00 movzbl (%eax),%eax
627: 3c 2f cmp $0x2f,%al
629: 7e 0a jle 635 <atoi+0x47>
62b: 8b 45 08 mov 0x8(%ebp),%eax
62e: 0f b6 00 movzbl (%eax),%eax
631: 3c 39 cmp $0x39,%al
633: 7e c8 jle 5fd <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
635: 8b 45 fc mov -0x4(%ebp),%eax
}
638: c9 leave
639: c3 ret
0000063a <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
63a: 55 push %ebp
63b: 89 e5 mov %esp,%ebp
63d: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
640: 8b 45 08 mov 0x8(%ebp),%eax
643: 89 45 f8 mov %eax,-0x8(%ebp)
src = vsrc;
646: 8b 45 0c mov 0xc(%ebp),%eax
649: 89 45 fc mov %eax,-0x4(%ebp)
while(n-- > 0)
64c: eb 13 jmp 661 <memmove+0x27>
*dst++ = *src++;
64e: 8b 45 fc mov -0x4(%ebp),%eax
651: 0f b6 10 movzbl (%eax),%edx
654: 8b 45 f8 mov -0x8(%ebp),%eax
657: 88 10 mov %dl,(%eax)
659: 83 45 f8 01 addl $0x1,-0x8(%ebp)
65d: 83 45 fc 01 addl $0x1,-0x4(%ebp)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
661: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
665: 0f 9f c0 setg %al
668: 83 6d 10 01 subl $0x1,0x10(%ebp)
66c: 84 c0 test %al,%al
66e: 75 de jne 64e <memmove+0x14>
*dst++ = *src++;
return vdst;
670: 8b 45 08 mov 0x8(%ebp),%eax
}
673: c9 leave
674: c3 ret
675: 90 nop
676: 90 nop
677: 90 nop
00000678 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
678: b8 01 00 00 00 mov $0x1,%eax
67d: cd 40 int $0x40
67f: c3 ret
00000680 <exit>:
SYSCALL(exit)
680: b8 02 00 00 00 mov $0x2,%eax
685: cd 40 int $0x40
687: c3 ret
00000688 <wait>:
SYSCALL(wait)
688: b8 03 00 00 00 mov $0x3,%eax
68d: cd 40 int $0x40
68f: c3 ret
00000690 <pipe>:
SYSCALL(pipe)
690: b8 04 00 00 00 mov $0x4,%eax
695: cd 40 int $0x40
697: c3 ret
00000698 <read>:
SYSCALL(read)
698: b8 05 00 00 00 mov $0x5,%eax
69d: cd 40 int $0x40
69f: c3 ret
000006a0 <write>:
SYSCALL(write)
6a0: b8 10 00 00 00 mov $0x10,%eax
6a5: cd 40 int $0x40
6a7: c3 ret
000006a8 <close>:
SYSCALL(close)
6a8: b8 15 00 00 00 mov $0x15,%eax
6ad: cd 40 int $0x40
6af: c3 ret
000006b0 <kill>:
SYSCALL(kill)
6b0: b8 06 00 00 00 mov $0x6,%eax
6b5: cd 40 int $0x40
6b7: c3 ret
000006b8 <exec>:
SYSCALL(exec)
6b8: b8 07 00 00 00 mov $0x7,%eax
6bd: cd 40 int $0x40
6bf: c3 ret
000006c0 <open>:
SYSCALL(open)
6c0: b8 0f 00 00 00 mov $0xf,%eax
6c5: cd 40 int $0x40
6c7: c3 ret
000006c8 <mknod>:
SYSCALL(mknod)
6c8: b8 11 00 00 00 mov $0x11,%eax
6cd: cd 40 int $0x40
6cf: c3 ret
000006d0 <unlink>:
SYSCALL(unlink)
6d0: b8 12 00 00 00 mov $0x12,%eax
6d5: cd 40 int $0x40
6d7: c3 ret
000006d8 <fstat>:
SYSCALL(fstat)
6d8: b8 08 00 00 00 mov $0x8,%eax
6dd: cd 40 int $0x40
6df: c3 ret
000006e0 <link>:
SYSCALL(link)
6e0: b8 13 00 00 00 mov $0x13,%eax
6e5: cd 40 int $0x40
6e7: c3 ret
000006e8 <mkdir>:
SYSCALL(mkdir)
6e8: b8 14 00 00 00 mov $0x14,%eax
6ed: cd 40 int $0x40
6ef: c3 ret
000006f0 <chdir>:
SYSCALL(chdir)
6f0: b8 09 00 00 00 mov $0x9,%eax
6f5: cd 40 int $0x40
6f7: c3 ret
000006f8 <dup>:
SYSCALL(dup)
6f8: b8 0a 00 00 00 mov $0xa,%eax
6fd: cd 40 int $0x40
6ff: c3 ret
00000700 <getpid>:
SYSCALL(getpid)
700: b8 0b 00 00 00 mov $0xb,%eax
705: cd 40 int $0x40
707: c3 ret
00000708 <sbrk>:
SYSCALL(sbrk)
708: b8 0c 00 00 00 mov $0xc,%eax
70d: cd 40 int $0x40
70f: c3 ret
00000710 <sleep>:
SYSCALL(sleep)
710: b8 0d 00 00 00 mov $0xd,%eax
715: cd 40 int $0x40
717: c3 ret
00000718 <uptime>:
SYSCALL(uptime)
718: b8 0e 00 00 00 mov $0xe,%eax
71d: cd 40 int $0x40
71f: c3 ret
00000720 <clone>:
SYSCALL(clone)
720: b8 16 00 00 00 mov $0x16,%eax
725: cd 40 int $0x40
727: c3 ret
00000728 <texit>:
SYSCALL(texit)
728: b8 17 00 00 00 mov $0x17,%eax
72d: cd 40 int $0x40
72f: c3 ret
00000730 <tsleep>:
SYSCALL(tsleep)
730: b8 18 00 00 00 mov $0x18,%eax
735: cd 40 int $0x40
737: c3 ret
00000738 <twakeup>:
SYSCALL(twakeup)
738: b8 19 00 00 00 mov $0x19,%eax
73d: cd 40 int $0x40
73f: c3 ret
00000740 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
740: 55 push %ebp
741: 89 e5 mov %esp,%ebp
743: 83 ec 28 sub $0x28,%esp
746: 8b 45 0c mov 0xc(%ebp),%eax
749: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
74c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
753: 00
754: 8d 45 f4 lea -0xc(%ebp),%eax
757: 89 44 24 04 mov %eax,0x4(%esp)
75b: 8b 45 08 mov 0x8(%ebp),%eax
75e: 89 04 24 mov %eax,(%esp)
761: e8 3a ff ff ff call 6a0 <write>
}
766: c9 leave
767: c3 ret
00000768 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
768: 55 push %ebp
769: 89 e5 mov %esp,%ebp
76b: 53 push %ebx
76c: 83 ec 44 sub $0x44,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
76f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
776: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
77a: 74 17 je 793 <printint+0x2b>
77c: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
780: 79 11 jns 793 <printint+0x2b>
neg = 1;
782: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
789: 8b 45 0c mov 0xc(%ebp),%eax
78c: f7 d8 neg %eax
78e: 89 45 f4 mov %eax,-0xc(%ebp)
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
791: eb 06 jmp 799 <printint+0x31>
neg = 1;
x = -xx;
} else {
x = xx;
793: 8b 45 0c mov 0xc(%ebp),%eax
796: 89 45 f4 mov %eax,-0xc(%ebp)
}
i = 0;
799: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
do{
buf[i++] = digits[x % base];
7a0: 8b 4d ec mov -0x14(%ebp),%ecx
7a3: 8b 5d 10 mov 0x10(%ebp),%ebx
7a6: 8b 45 f4 mov -0xc(%ebp),%eax
7a9: ba 00 00 00 00 mov $0x0,%edx
7ae: f7 f3 div %ebx
7b0: 89 d0 mov %edx,%eax
7b2: 0f b6 80 30 0f 00 00 movzbl 0xf30(%eax),%eax
7b9: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
7bd: 83 45 ec 01 addl $0x1,-0x14(%ebp)
}while((x /= base) != 0);
7c1: 8b 45 10 mov 0x10(%ebp),%eax
7c4: 89 45 d4 mov %eax,-0x2c(%ebp)
7c7: 8b 45 f4 mov -0xc(%ebp),%eax
7ca: ba 00 00 00 00 mov $0x0,%edx
7cf: f7 75 d4 divl -0x2c(%ebp)
7d2: 89 45 f4 mov %eax,-0xc(%ebp)
7d5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
7d9: 75 c5 jne 7a0 <printint+0x38>
if(neg)
7db: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
7df: 74 28 je 809 <printint+0xa1>
buf[i++] = '-';
7e1: 8b 45 ec mov -0x14(%ebp),%eax
7e4: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
7e9: 83 45 ec 01 addl $0x1,-0x14(%ebp)
while(--i >= 0)
7ed: eb 1a jmp 809 <printint+0xa1>
putc(fd, buf[i]);
7ef: 8b 45 ec mov -0x14(%ebp),%eax
7f2: 0f b6 44 05 dc movzbl -0x24(%ebp,%eax,1),%eax
7f7: 0f be c0 movsbl %al,%eax
7fa: 89 44 24 04 mov %eax,0x4(%esp)
7fe: 8b 45 08 mov 0x8(%ebp),%eax
801: 89 04 24 mov %eax,(%esp)
804: e8 37 ff ff ff call 740 <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
809: 83 6d ec 01 subl $0x1,-0x14(%ebp)
80d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
811: 79 dc jns 7ef <printint+0x87>
putc(fd, buf[i]);
}
813: 83 c4 44 add $0x44,%esp
816: 5b pop %ebx
817: 5d pop %ebp
818: c3 ret
00000819 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
819: 55 push %ebp
81a: 89 e5 mov %esp,%ebp
81c: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
81f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
ap = (uint*)(void*)&fmt + 1;
826: 8d 45 0c lea 0xc(%ebp),%eax
829: 83 c0 04 add $0x4,%eax
82c: 89 45 f4 mov %eax,-0xc(%ebp)
for(i = 0; fmt[i]; i++){
82f: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
836: e9 7e 01 00 00 jmp 9b9 <printf+0x1a0>
c = fmt[i] & 0xff;
83b: 8b 55 0c mov 0xc(%ebp),%edx
83e: 8b 45 ec mov -0x14(%ebp),%eax
841: 8d 04 02 lea (%edx,%eax,1),%eax
844: 0f b6 00 movzbl (%eax),%eax
847: 0f be c0 movsbl %al,%eax
84a: 25 ff 00 00 00 and $0xff,%eax
84f: 89 45 e8 mov %eax,-0x18(%ebp)
if(state == 0){
852: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
856: 75 2c jne 884 <printf+0x6b>
if(c == '%'){
858: 83 7d e8 25 cmpl $0x25,-0x18(%ebp)
85c: 75 0c jne 86a <printf+0x51>
state = '%';
85e: c7 45 f0 25 00 00 00 movl $0x25,-0x10(%ebp)
865: e9 4b 01 00 00 jmp 9b5 <printf+0x19c>
} else {
putc(fd, c);
86a: 8b 45 e8 mov -0x18(%ebp),%eax
86d: 0f be c0 movsbl %al,%eax
870: 89 44 24 04 mov %eax,0x4(%esp)
874: 8b 45 08 mov 0x8(%ebp),%eax
877: 89 04 24 mov %eax,(%esp)
87a: e8 c1 fe ff ff call 740 <putc>
87f: e9 31 01 00 00 jmp 9b5 <printf+0x19c>
}
} else if(state == '%'){
884: 83 7d f0 25 cmpl $0x25,-0x10(%ebp)
888: 0f 85 27 01 00 00 jne 9b5 <printf+0x19c>
if(c == 'd'){
88e: 83 7d e8 64 cmpl $0x64,-0x18(%ebp)
892: 75 2d jne 8c1 <printf+0xa8>
printint(fd, *ap, 10, 1);
894: 8b 45 f4 mov -0xc(%ebp),%eax
897: 8b 00 mov (%eax),%eax
899: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
8a0: 00
8a1: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
8a8: 00
8a9: 89 44 24 04 mov %eax,0x4(%esp)
8ad: 8b 45 08 mov 0x8(%ebp),%eax
8b0: 89 04 24 mov %eax,(%esp)
8b3: e8 b0 fe ff ff call 768 <printint>
ap++;
8b8: 83 45 f4 04 addl $0x4,-0xc(%ebp)
8bc: e9 ed 00 00 00 jmp 9ae <printf+0x195>
} else if(c == 'x' || c == 'p'){
8c1: 83 7d e8 78 cmpl $0x78,-0x18(%ebp)
8c5: 74 06 je 8cd <printf+0xb4>
8c7: 83 7d e8 70 cmpl $0x70,-0x18(%ebp)
8cb: 75 2d jne 8fa <printf+0xe1>
printint(fd, *ap, 16, 0);
8cd: 8b 45 f4 mov -0xc(%ebp),%eax
8d0: 8b 00 mov (%eax),%eax
8d2: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
8d9: 00
8da: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
8e1: 00
8e2: 89 44 24 04 mov %eax,0x4(%esp)
8e6: 8b 45 08 mov 0x8(%ebp),%eax
8e9: 89 04 24 mov %eax,(%esp)
8ec: e8 77 fe ff ff call 768 <printint>
ap++;
8f1: 83 45 f4 04 addl $0x4,-0xc(%ebp)
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
8f5: e9 b4 00 00 00 jmp 9ae <printf+0x195>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
8fa: 83 7d e8 73 cmpl $0x73,-0x18(%ebp)
8fe: 75 46 jne 946 <printf+0x12d>
s = (char*)*ap;
900: 8b 45 f4 mov -0xc(%ebp),%eax
903: 8b 00 mov (%eax),%eax
905: 89 45 e4 mov %eax,-0x1c(%ebp)
ap++;
908: 83 45 f4 04 addl $0x4,-0xc(%ebp)
if(s == 0)
90c: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
910: 75 27 jne 939 <printf+0x120>
s = "(null)";
912: c7 45 e4 fc 0e 00 00 movl $0xefc,-0x1c(%ebp)
while(*s != 0){
919: eb 1f jmp 93a <printf+0x121>
putc(fd, *s);
91b: 8b 45 e4 mov -0x1c(%ebp),%eax
91e: 0f b6 00 movzbl (%eax),%eax
921: 0f be c0 movsbl %al,%eax
924: 89 44 24 04 mov %eax,0x4(%esp)
928: 8b 45 08 mov 0x8(%ebp),%eax
92b: 89 04 24 mov %eax,(%esp)
92e: e8 0d fe ff ff call 740 <putc>
s++;
933: 83 45 e4 01 addl $0x1,-0x1c(%ebp)
937: eb 01 jmp 93a <printf+0x121>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
939: 90 nop
93a: 8b 45 e4 mov -0x1c(%ebp),%eax
93d: 0f b6 00 movzbl (%eax),%eax
940: 84 c0 test %al,%al
942: 75 d7 jne 91b <printf+0x102>
944: eb 68 jmp 9ae <printf+0x195>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
946: 83 7d e8 63 cmpl $0x63,-0x18(%ebp)
94a: 75 1d jne 969 <printf+0x150>
putc(fd, *ap);
94c: 8b 45 f4 mov -0xc(%ebp),%eax
94f: 8b 00 mov (%eax),%eax
951: 0f be c0 movsbl %al,%eax
954: 89 44 24 04 mov %eax,0x4(%esp)
958: 8b 45 08 mov 0x8(%ebp),%eax
95b: 89 04 24 mov %eax,(%esp)
95e: e8 dd fd ff ff call 740 <putc>
ap++;
963: 83 45 f4 04 addl $0x4,-0xc(%ebp)
967: eb 45 jmp 9ae <printf+0x195>
} else if(c == '%'){
969: 83 7d e8 25 cmpl $0x25,-0x18(%ebp)
96d: 75 17 jne 986 <printf+0x16d>
putc(fd, c);
96f: 8b 45 e8 mov -0x18(%ebp),%eax
972: 0f be c0 movsbl %al,%eax
975: 89 44 24 04 mov %eax,0x4(%esp)
979: 8b 45 08 mov 0x8(%ebp),%eax
97c: 89 04 24 mov %eax,(%esp)
97f: e8 bc fd ff ff call 740 <putc>
984: eb 28 jmp 9ae <printf+0x195>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
986: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
98d: 00
98e: 8b 45 08 mov 0x8(%ebp),%eax
991: 89 04 24 mov %eax,(%esp)
994: e8 a7 fd ff ff call 740 <putc>
putc(fd, c);
999: 8b 45 e8 mov -0x18(%ebp),%eax
99c: 0f be c0 movsbl %al,%eax
99f: 89 44 24 04 mov %eax,0x4(%esp)
9a3: 8b 45 08 mov 0x8(%ebp),%eax
9a6: 89 04 24 mov %eax,(%esp)
9a9: e8 92 fd ff ff call 740 <putc>
}
state = 0;
9ae: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
9b5: 83 45 ec 01 addl $0x1,-0x14(%ebp)
9b9: 8b 55 0c mov 0xc(%ebp),%edx
9bc: 8b 45 ec mov -0x14(%ebp),%eax
9bf: 8d 04 02 lea (%edx,%eax,1),%eax
9c2: 0f b6 00 movzbl (%eax),%eax
9c5: 84 c0 test %al,%al
9c7: 0f 85 6e fe ff ff jne 83b <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
9cd: c9 leave
9ce: c3 ret
9cf: 90 nop
000009d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
9d0: 55 push %ebp
9d1: 89 e5 mov %esp,%ebp
9d3: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
9d6: 8b 45 08 mov 0x8(%ebp),%eax
9d9: 83 e8 08 sub $0x8,%eax
9dc: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
9df: a1 54 0f 00 00 mov 0xf54,%eax
9e4: 89 45 fc mov %eax,-0x4(%ebp)
9e7: eb 24 jmp a0d <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
9e9: 8b 45 fc mov -0x4(%ebp),%eax
9ec: 8b 00 mov (%eax),%eax
9ee: 3b 45 fc cmp -0x4(%ebp),%eax
9f1: 77 12 ja a05 <free+0x35>
9f3: 8b 45 f8 mov -0x8(%ebp),%eax
9f6: 3b 45 fc cmp -0x4(%ebp),%eax
9f9: 77 24 ja a1f <free+0x4f>
9fb: 8b 45 fc mov -0x4(%ebp),%eax
9fe: 8b 00 mov (%eax),%eax
a00: 3b 45 f8 cmp -0x8(%ebp),%eax
a03: 77 1a ja a1f <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)
a05: 8b 45 fc mov -0x4(%ebp),%eax
a08: 8b 00 mov (%eax),%eax
a0a: 89 45 fc mov %eax,-0x4(%ebp)
a0d: 8b 45 f8 mov -0x8(%ebp),%eax
a10: 3b 45 fc cmp -0x4(%ebp),%eax
a13: 76 d4 jbe 9e9 <free+0x19>
a15: 8b 45 fc mov -0x4(%ebp),%eax
a18: 8b 00 mov (%eax),%eax
a1a: 3b 45 f8 cmp -0x8(%ebp),%eax
a1d: 76 ca jbe 9e9 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
a1f: 8b 45 f8 mov -0x8(%ebp),%eax
a22: 8b 40 04 mov 0x4(%eax),%eax
a25: c1 e0 03 shl $0x3,%eax
a28: 89 c2 mov %eax,%edx
a2a: 03 55 f8 add -0x8(%ebp),%edx
a2d: 8b 45 fc mov -0x4(%ebp),%eax
a30: 8b 00 mov (%eax),%eax
a32: 39 c2 cmp %eax,%edx
a34: 75 24 jne a5a <free+0x8a>
bp->s.size += p->s.ptr->s.size;
a36: 8b 45 f8 mov -0x8(%ebp),%eax
a39: 8b 50 04 mov 0x4(%eax),%edx
a3c: 8b 45 fc mov -0x4(%ebp),%eax
a3f: 8b 00 mov (%eax),%eax
a41: 8b 40 04 mov 0x4(%eax),%eax
a44: 01 c2 add %eax,%edx
a46: 8b 45 f8 mov -0x8(%ebp),%eax
a49: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
a4c: 8b 45 fc mov -0x4(%ebp),%eax
a4f: 8b 00 mov (%eax),%eax
a51: 8b 10 mov (%eax),%edx
a53: 8b 45 f8 mov -0x8(%ebp),%eax
a56: 89 10 mov %edx,(%eax)
a58: eb 0a jmp a64 <free+0x94>
} else
bp->s.ptr = p->s.ptr;
a5a: 8b 45 fc mov -0x4(%ebp),%eax
a5d: 8b 10 mov (%eax),%edx
a5f: 8b 45 f8 mov -0x8(%ebp),%eax
a62: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
a64: 8b 45 fc mov -0x4(%ebp),%eax
a67: 8b 40 04 mov 0x4(%eax),%eax
a6a: c1 e0 03 shl $0x3,%eax
a6d: 03 45 fc add -0x4(%ebp),%eax
a70: 3b 45 f8 cmp -0x8(%ebp),%eax
a73: 75 20 jne a95 <free+0xc5>
p->s.size += bp->s.size;
a75: 8b 45 fc mov -0x4(%ebp),%eax
a78: 8b 50 04 mov 0x4(%eax),%edx
a7b: 8b 45 f8 mov -0x8(%ebp),%eax
a7e: 8b 40 04 mov 0x4(%eax),%eax
a81: 01 c2 add %eax,%edx
a83: 8b 45 fc mov -0x4(%ebp),%eax
a86: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
a89: 8b 45 f8 mov -0x8(%ebp),%eax
a8c: 8b 10 mov (%eax),%edx
a8e: 8b 45 fc mov -0x4(%ebp),%eax
a91: 89 10 mov %edx,(%eax)
a93: eb 08 jmp a9d <free+0xcd>
} else
p->s.ptr = bp;
a95: 8b 45 fc mov -0x4(%ebp),%eax
a98: 8b 55 f8 mov -0x8(%ebp),%edx
a9b: 89 10 mov %edx,(%eax)
freep = p;
a9d: 8b 45 fc mov -0x4(%ebp),%eax
aa0: a3 54 0f 00 00 mov %eax,0xf54
}
aa5: c9 leave
aa6: c3 ret
00000aa7 <morecore>:
static Header*
morecore(uint nu)
{
aa7: 55 push %ebp
aa8: 89 e5 mov %esp,%ebp
aaa: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
aad: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
ab4: 77 07 ja abd <morecore+0x16>
nu = 4096;
ab6: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
abd: 8b 45 08 mov 0x8(%ebp),%eax
ac0: c1 e0 03 shl $0x3,%eax
ac3: 89 04 24 mov %eax,(%esp)
ac6: e8 3d fc ff ff call 708 <sbrk>
acb: 89 45 f0 mov %eax,-0x10(%ebp)
if(p == (char*)-1)
ace: 83 7d f0 ff cmpl $0xffffffff,-0x10(%ebp)
ad2: 75 07 jne adb <morecore+0x34>
return 0;
ad4: b8 00 00 00 00 mov $0x0,%eax
ad9: eb 22 jmp afd <morecore+0x56>
hp = (Header*)p;
adb: 8b 45 f0 mov -0x10(%ebp),%eax
ade: 89 45 f4 mov %eax,-0xc(%ebp)
hp->s.size = nu;
ae1: 8b 45 f4 mov -0xc(%ebp),%eax
ae4: 8b 55 08 mov 0x8(%ebp),%edx
ae7: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
aea: 8b 45 f4 mov -0xc(%ebp),%eax
aed: 83 c0 08 add $0x8,%eax
af0: 89 04 24 mov %eax,(%esp)
af3: e8 d8 fe ff ff call 9d0 <free>
return freep;
af8: a1 54 0f 00 00 mov 0xf54,%eax
}
afd: c9 leave
afe: c3 ret
00000aff <malloc>:
void*
malloc(uint nbytes)
{
aff: 55 push %ebp
b00: 89 e5 mov %esp,%ebp
b02: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
b05: 8b 45 08 mov 0x8(%ebp),%eax
b08: 83 c0 07 add $0x7,%eax
b0b: c1 e8 03 shr $0x3,%eax
b0e: 83 c0 01 add $0x1,%eax
b11: 89 45 f4 mov %eax,-0xc(%ebp)
if((prevp = freep) == 0){
b14: a1 54 0f 00 00 mov 0xf54,%eax
b19: 89 45 f0 mov %eax,-0x10(%ebp)
b1c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
b20: 75 23 jne b45 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
b22: c7 45 f0 4c 0f 00 00 movl $0xf4c,-0x10(%ebp)
b29: 8b 45 f0 mov -0x10(%ebp),%eax
b2c: a3 54 0f 00 00 mov %eax,0xf54
b31: a1 54 0f 00 00 mov 0xf54,%eax
b36: a3 4c 0f 00 00 mov %eax,0xf4c
base.s.size = 0;
b3b: c7 05 50 0f 00 00 00 movl $0x0,0xf50
b42: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
b45: 8b 45 f0 mov -0x10(%ebp),%eax
b48: 8b 00 mov (%eax),%eax
b4a: 89 45 ec mov %eax,-0x14(%ebp)
if(p->s.size >= nunits){
b4d: 8b 45 ec mov -0x14(%ebp),%eax
b50: 8b 40 04 mov 0x4(%eax),%eax
b53: 3b 45 f4 cmp -0xc(%ebp),%eax
b56: 72 4d jb ba5 <malloc+0xa6>
if(p->s.size == nunits)
b58: 8b 45 ec mov -0x14(%ebp),%eax
b5b: 8b 40 04 mov 0x4(%eax),%eax
b5e: 3b 45 f4 cmp -0xc(%ebp),%eax
b61: 75 0c jne b6f <malloc+0x70>
prevp->s.ptr = p->s.ptr;
b63: 8b 45 ec mov -0x14(%ebp),%eax
b66: 8b 10 mov (%eax),%edx
b68: 8b 45 f0 mov -0x10(%ebp),%eax
b6b: 89 10 mov %edx,(%eax)
b6d: eb 26 jmp b95 <malloc+0x96>
else {
p->s.size -= nunits;
b6f: 8b 45 ec mov -0x14(%ebp),%eax
b72: 8b 40 04 mov 0x4(%eax),%eax
b75: 89 c2 mov %eax,%edx
b77: 2b 55 f4 sub -0xc(%ebp),%edx
b7a: 8b 45 ec mov -0x14(%ebp),%eax
b7d: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
b80: 8b 45 ec mov -0x14(%ebp),%eax
b83: 8b 40 04 mov 0x4(%eax),%eax
b86: c1 e0 03 shl $0x3,%eax
b89: 01 45 ec add %eax,-0x14(%ebp)
p->s.size = nunits;
b8c: 8b 45 ec mov -0x14(%ebp),%eax
b8f: 8b 55 f4 mov -0xc(%ebp),%edx
b92: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
b95: 8b 45 f0 mov -0x10(%ebp),%eax
b98: a3 54 0f 00 00 mov %eax,0xf54
return (void*)(p + 1);
b9d: 8b 45 ec mov -0x14(%ebp),%eax
ba0: 83 c0 08 add $0x8,%eax
ba3: eb 38 jmp bdd <malloc+0xde>
}
if(p == freep)
ba5: a1 54 0f 00 00 mov 0xf54,%eax
baa: 39 45 ec cmp %eax,-0x14(%ebp)
bad: 75 1b jne bca <malloc+0xcb>
if((p = morecore(nunits)) == 0)
baf: 8b 45 f4 mov -0xc(%ebp),%eax
bb2: 89 04 24 mov %eax,(%esp)
bb5: e8 ed fe ff ff call aa7 <morecore>
bba: 89 45 ec mov %eax,-0x14(%ebp)
bbd: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
bc1: 75 07 jne bca <malloc+0xcb>
return 0;
bc3: b8 00 00 00 00 mov $0x0,%eax
bc8: eb 13 jmp bdd <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){
bca: 8b 45 ec mov -0x14(%ebp),%eax
bcd: 89 45 f0 mov %eax,-0x10(%ebp)
bd0: 8b 45 ec mov -0x14(%ebp),%eax
bd3: 8b 00 mov (%eax),%eax
bd5: 89 45 ec mov %eax,-0x14(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
bd8: e9 70 ff ff ff jmp b4d <malloc+0x4e>
}
bdd: c9 leave
bde: c3 ret
bdf: 90 nop
00000be0 <xchg>:
asm volatile("sti");
}
static inline uint
xchg(volatile uint *addr, uint newval)
{
be0: 55 push %ebp
be1: 89 e5 mov %esp,%ebp
be3: 83 ec 10 sub $0x10,%esp
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
be6: 8b 55 08 mov 0x8(%ebp),%edx
be9: 8b 45 0c mov 0xc(%ebp),%eax
bec: 8b 4d 08 mov 0x8(%ebp),%ecx
bef: f0 87 02 lock xchg %eax,(%edx)
bf2: 89 45 fc mov %eax,-0x4(%ebp)
"+m" (*addr), "=a" (result) :
"1" (newval) :
"cc");
return result;
bf5: 8b 45 fc mov -0x4(%ebp),%eax
}
bf8: c9 leave
bf9: c3 ret
00000bfa <lock_init>:
#include "x86.h"
#include "proc.h"
unsigned long rands = 1;
void lock_init(lock_t *lock){
bfa: 55 push %ebp
bfb: 89 e5 mov %esp,%ebp
lock->locked = 0;
bfd: 8b 45 08 mov 0x8(%ebp),%eax
c00: c7 00 00 00 00 00 movl $0x0,(%eax)
}
c06: 5d pop %ebp
c07: c3 ret
00000c08 <lock_acquire>:
void lock_acquire(lock_t *lock){
c08: 55 push %ebp
c09: 89 e5 mov %esp,%ebp
c0b: 83 ec 08 sub $0x8,%esp
while(xchg(&lock->locked,1) != 0);
c0e: 8b 45 08 mov 0x8(%ebp),%eax
c11: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
c18: 00
c19: 89 04 24 mov %eax,(%esp)
c1c: e8 bf ff ff ff call be0 <xchg>
c21: 85 c0 test %eax,%eax
c23: 75 e9 jne c0e <lock_acquire+0x6>
}
c25: c9 leave
c26: c3 ret
00000c27 <lock_release>:
void lock_release(lock_t *lock){
c27: 55 push %ebp
c28: 89 e5 mov %esp,%ebp
c2a: 83 ec 08 sub $0x8,%esp
xchg(&lock->locked,0);
c2d: 8b 45 08 mov 0x8(%ebp),%eax
c30: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
c37: 00
c38: 89 04 24 mov %eax,(%esp)
c3b: e8 a0 ff ff ff call be0 <xchg>
}
c40: c9 leave
c41: c3 ret
00000c42 <thread_create>:
void *thread_create(void(*start_routine)(void*), void *arg){
c42: 55 push %ebp
c43: 89 e5 mov %esp,%ebp
c45: 83 ec 28 sub $0x28,%esp
int tid;
void * stack = malloc(2 * 4096);
c48: c7 04 24 00 20 00 00 movl $0x2000,(%esp)
c4f: e8 ab fe ff ff call aff <malloc>
c54: 89 45 f0 mov %eax,-0x10(%ebp)
void *garbage_stack = stack;
c57: 8b 45 f0 mov -0x10(%ebp),%eax
c5a: 89 45 f4 mov %eax,-0xc(%ebp)
// printf(1,"start routine addr : %d\n",(uint)start_routine);
if((uint)stack % 4096){
c5d: 8b 45 f0 mov -0x10(%ebp),%eax
c60: 25 ff 0f 00 00 and $0xfff,%eax
c65: 85 c0 test %eax,%eax
c67: 74 15 je c7e <thread_create+0x3c>
stack = stack + (4096 - (uint)stack % 4096);
c69: 8b 45 f0 mov -0x10(%ebp),%eax
c6c: 89 c2 mov %eax,%edx
c6e: 81 e2 ff 0f 00 00 and $0xfff,%edx
c74: b8 00 10 00 00 mov $0x1000,%eax
c79: 29 d0 sub %edx,%eax
c7b: 01 45 f0 add %eax,-0x10(%ebp)
}
if (stack == 0){
c7e: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
c82: 75 1b jne c9f <thread_create+0x5d>
printf(1,"malloc fail \n");
c84: c7 44 24 04 03 0f 00 movl $0xf03,0x4(%esp)
c8b: 00
c8c: c7 04 24 01 00 00 00 movl $0x1,(%esp)
c93: e8 81 fb ff ff call 819 <printf>
return 0;
c98: b8 00 00 00 00 mov $0x0,%eax
c9d: eb 6f jmp d0e <thread_create+0xcc>
}
tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg);
c9f: 8b 4d 0c mov 0xc(%ebp),%ecx
ca2: 8b 55 08 mov 0x8(%ebp),%edx
ca5: 8b 45 f0 mov -0x10(%ebp),%eax
ca8: 89 4c 24 0c mov %ecx,0xc(%esp)
cac: 89 54 24 08 mov %edx,0x8(%esp)
cb0: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp)
cb7: 00
cb8: 89 04 24 mov %eax,(%esp)
cbb: e8 60 fa ff ff call 720 <clone>
cc0: 89 45 ec mov %eax,-0x14(%ebp)
if(tid < 0){
cc3: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
cc7: 79 1b jns ce4 <thread_create+0xa2>
printf(1,"clone fails\n");
cc9: c7 44 24 04 11 0f 00 movl $0xf11,0x4(%esp)
cd0: 00
cd1: c7 04 24 01 00 00 00 movl $0x1,(%esp)
cd8: e8 3c fb ff ff call 819 <printf>
return 0;
cdd: b8 00 00 00 00 mov $0x0,%eax
ce2: eb 2a jmp d0e <thread_create+0xcc>
}
if(tid > 0){
ce4: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
ce8: 7e 05 jle cef <thread_create+0xad>
//store threads on thread table
return garbage_stack;
cea: 8b 45 f4 mov -0xc(%ebp),%eax
ced: eb 1f jmp d0e <thread_create+0xcc>
}
if(tid == 0){
cef: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
cf3: 75 14 jne d09 <thread_create+0xc7>
printf(1,"tid = 0 return \n");
cf5: c7 44 24 04 1e 0f 00 movl $0xf1e,0x4(%esp)
cfc: 00
cfd: c7 04 24 01 00 00 00 movl $0x1,(%esp)
d04: e8 10 fb ff ff call 819 <printf>
}
// wait();
// free(garbage_stack);
return 0;
d09: b8 00 00 00 00 mov $0x0,%eax
}
d0e: c9 leave
d0f: c3 ret
00000d10 <random>:
// generate 0 -> max random number exclude max.
int random(int max){
d10: 55 push %ebp
d11: 89 e5 mov %esp,%ebp
rands = rands * 1664525 + 1013904233;
d13: a1 44 0f 00 00 mov 0xf44,%eax
d18: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax
d1e: 05 69 f3 6e 3c add $0x3c6ef369,%eax
d23: a3 44 0f 00 00 mov %eax,0xf44
return (int)(rands % max);
d28: a1 44 0f 00 00 mov 0xf44,%eax
d2d: 8b 4d 08 mov 0x8(%ebp),%ecx
d30: ba 00 00 00 00 mov $0x0,%edx
d35: f7 f1 div %ecx
d37: 89 d0 mov %edx,%eax
}
d39: 5d pop %ebp
d3a: c3 ret
d3b: 90 nop
00000d3c <init_q>:
#include "queue.h"
#include "types.h"
#include "user.h"
void init_q(struct queue *q){
d3c: 55 push %ebp
d3d: 89 e5 mov %esp,%ebp
q->size = 0;
d3f: 8b 45 08 mov 0x8(%ebp),%eax
d42: c7 00 00 00 00 00 movl $0x0,(%eax)
q->head = 0;
d48: 8b 45 08 mov 0x8(%ebp),%eax
d4b: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
d52: 8b 45 08 mov 0x8(%ebp),%eax
d55: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
d5c: 5d pop %ebp
d5d: c3 ret
00000d5e <add_q>:
void add_q(struct queue *q, int v){
d5e: 55 push %ebp
d5f: 89 e5 mov %esp,%ebp
d61: 83 ec 28 sub $0x28,%esp
struct node * n = malloc(sizeof(struct node));
d64: c7 04 24 08 00 00 00 movl $0x8,(%esp)
d6b: e8 8f fd ff ff call aff <malloc>
d70: 89 45 f4 mov %eax,-0xc(%ebp)
n->next = 0;
d73: 8b 45 f4 mov -0xc(%ebp),%eax
d76: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
n->value = v;
d7d: 8b 45 f4 mov -0xc(%ebp),%eax
d80: 8b 55 0c mov 0xc(%ebp),%edx
d83: 89 10 mov %edx,(%eax)
if(q->head == 0){
d85: 8b 45 08 mov 0x8(%ebp),%eax
d88: 8b 40 04 mov 0x4(%eax),%eax
d8b: 85 c0 test %eax,%eax
d8d: 75 0b jne d9a <add_q+0x3c>
q->head = n;
d8f: 8b 45 08 mov 0x8(%ebp),%eax
d92: 8b 55 f4 mov -0xc(%ebp),%edx
d95: 89 50 04 mov %edx,0x4(%eax)
d98: eb 0c jmp da6 <add_q+0x48>
}else{
q->tail->next = n;
d9a: 8b 45 08 mov 0x8(%ebp),%eax
d9d: 8b 40 08 mov 0x8(%eax),%eax
da0: 8b 55 f4 mov -0xc(%ebp),%edx
da3: 89 50 04 mov %edx,0x4(%eax)
}
q->tail = n;
da6: 8b 45 08 mov 0x8(%ebp),%eax
da9: 8b 55 f4 mov -0xc(%ebp),%edx
dac: 89 50 08 mov %edx,0x8(%eax)
q->size++;
daf: 8b 45 08 mov 0x8(%ebp),%eax
db2: 8b 00 mov (%eax),%eax
db4: 8d 50 01 lea 0x1(%eax),%edx
db7: 8b 45 08 mov 0x8(%ebp),%eax
dba: 89 10 mov %edx,(%eax)
}
dbc: c9 leave
dbd: c3 ret
00000dbe <empty_q>:
int empty_q(struct queue *q){
dbe: 55 push %ebp
dbf: 89 e5 mov %esp,%ebp
if(q->size == 0)
dc1: 8b 45 08 mov 0x8(%ebp),%eax
dc4: 8b 00 mov (%eax),%eax
dc6: 85 c0 test %eax,%eax
dc8: 75 07 jne dd1 <empty_q+0x13>
return 1;
dca: b8 01 00 00 00 mov $0x1,%eax
dcf: eb 05 jmp dd6 <empty_q+0x18>
else
return 0;
dd1: b8 00 00 00 00 mov $0x0,%eax
}
dd6: 5d pop %ebp
dd7: c3 ret
00000dd8 <pop_q>:
int pop_q(struct queue *q){
dd8: 55 push %ebp
dd9: 89 e5 mov %esp,%ebp
ddb: 83 ec 28 sub $0x28,%esp
int val;
struct node *destroy;
if(!empty_q(q)){
dde: 8b 45 08 mov 0x8(%ebp),%eax
de1: 89 04 24 mov %eax,(%esp)
de4: e8 d5 ff ff ff call dbe <empty_q>
de9: 85 c0 test %eax,%eax
deb: 75 5d jne e4a <pop_q+0x72>
val = q->head->value;
ded: 8b 45 08 mov 0x8(%ebp),%eax
df0: 8b 40 04 mov 0x4(%eax),%eax
df3: 8b 00 mov (%eax),%eax
df5: 89 45 f0 mov %eax,-0x10(%ebp)
destroy = q->head;
df8: 8b 45 08 mov 0x8(%ebp),%eax
dfb: 8b 40 04 mov 0x4(%eax),%eax
dfe: 89 45 f4 mov %eax,-0xc(%ebp)
q->head = q->head->next;
e01: 8b 45 08 mov 0x8(%ebp),%eax
e04: 8b 40 04 mov 0x4(%eax),%eax
e07: 8b 50 04 mov 0x4(%eax),%edx
e0a: 8b 45 08 mov 0x8(%ebp),%eax
e0d: 89 50 04 mov %edx,0x4(%eax)
free(destroy);
e10: 8b 45 f4 mov -0xc(%ebp),%eax
e13: 89 04 24 mov %eax,(%esp)
e16: e8 b5 fb ff ff call 9d0 <free>
q->size--;
e1b: 8b 45 08 mov 0x8(%ebp),%eax
e1e: 8b 00 mov (%eax),%eax
e20: 8d 50 ff lea -0x1(%eax),%edx
e23: 8b 45 08 mov 0x8(%ebp),%eax
e26: 89 10 mov %edx,(%eax)
if(q->size == 0){
e28: 8b 45 08 mov 0x8(%ebp),%eax
e2b: 8b 00 mov (%eax),%eax
e2d: 85 c0 test %eax,%eax
e2f: 75 14 jne e45 <pop_q+0x6d>
q->head = 0;
e31: 8b 45 08 mov 0x8(%ebp),%eax
e34: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
q->tail = 0;
e3b: 8b 45 08 mov 0x8(%ebp),%eax
e3e: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax)
}
return val;
e45: 8b 45 f0 mov -0x10(%ebp),%eax
e48: eb 05 jmp e4f <pop_q+0x77>
}
return -1;
e4a: b8 ff ff ff ff mov $0xffffffff,%eax
}
e4f: c9 leave
e50: c3 ret
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/a49027b.ada | best08618/asylo | 7 | 3047 | -- A49027B.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT A SUBTYPE CAN BE NONSTATIC IN A GENERIC TEMPLATE
-- AND STATIC IN THE CORRESPONDING INSTANCE.
-- CHECK THAT IF A GENERIC PARAMETER IS A STATIC EXPRESSION AND THE
-- CORRESPONDING (IN) PARAMETER HAS A STATIC SUBTYPE IN THE INSTANCE,
-- THEN EACH USE OF THE FORMAL PARAMETERS IN THE INSTANCE IS SAID TO
-- BE STATIC.
--
-- A NAME DENOTING A CONSTANT DECLARED IN A GENERIC INSTANCE IS
-- ALLOWED AS A PRIMARY IN A STATIC EXPRESSION IF THE CONSTANT
-- IS DECLARED BY A CONSTANT DECLARATION WITH A STATIC SUBTYPE
-- AND INITIALIZED WITH A STATIC EXPRESSION.
--
-- THIS IS A TEST BASED ON AI-00505/03-BI-WA.
-- HISTORY:
-- <NAME>, 27 AUGUST 1990
-- DAS 8 OCT 90 ADDED CODE TO MATCH EXAMPLE 1 IN
-- AI-00505.
-- JRL 05/29/92 CORRECTED MINOR PROBLEM IN REPORT.TEST STRING.
-- JRL 02/18/93 EXPANDED TEXT OF REPORT.TEST STRING.
-- PWN 04/14/95 CORRECTED MINOR COPYRIGHT COMMENT PROBLEM.
WITH REPORT ;
PROCEDURE A49027B IS
BEGIN -- A49027B
REPORT.TEST ("A49027B", "CHECK THAT IF A GENERIC ACTUAL " &
"PARAMETER IS A STATIC EXPRESSION AND THE " &
"CORRESPONDING FORMAL PARAMETER HAS A STATIC " &
"SUBTYPE IN THE INSTANCE, THEN EACH USE OF THE " &
"FORMAL PARAMETER IN THE INSTANCE IS SAID TO BE " &
"STATIC. CHECK THAT A NAME DENOTING A CONSTANT " &
"DECLARED IN A GENERIC INSTANCE IS ALLOWED AS " &
"A PRIMARY IN A STATIC EXPRESSION IF THE " &
"CONSTANT IS DECLARED BY A CONSTANT DECLARATION " &
"WITH A STATIC SUBTYPE AND INITIALIZED WITH A " &
"STATIC EXPRESSION. (AI-00505)");
LOCAL_BLOCK:
DECLARE
TYPE NUMBER IS RANGE 1 .. 10 ;
TYPE COLOR IS (RED, ORANGE, YELLOW, GREEN, BLUE) ;
MIDDLE_COLOR : CONSTANT COLOR := GREEN ;
ENUMERATED_VALUE : COLOR := COLOR'LAST ;
GENERIC
TYPE NUMBER_TYPE IS RANGE <> ;
X : INTEGER ;
TYPE ENUMERATED IS (<>) ;
FIRST_NUMBER : IN NUMBER_TYPE ;
SECOND_NUMBER : IN NUMBER_TYPE ;
THIRD_NUMBER : IN NUMBER_TYPE ;
FIRST_ENUMERATED : IN ENUMERATED ;
SECOND_ENUMERATED : IN ENUMERATED ;
THIRD_ENUMERATED : IN ENUMERATED ;
FIRST_INTEGER_VALUE : IN INTEGER ;
SECOND_INTEGER_VALUE : IN INTEGER ;
PACKAGE STATIC_TEST IS
Y : CONSTANT INTEGER := X;
Z : CONSTANT NUMBER_TYPE := 5;
SUBTYPE FIRST_NUMBER_SUBTYPE IS NUMBER_TYPE
RANGE FIRST_NUMBER .. SECOND_NUMBER ;
SUBTYPE SECOND_NUMBER_SUBTYPE IS NUMBER_TYPE
RANGE FIRST_NUMBER .. THIRD_NUMBER ;
SUBTYPE FIRST_ENUMERATED_SUBTYPE IS ENUMERATED
RANGE FIRST_ENUMERATED .. SECOND_ENUMERATED ;
SUBTYPE SECOND_ENUMERATED_SUBTYPE IS ENUMERATED
RANGE FIRST_ENUMERATED .. THIRD_ENUMERATED ;
SUBTYPE THIRD_NUMBER_TYPE IS INTEGER
RANGE FIRST_INTEGER_VALUE .. SECOND_INTEGER_VALUE ;
END STATIC_TEST ;
PACKAGE NEW_STATIC_TEST IS NEW STATIC_TEST
(NUMBER_TYPE => NUMBER,
X => 3,
ENUMERATED => COLOR,
FIRST_NUMBER => NUMBER'FIRST,
SECOND_NUMBER => NUMBER'LAST,
THIRD_NUMBER => NUMBER'SUCC(NUMBER'FIRST),
FIRST_ENUMERATED => RED,
SECOND_ENUMERATED => MIDDLE_COLOR,
THIRD_ENUMERATED => COLOR'VAL (1),
FIRST_INTEGER_VALUE => COLOR'POS (YELLOW),
SECOND_INTEGER_VALUE => NUMBER'POS (5)) ;
TYPE T1 IS RANGE 1 .. NEW_STATIC_TEST.Y;
TYPE T2 IS RANGE 1 .. NEW_STATIC_TEST.Z;
TYPE ANOTHER_NUMBER IS RANGE
NEW_STATIC_TEST.FIRST_NUMBER_SUBTYPE'FIRST ..
NEW_STATIC_TEST.FIRST_NUMBER_SUBTYPE'LAST ;
TYPE YET_ANOTHER_NUMBER IS RANGE
NEW_STATIC_TEST.SECOND_NUMBER_SUBTYPE'FIRST ..
NEW_STATIC_TEST.SECOND_NUMBER_SUBTYPE'LAST ;
TYPE STILL_ANOTHER_NUMBER IS RANGE
NEW_STATIC_TEST.THIRD_NUMBER_TYPE'FIRST ..
NEW_STATIC_TEST.THIRD_NUMBER_TYPE'LAST ;
BEGIN -- LOCAL_BLOCK
CASE ENUMERATED_VALUE IS
WHEN YELLOW => NULL ;
WHEN NEW_STATIC_TEST.FIRST_ENUMERATED_SUBTYPE'FIRST
=> NULL ;
WHEN NEW_STATIC_TEST.FIRST_ENUMERATED_SUBTYPE'LAST
=> NULL ;
WHEN NEW_STATIC_TEST.SECOND_ENUMERATED_SUBTYPE'LAST
=> NULL ;
WHEN COLOR'LAST => NULL ;
END CASE ;
END LOCAL_BLOCK ;
REPORT.RESULT ;
END A49027B ;
|
src/nl/tvandijk/aoc/year2020/day22/Input.g4 | trolando/aoc2020 | 1 | 6013 | grammar Input;
players : player player;
player : 'Player' INT ':' card+;
card : INT;
CHAR : [a-zA-Z]+ ;
INT : [0-9]+ ;
WS : [ \t\r\n]+ -> skip ; |
org.alloytools.alloy.diff/misc/multiplicities/notB2.als | jringert/alloy-diff | 1 | 5300 | <filename>org.alloytools.alloy.diff/misc/multiplicities/notB2.als
module b
sig Branch {}
sig Bank{
branches: one Branch
}
pred b2 {
branches in Bank set -> one Branch
//all b : Bank | #b.branches =1
}
run {not b2} for 10
|
src/frontend/Experimental_Ada_ROSE_Connection/parser/lal_adapter/source/main.adb | ouankou/rose | 488 | 564 | <filename>src/frontend/Experimental_Ada_ROSE_Connection/parser/lal_adapter/source/main.adb
with Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with GNATCOLL.Projects;
with GNATCOLL.VFS;
with Langkit_Support.Slocs;
with Libadalang.Analysis;
with Libadalang.Common;
with Libadalang.Project_Provider;
procedure Main is
package LAL renames Libadalang.Analysis;
package LALCO renames Libadalang.Common;
package Slocs renames Langkit_Support.Slocs;
-- Context : constant LAL.Analysis_Context := LAL.Create_Context;
Context : LAL.Analysis_Context;
Provider : LAL.Unit_Provider_Reference;
-- If Node is an object declaration, print its text. Always continue the
-- traversal.
function Process_Node
(Node : LAL.Ada_Node'Class)
return LALCO.Visit_Status
is
use type LALCO.Ada_Node_Kind_Type;
begin
-- if Node.Kind = LALCO.Ada_Object_Decl then
Put_Line
("Line" & Slocs.Line_Number'Image (Node.Sloc_Range.Start_Line) & ": " &
LALCO.Ada_Node_Kind_Type'Image (Node.kind) & ": " &
Node.Debug_Text);
-- end if;
return LALCO.Into;
end Process_Node;
-- Load the project file designated by the first command-line argument
function Load_Project return LAL.Unit_Provider_Reference is
package GPR renames GNATCOLL.Projects;
package LAL_GPR renames Libadalang.Project_Provider;
use type GNATCOLL.VFS.Filesystem_String;
Project_Filename : constant String := Ada.Command_Line.Argument (1);
Project_File : constant GNATCOLL.VFS.Virtual_File :=
GNATCOLL.VFS.Create (+Project_Filename);
Env : GPR.Project_Environment_Access;
Project : constant GPR.Project_Tree_Access := new GPR.Project_Tree;
begin
GPR.Initialize (Env);
-- Use procedures in GNATCOLL.Projects to set scenario
-- variables (Change_Environment), to set the target
-- and the runtime (Set_Target_And_Runtime), etc.
Project.Load (Project_File, Env);
return LAL_GPR.Create_Project_Unit_Provider
(Tree => Project,
Project => GPR.No_Project,
Env => Env);
end Load_Project;
begin
Context := LAL.Create_Context (Unit_Provider => Load_Project);
-- Try to parse all source file given as arguments
for I in 2 .. Ada.Command_Line.Argument_Count loop
declare
Filename : constant String := Ada.Command_Line.Argument (I);
Unit : constant LAL.Analysis_Unit := Context.Get_From_File (Filename);
begin
Put_Line ("== " & Filename & " ==");
-- Report parsing errors, if any
if Unit.Has_Diagnostics then
for D of Unit.Diagnostics loop
Put_Line (Unit.Format_GNU_Diagnostic (D));
end loop;
-- Otherwise, look for object declarations
else
Unit.Root.Traverse (Process_Node'Access);
end if;
New_Line;
end;
end loop;
end Main;
|
source/xml/dom/matreshka-dom_character_datas.adb | svn2github/matreshka | 24 | 10790 | <gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the <NAME>, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
package body Matreshka.DOM_Character_Datas is
------------------
-- Constructors --
------------------
package body Constructors is
----------------
-- Initialize --
----------------
procedure Initialize
(Self : not null access Character_Data_Node'Class;
Document : not null Matreshka.DOM_Nodes.Document_Access;
Data : League.Strings.Universal_String) is
begin
Matreshka.DOM_Nodes.Constructors.Initialize (Self, Document);
Self.Data := Data;
end Initialize;
end Constructors;
--------------
-- Get_Data --
--------------
overriding function Get_Data
(Self : not null access constant Character_Data_Node)
return League.Strings.Universal_String is
begin
return Self.Data;
end Get_Data;
------------------
-- Replace_Data --
------------------
overriding procedure Replace_Data
(Self : not null access Character_Data_Node;
Offset : Positive;
Count : Natural;
Arg : League.Strings.Universal_String) is
begin
if Offset <= Self.Data.Length then
-- Position of first character of the replaced slice is inside
-- string. Position of last character of replaced slice can't be
-- greater than length of the string.
Self.Data.Replace
(Offset,
Natural'Min (Offset + Count - 1, Self.Data.Length),
Arg);
elsif Offset = Self.Data.Length + 1 then
-- Position of first character points to first position after
-- position of last character of the string. Specified new data need
-- to be appended to the string.
Self.Data.Append (Arg);
else
-- Position of the first character points outside of current data,
-- DOM_INDEX_SIZE_ERR need to be raised.
Self.Raise_Index_Size_Error;
end if;
end Replace_Data;
--------------
-- Set_Data --
--------------
overriding procedure Set_Data
(Self : not null access Character_Data_Node;
New_Value : League.Strings.Universal_String) is
begin
Self.Data := New_Value;
end Set_Data;
end Matreshka.DOM_Character_Datas;
|
oeis/098/A098871.asm | neoneye/loda-programs | 11 | 11707 | ; A098871: Sums of distinct powers of 4 plus 1.
; Submitted by <NAME>
; 1,2,5,6,17,18,21,22,65,66,69,70,81,82,85,86,257,258,261,262,273,274,277,278,321,322,325,326,337,338,341,342,1025,1026,1029,1030,1041,1042,1045,1046,1089,1090,1093,1094,1105,1106,1109,1110,1281,1282,1285,1286
mov $2,1
lpb $0
mov $3,$0
div $0,2
mod $3,2
mul $3,$2
add $1,$3
mul $2,4
lpe
mov $0,$1
add $0,1
|
Assignment/passworddatabase.ads | vivianjia123/Password-Manager | 0 | 13913 | <filename>Assignment/passworddatabase.ads
with Ada.Containers.Formal_Ordered_Maps;
with Ada.Containers;
use Ada.Containers;
with MyString;
package PasswordDatabase with SPARK_Mode is
Max_Password_Length : constant Natural := 100;
Max_URL_Length : constant Natural := 1024;
Max_Entries : constant Ada.Containers.Count_Type := 1000;
package Passwords is new MyString(Max_MyString_Length => Max_Password_Length);
package URLs is new MyString(Max_MyString_Length => Max_URL_Length);
type Password is new Passwords.MyString;
type URL is new URLs.MyString;
type Database is private;
procedure Init(D : out Database);
function Has_Password_For(D : in Database; U : in URL) return Boolean;
function Get(D : in Database; U : in URL) return Password with
Pre => Has_Password_For(D,U);
procedure Put(D : in out Database; U : in URL; P : in Password) with
Pre => Length(D) < Max_Entries or Has_Password_For(D,U);
procedure Remove(D : in out Database; U : in URL) with
Pre => Has_Password_For(D,U);
function From_String(S : String) return Password with
Pre => S'Length <= Max_Password_Length;
function From_String(S : String) return URL with
Pre => S'Length <= Max_URL_Length;
function To_String(P : Password) return String;
function To_String(U : URL) return String;
function Less(U1 : URL; U2 : URL) return Boolean;
function Equal(U1 : URL; U2 : URL) return Boolean;
function Equal(P1 : Password; P2 : Password) return Boolean;
function Length(D : in Database) return Ada.Containers.Count_Type;
private
pragma SPARK_Mode(Off);
package PW_Ordered_Maps is new
Ada.Containers.Formal_Ordered_Maps
(Key_Type => URL,
Element_Type => Password,
"<" => Less);
type Database is record
passwords : PW_Ordered_Maps.Map(Capacity => Max_Entries);
end record;
function Get(D : in Database; U : in URL) return Password is
(PW_Ordered_Maps.Element(Container => D.passwords,Key => U));
function Has_Password_For(D : in Database; U : in URL) return Boolean is
(PW_Ordered_Maps.Contains(Container => D.passwords, Key => U));
function From_String(S : String) return Password is
(Password(Passwords.From_String(S)));
function From_String(S : String) return URL is
(URL(URLs.From_String(S)));
function To_String(P : Password) return String is
(Passwords.To_String(Passwords.MyString(P)));
function To_String(U : URL) return String is
(URLs.To_String(URLs.MyString(U)));
function Less(U1 : URL; U2 : URL) return Boolean is
(URLs.Less(URLs.MyString(U1),URLs.MyString(U2)));
function Equal(U1 : URL; U2 : URL) return Boolean is
(URLs.Equal(URLs.MyString(U1),URLs.MyString(U2)));
function Equal(P1 : Password; P2 : Password) return Boolean is
(Passwords.Equal(Passwords.MyString(P1),Passwords.MyString(P2)));
function Length(D : in Database) return Ada.Containers.Count_Type is
(PW_Ordered_Maps.Length(D.passwords));
end PasswordDatabase;
|
src/natools-web-cookie_setters.ads | faelys/natools-web | 1 | 22702 | ------------------------------------------------------------------------------
-- Copyright (c) 2019, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.Web.Cookie_Setters provides and end-point to set --
-- more or less abritrary cookies. --
------------------------------------------------------------------------------
with Natools.Web.Sites;
with Natools.S_Expressions;
private with Natools.S_Expressions.Atom_Refs;
private with Natools.Web.Containers;
package Natools.Web.Cookie_Setters is
type Setter is new Sites.Page with private;
overriding procedure Respond
(Object : in out Setter;
Exchange : in out Sites.Exchange;
Extra_Path : in S_Expressions.Atom);
type Loader is new Sites.Transient_Page_Loader with private;
overriding function Can_Be_Stored (Object : in Loader) return Boolean;
overriding procedure Load
(Object : in out Loader;
Builder : in out Sites.Site_Builder;
Path : in S_Expressions.Atom);
function Create (File : in S_Expressions.Atom)
return Sites.Page_Loader'Class;
private
Default_Max_Age : constant := 10.0 * 365.0 * 86400.0;
Default_Max_Length : constant := 50;
type Setter is new Sites.Page with record
Redirect_Target : S_Expressions.Atom_Refs.Immutable_Reference;
Force_Name : S_Expressions.Atom_Refs.Immutable_Reference;
Allowed_Names : Containers.Atom_Set;
Path : S_Expressions.Atom_Refs.Immutable_Reference;
Comment : S_Expressions.Atom_Refs.Immutable_Reference;
Domain : S_Expressions.Atom_Refs.Immutable_Reference;
Max_Age : Duration := Default_Max_Age;
Secure : Boolean := False;
HTTP_Only : Boolean := False;
Max_Length : Positive := Default_Max_Length;
end record;
function Comment (Object : in Setter) return String
is (if Object.Comment.Is_Empty
then "" else S_Expressions.To_String (Object.Comment.Query));
function Domain (Object : in Setter) return String
is (if Object.Domain.Is_Empty
then "" else S_Expressions.To_String (Object.Domain.Query));
function Path (Object : in Setter) return String
is (if Object.Path.Is_Empty
then "/" else S_Expressions.To_String (Object.Path.Query));
type Loader is new Sites.Transient_Page_Loader with record
File_Name : S_Expressions.Atom_Refs.Immutable_Reference;
File_Found : Boolean := False;
end record;
end Natools.Web.Cookie_Setters;
|
programs/oeis/187/A187950.asm | neoneye/loda | 22 | 242923 | ; A187950: [nr+kr] - [nr] - [kr], where r = (1+sqrt(5))/2, k = 4, [.]=floor.
; 1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1
lpb $0
mov $1,$0
mov $2,$0
seq $2,66628 ; a(n) = n - the largest Fibonacci number <= n.
mov $0,$2
lpe
lpb $1
mov $1,4
lpe
add $1,1
mod $1,2
mov $0,$1
|
lab3.asm | UyChooTran/CS153Lab3 | 0 | 7775 | <gh_stars>0
_lab3: file format elf32-i386
Disassembly of section .text:
00001000 <main>:
x = test(x);
printf(1,"%d\n",x);
return x;
}
int main(int argc, char *argv[])
{
1000: 8d 4c 24 04 lea 0x4(%esp),%ecx
1004: 83 e4 f0 and $0xfffffff0,%esp
1007: ff 71 fc pushl -0x4(%ecx)
100a: 55 push %ebp
100b: 89 e5 mov %esp,%ebp
100d: 51 push %ecx
100e: 83 ec 04 sub $0x4,%esp
int pid=0;
pid=fork();
1011: e8 b4 02 00 00 call 12ca <fork>
if(pid==0){
1016: 85 c0 test %eax,%eax
1018: 75 1d jne 1037 <main+0x37>
test(1);
101a: 83 ec 0c sub $0xc,%esp
101d: 6a 01 push $0x1
101f: e8 2c 00 00 00 call 1050 <test>
printf(1,"running");
1024: 58 pop %eax
1025: 5a pop %edx
1026: 68 88 17 00 00 push $0x1788
102b: 6a 01 push $0x1
102d: e8 fe 03 00 00 call 1430 <printf>
exit();
1032: e8 9b 02 00 00 call 12d2 <exit>
}
wait();
1037: e8 9e 02 00 00 call 12da <wait>
exit();
103c: e8 91 02 00 00 call 12d2 <exit>
1041: 66 90 xchg %ax,%ax
1043: 66 90 xchg %ax,%ax
1045: 66 90 xchg %ax,%ax
1047: 66 90 xchg %ax,%ax
1049: 66 90 xchg %ax,%ax
104b: 66 90 xchg %ax,%ax
104d: 66 90 xchg %ax,%ax
104f: 90 nop
00001050 <test>:
#include "types.h"
#include "stat.h"
#include "user.h"
int test(int n)
{
1050: 55 push %ebp
1051: 89 e5 mov %esp,%ebp
1053: 53 push %ebx
1054: 83 ec 10 sub $0x10,%esp
int x = n + 1;
1057: 8b 45 08 mov 0x8(%ebp),%eax
105a: 83 c0 01 add $0x1,%eax
x = test(x);
105d: 50 push %eax
105e: e8 ed ff ff ff call 1050 <test>
x = test(x);
1063: 89 04 24 mov %eax,(%esp)
1066: e8 e5 ff ff ff call 1050 <test>
printf(1,"%d\n",x);
106b: 83 c4 0c add $0xc,%esp
int test(int n)
{
int x = n + 1;
x = test(x);
x = test(x);
106e: 89 c3 mov %eax,%ebx
printf(1,"%d\n",x);
1070: 50 push %eax
1071: 68 84 17 00 00 push $0x1784
1076: 6a 01 push $0x1
1078: e8 b3 03 00 00 call 1430 <printf>
return x;
}
107d: 89 d8 mov %ebx,%eax
107f: 8b 5d fc mov -0x4(%ebp),%ebx
1082: c9 leave
1083: c3 ret
1084: 66 90 xchg %ax,%ax
1086: 66 90 xchg %ax,%ax
1088: 66 90 xchg %ax,%ax
108a: 66 90 xchg %ax,%ax
108c: 66 90 xchg %ax,%ax
108e: 66 90 xchg %ax,%ax
00001090 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
1090: 55 push %ebp
1091: 89 e5 mov %esp,%ebp
1093: 53 push %ebx
1094: 8b 45 08 mov 0x8(%ebp),%eax
1097: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
109a: 89 c2 mov %eax,%edx
109c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
10a0: 83 c1 01 add $0x1,%ecx
10a3: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
10a7: 83 c2 01 add $0x1,%edx
10aa: 84 db test %bl,%bl
10ac: 88 5a ff mov %bl,-0x1(%edx)
10af: 75 ef jne 10a0 <strcpy+0x10>
;
return os;
}
10b1: 5b pop %ebx
10b2: 5d pop %ebp
10b3: c3 ret
10b4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
10ba: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000010c0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
10c0: 55 push %ebp
10c1: 89 e5 mov %esp,%ebp
10c3: 56 push %esi
10c4: 53 push %ebx
10c5: 8b 55 08 mov 0x8(%ebp),%edx
10c8: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
10cb: 0f b6 02 movzbl (%edx),%eax
10ce: 0f b6 19 movzbl (%ecx),%ebx
10d1: 84 c0 test %al,%al
10d3: 75 1e jne 10f3 <strcmp+0x33>
10d5: eb 29 jmp 1100 <strcmp+0x40>
10d7: 89 f6 mov %esi,%esi
10d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
10e0: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
10e3: 0f b6 02 movzbl (%edx),%eax
p++, q++;
10e6: 8d 71 01 lea 0x1(%ecx),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
10e9: 0f b6 59 01 movzbl 0x1(%ecx),%ebx
10ed: 84 c0 test %al,%al
10ef: 74 0f je 1100 <strcmp+0x40>
10f1: 89 f1 mov %esi,%ecx
10f3: 38 d8 cmp %bl,%al
10f5: 74 e9 je 10e0 <strcmp+0x20>
p++, q++;
return (uchar)*p - (uchar)*q;
10f7: 29 d8 sub %ebx,%eax
}
10f9: 5b pop %ebx
10fa: 5e pop %esi
10fb: 5d pop %ebp
10fc: c3 ret
10fd: 8d 76 00 lea 0x0(%esi),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
1100: 31 c0 xor %eax,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
1102: 29 d8 sub %ebx,%eax
}
1104: 5b pop %ebx
1105: 5e pop %esi
1106: 5d pop %ebp
1107: c3 ret
1108: 90 nop
1109: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00001110 <strlen>:
uint
strlen(char *s)
{
1110: 55 push %ebp
1111: 89 e5 mov %esp,%ebp
1113: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
1116: 80 39 00 cmpb $0x0,(%ecx)
1119: 74 12 je 112d <strlen+0x1d>
111b: 31 d2 xor %edx,%edx
111d: 8d 76 00 lea 0x0(%esi),%esi
1120: 83 c2 01 add $0x1,%edx
1123: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
1127: 89 d0 mov %edx,%eax
1129: 75 f5 jne 1120 <strlen+0x10>
;
return n;
}
112b: 5d pop %ebp
112c: c3 ret
uint
strlen(char *s)
{
int n;
for(n = 0; s[n]; n++)
112d: 31 c0 xor %eax,%eax
;
return n;
}
112f: 5d pop %ebp
1130: c3 ret
1131: eb 0d jmp 1140 <memset>
1133: 90 nop
1134: 90 nop
1135: 90 nop
1136: 90 nop
1137: 90 nop
1138: 90 nop
1139: 90 nop
113a: 90 nop
113b: 90 nop
113c: 90 nop
113d: 90 nop
113e: 90 nop
113f: 90 nop
00001140 <memset>:
void*
memset(void *dst, int c, uint n)
{
1140: 55 push %ebp
1141: 89 e5 mov %esp,%ebp
1143: 57 push %edi
1144: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1147: 8b 4d 10 mov 0x10(%ebp),%ecx
114a: 8b 45 0c mov 0xc(%ebp),%eax
114d: 89 d7 mov %edx,%edi
114f: fc cld
1150: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1152: 89 d0 mov %edx,%eax
1154: 5f pop %edi
1155: 5d pop %ebp
1156: c3 ret
1157: 89 f6 mov %esi,%esi
1159: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00001160 <strchr>:
char*
strchr(const char *s, char c)
{
1160: 55 push %ebp
1161: 89 e5 mov %esp,%ebp
1163: 53 push %ebx
1164: 8b 45 08 mov 0x8(%ebp),%eax
1167: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
116a: 0f b6 10 movzbl (%eax),%edx
116d: 84 d2 test %dl,%dl
116f: 74 1d je 118e <strchr+0x2e>
if(*s == c)
1171: 38 d3 cmp %dl,%bl
1173: 89 d9 mov %ebx,%ecx
1175: 75 0d jne 1184 <strchr+0x24>
1177: eb 17 jmp 1190 <strchr+0x30>
1179: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1180: 38 ca cmp %cl,%dl
1182: 74 0c je 1190 <strchr+0x30>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
1184: 83 c0 01 add $0x1,%eax
1187: 0f b6 10 movzbl (%eax),%edx
118a: 84 d2 test %dl,%dl
118c: 75 f2 jne 1180 <strchr+0x20>
if(*s == c)
return (char*)s;
return 0;
118e: 31 c0 xor %eax,%eax
}
1190: 5b pop %ebx
1191: 5d pop %ebp
1192: c3 ret
1193: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1199: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000011a0 <gets>:
char*
gets(char *buf, int max)
{
11a0: 55 push %ebp
11a1: 89 e5 mov %esp,%ebp
11a3: 57 push %edi
11a4: 56 push %esi
11a5: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
11a6: 31 f6 xor %esi,%esi
cc = read(0, &c, 1);
11a8: 8d 7d e7 lea -0x19(%ebp),%edi
return 0;
}
char*
gets(char *buf, int max)
{
11ab: 83 ec 1c sub $0x1c,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
11ae: eb 29 jmp 11d9 <gets+0x39>
cc = read(0, &c, 1);
11b0: 83 ec 04 sub $0x4,%esp
11b3: 6a 01 push $0x1
11b5: 57 push %edi
11b6: 6a 00 push $0x0
11b8: e8 2d 01 00 00 call 12ea <read>
if(cc < 1)
11bd: 83 c4 10 add $0x10,%esp
11c0: 85 c0 test %eax,%eax
11c2: 7e 1d jle 11e1 <gets+0x41>
break;
buf[i++] = c;
11c4: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
11c8: 8b 55 08 mov 0x8(%ebp),%edx
11cb: 89 de mov %ebx,%esi
if(c == '\n' || c == '\r')
11cd: 3c 0a cmp $0xa,%al
for(i=0; i+1 < max; ){
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
11cf: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
11d3: 74 1b je 11f0 <gets+0x50>
11d5: 3c 0d cmp $0xd,%al
11d7: 74 17 je 11f0 <gets+0x50>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
11d9: 8d 5e 01 lea 0x1(%esi),%ebx
11dc: 3b 5d 0c cmp 0xc(%ebp),%ebx
11df: 7c cf jl 11b0 <gets+0x10>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
11e1: 8b 45 08 mov 0x8(%ebp),%eax
11e4: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
11e8: 8d 65 f4 lea -0xc(%ebp),%esp
11eb: 5b pop %ebx
11ec: 5e pop %esi
11ed: 5f pop %edi
11ee: 5d pop %ebp
11ef: c3 ret
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
11f0: 8b 45 08 mov 0x8(%ebp),%eax
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
11f3: 89 de mov %ebx,%esi
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
11f5: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
11f9: 8d 65 f4 lea -0xc(%ebp),%esp
11fc: 5b pop %ebx
11fd: 5e pop %esi
11fe: 5f pop %edi
11ff: 5d pop %ebp
1200: c3 ret
1201: eb 0d jmp 1210 <stat>
1203: 90 nop
1204: 90 nop
1205: 90 nop
1206: 90 nop
1207: 90 nop
1208: 90 nop
1209: 90 nop
120a: 90 nop
120b: 90 nop
120c: 90 nop
120d: 90 nop
120e: 90 nop
120f: 90 nop
00001210 <stat>:
int
stat(char *n, struct stat *st)
{
1210: 55 push %ebp
1211: 89 e5 mov %esp,%ebp
1213: 56 push %esi
1214: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
1215: 83 ec 08 sub $0x8,%esp
1218: 6a 00 push $0x0
121a: ff 75 08 pushl 0x8(%ebp)
121d: e8 f0 00 00 00 call 1312 <open>
if(fd < 0)
1222: 83 c4 10 add $0x10,%esp
1225: 85 c0 test %eax,%eax
1227: 78 27 js 1250 <stat+0x40>
return -1;
r = fstat(fd, st);
1229: 83 ec 08 sub $0x8,%esp
122c: ff 75 0c pushl 0xc(%ebp)
122f: 89 c3 mov %eax,%ebx
1231: 50 push %eax
1232: e8 f3 00 00 00 call 132a <fstat>
1237: 89 c6 mov %eax,%esi
close(fd);
1239: 89 1c 24 mov %ebx,(%esp)
123c: e8 b9 00 00 00 call 12fa <close>
return r;
1241: 83 c4 10 add $0x10,%esp
1244: 89 f0 mov %esi,%eax
}
1246: 8d 65 f8 lea -0x8(%ebp),%esp
1249: 5b pop %ebx
124a: 5e pop %esi
124b: 5d pop %ebp
124c: c3 ret
124d: 8d 76 00 lea 0x0(%esi),%esi
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
1250: b8 ff ff ff ff mov $0xffffffff,%eax
1255: eb ef jmp 1246 <stat+0x36>
1257: 89 f6 mov %esi,%esi
1259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00001260 <atoi>:
return r;
}
int
atoi(const char *s)
{
1260: 55 push %ebp
1261: 89 e5 mov %esp,%ebp
1263: 53 push %ebx
1264: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
1267: 0f be 11 movsbl (%ecx),%edx
126a: 8d 42 d0 lea -0x30(%edx),%eax
126d: 3c 09 cmp $0x9,%al
126f: b8 00 00 00 00 mov $0x0,%eax
1274: 77 1f ja 1295 <atoi+0x35>
1276: 8d 76 00 lea 0x0(%esi),%esi
1279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
1280: 8d 04 80 lea (%eax,%eax,4),%eax
1283: 83 c1 01 add $0x1,%ecx
1286: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
128a: 0f be 11 movsbl (%ecx),%edx
128d: 8d 5a d0 lea -0x30(%edx),%ebx
1290: 80 fb 09 cmp $0x9,%bl
1293: 76 eb jbe 1280 <atoi+0x20>
n = n*10 + *s++ - '0';
return n;
}
1295: 5b pop %ebx
1296: 5d pop %ebp
1297: c3 ret
1298: 90 nop
1299: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000012a0 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
12a0: 55 push %ebp
12a1: 89 e5 mov %esp,%ebp
12a3: 56 push %esi
12a4: 53 push %ebx
12a5: 8b 5d 10 mov 0x10(%ebp),%ebx
12a8: 8b 45 08 mov 0x8(%ebp),%eax
12ab: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
12ae: 85 db test %ebx,%ebx
12b0: 7e 14 jle 12c6 <memmove+0x26>
12b2: 31 d2 xor %edx,%edx
12b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
12b8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
12bc: 88 0c 10 mov %cl,(%eax,%edx,1)
12bf: 83 c2 01 add $0x1,%edx
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
12c2: 39 da cmp %ebx,%edx
12c4: 75 f2 jne 12b8 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
12c6: 5b pop %ebx
12c7: 5e pop %esi
12c8: 5d pop %ebp
12c9: c3 ret
000012ca <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
12ca: b8 01 00 00 00 mov $0x1,%eax
12cf: cd 40 int $0x40
12d1: c3 ret
000012d2 <exit>:
SYSCALL(exit)
12d2: b8 02 00 00 00 mov $0x2,%eax
12d7: cd 40 int $0x40
12d9: c3 ret
000012da <wait>:
SYSCALL(wait)
12da: b8 03 00 00 00 mov $0x3,%eax
12df: cd 40 int $0x40
12e1: c3 ret
000012e2 <pipe>:
SYSCALL(pipe)
12e2: b8 04 00 00 00 mov $0x4,%eax
12e7: cd 40 int $0x40
12e9: c3 ret
000012ea <read>:
SYSCALL(read)
12ea: b8 05 00 00 00 mov $0x5,%eax
12ef: cd 40 int $0x40
12f1: c3 ret
000012f2 <write>:
SYSCALL(write)
12f2: b8 10 00 00 00 mov $0x10,%eax
12f7: cd 40 int $0x40
12f9: c3 ret
000012fa <close>:
SYSCALL(close)
12fa: b8 15 00 00 00 mov $0x15,%eax
12ff: cd 40 int $0x40
1301: c3 ret
00001302 <kill>:
SYSCALL(kill)
1302: b8 06 00 00 00 mov $0x6,%eax
1307: cd 40 int $0x40
1309: c3 ret
0000130a <exec>:
SYSCALL(exec)
130a: b8 07 00 00 00 mov $0x7,%eax
130f: cd 40 int $0x40
1311: c3 ret
00001312 <open>:
SYSCALL(open)
1312: b8 0f 00 00 00 mov $0xf,%eax
1317: cd 40 int $0x40
1319: c3 ret
0000131a <mknod>:
SYSCALL(mknod)
131a: b8 11 00 00 00 mov $0x11,%eax
131f: cd 40 int $0x40
1321: c3 ret
00001322 <unlink>:
SYSCALL(unlink)
1322: b8 12 00 00 00 mov $0x12,%eax
1327: cd 40 int $0x40
1329: c3 ret
0000132a <fstat>:
SYSCALL(fstat)
132a: b8 08 00 00 00 mov $0x8,%eax
132f: cd 40 int $0x40
1331: c3 ret
00001332 <link>:
SYSCALL(link)
1332: b8 13 00 00 00 mov $0x13,%eax
1337: cd 40 int $0x40
1339: c3 ret
0000133a <mkdir>:
SYSCALL(mkdir)
133a: b8 14 00 00 00 mov $0x14,%eax
133f: cd 40 int $0x40
1341: c3 ret
00001342 <chdir>:
SYSCALL(chdir)
1342: b8 09 00 00 00 mov $0x9,%eax
1347: cd 40 int $0x40
1349: c3 ret
0000134a <dup>:
SYSCALL(dup)
134a: b8 0a 00 00 00 mov $0xa,%eax
134f: cd 40 int $0x40
1351: c3 ret
00001352 <getpid>:
SYSCALL(getpid)
1352: b8 0b 00 00 00 mov $0xb,%eax
1357: cd 40 int $0x40
1359: c3 ret
0000135a <sbrk>:
SYSCALL(sbrk)
135a: b8 0c 00 00 00 mov $0xc,%eax
135f: cd 40 int $0x40
1361: c3 ret
00001362 <sleep>:
SYSCALL(sleep)
1362: b8 0d 00 00 00 mov $0xd,%eax
1367: cd 40 int $0x40
1369: c3 ret
0000136a <uptime>:
SYSCALL(uptime)
136a: b8 0e 00 00 00 mov $0xe,%eax
136f: cd 40 int $0x40
1371: c3 ret
00001372 <shm_open>:
SYSCALL(shm_open)
1372: b8 16 00 00 00 mov $0x16,%eax
1377: cd 40 int $0x40
1379: c3 ret
0000137a <shm_close>:
SYSCALL(shm_close)
137a: b8 17 00 00 00 mov $0x17,%eax
137f: cd 40 int $0x40
1381: c3 ret
1382: 66 90 xchg %ax,%ax
1384: 66 90 xchg %ax,%ax
1386: 66 90 xchg %ax,%ax
1388: 66 90 xchg %ax,%ax
138a: 66 90 xchg %ax,%ax
138c: 66 90 xchg %ax,%ax
138e: 66 90 xchg %ax,%ax
00001390 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
1390: 55 push %ebp
1391: 89 e5 mov %esp,%ebp
1393: 57 push %edi
1394: 56 push %esi
1395: 53 push %ebx
1396: 89 c6 mov %eax,%esi
1398: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
139b: 8b 5d 08 mov 0x8(%ebp),%ebx
139e: 85 db test %ebx,%ebx
13a0: 74 7e je 1420 <printint+0x90>
13a2: 89 d0 mov %edx,%eax
13a4: c1 e8 1f shr $0x1f,%eax
13a7: 84 c0 test %al,%al
13a9: 74 75 je 1420 <printint+0x90>
neg = 1;
x = -xx;
13ab: 89 d0 mov %edx,%eax
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
13ad: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
x = -xx;
13b4: f7 d8 neg %eax
13b6: 89 75 c0 mov %esi,-0x40(%ebp)
} else {
x = xx;
}
i = 0;
13b9: 31 ff xor %edi,%edi
13bb: 8d 5d d7 lea -0x29(%ebp),%ebx
13be: 89 ce mov %ecx,%esi
13c0: eb 08 jmp 13ca <printint+0x3a>
13c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
13c8: 89 cf mov %ecx,%edi
13ca: 31 d2 xor %edx,%edx
13cc: 8d 4f 01 lea 0x1(%edi),%ecx
13cf: f7 f6 div %esi
13d1: 0f b6 92 98 17 00 00 movzbl 0x1798(%edx),%edx
}while((x /= base) != 0);
13d8: 85 c0 test %eax,%eax
x = xx;
}
i = 0;
do{
buf[i++] = digits[x % base];
13da: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
13dd: 75 e9 jne 13c8 <printint+0x38>
if(neg)
13df: 8b 45 c4 mov -0x3c(%ebp),%eax
13e2: 8b 75 c0 mov -0x40(%ebp),%esi
13e5: 85 c0 test %eax,%eax
13e7: 74 08 je 13f1 <printint+0x61>
buf[i++] = '-';
13e9: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
13ee: 8d 4f 02 lea 0x2(%edi),%ecx
13f1: 8d 7c 0d d7 lea -0x29(%ebp,%ecx,1),%edi
13f5: 8d 76 00 lea 0x0(%esi),%esi
13f8: 0f b6 07 movzbl (%edi),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
13fb: 83 ec 04 sub $0x4,%esp
13fe: 83 ef 01 sub $0x1,%edi
1401: 6a 01 push $0x1
1403: 53 push %ebx
1404: 56 push %esi
1405: 88 45 d7 mov %al,-0x29(%ebp)
1408: e8 e5 fe ff ff call 12f2 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
140d: 83 c4 10 add $0x10,%esp
1410: 39 df cmp %ebx,%edi
1412: 75 e4 jne 13f8 <printint+0x68>
putc(fd, buf[i]);
}
1414: 8d 65 f4 lea -0xc(%ebp),%esp
1417: 5b pop %ebx
1418: 5e pop %esi
1419: 5f pop %edi
141a: 5d pop %ebp
141b: c3 ret
141c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
} else {
x = xx;
1420: 89 d0 mov %edx,%eax
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
1422: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
1429: eb 8b jmp 13b6 <printint+0x26>
142b: 90 nop
142c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00001430 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
1430: 55 push %ebp
1431: 89 e5 mov %esp,%ebp
1433: 57 push %edi
1434: 56 push %esi
1435: 53 push %ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
1436: 8d 45 10 lea 0x10(%ebp),%eax
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
1439: 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++){
143c: 8b 75 0c mov 0xc(%ebp),%esi
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
143f: 8b 7d 08 mov 0x8(%ebp),%edi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
1442: 89 45 d0 mov %eax,-0x30(%ebp)
1445: 0f b6 1e movzbl (%esi),%ebx
1448: 83 c6 01 add $0x1,%esi
144b: 84 db test %bl,%bl
144d: 0f 84 b0 00 00 00 je 1503 <printf+0xd3>
1453: 31 d2 xor %edx,%edx
1455: eb 39 jmp 1490 <printf+0x60>
1457: 89 f6 mov %esi,%esi
1459: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
1460: 83 f8 25 cmp $0x25,%eax
1463: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
1466: ba 25 00 00 00 mov $0x25,%edx
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
146b: 74 18 je 1485 <printf+0x55>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
146d: 8d 45 e2 lea -0x1e(%ebp),%eax
1470: 83 ec 04 sub $0x4,%esp
1473: 88 5d e2 mov %bl,-0x1e(%ebp)
1476: 6a 01 push $0x1
1478: 50 push %eax
1479: 57 push %edi
147a: e8 73 fe ff ff call 12f2 <write>
147f: 8b 55 d4 mov -0x2c(%ebp),%edx
1482: 83 c4 10 add $0x10,%esp
1485: 83 c6 01 add $0x1,%esi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
1488: 0f b6 5e ff movzbl -0x1(%esi),%ebx
148c: 84 db test %bl,%bl
148e: 74 73 je 1503 <printf+0xd3>
c = fmt[i] & 0xff;
if(state == 0){
1490: 85 d2 test %edx,%edx
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
1492: 0f be cb movsbl %bl,%ecx
1495: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
1498: 74 c6 je 1460 <printf+0x30>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
149a: 83 fa 25 cmp $0x25,%edx
149d: 75 e6 jne 1485 <printf+0x55>
if(c == 'd'){
149f: 83 f8 64 cmp $0x64,%eax
14a2: 0f 84 f8 00 00 00 je 15a0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
14a8: 81 e1 f7 00 00 00 and $0xf7,%ecx
14ae: 83 f9 70 cmp $0x70,%ecx
14b1: 74 5d je 1510 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
14b3: 83 f8 73 cmp $0x73,%eax
14b6: 0f 84 84 00 00 00 je 1540 <printf+0x110>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
14bc: 83 f8 63 cmp $0x63,%eax
14bf: 0f 84 ea 00 00 00 je 15af <printf+0x17f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
14c5: 83 f8 25 cmp $0x25,%eax
14c8: 0f 84 c2 00 00 00 je 1590 <printf+0x160>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
14ce: 8d 45 e7 lea -0x19(%ebp),%eax
14d1: 83 ec 04 sub $0x4,%esp
14d4: c6 45 e7 25 movb $0x25,-0x19(%ebp)
14d8: 6a 01 push $0x1
14da: 50 push %eax
14db: 57 push %edi
14dc: e8 11 fe ff ff call 12f2 <write>
14e1: 83 c4 0c add $0xc,%esp
14e4: 8d 45 e6 lea -0x1a(%ebp),%eax
14e7: 88 5d e6 mov %bl,-0x1a(%ebp)
14ea: 6a 01 push $0x1
14ec: 50 push %eax
14ed: 57 push %edi
14ee: 83 c6 01 add $0x1,%esi
14f1: e8 fc fd ff ff call 12f2 <write>
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
14f6: 0f b6 5e ff movzbl -0x1(%esi),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
14fa: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
14fd: 31 d2 xor %edx,%edx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
14ff: 84 db test %bl,%bl
1501: 75 8d jne 1490 <printf+0x60>
putc(fd, c);
}
state = 0;
}
}
}
1503: 8d 65 f4 lea -0xc(%ebp),%esp
1506: 5b pop %ebx
1507: 5e pop %esi
1508: 5f pop %edi
1509: 5d pop %ebp
150a: c3 ret
150b: 90 nop
150c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
1510: 83 ec 0c sub $0xc,%esp
1513: b9 10 00 00 00 mov $0x10,%ecx
1518: 6a 00 push $0x0
151a: 8b 5d d0 mov -0x30(%ebp),%ebx
151d: 89 f8 mov %edi,%eax
151f: 8b 13 mov (%ebx),%edx
1521: e8 6a fe ff ff call 1390 <printint>
ap++;
1526: 89 d8 mov %ebx,%eax
1528: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
152b: 31 d2 xor %edx,%edx
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
152d: 83 c0 04 add $0x4,%eax
1530: 89 45 d0 mov %eax,-0x30(%ebp)
1533: e9 4d ff ff ff jmp 1485 <printf+0x55>
1538: 90 nop
1539: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
} else if(c == 's'){
s = (char*)*ap;
1540: 8b 45 d0 mov -0x30(%ebp),%eax
1543: 8b 18 mov (%eax),%ebx
ap++;
1545: 83 c0 04 add $0x4,%eax
1548: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
s = "(null)";
154b: b8 90 17 00 00 mov $0x1790,%eax
1550: 85 db test %ebx,%ebx
1552: 0f 44 d8 cmove %eax,%ebx
while(*s != 0){
1555: 0f b6 03 movzbl (%ebx),%eax
1558: 84 c0 test %al,%al
155a: 74 23 je 157f <printf+0x14f>
155c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1560: 88 45 e3 mov %al,-0x1d(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
1563: 8d 45 e3 lea -0x1d(%ebp),%eax
1566: 83 ec 04 sub $0x4,%esp
1569: 6a 01 push $0x1
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
156b: 83 c3 01 add $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
156e: 50 push %eax
156f: 57 push %edi
1570: e8 7d fd ff ff call 12f2 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
1575: 0f b6 03 movzbl (%ebx),%eax
1578: 83 c4 10 add $0x10,%esp
157b: 84 c0 test %al,%al
157d: 75 e1 jne 1560 <printf+0x130>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
157f: 31 d2 xor %edx,%edx
1581: e9 ff fe ff ff jmp 1485 <printf+0x55>
1586: 8d 76 00 lea 0x0(%esi),%esi
1589: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
1590: 83 ec 04 sub $0x4,%esp
1593: 88 5d e5 mov %bl,-0x1b(%ebp)
1596: 8d 45 e5 lea -0x1b(%ebp),%eax
1599: 6a 01 push $0x1
159b: e9 4c ff ff ff jmp 14ec <printf+0xbc>
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
15a0: 83 ec 0c sub $0xc,%esp
15a3: b9 0a 00 00 00 mov $0xa,%ecx
15a8: 6a 01 push $0x1
15aa: e9 6b ff ff ff jmp 151a <printf+0xea>
15af: 8b 5d d0 mov -0x30(%ebp),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
15b2: 83 ec 04 sub $0x4,%esp
15b5: 8b 03 mov (%ebx),%eax
15b7: 6a 01 push $0x1
15b9: 88 45 e4 mov %al,-0x1c(%ebp)
15bc: 8d 45 e4 lea -0x1c(%ebp),%eax
15bf: 50 push %eax
15c0: 57 push %edi
15c1: e8 2c fd ff ff call 12f2 <write>
15c6: e9 5b ff ff ff jmp 1526 <printf+0xf6>
15cb: 66 90 xchg %ax,%ax
15cd: 66 90 xchg %ax,%ax
15cf: 90 nop
000015d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
15d0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
15d1: a1 94 1a 00 00 mov 0x1a94,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
15d6: 89 e5 mov %esp,%ebp
15d8: 57 push %edi
15d9: 56 push %esi
15da: 53 push %ebx
15db: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
15de: 8b 10 mov (%eax),%edx
void
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
15e0: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
15e3: 39 c8 cmp %ecx,%eax
15e5: 73 19 jae 1600 <free+0x30>
15e7: 89 f6 mov %esi,%esi
15e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
15f0: 39 d1 cmp %edx,%ecx
15f2: 72 1c jb 1610 <free+0x40>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
15f4: 39 d0 cmp %edx,%eax
15f6: 73 18 jae 1610 <free+0x40>
static Header base;
static Header *freep;
void
free(void *ap)
{
15f8: 89 d0 mov %edx,%eax
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
15fa: 39 c8 cmp %ecx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
15fc: 8b 10 mov (%eax),%edx
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
15fe: 72 f0 jb 15f0 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1600: 39 d0 cmp %edx,%eax
1602: 72 f4 jb 15f8 <free+0x28>
1604: 39 d1 cmp %edx,%ecx
1606: 73 f0 jae 15f8 <free+0x28>
1608: 90 nop
1609: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(bp + bp->s.size == p->s.ptr){
1610: 8b 73 fc mov -0x4(%ebx),%esi
1613: 8d 3c f1 lea (%ecx,%esi,8),%edi
1616: 39 d7 cmp %edx,%edi
1618: 74 19 je 1633 <free+0x63>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
161a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
161d: 8b 50 04 mov 0x4(%eax),%edx
1620: 8d 34 d0 lea (%eax,%edx,8),%esi
1623: 39 f1 cmp %esi,%ecx
1625: 74 23 je 164a <free+0x7a>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
1627: 89 08 mov %ecx,(%eax)
freep = p;
1629: a3 94 1a 00 00 mov %eax,0x1a94
}
162e: 5b pop %ebx
162f: 5e pop %esi
1630: 5f pop %edi
1631: 5d pop %ebp
1632: c3 ret
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
1633: 03 72 04 add 0x4(%edx),%esi
1636: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
1639: 8b 10 mov (%eax),%edx
163b: 8b 12 mov (%edx),%edx
163d: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
1640: 8b 50 04 mov 0x4(%eax),%edx
1643: 8d 34 d0 lea (%eax,%edx,8),%esi
1646: 39 f1 cmp %esi,%ecx
1648: 75 dd jne 1627 <free+0x57>
p->s.size += bp->s.size;
164a: 03 53 fc add -0x4(%ebx),%edx
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
freep = p;
164d: a3 94 1a 00 00 mov %eax,0x1a94
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
1652: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
1655: 8b 53 f8 mov -0x8(%ebx),%edx
1658: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
}
165a: 5b pop %ebx
165b: 5e pop %esi
165c: 5f pop %edi
165d: 5d pop %ebp
165e: c3 ret
165f: 90 nop
00001660 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
1660: 55 push %ebp
1661: 89 e5 mov %esp,%ebp
1663: 57 push %edi
1664: 56 push %esi
1665: 53 push %ebx
1666: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
1669: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
166c: 8b 15 94 1a 00 00 mov 0x1a94,%edx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
1672: 8d 78 07 lea 0x7(%eax),%edi
1675: c1 ef 03 shr $0x3,%edi
1678: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
167b: 85 d2 test %edx,%edx
167d: 0f 84 a3 00 00 00 je 1726 <malloc+0xc6>
1683: 8b 02 mov (%edx),%eax
1685: 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){
1688: 39 cf cmp %ecx,%edi
168a: 76 74 jbe 1700 <malloc+0xa0>
168c: 81 ff 00 10 00 00 cmp $0x1000,%edi
1692: be 00 10 00 00 mov $0x1000,%esi
1697: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx
169e: 0f 43 f7 cmovae %edi,%esi
16a1: ba 00 80 00 00 mov $0x8000,%edx
16a6: 81 ff ff 0f 00 00 cmp $0xfff,%edi
16ac: 0f 46 da cmovbe %edx,%ebx
16af: eb 10 jmp 16c1 <malloc+0x61>
16b1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
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){
16b8: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
16ba: 8b 48 04 mov 0x4(%eax),%ecx
16bd: 39 cf cmp %ecx,%edi
16bf: 76 3f jbe 1700 <malloc+0xa0>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
16c1: 39 05 94 1a 00 00 cmp %eax,0x1a94
16c7: 89 c2 mov %eax,%edx
16c9: 75 ed jne 16b8 <malloc+0x58>
char *p;
Header *hp;
if(nu < 4096)
nu = 4096;
p = sbrk(nu * sizeof(Header));
16cb: 83 ec 0c sub $0xc,%esp
16ce: 53 push %ebx
16cf: e8 86 fc ff ff call 135a <sbrk>
if(p == (char*)-1)
16d4: 83 c4 10 add $0x10,%esp
16d7: 83 f8 ff cmp $0xffffffff,%eax
16da: 74 1c je 16f8 <malloc+0x98>
return 0;
hp = (Header*)p;
hp->s.size = nu;
16dc: 89 70 04 mov %esi,0x4(%eax)
free((void*)(hp + 1));
16df: 83 ec 0c sub $0xc,%esp
16e2: 83 c0 08 add $0x8,%eax
16e5: 50 push %eax
16e6: e8 e5 fe ff ff call 15d0 <free>
return freep;
16eb: 8b 15 94 1a 00 00 mov 0x1a94,%edx
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
16f1: 83 c4 10 add $0x10,%esp
16f4: 85 d2 test %edx,%edx
16f6: 75 c0 jne 16b8 <malloc+0x58>
return 0;
16f8: 31 c0 xor %eax,%eax
16fa: eb 1c jmp 1718 <malloc+0xb8>
16fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
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){
if(p->s.size == nunits)
1700: 39 cf cmp %ecx,%edi
1702: 74 1c je 1720 <malloc+0xc0>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
1704: 29 f9 sub %edi,%ecx
1706: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
1709: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
170c: 89 78 04 mov %edi,0x4(%eax)
}
freep = prevp;
170f: 89 15 94 1a 00 00 mov %edx,0x1a94
return (void*)(p + 1);
1715: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
1718: 8d 65 f4 lea -0xc(%ebp),%esp
171b: 5b pop %ebx
171c: 5e pop %esi
171d: 5f pop %edi
171e: 5d pop %ebp
171f: c3 ret
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
1720: 8b 08 mov (%eax),%ecx
1722: 89 0a mov %ecx,(%edx)
1724: eb e9 jmp 170f <malloc+0xaf>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
1726: c7 05 94 1a 00 00 98 movl $0x1a98,0x1a94
172d: 1a 00 00
1730: c7 05 98 1a 00 00 98 movl $0x1a98,0x1a98
1737: 1a 00 00
base.s.size = 0;
173a: b8 98 1a 00 00 mov $0x1a98,%eax
173f: c7 05 9c 1a 00 00 00 movl $0x0,0x1a9c
1746: 00 00 00
1749: e9 3e ff ff ff jmp 168c <malloc+0x2c>
174e: 66 90 xchg %ax,%ax
00001750 <uacquire>:
#include "uspinlock.h"
#include "x86.h"
void
uacquire(struct uspinlock *lk)
{
1750: 55 push %ebp
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
1751: b9 01 00 00 00 mov $0x1,%ecx
1756: 89 e5 mov %esp,%ebp
1758: 8b 55 08 mov 0x8(%ebp),%edx
175b: 90 nop
175c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1760: 89 c8 mov %ecx,%eax
1762: f0 87 02 lock xchg %eax,(%edx)
// The xchg is atomic.
while(xchg(&lk->locked, 1) != 0)
1765: 85 c0 test %eax,%eax
1767: 75 f7 jne 1760 <uacquire+0x10>
;
// Tell the C compiler and the processor to not move loads or stores
// past this point, to ensure that the critical section's memory
// references happen after the lock is acquired.
__sync_synchronize();
1769: f0 83 0c 24 00 lock orl $0x0,(%esp)
}
176e: 5d pop %ebp
176f: c3 ret
00001770 <urelease>:
void urelease (struct uspinlock *lk) {
1770: 55 push %ebp
1771: 89 e5 mov %esp,%ebp
1773: 8b 45 08 mov 0x8(%ebp),%eax
__sync_synchronize();
1776: f0 83 0c 24 00 lock orl $0x0,(%esp)
// Release the lock, equivalent to lk->locked = 0.
// This code can't use a C assignment, since it might
// not be atomic. A real OS would use C atomics here.
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
177b: c7 00 00 00 00 00 movl $0x0,(%eax)
}
1781: 5d pop %ebp
1782: c3 ret
|
alloy4fun_models/trainstlt/models/16/RKoxwQt6QDTZruMj8.als | Kaixi26/org.alloytools.alloy | 0 | 4097 | <gh_stars>0
open main
pred idRKoxwQt6QDTZruMj8_prop17 {
some pos => one Train.pos:>Exit since one pos
}
pred __repair { idRKoxwQt6QDTZruMj8_prop17 }
check __repair { idRKoxwQt6QDTZruMj8_prop17 <=> prop17o } |
sharding-parser/sharding-parser-sqlserver/src/main/antlr4/imports/sqlserver/DataType.g4 | sopeLi/incubator-shardingsphere | 2 | 2302 | lexer grammar DataType;
import Symbol, Alphabet;
STRING_: DQ_ ('\\"' | .)*? DQ_ | SQ_ (SQ_ | .)*? SQ_;
NUMBER_: MINUS_? INT_? DOT_? INT_ (E [+\-]? INT_)?;
HEX_DIGIT_: '0x' HEX_+ | 'X' SQ_ HEX_+ SQ_;
BIT_NUM_: '0b' ('0' | '1')+ | B SQ_ ('0' | '1')+ SQ_;
fragment INT_: [0-9]+;
fragment HEX_: [0-9a-fA-F];
|
example/in.asm | oj-mik/eatersim | 0 | 24740 | <reponame>oj-mik/eatersim
; multiplication program
start:
lda product
add factor1
sta product
lda factor2
sub dec
sta factor2
jz exit
jmp start
exit:
lda product
out
hlt
.org 12
dec:
.byte 1 ; decrementer (must be 1)
product:
.byte 0 ; result
factor1:
.byte 2 ; first number to multiply
factor2:
.byte 4 ; second number to multiply |
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_835.asm | ljhsiun2/medusa | 9 | 170807 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %r9
push %rax
push %rbp
lea addresses_A_ht+0x83c1, %r8
nop
and %rbp, %rbp
mov (%r8), %r9d
nop
nop
add %r14, %r14
lea addresses_WT_ht+0xb161, %rax
xor %r10, %r10
mov (%rax), %r8
nop
cmp $41849, %r10
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %rbx
push %rdi
push %rsi
// Store
lea addresses_D+0x19e61, %rsi
nop
nop
nop
add $5053, %r12
mov $0x5152535455565758, %r13
movq %r13, %xmm7
movups %xmm7, (%rsi)
nop
nop
dec %rbx
// Store
lea addresses_normal+0x9b16, %r12
clflush (%r12)
nop
dec %rdi
mov $0x5152535455565758, %r13
movq %r13, (%r12)
nop
nop
nop
sub %r14, %r14
// Faulty Load
lea addresses_RW+0x17a61, %rbx
nop
nop
nop
xor %rsi, %rsi
mov (%rbx), %r13d
lea oracles, %rsi
and $0xff, %r13
shlq $12, %r13
mov (%rsi,%r13,1), %r13
pop %rsi
pop %rdi
pop %rbx
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_normal', 'size': 8, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_A_ht', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
Cubical/Data/Queue/Untruncated2List.agda | dan-iel-lee/cubical | 0 | 11391 | <filename>Cubical/Data/Queue/Untruncated2List.agda
{-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-}
module Cubical.Data.Queue.Untruncated2List where
open import Cubical.Foundations.Everything
open import Cubical.Foundations.SIP
open import Cubical.Structures.Queue
open import Cubical.Data.Maybe
open import Cubical.Data.List
open import Cubical.Data.Sigma
open import Cubical.HITs.PropositionalTruncation
open import Cubical.Data.Queue.1List
module Untruncated2List {ℓ} (A : Type ℓ) (Aset : isSet A) where
open Queues-on A Aset
-- Untruncated 2Lists
data Q : Type ℓ where
Q⟨_,_⟩ : (xs ys : List A) → Q
tilt : ∀ xs ys z → Q⟨ xs ++ [ z ] , ys ⟩ ≡ Q⟨ xs , ys ++ [ z ] ⟩
-- enq into the first list, deq from the second if possible
flushEq' : (xs ys : List A) → Q⟨ xs ++ ys , [] ⟩ ≡ Q⟨ xs , rev ys ⟩
flushEq' xs [] = cong Q⟨_, [] ⟩ (++-unit-r xs)
flushEq' xs (z ∷ ys) j =
hcomp
(λ i → λ
{ (j = i0) → Q⟨ ++-assoc xs [ z ] ys i , [] ⟩
; (j = i1) → tilt xs (rev ys) z i
})
(flushEq' (xs ++ [ z ]) ys j)
flushEq : (xs ys : List A) → Q⟨ xs ++ rev ys , [] ⟩ ≡ Q⟨ xs , ys ⟩
flushEq xs ys = flushEq' xs (rev ys) ∙ cong Q⟨ xs ,_⟩ (rev-rev ys)
emp : Q
emp = Q⟨ [] , [] ⟩
enq : A → Q → Q
enq a Q⟨ xs , ys ⟩ = Q⟨ a ∷ xs , ys ⟩
enq a (tilt xs ys z i) = tilt (a ∷ xs) ys z i
deqFlush : List A → Maybe (Q × A)
deqFlush [] = nothing
deqFlush (x ∷ xs) = just (Q⟨ [] , xs ⟩ , x)
deq : Q → Maybe (Q × A)
deq Q⟨ xs , [] ⟩ = deqFlush (rev xs)
deq Q⟨ xs , y ∷ ys ⟩ = just (Q⟨ xs , ys ⟩ , y)
deq (tilt xs [] z i) = path i
where
path : deqFlush (rev (xs ++ [ z ])) ≡ just (Q⟨ xs , [] ⟩ , z)
path =
cong deqFlush (rev-snoc xs z)
∙ cong (λ q → just (q , z)) (sym (flushEq' [] xs))
deq (tilt xs (y ∷ ys) z i) = just (tilt xs ys z i , y)
Raw : RawQueue
Raw = (Q , emp , enq , deq)
-- We construct an equivalence Q₁≃Q and prove that this is an equivalence of queue structures
private
module One = 1List A Aset
open One renaming (Q to Q₁; emp to emp₁; enq to enq₁; deq to deq₁) using ()
quot : Q₁ → Q
quot xs = Q⟨ xs , [] ⟩
eval : Q → Q₁
eval Q⟨ xs , ys ⟩ = xs ++ rev ys
eval (tilt xs ys z i) =
hcomp
(λ j → λ
{ (i = i0) → (xs ++ [ z ]) ++ rev ys
; (i = i1) → xs ++ rev-snoc ys z (~ j)
})
(++-assoc xs [ z ] (rev ys) i)
quot∘eval : ∀ q → quot (eval q) ≡ q
quot∘eval Q⟨ xs , ys ⟩ = flushEq xs ys
quot∘eval (tilt xs ys z i) j =
hcomp
(λ k → λ
{ (i = i0) →
compPath-filler (flushEq' (xs ++ [ z ]) (rev ys)) (cong Q⟨ xs ++ [ z ] ,_⟩ (rev-rev ys)) k j
; (i = i1) → helper k
; (j = i0) →
Q⟨ compPath-filler (++-assoc xs [ z ] (rev ys)) (cong (xs ++_) (sym (rev-snoc ys z))) k i , [] ⟩
; (j = i1) → tilt xs (rev-rev ys k) z i
})
flushEq'-filler
where
flushEq'-filler : Q
flushEq'-filler =
hfill
(λ i → λ
{ (j = i0) → Q⟨ ++-assoc xs [ z ] (rev ys) i , [] ⟩
; (j = i1) → tilt xs (rev (rev ys)) z i
})
(inS (flushEq' (xs ++ [ z ]) (rev ys) j))
i
helper : I → Q
helper k =
hcomp
(λ l → λ
{ (j = i0) → Q⟨ xs ++ rev-snoc ys z (l ∧ ~ k) , [] ⟩
; (j = i1) → Q⟨ xs , rev-rev-snoc ys z l k ⟩
; (k = i0) → flushEq' xs (rev-snoc ys z l) j
; (k = i1) → flushEq xs (ys ++ [ z ]) j
})
(compPath-filler (flushEq' xs (rev (ys ++ [ z ]))) (cong Q⟨ xs ,_⟩ (rev-rev (ys ++ [ z ]))) k j)
eval∘quot : ∀ xs → eval (quot xs) ≡ xs
eval∘quot = ++-unit-r
-- We get our desired equivalence
quotEquiv : Q₁ ≃ Q
quotEquiv = isoToEquiv (iso quot eval quot∘eval eval∘quot)
-- Now it only remains to prove that this is an equivalence of queue structures
quot∘emp : quot emp₁ ≡ emp
quot∘emp = refl
quot∘enq : ∀ x xs → quot (enq₁ x xs) ≡ enq x (quot xs)
quot∘enq x xs = refl
quot∘deq : ∀ xs → deqMap quot (deq₁ xs) ≡ deq (quot xs)
quot∘deq [] = refl
quot∘deq (x ∷ []) = refl
quot∘deq (x ∷ x' ∷ xs) =
deqMap-∘ quot (enq₁ x) (deq₁ (x' ∷ xs))
∙ sym (deqMap-∘ (enq x) quot (deq₁ (x' ∷ xs)))
∙ cong (deqMap (enq x)) (quot∘deq (x' ∷ xs))
∙ lemma x x' (rev xs)
where
lemma : ∀ x x' ys
→ deqMap (enq x) (deqFlush (ys ++ [ x' ]))
≡ deqFlush ((ys ++ [ x' ]) ++ [ x ])
lemma x x' [] i = just (tilt [] [] x i , x')
lemma x x' (y ∷ ys) i = just (tilt [] (ys ++ [ x' ]) x i , y)
quotEquivHasQueueEquivStr : RawQueueEquivStr One.Raw Raw quotEquiv
quotEquivHasQueueEquivStr = quot∘emp , quot∘enq , quot∘deq
-- And we get a path between the raw 1Lists and 2Lists
Raw-1≡2 : One.Raw ≡ Raw
Raw-1≡2 = sip rawQueueUnivalentStr _ _ (quotEquiv , quotEquivHasQueueEquivStr)
-- We derive the axioms for 2List from those for 1List
WithLaws : Queue
WithLaws = Q , str Raw , subst (uncurry QueueAxioms) Raw-1≡2 (snd (str One.WithLaws))
-- In particular, the untruncated queue type is a set
isSetQ : isSet Q
isSetQ = str WithLaws .snd .fst
WithLaws-1≡2 : One.WithLaws ≡ WithLaws
WithLaws-1≡2 = sip queueUnivalentStr _ _ (quotEquiv , quotEquivHasQueueEquivStr)
Finite : FiniteQueue
Finite = Q , str WithLaws , subst (uncurry FiniteQueueAxioms) WithLaws-1≡2 (snd (str One.Finite))
|
test/annotation/test_annotation-read.ads | skill-lang/skillAdaTestSuite | 1 | 7792 | <gh_stars>1-10
with Ahven.Framework;
with Annotation.Api;
package Test_Annotation.Read is
package Skill renames Annotation.Api;
use Annotation;
use Annotation.Api;
type Test is new Ahven.Framework.Test_Case with null record;
procedure Initialize (T : in out Test);
procedure Check_Annotation;
procedure Change_Annotation;
procedure Annotation_Type_Safety;
end Test_Annotation.Read;
|
matlab_ext/code-miners/projects/asm-code-analyser/call_flow_graph_former/tmp/pure_code.asm | zaqwes8811/coordinator-tasks | 0 | 103590 | _begin
bz _lbl
movlw 0x00
return
asf_v#v(asfd)asdf:
movlw
lbl
return |
Vezba 9/while/program.asm | KristianKalamin/Programski-Prevodioci-Domaci | 1 | 240951 | <reponame>KristianKalamin/Programski-Prevodioci-Domaci
main:
PUSH %14
MOV %15,%14
SUBS %15,$8,%15
@main_body:
MOV $1,-4(%14)
MOV $3,-8(%14)
@while0:
CMPS -4(%14),-8(%14)
JGES @true0
ADDS -4(%14),-4(%14),%0
MOV %0,-4(%14)
JMP @while0
@true0:
MOV -4(%14),%13
JMP @main_exit
@main_exit:
MOV %14,%15
POP %14
RET |
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_53.asm | ljhsiun2/medusa | 9 | 89993 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x183e7, %rdi
nop
nop
nop
nop
nop
xor $2103, %rdx
movb $0x61, (%rdi)
nop
and %r12, %r12
lea addresses_WT_ht+0x1763, %r9
nop
nop
nop
sub $55431, %rsi
movl $0x61626364, (%r9)
nop
nop
nop
nop
nop
cmp $13740, %r9
lea addresses_WT_ht+0x10bfa, %rsi
lea addresses_normal_ht+0x195ff, %rdi
clflush (%rsi)
nop
nop
nop
sub %r12, %r12
mov $4, %rcx
rep movsl
nop
nop
nop
xor $57454, %r9
lea addresses_WT_ht+0x13bc1, %rdx
nop
nop
and $50903, %rcx
vmovups (%rdx), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r9
nop
nop
nop
nop
cmp $33691, %rsi
lea addresses_WT_ht+0xf1ff, %rsi
nop
nop
sub $50109, %rax
mov (%rsi), %r9w
nop
and $12166, %r9
lea addresses_UC_ht+0x95ff, %rsi
lea addresses_UC_ht+0x1bdff, %rdi
clflush (%rsi)
nop
nop
nop
nop
add %r15, %r15
mov $72, %rcx
rep movsw
nop
nop
add %r15, %r15
lea addresses_WC_ht+0x41f, %r9
nop
nop
nop
cmp %r12, %r12
mov (%r9), %dx
nop
nop
and %rsi, %rsi
lea addresses_normal_ht+0x1a13f, %r12
nop
nop
nop
cmp %rcx, %rcx
mov (%r12), %rdx
nop
xor %rax, %rax
lea addresses_UC_ht+0x181ff, %rsi
lea addresses_UC_ht+0x11a6f, %rdi
clflush (%rdi)
nop
nop
cmp $64692, %rax
mov $61, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_D_ht+0x8cf3, %rcx
clflush (%rcx)
nop
nop
nop
nop
dec %r12
mov $0x6162636465666768, %r9
movq %r9, (%rcx)
nop
nop
nop
nop
and %rax, %rax
lea addresses_A_ht+0x73df, %rsi
lea addresses_normal_ht+0x1898d, %rdi
nop
nop
nop
add %r15, %r15
mov $116, %rcx
rep movsw
nop
nop
nop
nop
nop
sub %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %r8
push %rax
// Faulty Load
lea addresses_A+0xb9ff, %rax
nop
nop
nop
nop
nop
and %r15, %r15
mov (%rax), %r14d
lea oracles, %r12
and $0xff, %r14
shlq $12, %r14
mov (%r12,%r14,1), %r14
pop %rax
pop %r8
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': True, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
oeis/077/A077193.asm | neoneye/loda-programs | 11 | 2964 | <filename>oeis/077/A077193.asm
; A077193: Number of multiples of n that can be obtained by permuting the digits of number formed by the concatenation of first n numbers.
; Submitted by <NAME>
; 1,1,6,6,24,360,720,5040,362880,1814400
add $0,1
mov $1,1
lpb $0
sub $0,1
mul $1,2
mul $3,$2
add $2,1
add $3,$1
mul $1,$2
mul $1,2
lpe
gcd $3,$1
mov $0,$3
div $0,2
|
Formalization/LambdaCalculus/Semantics/Reduction.agda | Lolirofle/stuff-in-agda | 6 | 9301 | <filename>Formalization/LambdaCalculus/Semantics/Reduction.agda
module Formalization.LambdaCalculus.Semantics.Reduction where
import Lvl
open import Data
open import Formalization.LambdaCalculus
open import Formalization.LambdaCalculus.SyntaxTransformation
open import Numeral.Natural
open import Numeral.Finite
open import Relator.ReflexiveTransitiveClosure
open import Syntax.Number
open import Type
private variable d d₁ d₂ : ℕ
private variable f g x y : Term(d)
-- β-reduction (beta) with its compatible closure over `Apply`.
-- Reduces a term of form `f(x)` to `f[0 ≔ x]`.
data _β⇴_ : Term(d₁) → Term(d₂) → Type{1} where
β : {f : Term(𝐒(d))}{x : Term(d)} → (Apply(Abstract(f))(x) β⇴ substituteVar0(x)(f))
cong-applyₗ : (f β⇴ g) → (Apply f(x) β⇴ Apply g(x)) -- TODO: cong-applyₗ and cong-applyᵣ can be applied in any order, but many evaluation strategies have a fixed order. How should this be represented?
cong-applyᵣ : (x β⇴ y) → (Apply f(x) β⇴ Apply f(y))
cong-abstract : (x β⇴ y) → (Abstract x β⇴ Abstract y) -- TODO: Sometimes this is not included, specifically for the call by value evaluation strategy? But it seems to be required for the encoding of ℕ?
-- η-reduction (eta). (TODO: May require more introductions like β have)
-- Reduces a term of form `x ↦ f(x)` to `f`.
data _η⇴_ : Term(d₁) → Term(d₂) → Type{1} where
η : (Abstract(Apply(f)(Var(maximum))) η⇴ f)
-- Reduction of expressions (TODO: May require more introductions like β have)
data _⇴_ : Term(d₁) → Term(d₂) → Type{1} where
β : (Apply(Abstract(f))(x) ⇴ substituteVar0(x)(f))
η : (Abstract(Apply(f)(Var(maximum))) ⇴ f)
_β⇴*_ : Term(d) → Term(d) → Type
_β⇴*_ = ReflexiveTransitiveClosure(_β⇴_)
_β⥈_ : Term(d) → Term(d) → Type
_β⥈_ = SymmetricClosure(_β⇴_)
_β⥈*_ : Term(d) → Term(d) → Type
_β⥈*_ = ReflexiveTransitiveClosure(_β⥈_)
|
Src/Ant8/Tests/Ant8/basic/04_sub_r1.asm | geoffthorpe/ant-architecture | 0 | 88954 | <gh_stars>0
# $Id: 04_sub_r1.asm,v 1.2 2001/03/22 00:39:03 ellard Exp $
#
# Copyright 1999-2000 by the President and Fellows of Harvard College.
# See LICENSE.txt for license information.
#
#@ test sub with r1
# OK
lc r2, -100
lc r3, 100
sub r1, r2, r3
add r5, r1, r0
hlt
|
src/main/antlr/com/defano/hypertalk/parser/HyperTalk.g4 | laurentd75/wyldcard | 0 | 3250 | /*
* MIT License
*
* Copyright (c) 2017-2019 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
grammar HyperTalk;
/* Start symbol accepting only well-formed HyperTalk scripts that consist of handlers, functions, whitespace and
* comments (representing scipts that are assignable to objects like buttons, fields and cards). Disallows statements or
* expressions that are not inside of a handler or function block.
*/
script
: handler script # handlerScript
| function script # functionScript
| NEWLINE script # newlineScript
| EOF # emptyScript
;
/* Start symbol accepting any sequence of HyperTalk statements, expressions, whitespace and comments. Suitable when
* evaluating the message box or HyperTalk strings via the 'do' command and 'value of' function.
*/
scriptlet
: statement EOF # singleScriptlet
| multilineScriptlet # mutliScriptlet
;
multilineScriptlet
: statement NEWLINE multilineScriptlet # stmntMultiScriptlet
| statement EOF # stmntScriptlet
| NEWLINE multilineScriptlet # whitespaceScriptlet
| EOF # eofScriptlet
;
handler
: 'on' symbol NEWLINE+ statementList? 'end' symbol # noArgHandler
| 'on' symbol parameterList NEWLINE+ statementList? 'end' symbol # argHandler
;
function
: 'function' symbol NEWLINE+ statementList? 'end' symbol # noArgFunction
| 'function' symbol parameterList NEWLINE+ statementList? 'end' symbol # argFunction
;
parameterList
: symbol # singleParamList
| parameterList ',' symbol # multiParamList
;
symbol
: ID # idSymbol
| keyword # keywordSymbol
;
statementList
: statement NEWLINE+ statementList # multiStmntList
| statement NEWLINE+ # singleStmntList
;
statement
: commandStatement # commandStmnt
| functionCall # funcStmnt
| messageStatement # msgStmnt
| expression # expStmnt
| ifStatement # ifStmnt
| repeatStatement # repeatStmnt
| globalStatement # globalStmnt
| returnStatement # returnStmnt
;
globalStatement
: 'global' parameterList
;
returnStatement
: 'return' expression # eprReturnStmnt
| 'return' # voidReturnStmnt
;
ifStatement
: 'if' expression thenStatement
;
thenStatement
: NEWLINE? 'then' statement # thenSingleLineStmnt
| NEWLINE? 'then' statement NEWLINE? elseStatement? # thenSingleStmnt
| NEWLINE? 'then' NEWLINE+ statementList? (elseStatement | 'end' 'if') # thenStmntList
;
elseStatement
: 'else' statement (NEWLINE+ 'end' 'if')? # elseSingleStmt
| 'else' NEWLINE+ statementList? 'end' 'if' # elseStmntList
;
repeatStatement
: 'repeat' repeatRange NEWLINE+ statementList 'end' 'repeat' # repeatStmntList
| 'repeat' repeatRange NEWLINE+ 'end' 'repeat' # repeatEmpty
;
messageStatement
: ID # noArgMsgCmdStmt
| ID listExpression # argMsgCmdStmt
;
commandStatement
: 'add' expression 'to' expression # addCmd
| 'answer' expression 'with' term 'or' term 'or' term # answerThreeButtonCmd
| 'answer' expression 'with' term 'or' term # answerTwoButtonCmd
| 'answer' expression 'with' term # answerOneButtonCmd
| 'answer' expression # answerDefaultCmd
| 'answer' 'file' expression # answerFileCmd
| 'answer' 'file' expression 'of' 'type' expression # answerFileTypeCmd
| 'arrowkey' arrowExpression # arrowKeyCmd
| 'ask' expression 'with' expression # askExpWithCmd
| 'ask' expression # askExpCmd
| 'ask' 'file' expression # askFileCmd
| 'ask' 'file' expression 'with' expression # askFileWithCmd
| 'ask' 'password' expression # askPasswordCmd
| 'ask' 'password' expression 'with' expression # askPasswordWithCmd
| 'ask' 'password' 'clear' expression # askPasswordClearCmd
| 'ask' 'password' 'clear' expression 'with' expression # askPasswordClearWithCmd
| 'beep' # beepCmd
| 'beep' expression # beepMultipleCmd
| 'choose' toolExpression 'tool'? # chooseToolCmd
| 'choose' 'tool' toolExpression # chooseToolNumberCmd
| 'click' 'at' listExpression # clickCmd
| 'click' 'at' listExpression 'with' listExpression # clickWithKeyCmd
| 'close' 'file' expression # closeFileCmd
| 'close' card 'window' # closeCardWindowCmd
| 'close' 'window' expression # closeWindowCmd
| 'commandkeydown' expression # commandKeyDownCmd
| 'controlkey' expression # controlKeyCmd
| 'optionkey' expression # optionKeyCmd
| 'convert' expression 'to' convertible # convertToCmd
| 'convert' expression 'from' convertible 'to' convertible # convertFromToCmd
| 'create' 'menu' expression # createMenuCmd
| 'debug' 'checkpoint' # debugCheckpointCmd
| 'delete' expression # deleteCmd
| 'dial' expression # dialCmd
| 'disable' expression # disableCmd
| 'divide' expression 'by' expression # divideCmd
| 'do' expression # doCmd
| 'domenu' expression # doMenuCmd
| 'drag' 'from' listExpression 'to' listExpression # dragCmd
| 'drag' 'from' listExpression 'to' listExpression 'with' listExpression # dragWithKeyCmd
| 'edit' 'the'? 'script' of expression # editScriptCmd
| 'enable' expression # enableCmd
| 'enterinfield' # enterInFieldCmd
| 'enterkey' # enterKeyCmd
| 'execute' expression 'with' expression # executeExpWithCmd
| 'execute' expression # executeExpCmd
| 'exit' symbol # exitCmd
| 'exit' 'repeat' # exitRepeatCmd
| 'exit' 'to' hypercard # exitToHyperCardCmd
| 'export' 'paint' 'to' 'file' expression # exportPaintCmd
| 'find' expression? 'international'? expression of expression of 'marked' cards # findFieldMarkedCardsCmd
| 'find' expression? 'international'? expression of expression # findFieldCmd
| 'find' expression? 'international'? expression of 'marked' cards # findMarkedCardsCmd
| 'find' expression? 'international'? expression # findAnywhereCmd
| 'get' expression # getCmd
| 'go' 'to'? position # goPosition
| 'go' 'to'? ordinal # goOrdinal
| 'go' 'to'? expression navigationOption # goCmd
| 'hide' 'the'? 'menubar' # hideMenubarCmd
| 'hide' 'the'? 'titlebar' # hideTitleBarCmd
| 'hide' card picture # hideThisCardPictCmd
| 'hide' background picture # hideThisBkgndPictCmd
| 'hide' picture of expression # hidePictCmd
| 'hide' expression # hideCmd
| 'import' 'paint' 'from' 'file' expression # importPaintCmd
| 'keydown' expression # keydownCmd
| 'lock' 'screen' # lockScreenCmd
| 'lock' 'messages' # lockMessagesCmd
| 'mark' 'all' cards # markAllCardsCmd
| 'mark' expression # markCardCmd
| 'mark' cards 'where' expression # markCardsWhereCmd
| 'mark' cards 'by' 'finding' expression? 'international'? expression of expression # markCardsFindingInFieldCmd
| 'mark' cards 'by' 'finding' expression? 'international'? expression # markCardsFindingCmd
| 'multiply' expression 'by' expression # multiplyCmd
| 'next' 'repeat' # nextRepeatCmd
| 'open' 'file' expression # openFileCmd
| 'pass' symbol # passCmd
| 'play' musicExpression # playCmd
| 'pop' card # popCardCmd
| 'pop' card preposition expression # popCardIntoCmd
| 'push' card # pushCardCmd
| 'push' expression # pushDestCmd
| 'put' listExpression # putIntoCmd
| 'put' listExpression preposition expression # putPrepositionCmd
| 'put' listExpression preposition expression 'with' menuMessage listExpression # putWithMenuMessagesCmd
| 'read' 'from' 'file' expression # readFileCmd
| 'read' 'from' 'file' expression 'for' expression # readFileForCmd
| 'read' 'from' 'file' expression 'at' expression 'for' expression # readFileAtCmd
| 'read' 'from' 'file' expression 'until' expression # readFileUntil
| 'reset' 'the'? 'menubar' # resetMenuCmd
| 'reset' 'paint' # resetPaintCmd
| 'save' 'this'? 'stack' 'as' 'stack'? expression # saveThisStackAsCmd
| 'save' 'stack' expression 'as' 'stack'? expression # saveStackAsCmd
| 'select' 'empty' # selectEmptyCmd
| 'select' 'text' of expression # selectTextCmd
| 'select' 'before' 'text' of expression # selectBeforeCmd
| 'select' 'after' 'text' of expression # selectAfterCmd
| 'select' expression # selectChunkCmd
| 'select' 'before' expression # selectBeforeChunkCmd
| 'select' 'after' expression # selectAfterChunkCmd
| 'set' property 'to' propertyValue # setCmdStmnt
| 'send' listExpression 'to' expression # sendCmdStmnt
| 'show' 'the'? 'titlebar' # showTitleBarCmd
| 'show' 'the'? 'menubar' # showMenubarCmd
| 'show' 'all' cards # showAllCardsCmd
| 'show' 'marked' cards # showMarkedCardsCmd
| 'show' expression cards # showCardsCmd
| 'show' card picture # showThisCardPictCmd
| 'show' background picture # showThisBkgndPictCmd
| 'show' picture of expression # showPictCmd
| 'show' expression # showCmd
| 'show' expression 'at' listExpression # showAtCmd
| 'sort' 'this'? 'stack' sortDirection sortStyle 'by' expression # sortStackCmd
| 'sort' 'the'? cards (of 'this' 'stack')? sortDirection sortStyle 'by' expression # sortStackCmd
| 'sort' 'the'? 'marked' cards (of 'this' 'stack')? sortDirection sortStyle 'by' expression # sortMarkedCardsCmd
| 'sort' sortChunkType expression sortDirection sortStyle # sortDirectionCmd
| 'sort' sortChunkType expression sortDirection sortStyle 'by' expression # sortExpressionCmd
| 'sort' sortDirection sortStyle 'by' expression # sortStackCmd
| 'sort' expression sortDirection sortStyle 'by' expression # sortBkgndCardsCmd
| 'sort' 'the'? cards of expression sortDirection sortStyle 'by' expression # sortBkgndCardsCmd
| 'sort' 'the'? 'marked' cards of expression sortDirection sortStyle 'by' expression # sortMarkedBkgndCardsCmd
| 'speak' expression # speakCmd
| 'speak' expression 'with' gender=('male'|'female'|'neuter'|'robotic') 'voice' # speakGenderCmd
| 'speak' expression 'with' 'voice' expression # speakVoiceCmd
| 'subtract' expression 'from' expression # subtractCmd
| 'start' 'using' expression # startUsingCmd
| 'tabkey' # tabKeyCmd
| 'type' expression # typeCmd
| 'type' expression 'with' listExpression # typeWithCmdKeyCmd
| 'unlock' 'screen' # unlockScreenCmd
| 'unlock' 'screen' 'with' 'visual'? 'effect'? expression # unlockScreenVisualCmd
| 'unlock' 'messages' # unlockMessagesCmd
| 'unmark' 'all' cards # unmarkAllCardsCmd
| 'unmark' expression # unmarkCardCmd
| 'unmark' cards 'where' expression # unmarkCardsWhereCmd
| 'unmark' cards 'by' 'finding' expression? 'international'? expression of expression # unmarkCardsFindingInFieldCmd
| 'unmark' cards 'by' 'finding' expression? 'international'? expression # unmarkCardsFindingCmd
| 'visual' 'effect'? expression # visualEffectCmd
| 'wait' expression timeUnit # waitCountCmd
| 'wait' 'for' expression timeUnit # waitForCountCmd
| 'wait' 'until' expression # waitUntilCmd
| 'wait' 'while' expression # waitWhileCmd
| 'write' expression 'to' 'file' expression # writeFileCmd
| 'write' expression 'to' 'file' expression 'at' ('eof' | 'end') # writeEndFileCmd
| 'write' expression 'to' 'file' expression 'at' expression # writeAtFileCmd
;
navigationOption
: IN_A_NEW 'window' # remoteInNewWindow
| IN_A_NEW 'window' 'without' 'dialog' # remoteInNewWindowWithoutDialog
| 'without' 'dialog' # remoteWithoutDialog
| # remoteDefault
;
convertible
: conversionFormat # singleFormatConvertible
| conversionFormat 'and' conversionFormat # dualFormatConvertible
;
conversionFormat
: seconds # secondsConvFormat
| 'dateitems' # dateItemsConvFormat
| length 'date' # dateConvFormat
| length 'time' # timeConvFormat
;
length
: ('english' | 'long') # longTimeFormat
| ('abbreviated' | 'abbrev' | 'abbr') # abbreviatedTimeFormat
| 'short' # shortTimeFormat
| # defaultTimeFormat
;
sortDirection
: 'ascending' # sortDirectionAsc
| 'descending' # sortDirectionDesc
| # sortDirectionDefault
;
sortChunkType
: 'the'? line of # sortChunkLines
| 'the'? item of # sortChunkItems
| 'the'? word of # sortChunkWords
| 'the'? character of # sortChunkChars
| # sortChunkDefault
;
sortStyle
: 'text' # sortStyleText
| 'numeric' # sortStyleNumeric
| 'international' # sortStyleInternational
| 'datetime' # sortStyleDateTime
| # sortStyleDefault
;
repeatRange
: 'forever' # infiniteLoop
| 'with' ID '=' range # withLoop
| duration # durationLoop
| count # countLoop
| # infiniteLoop
;
duration
: 'until' expression # untilDuration
| 'while' expression # whileDuration
;
count
: 'for' expression 'times'
| 'for' expression
| expression 'times'
| expression
;
range
: expression 'down' 'to' expression # rangeDownTo
| expression 'to' expression # rangeUpTo
;
chunk
: chunk chunk # compositeChunk
| ordinal character of # ordinalCharChunk
| character expression 'to' expression of # rangeCharChunk
| character expression of # charCharChunk
| ordinal word of # ordinalWordChunk
| word expression 'to' expression of # rangeWordChunk
| word expression of # wordWordChunk
| ordinal item of # ordinalItemChunk
| item expression 'to' expression of # rangeItemChunk
| item expression of # itemItemChunk
| ordinal line of # ordinalLineChunk
| line expression 'to' expression of # rangeLineChunk
| line expression of # lineLineChunk
;
menu
: 'menu' term # expressionMenu
| ordinal 'menu' # ordinalMenu
;
menuItem
: 'menuitem' term of menu # expressionMenuItem
| ordinal 'menuitem' of menu # ordinalMenuItem
;
property
: partProperty
| globalProperty
;
globalProperty
: 'the'? symbol # propertySpecGlobal
;
partProperty
: 'the'? symbol of term # propertySpecPart
| 'the'? length symbol of term # lengthPropertySpecPart
;
part
: message # msgPart
| card 'part' term # cardPartNumberPart
| background 'part' term # bkgndPartNumberPart
| 'me' # mePart
| buttonPart # buttonPartPart
| fieldPart # fieldPartPart
| bkgndPart # bkgndPartPart
| windowPart # windowPartPart
| cardPart # cardPartPart
| stackPart # stackPartPart
| hypercard # hypercardPart
;
stackPart
: 'this'? stack # thisStackPart
| stack term # anotherStackPart
;
buttonPart
: card? button 'id' term # cardButtonIdPart
| background button 'id' term # bkgndButtonIdPart
| card? button term # cardButtonPart
| background button term # bkgndButtonPart
| ordinal card? button # cardButtonOrdinalPart
| ordinal background button # bkgndButtonOrdinalPart
| buttonPart of cardPart # buttonOfCardPart
;
fieldPart
: card field 'id' term # cardFieldIdPart
| background? field 'id' term # bkgndFieldIdPart
| card field term # cardFieldPart
| background? field term # bkgndFieldPart
| ordinal card field # cardFieldOrdinalPart
| ordinal background? field # bkgndFieldOrdinalPart
| fieldPart of cardPart # fieldOfCardPart
;
cardPart
: 'this'? card # thisCardPart
| card 'id' term # cardIdPart
| position card # positionCardPart
| position 'marked' card # positionMarkedCardPart
| ordinal card # ordinalCardPart
| ordinal 'marked' card # ordinalMarkedCardPart
| card term # expressionCardPart
| 'marked' card term # markedCardExpressionPart
| cardPart of bkgndPart # cardOfBkgndPart
| cardPart of stackPart # cardOfStackPart
| 'recent' card # recentCardPart
| direction # directionCardPart
;
bkgndPart
: 'this'? background # thisBkgndPart
| background 'id' term # bkgndIdPart
| background term # expressionBkgndPart
| ordinal background # ordinalBkgndPart
| position background # positionBkgndPart
| bkgndPart of stackPart # bkgndOfStackPart
;
windowPart
: 'the'? card 'window' # cardWindowExpr
| 'the'? 'tool' 'window' # toolWindowExpr
| 'the'? 'pattern' 'window' # patternWindowExpr
| 'the'? 'message' 'watcher' # messageWatcherExpr
| 'the'? 'variable' 'watcher' # variableWatcherExpr
| 'window' expression # windowNameExpr
| 'window' 'id' expression # windowIdExpr
;
listExpression
: expression # singletonListExp
| expression ',' listExpression # listExp
;
expression
: term # factorExp
| 'not' expression # notExp
| '-' expression # negateExp
| op=(THERE_IS_A|THERE_IS_NO) expression # unaryOpExp
| expression '^' expression # powOpExp
| expression op=('mod'| 'div'| '/'| '*') expression # binaryOpExp
| expression op=('+'| '-') expression # binaryOpExp
| expression op=('&&'| '&') expression # binaryOpExp
| expression op=('>='|'<='|'≤'|'≥'|'<'|'>'|'contains'|IS_IN|IS_NOT_IN|IS_A|IS_NOT_A|IS_WITHIN|IS_NOT_WITHIN) expression # binaryOpExp
| expression op=('='|IS_NOT|'is'|'<>'|'≠') expression # binaryOpExp
| expression 'and' expression # binaryAndExp
| expression 'or' expression # binaryOrExp
;
term
: literal # literalTerm
| '-' literal # negativeLiteralTerm
| '(' expression ')' # expressionTerm
| effectExpression # visualEffectTerm
| functionCall # functionTerm
| container # containerTerm
| chunk term # chunkTerm
;
container
: 'the'? 'selection' # selectionContainer
| 'target' # targetContainer
| part # partContainer
| menu # menuContainer
| menuItem # menuItemContainer
| symbol # variableContainer
| property # propertyContainer
;
musicExpression
: expression expression # musicInstrumentNotes
| expression 'tempo' expression expression # musicInstrumentNotesTempo
| expression 'tempo' expression # musicInstrumentTempo
| expression # musicInstrument
;
toolExpression
: 'text' # keywordToolExpr
| 'select' # keywordToolExpr
| 'field' # keywordToolExpr
| 'button' # keywordToolExpr
| 'line' # keywordToolExpr
| ('reg' | 'regular')? ('poly' | 'polygon') # keywordToolExpr
| 'round'? ('rect' | 'rectangle') # keywordToolExpr
| 'spray' 'can'? # keywordToolExpr
| expression # toolExpr
;
arrowExpression
: 'up' # arrowLiteralExpr
| 'down' # arrowLiteralExpr
| 'left' # arrowLiteralExpr
| 'right' # arrowLiteralExpr
| expression # arrowExpr
;
functionCall
: builtInFunc # builtInFuncCall
| ID '(' listExpression? ')' # userArgFuncCall
;
builtInFunc
: 'the' zeroArgFunc # builtinFuncNoArg
| zeroArgFunc '(' ')' # builtinFuncNoArg
| 'the'? oneArgFunc of term # builtinFuncOneArgs
| oneArgFunc '(' listExpression ')' # builtinFuncOneArgs
| multiArgFunc '(' listExpression ')' # builtinFuncArgList
| 'the'? 'number' of countable # builtinFuncNumber
| 'number' '(' countable ')' # builtinFuncNumber
| 'the'? 'selectedbutton' of buttonFamily # builtinFuncBtnFamily
| 'selectedbutton' '(' buttonFamily ')' # builtinFuncBtnFamily
;
zeroArgFunc
: 'clickh' # clickHFunc
| 'clickchunk' # clickChunkFunc
| 'clickloc' # clickLocFunc
| 'clickline' # clickLineFunc
| 'clicktext' # clickTextFunc
| 'clickv' # clickVFunc
| ('commandkey' | 'cmdkey') # commandKeyFunc
| length 'date' # dateFunc
| 'diskspace' # diskSpaceNoArgFunc
| 'foundchunk' # foundChunkFunc
| 'foundfield' # foundFieldFunc
| 'foundline' # foundLineFunc
| 'foundtext' # foundTextFunc
| 'menus' # menusFunc
| 'mouse' # mouseFunc
| 'mouseh' # mouseHFunc
| 'mousev' # mouseVFunc
| 'mouseclick' # mouseClickFunc
| 'mouseloc' # mouseLocFunc
| 'optionkey' # optionKeyFunc
| 'osname' # OSNameFunc
| 'osversion' # OSVersionFunc
| 'version' # VersionFunc
| 'result' # resultFunc
| 'screenrect' # screenRectFunc
| seconds # secondsFunc
| 'selectedchunk' # selectedChunkFunc
| 'selectedfield' # selectedFieldFunc
| 'selectedline' # selectedLineFunc
| 'selectedloc' # selectedLocFunc
| 'selectedtext' # selectedTextFunc
| 'shiftkey' # shiftKeyFunc
| 'sound' # soundFunc
| 'speech' # speechFunc
| 'stacks' # stacksFunc
| 'systemversion' # systemVersionFunc
| 'ticks' # ticksFunc
| length 'time' # timeFunc
| 'tool' # toolFunc
| 'paramcount' # paramCountFunc
| 'params' # paramsFunc
| 'target' # targetFunc
| 'voices' # voicesFunc
| 'windows' # windowsFunc
;
oneArgFunc
: 'average' # averageFunc
| 'min' # minFunc
| 'max' # maxFunc
| 'sum' # sumFunc
| 'random' # randomFunc
| 'round' # roundFunc
| 'sqrt' # sqrtFunc
| 'trunc' # truncFunc
| 'sin' # sinFunc
| 'cos' # cosFunc
| 'tan' # tanFunc
| 'atan' # atanFunc
| 'exp' # expFunc
| 'exp1' # exp1Func
| 'exp2' # exp2Func
| 'ln' # lnFunc
| 'ln1' # ln1Func
| 'log2' # log2Func
| 'abs' # absFunc
| 'chartonum' # charToNumFunc
| 'numtochar' # numToCharFunc
| 'value' # valueFunc
| 'length' # lengthFunc
| 'diskspace' # diskSpaceFunc
| 'param' # paramFunc
;
multiArgFunc
: oneArgFunc # oneArgArgFunc
| 'annuity' # annuityArgFunc
| 'compound' # compoundArgFunc
| 'offset' # offsetArgFunc
;
literal
: constant # constantExp
| modifierKey # literalExp
| mouseState # literalExp
| knownType # literalExp
| findType # literalExp
| LITERAL # literalExp
;
preposition
: 'before' # beforePreposition
| 'after' # afterPreposition
| 'into' # intoPreposition
;
constant
: cardinalValue # cardninalExp
| 'empty' # emptyExp
| 'pi' # piExp
| 'quote' # quoteExp
| 'return' # returnExp
| 'space' # spaceExp
| 'tab' # tabExp
| 'formfeed' # formFeedExp
| 'linefeed' # lineFeedExp
| 'comma' # commaExp
| 'colon' # colonExp
;
cardinalValue
: 'zero'
| 'one'
| 'two'
| 'three'
| 'four'
| 'five'
| 'six'
| 'seven'
| 'eight'
| 'nine'
| 'ten'
;
ordinal
: 'the'? 'first'
| 'the'? 'second'
| 'the'? 'third'
| 'the'? 'fourth'
| 'the'? 'fifth'
| 'the'? 'sixth'
| 'the'? 'seventh'
| 'the'? 'eighth'
| 'the'? 'ninth'
| 'the'? 'tenth'
| 'the'? ('mid' | 'middle')
| 'the'? 'last'
| 'the'? 'any'
;
countable
: cards (of 'this' 'stack')? # cardsCount
| cards of term # cardsOfCount
| background (of 'this' 'stack')? # backgroundCount
| background of term # backgroundsOfCount
| card button # cardButtonCount
| card button of term # cardButtonsOfCount
| card field # cardFieldCount
| card field of term # cardFieldsOfCount
| card? 'parts' # cardPartCount
| card 'parts' of term # cardPartsOfCount
| background button # bkgndButtonCount
| background button of term # bkgndButtonsOfCount
| background? field # bkgndFieldCount
| background field of term # bkgndFieldsOfCount
| background 'parts' # bkgndPartCount
| background 'parts' of term # bkgndPartsOfCount
| 'marked' cards (of 'this' 'stack')? # markedCardsCount
| 'marked' cards of term # markedCardsOfCount
| character of term # charsOfCount
| item of term # itemsOfCount
| word of term # wordsOfCount
| line of term # linesOfCount
| 'windows' # windowsCount
| 'menus' # menusCount
| 'menuitems' of 'menu' term # menuItemsCount
;
buttonFamily
: card 'family' term # cardFamily
| background 'family' term # bkgndFamily
;
mouseState
: 'up'
| 'down'
;
modifierKey
: 'commandkey'
| 'cmdkey'
| 'optionkey'
| 'controlkey'
| 'ctrlkey'
| 'shiftkey'
;
knownType
: 'number'
| 'integer'
| 'point'
| 'rect'
| 'rectangle'
| 'date'
| 'logical'
| 'boolean'
| 'bool'
;
findType
: 'word'
| 'chars'
| 'whole'
| 'string'
;
propertyValue
: symbol # propertySymbolValueExp
| listExpression # propertyValueExp
;
keyword
: 'add' | 'to' | 'answer' | 'optionkey' | 'ctrlkey'
| 'with' | 'arrowkey' | 'ask' | 'file' | 'beep' | 'choose' | 'tool' | 'click' | 'at' | 'close'
| 'commandkeydown' | 'controlkey' | 'convert' | 'from' | 'create' | 'menu' | 'debug' | 'checkpoint' | 'delete'
| 'dial' | 'disable' | 'divide' | 'by' | 'domenu' | 'drag' | 'edit' | 'script' | 'enable'
| 'enterinfield' | 'enterkey' | 'export' | 'paint' | 'find' | 'international' | 'marked'
| 'get' | 'go' | 'visual' | 'hide' | 'titlebar' | 'menubar' | 'import' | 'keydown' | 'lock' | 'screen'
| 'mark' | 'all' | 'where' | 'finding' | 'multiply' | 'next' | 'open' | 'pass' | 'play' | 'pop' | 'push' | 'put'
| 'read' | 'for' | 'until' | 'reset' | 'save' | 'this' | 'stack' | 'as' | 'select' | 'text'
| 'set' | 'send' | 'show' | 'sort' | 'speak' | 'male' | 'female' | 'neuter' | 'robotic' | 'voice'
| 'subtract' | 'tabkey' | 'type' | 'commandkey' | 'cmdkey' | 'unlock' | 'unmark' | 'wait' | 'while' | 'write'
| 'window' | 'without' | 'dialog' | 'dateitems' | 'date' | 'time' | 'english' | 'long' | 'abbreviated'
| 'abbrev' | 'abbr' | 'short' | 'ascending' | 'descending' | 'numeric' | 'datetime' | 'forever' | 'times'
| 'down' | 'menuitem' | 'part' | 'id' | 'pattern' | 'watcher' | 'variable' | 'start' | 'using' | 'password'
| 'selection' | 'tempo' | 'field' | 'button' | 'line' | 'reg' | 'regular'
| 'poly' | 'polygon' | 'round' | 'rect' | 'rectangle' | 'spray' | 'can' | 'up' | 'left' | 'right' | 'effect'
| 'number' | 'clickh' | 'clickchunk' | 'clickloc' | 'clickline' | 'clicktext' | 'clickv' | 'diskspace'
| 'foundchunk' | 'foundfield' | 'foundline' | 'foundtext' | 'menus' | 'mouse' | 'mouseclick' | 'mouseloc'
| 'optionkey' | 'result' | 'screenrect' | 'selectedchunk' | 'selectedfield' | 'selectedline' | 'selectedloc'
| 'selectedtext' | 'shiftkey' | 'sound' | 'speech' | 'stacks' | 'systemversion' | 'ticks' | 'paramcount' | 'params'
| 'voices' | 'windows' | 'average' | 'min' | 'max' | 'sum' | 'random' | 'sqrt' | 'trunc' | 'sin' | 'cos' | 'tan'
| 'atan' | 'exp' | 'exp1' | 'exp2' | 'ln' | 'ln1' | 'log2' | 'abs' | 'chartonum' | 'numtochar' | 'value' | 'length'
| 'param' | 'annuity' | 'compound' | 'offset' | 'first' | 'second' | 'third' | 'fourth' | 'fifth' | 'sixth'
| 'seventh' | 'eighth' | 'ninth' | 'tenth' | 'messages' | 'menumessage' | 'menumsg'
| 'mid' | 'middle' | 'last' | 'any' | 'parts' | 'menuitems' | 'integer' | 'point' | 'logical' | 'boolean' | 'bool'
| 'word' | 'chars' | 'whole' | 'string' | 'bottom' | 'top' | 'center' | 'scroll' | 'plain' | 'picture' | 'pict'
| 'seconds' | 'secs' | 'sec' | 'fast' | 'slow' | 'slowly' | 'very' | 'black' | 'card' | 'gray' | 'grey' | 'inverse'
| 'white' | 'dissolve' | 'barn' | 'door' | 'checkerboard' | 'iris' | 'shrink' | 'stretch' | 'venetian' | 'blinds'
| 'wipe' | 'zoom' | 'in' | 'out' | 'tick' | 'prev' | 'previous' | 'msg' | 'box' | 'cards' | 'cds' | 'cd'
| 'background' | 'backgrounds' | 'bkgnd' | 'bkgnds' | 'bg' | 'bgs' | 'buttons' | 'btn' | 'btns' | 'fields' | 'fld'
| 'flds' | 'character' | 'characters' | 'char' | 'words' | 'lines' | 'item' | 'items' | 'of' | 'osname' | 'osversion'
| 'version';
picture
: 'picture'
| 'pict'
;
seconds
: 'seconds'
| 'secs'
| 'second'
| 'sec'
;
effectExpression
: 'visual' 'effect'? effectNameExpresssion effectDirection # visualEffectNameExpr
| 'visual' 'effect'? effectNameExpresssion effectDirection 'to' effectImage # visualEffectNameImageExpr
| 'visual' 'effect'? effectNameExpresssion effectDirection effectSpeed # visualEffectNameSpeedExpr
| 'visual' 'effect'? effectNameExpresssion effectDirection effectSpeed 'to' effectImage # visualEffectNameSpeedImageExpr
| 'visual'? 'effect'? effectName effectDirection # visualEffectName
| 'visual'? 'effect'? effectName effectDirection 'to' effectImage # visualEffectImageExpr
| 'visual'? 'effect'? effectName effectDirection effectSpeed # visualEffectSpeedExpr
| 'visual'? 'effect'? effectName effectDirection effectSpeed 'to' effectImage # visualEffectSpeedImageExpr
;
effectNameExpresssion
: effectName # literalEffectNameExpr
| expression # exprEffectNameExpr
;
effectName
: 'dissolve' # literalEffectName
| 'barn' 'door' # literalEffectName
| 'checkerboard' # literalEffectName
| 'iris' # literalEffectName
| 'plain' # literalEffectName
| 'push' # literalEffectName
| 'scroll' # literalEffectName
| 'shrink' 'to' # literalEffectName
| 'stretch' 'from' # literalEffectName
| 'venetian' 'blinds' # literalEffectName
| 'wipe' # literalEffectName
| 'zoom' # literalEffectName
;
effectDirection
: 'open' # literalEffectDirection
| 'close' # literalEffectDirection
| 'up' # literalEffectDirection
| 'down' # literalEffectDirection
| 'left' # literalEffectDirection
| 'right' # literalEffectDirection
| 'top' # literalEffectDirection
| 'center' # literalEffectDirection
| 'bottom' # literalEffectDirection
| 'in' # literalEffectDirection
| 'out' # literalEffectDirection
| # emptyEffectDirection
| expression # expressionEffectDirection
;
effectSpeed
: 'fast' # literalEffectSpeed
| ('slow' | 'slowly') # literalEffectSpeed
| 'very' 'fast' # literalEffectSpeed
| 'very' ('slow' | 'slowly') # literalEffectSpeed
| expression # expressionEffectSpeed
;
effectImage
: 'black' # literalEffectImage
| 'card' # literalEffectImage
| ('gray' | 'grey') # literalEffectImage
| 'inverse' # literalEffectImage
| 'white' # literalEffectImage
| expression # expressionEffectImage
;
timeUnit
: 'ticks' # ticksTimeUnit
| 'tick' # tickTimeUnit
| seconds # secondsTimeUnit
| # secondsTimeUnit
;
position
: 'the'? 'next' # nextPosition
| 'the'? ('prev' | 'previous') # prevPosition
| 'this' # thisPosition
;
direction
: 'back' # backDirection
| 'forth' # forthDirection
;
message
: 'the'? ('message' | 'msg') ('box' | 'window')?
;
cards
: 'cards'
| 'cds'
;
card
: 'card'
| 'cd'
;
background
: 'background'
| 'backgrounds'
| 'bkgnd'
| 'bkgnds'
| 'bg'
| 'bgs'
;
button
: 'button'
| 'buttons'
| 'btn'
| 'btns'
;
field
: 'field'
| 'fields'
| 'fld'
| 'flds'
;
stack
: 'stack'
;
character
: 'character'
| 'characters'
| 'char'
| 'chars'
;
word
: 'word'
| 'words'
;
line
: 'line'
| 'lines'
;
item
: 'item'
| 'items'
;
of
: 'of'
| 'from'
| 'in'
;
hypercard
: 'hypercard'
| 'wyldcard'
;
menuMessage
: 'menumessage'
| 'menumessages'
| 'menumsgs'
| 'menumsg'
;
ID
: (ALPHA (ALPHA | DIGIT)*)
;
BREAK
: ('|' | '¬') WHITESPACE? COMMENT? WHITESPACE? NEWLINE -> skip
;
LITERAL
: STRING_LITERAL
| NUMBER_LITERAL
;
INTEGER_LITERAL
: DIGIT+
;
NUMBER_LITERAL
: INTEGER_LITERAL
| '.' INTEGER_LITERAL
| INTEGER_LITERAL '.'
| INTEGER_LITERAL '.' INTEGER_LITERAL
;
STRING_LITERAL
: '"' ~('"' | '\r' | '\n')* '"'
;
ALPHA
: ('a' .. 'z' | 'A' .. 'Z' | '_' )+
;
DIGIT
: ('0' .. '9')+
;
COMMENT
: ('--' ~('\r' | '\n' | '|')*) -> channel(HIDDEN)
;
NEWLINE
: ('\n' | '\r')+
;
WHITESPACE
: (' ' | '\t')+ -> channel(HIDDEN)
;
IN_A_NEW
: 'in' WHITESPACE 'a' WHITESPACE 'new'
| 'in' WHITESPACE 'new'
;
THERE_IS_A
: 'there' WHITESPACE 'is' WHITESPACE 'a'
| 'there' WHITESPACE 'is' WHITESPACE 'an'
;
THERE_IS_NO
: 'there' WHITESPACE 'is' WHITESPACE 'no'
| 'there' WHITESPACE 'is' WHITESPACE 'not' WHITESPACE 'a'
| 'there' WHITESPACE 'is' WHITESPACE 'not' WHITESPACE 'an'
;
IS_IN
: 'is' WHITESPACE 'in'
;
IS_NOT_IN
: 'is' WHITESPACE 'not' WHITESPACE 'in'
;
IS_A
: 'is' WHITESPACE 'a'
| 'is' WHITESPACE 'an'
;
IS_NOT_A
: 'is' WHITESPACE 'not' WHITESPACE 'a'
| 'is' WHITESPACE 'not' WHITESPACE 'an'
;
IS_WITHIN
: 'is' WHITESPACE 'within'
;
IS_NOT_WITHIN
: 'is' WHITESPACE 'not' WHITESPACE 'within'
;
IS_NOT
: 'is' WHITESPACE 'not'
;
UNLEXED_CHAR
: .
; |
programs/oeis/156/A156821.asm | jmorken/loda | 1 | 12604 | ; A156821: Prime factors of 13! listed with multiplicity.
; 2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,5,5,7,11,13
sub $0,5
trn $0,3
mov $2,1
mov $3,1
lpb $0
add $0,1
sub $3,1
add $0,$3
trn $0,7
add $0,$2
mov $1,$0
mul $2,2
mov $3,$0
lpe
add $3,1
add $1,$3
|
scores.asm | wiebow/tetris.c64 | 79 | 12711 |
// resets player score and total lines made.
ResetScore:
lda #$00
sta score+0
sta score+1
sta score+2
rts
// this adds the score that is put in the
// addition bytes.
// we start at the rightmost byte (LSB)
AddScore:
sed // set decimal mode
clc // clear the carry bit
lda score+2 // get this score
adc addition+2 // add the first byte
sta score+2 // store it.
lda score+1 // and the 2nd byte
adc addition+1
sta score+1
lda score+0 // and the 3rd byte
adc addition+0
sta score+0
cld // clear decimal mode
rts
// prints the score into the playing field
PrintScore:
// set cursor position
clc // clear carry bit so we set cursor
ldx #4 // row 4
ldy #24 // column 24
jsr PLOT // move cursor so we can use PRINT
ldx #0 // start with left most byte (MSB)
!loop:
lda score,x // get value
pha // push to stack
lsr // shift 4 times to right
lsr
lsr
lsr
clc
adc #$30 // add #$30 to it to get a screencode
jsr PRINT // print it
pla // restore value
and #%00001111 // get rid of leftmost bits
clc
adc #$30 // create a screen code
jsr PRINT // print it
inx // update counter
cpx #3
bne !loop- // continue
rts
// this looks at the made lines amount, and the current
// level, and adds the appropriate score: (level+1) * line score
AddLineValue:
ldy linesMade // get made lines amount
dey // minus 1 to get currect offset to lineValue array
lda lineValue1,y // get 1st byte
sta addition+0 // put in addition
lda lineValue2,y // same for middle byte
sta addition+1
lda lineValue3,y // and last byte
sta addition+2
ldx currentLevel // get the current player level
// this is how many times the score is added
!loop:
jsr AddScore // add the score
dex
bpl !loop- // keep doing this until all levels have been added
rts
//prints the current play level on the screen
PrintLevel:
clc // position cursor at 26,8
ldx #8
ldy #26
jsr PLOT
// do 1st byte.
// only do the first 4 bits of this byte
lda gameLevel+1
and #%00001111 // get rid of leftmost bits
clc
adc #$30 // create a screen code
jsr PRINT // print it
// do 2nd byte
lda gameLevel+0
pha // push to stack
lsr // shift 4 times to right
lsr
lsr
lsr
clc
adc #$30 // add #$30 to it to get a screencode
jsr PRINT // print it
pla // restore value
and #%00001111 // get rid of leftmost bits
clc
adc #$30 // create a screen code
jsr PRINT // print it
rts
// ---------------------------
score:
.byte 0,0,0 // 24 bits score value, MSB first.
addition:
.byte 0,0,0 // score to add goes here
// http://tetris.wikia.com/wiki/Scoring
// lines: 1 2 3 4
lineValue1:
.byte 00, 00, 00, 00 // right most byte of scores (LSB)
lineValue2:
.byte 00, 01, 03,$12 // middle byte
lineValue3:
.byte $40, 00, 00, 00 // left most byte of score (MSB)
|
src/Function-universe/Size.agda | nad/equality | 3 | 15759 | ------------------------------------------------------------------------
-- Some results that could not be placed in Function-universe because
-- they make use of --sized-types
------------------------------------------------------------------------
{-# OPTIONS --without-K --sized-types #-}
open import Equality
module Function-universe.Size
{reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexive) where
open Derived-definitions-and-properties eq
open import Prelude
open import Prelude.Size
import Bijection eq as B
open import Equivalence eq as Eq using (_≃_)
open import Function-universe eq
private
variable
S : Size-universe
p q : Level
P : S → Type p
k : Kind
-- Π-types with something from the size universe in the domain can be
-- expressed using something from Type in the domain.
Π-size-≃ :
((i : S) → P i) ≃
((i : S in-type) → P (size i))
Π-size-≃ = Eq.↔→≃
(λ p i → p (size i))
(λ p i → p (record { size = i }))
refl
refl
-- Implicit Π-types with something from the size universe in the
-- domain can be expressed using something from Type in the domain.
implicit-Π-size-≃ :
({i : S} → P i) ≃
({i : S in-type} → P (size i))
implicit-Π-size-≃ = Eq.↔→≃
(λ p {i} → p {size i})
(λ p {i} → p {record { size = i }})
refl
refl
-- Implicit Π-types with something from the size universe in the
-- domain are equivalent to explicit Π-types.
implicit-Π-size-≃-Π-size :
({i : S} → P i) ≃ ((i : S) → P i)
implicit-Π-size-≃-Π-size {P = P} =
(∀ {i} → P i) ↔⟨ implicit-Π-size-≃ ⟩
(∀ {i} → P (size i)) ↔⟨ B.implicit-Π↔Π ⟩
(∀ i → P (size i)) ↔⟨ inverse Π-size-≃ ⟩□
(∀ i → P i) □
-- A preservation lemma for Π-types with something from the size
-- universe in the domain.
∀-size-cong :
{P : S → Type p} {Q : S → Type q} →
Extensionality? k lzero (p ⊔ q) →
(∀ i → P i ↝[ k ] Q i) →
(∀ i → P i) ↝[ k ] (∀ i → Q i)
∀-size-cong {P = P} {Q = Q} ext P↝Q =
(∀ i → P i) ↔⟨ Π-size-≃ ⟩
(∀ i → P (size i)) ↝⟨ ∀-cong ext (λ i → P↝Q (size i)) ⟩
(∀ i → Q (size i)) ↔⟨ inverse Π-size-≃ ⟩□
(∀ i → Q i) □
-- A preservation lemma for implicit Π-types with something from the
-- size universe in the domain.
implicit-∀-size-cong :
{P : S → Type p} {Q : S → Type q} →
Extensionality? k lzero (p ⊔ q) →
(∀ {i} → P (size i) ↝[ k ] Q (size i)) →
(∀ {i} → P i) ↝[ k ] (∀ {i} → Q i)
implicit-∀-size-cong {P = P} {Q = Q} ext P↝Q =
(∀ {i} → P i) ↔⟨ implicit-Π-size-≃ ⟩
(∀ {i} → P (size i)) ↝⟨ implicit-∀-cong ext P↝Q ⟩
(∀ {i} → Q (size i)) ↔⟨ inverse implicit-Π-size-≃ ⟩□
(∀ {i} → Q i) □
|
programs/oeis/183/A183625.asm | neoneye/loda | 22 | 25312 | ; A183625: Number of (n+1) X 3 0..2 arrays with every 2 X 2 subblock summing to 4.
; 45,87,189,447,1125,2967,8109,22767,65205,189447,556029,1643487,4881285,14545527,43439949,129926607,388993365,1165407207,3493075869,10472936127,31406225445,94193510487,282530199789,847489936047,2542268481525,7626402791367,22878403067709,68633598590367,205897574545605,617686281185847,1853045958655629,5559112106163087,16677284778881685,50031751257429927,150095047613859549,450284730524718207,1350853366940433765,4052558451553859607,12157672056126695469,36473009571310319727,109419015519791425845,328257020171095210887,984771007736727499389,2954312917657066231647,8862938541864966161925,26588815203382433419767,79766444765722370127309,239299332608317250117967,717897994447252029826005,2153693976586356648422247,6461081916248271063155229,19383245721723215425242687,58149737111126450747282085,174449211225292961184954327,523347633459706101441079149,1570042899946772740095669807,4710128698975627091831874165,14130386095197499018585352007,42391158282133732541935515069,127173474839483668598165463327,381520424504615947739214226245,1144561273486177727107078351287,3433683820403192949100106398989,10301051461098898382858061887247,30903154383075334219689671042325,92709463148783280801299983888167,278128389445464398688361893186909,834385168334622308634009562605567,2503155505000325151039876453906405,7509466514993891903395324893898647,22528399544967508610737365746054829,67585198634874191633314879366882287,202755595904565906502150202358082485,608266787713584382710861735589118727
add $0,1
mov $1,2
pow $1,$0
mul $1,4
mov $2,3
pow $2,$0
add $1,$2
sub $1,5
div $1,2
mul $1,2
add $1,9
mul $1,3
mov $0,$1
|
day01/src/main.adb | jwarwick/aoc_2019_ada | 0 | 18437 | <gh_stars>0
-- AOC, Day 1
with Ada.Text_IO;
use Ada.Text_IO;
with Day1;
procedure main is
begin
Day1.load_modules("day1_input.txt");
put_line("Part 1: " & Day1.Mass'Image(Day1.fuel_for_modules));
put_line("Part 2: " & Day1.Mass'Image(Day1.total_fuel));
end main;
|
src/maps.ads | acornagl/Control_flow_graph-wcet | 0 | 24835 | <reponame>acornagl/Control_flow_graph-wcet
package Maps is
end Maps;
|
mp1/mp1.asm | Candy-Crusher/ece220 | 0 | 244555 | <reponame>Candy-Crusher/ece220<gh_stars>0
.ORIG X3000
;PRINT_SLOT:
;A number from 0 to 14 is passed to this subroutine in R1.
;The subroutine prints the time corresponding to the specified slot.(R1+6)
;If R1=0, for example, your subroutine must print “0600”
;preceded by three spaces (ASCII x20) and followed by two trailing spaces.
PRINT_SLOT
;store R0-R7
ST R0,STORE_REGISTER0
ST R1,STORE_REGISTER1
ST R2,STORE_REGISTER2
ST R3,STORE_REGISTER3
ST R4,STORE_REGISTER4
ST R5,STORE_REGISTER5
ST R6,STORE_REGISTER6
ST R7,STORE_REGISTER7
;print preceded spaces
LD R0,SPACE
OUT
OUT
OUT
;print numbers
;test if R1<=3
ADD R2,R1,#-3
BRp FIRSTN_NOT_ZERO
;if R1<=3, first digit should be 0,print
LD R0,ZERO
OUT
;if R1<=3,second digit should be R1+6;print
LD R2,START_TIME
ADD R0,R1,R2
OUT
BRnzp LATTER
;go to print followed zeros and spaces
FIRSTN_NOT_ZERO ;test if R1=14
ADD R2,R1,#-14
BRn FIRSTN_1
;if R1=14,the first digit should be 2,print
LD R0,ZERO
ADD R0,R0,#2
OUT
;if R1=14,the second digit should be 0,print
LD R0,ZERO
OUT
BRnzp LATTER
;go to print followed zeros and spaces
FIRSTN_1 ;if 3<=R1<14,the first digit should be 1
LD R0,ZERO
ADD R0,R0,#1
OUT
;if 3<=R1<14,the second digit should be R1-4
LD R0,ZERO
ADD R2,R1,#-4
ADD R0,R0,R2
OUT
;print followed zeros and spaces
LATTER LD R0,ZERO
OUT
OUT
LD R0,SPACE
OUT
OUT
;load back
LD R0,STORE_REGISTER0
LD R1,STORE_REGISTER1
LD R2,STORE_REGISTER2
LD R3,STORE_REGISTER3
LD R4,STORE_REGISTER4
LD R5,STORE_REGISTER5
LD R6,STORE_REGISTER6
LD R7,STORE_REGISTER7
RET
;The second subroutine is PRINT_CENTERED.
;A string (the address of the first ASCII character
;in sequence terminated by an ASCII NUL, x00) is passed to your subroutine in R1.
;Your subroutine must print exactly nine characters.
;If the string is longer than nine characters,
;your subroutine must print the first nine characters.
;If the string is shorter than nine characters,
;your subroutine must print additional spaces
;around the string to bring the total length to nine characters.
;If the number of spaces needed is odd,
;the subroutine must use one more leading space than trailing space.
PRINT_CENTERED ;store R0-R7
ST R0,STORE_REGISTER0
ST R1,STORE_REGISTER1
ST R2,STORE_REGISTER2
ST R3,STORE_REGISTER3
ST R4,STORE_REGISTER4
ST R5,STORE_REGISTER5
ST R6,STORE_REGISTER6
ST R7,STORE_REGISTER7
;initialize
AND R2,R2,#0
ADD R4,R1,#0;copy R1 to R4
;count the length of the string
COUNT_LENGTH
LDR R3,R1,#0;load first character to R3
BRz COMPARE
; check if the string ends
ADD R2,R2,#1;the length of the string is stored in R2
ADD R1,R1,#1
BRnzp COUNT_LENGTH
;go to check next character
;compare the length of the string with 9
COMPARE
ADD R1,R4,#0;copy the address of the first character to R1
ADD R4,R2,#-9;R4 <- R2-9
BRzp NOT_SMALLER_THAN_9
SMALLER_TAHN_9
NOT R4,R4;R4 <- 9-R2-1
ADD R4,R4,#1;R4 <- 9-R2
AND R5,R5,#0
AND R3,R3,#0
ADD R3,R4,#0;R3 is 9-R2
CULCULATE_SPACE
ADD R5,R5,#1;R5 as former spaces counter
ADD R4,R4,#-2;R4/2
BRp CULCULATE_SPACE
AND R6,R6,#0
ADD R6,R5,R6
;print former spaces
FORMER_SPACE
BRz PRINT_STRING
LD R0,SPACE
OUT
ADD R5,R5,#-1
BRnzp FORMER_SPACE
;print string
PRINT_STRING
ADD R2,R2,#0
BRz LATTER_SPACE1
LDR R0,R1,#0
OUT
ADD R1,R1,#1
ADD R2,R2,#-1
BRnzp PRINT_STRING
;print latter spaces
LATTER_SPACE1
NOT R6,R6;R6 was the number of former spaces
ADD R6,R6,#1
ADD R5,R3,R6;R5 is 9-string length-former spaces length=latter spaces length
LATTER_SPACE2
BRz DONE
LD R0,SPACE
OUT
ADD R5,R5,#-1
BRnzp LATTER_SPACE2
NOT_SMALLER_THAN_9
AND R4,R4,#0
ADD R4,R4,#9;R4 as a counter of 9
;print first 9 characters
FIRST_9
BRz DONE
LDR R0,R1,#0
ADD R1,R1,#1
OUT
ADD R4,R4,#-1
BRnzp FIRST_9
DONE ;load back
LD R0,STORE_REGISTER0
LD R1,STORE_REGISTER1
LD R2,STORE_REGISTER2
LD R3,STORE_REGISTER3
LD R4,STORE_REGISTER4
LD R5,STORE_REGISTER5
LD R6,STORE_REGISTER6
LD R7,STORE_REGISTER7
RET
SPACE .FILL X20
START_TIME .FILL X36
ZERO .FILL X30
STORE_REGISTER0 .BLKW #1
STORE_REGISTER1 .BLKW #1
STORE_REGISTER2 .BLKW #1
STORE_REGISTER3 .BLKW #1
STORE_REGISTER4 .BLKW #1
STORE_REGISTER5 .BLKW #1
STORE_REGISTER6 .BLKW #1
STORE_REGISTER7 .BLKW #1
.END
|
programs/oeis/123/A123068.asm | karttu/loda | 0 | 22737 | ; A123068: Numbers represented by the "Little Methuselah" quadratic form x^2 + 2*y^2 + y*z + 4*z^2.
; 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75
mov $1,$0
lpb $0,1
mov $0,30
add $1,1
lpe
|
test/asset/agda-stdlib-1.0/Data/List/Relation/Binary/Prefix/Heterogeneous.agda | omega12345/agda-mode | 5 | 9273 | <reponame>omega12345/agda-mode
------------------------------------------------------------------------
-- The Agda standard library
--
-- An inductive definition of the heterogeneous prefix relation
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Binary.Prefix.Heterogeneous where
open import Level
open import Data.List.Base as List using (List; []; _∷_)
open import Data.List.Relation.Binary.Pointwise
using (Pointwise; []; _∷_)
open import Data.Product using (∃; _×_; _,_; uncurry)
open import Relation.Binary using (REL; _⇒_)
module _ {a b r} {A : Set a} {B : Set b} (R : REL A B r) where
data Prefix : REL (List A) (List B) (a ⊔ b ⊔ r) where
[] : ∀ {bs} → Prefix [] bs
_∷_ : ∀ {a b as bs} → R a b → Prefix as bs → Prefix (a ∷ as) (b ∷ bs)
data PrefixView (as : List A) : List B → Set (a ⊔ b ⊔ r) where
_++_ : ∀ {cs} → Pointwise R as cs → ∀ ds → PrefixView as (cs List.++ ds)
module _ {a b r} {A : Set a} {B : Set b} {R : REL A B r} {a b as bs} where
head : Prefix R (a ∷ as) (b ∷ bs) → R a b
head (r ∷ rs) = r
tail : Prefix R (a ∷ as) (b ∷ bs) → Prefix R as bs
tail (r ∷ rs) = rs
uncons : Prefix R (a ∷ as) (b ∷ bs) → R a b × Prefix R as bs
uncons (r ∷ rs) = r , rs
module _ {a b r s} {A : Set a} {B : Set b} {R : REL A B r} {S : REL A B s} where
map : R ⇒ S → Prefix R ⇒ Prefix S
map R⇒S [] = []
map R⇒S (r ∷ rs) = R⇒S r ∷ map R⇒S rs
module _ {a b r} {A : Set a} {B : Set b} {R : REL A B r} where
toView : ∀ {as bs} → Prefix R as bs → PrefixView R as bs
toView [] = [] ++ _
toView (r ∷ rs) with toView rs
... | rs′ ++ ds = (r ∷ rs′) ++ ds
fromView : ∀ {as bs} → PrefixView R as bs → Prefix R as bs
fromView ([] ++ ds) = []
fromView ((r ∷ rs) ++ ds) = r ∷ fromView (rs ++ ds)
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_574.asm | ljhsiun2/medusa | 9 | 101639 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1665e, %r9
nop
nop
nop
nop
nop
and %rdi, %rdi
mov (%r9), %rbx
nop
nop
nop
xor $56160, %rbx
lea addresses_D_ht+0x725e, %r10
nop
nop
cmp $56478, %rdi
mov (%r10), %ecx
xor $6340, %rcx
lea addresses_A_ht+0x57dc, %rsi
lea addresses_D_ht+0xe31e, %rdi
nop
nop
nop
inc %r14
mov $98, %rcx
rep movsw
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_UC_ht+0x11a5e, %r9
nop
nop
nop
nop
nop
xor $63946, %rbx
mov (%r9), %rdi
nop
nop
nop
nop
nop
add $35744, %r10
lea addresses_A_ht+0x18ad, %rdi
nop
nop
add $18572, %rsi
mov (%rdi), %r14w
nop
nop
and $57420, %r9
lea addresses_A_ht+0x1383e, %r14
nop
nop
nop
nop
nop
cmp $25824, %rsi
mov $0x6162636465666768, %r9
movq %r9, %xmm1
movups %xmm1, (%r14)
nop
add %r9, %r9
lea addresses_A_ht+0x8dbe, %rbx
sub $12687, %rsi
movb $0x61, (%rbx)
nop
cmp %rcx, %rcx
lea addresses_normal_ht+0x485e, %r9
inc %rsi
movups (%r9), %xmm2
vpextrq $0, %xmm2, %rbx
nop
add $29755, %r10
lea addresses_A_ht+0x1df7c, %rsi
lea addresses_D_ht+0xd03e, %rdi
clflush (%rdi)
nop
nop
nop
nop
add %rax, %rax
mov $22, %rcx
rep movsb
nop
nop
nop
nop
nop
and $61019, %r9
lea addresses_WT_ht+0x129ee, %rbx
nop
add $1232, %rcx
movl $0x61626364, (%rbx)
nop
nop
sub %r14, %r14
lea addresses_normal_ht+0x1103e, %rsi
nop
nop
nop
dec %rbx
movups (%rsi), %xmm5
vpextrq $1, %xmm5, %r9
nop
nop
nop
and $2313, %rcx
lea addresses_normal_ht+0x1e15e, %rsi
lea addresses_WC_ht+0x152de, %rdi
clflush (%rsi)
dec %rax
mov $87, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $45468, %r9
lea addresses_WC_ht+0x14e66, %rsi
lea addresses_WT_ht+0x34de, %rdi
nop
nop
nop
nop
cmp $31816, %rbx
mov $70, %rcx
rep movsw
add $37641, %rsi
lea addresses_WT_ht+0x5de, %rcx
nop
xor %r10, %r10
movw $0x6162, (%rcx)
nop
nop
nop
nop
and $49414, %r10
lea addresses_A_ht+0x6dd5, %rsi
nop
nop
cmp $19109, %rax
movb (%rsi), %r14b
cmp %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rsi
// Store
lea addresses_D+0xaf92, %r9
nop
nop
cmp $16735, %rcx
movw $0x5152, (%r9)
nop
cmp $63951, %r11
// REPMOV
lea addresses_RW+0x1365e, %rsi
lea addresses_normal+0x1825e, %rdi
nop
sub $43109, %r8
mov $23, %rcx
rep movsq
sub %r15, %r15
// Store
lea addresses_UC+0x6bae, %r15
nop
nop
nop
nop
and %r9, %r9
movb $0x51, (%r15)
nop
nop
sub %rsi, %rsi
// Store
lea addresses_PSE+0x1aa5e, %r15
nop
nop
nop
nop
nop
cmp $5053, %rdi
mov $0x5152535455565758, %r12
movq %r12, %xmm0
vmovups %ymm0, (%r15)
nop
nop
dec %rcx
// REPMOV
lea addresses_RW+0x495e, %rsi
lea addresses_PSE+0x1aa5e, %rdi
clflush (%rsi)
nop
nop
add $18715, %r9
mov $73, %rcx
rep movsb
nop
nop
nop
nop
cmp %rcx, %rcx
// Load
lea addresses_PSE+0x1225e, %r8
nop
and %r15, %r15
mov (%r8), %esi
sub $41655, %rsi
// REPMOV
lea addresses_PSE+0xab5e, %rsi
lea addresses_WC+0x1f23e, %rdi
nop
nop
nop
add $52781, %r9
mov $92, %rcx
rep movsw
nop
nop
nop
add $14868, %rcx
// Faulty Load
lea addresses_PSE+0x1aa5e, %rdi
clflush (%rdi)
nop
nop
inc %r8
movb (%rdi), %r11b
lea oracles, %r8
and $0xff, %r11
shlq $12, %r11
mov (%r8,%r11,1), %r11
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_D', 'size': 2, 'AVXalign': False}}
{'src': {'type': 'addresses_RW', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_RW', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_PSE', 'congruent': 0, 'same': True}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_PSE', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC', 'congruent': 4, 'same': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}}
{'src': {'same': True, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
programs/oeis/087/A087802.asm | neoneye/loda | 22 | 26138 | <reponame>neoneye/loda
; A087802: Sum(mu(d): d nonprime divisor of n), mu=A008683.
; 1,1,1,1,1,2,1,1,1,2,1,2,1,2,2,1,1,2,1,2,2,2,1,2,1,2,1,2,1,3,1,1,2,2,2,2,1,2,2,2,1,3,1,2,2,2,1,2,1,2,2,2,1,2,2,2,2,2,1,3,1,2,2,1,2,3,1,2,2,3,1,2,1,2,2,2,2,3,1,2,1,2,1,3,2,2,2,2,1,3,2,2,2,2,2,2,1,2,2,2
seq $0,1221 ; Number of distinct primes dividing n (also called omega(n)).
max $0,1
|
libsrc/target/primo/games/joystick.asm | Frodevan/z88dk | 640 | 172328 |
SECTION code_clib
PUBLIC joystick
PUBLIC _joystick
EXTERN joystick_inkey
joystick:
_joystick:
ld a,l
cp 5
jp c,joystick_inkey
ld hl,0
ret
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt17.ads | best08618/asylo | 7 | 30598 | package Opt17 is
subtype S is String (1 .. 5);
function Func return S;
end Opt17;
|
oeis/046/A046172.asm | neoneye/loda-programs | 11 | 3268 | ; A046172: Indices of pentagonal numbers (A000326) that are also squares (A000290).
; Submitted by <NAME>
; 1,81,7921,776161,76055841,7452696241,730288175761,71560788528321,7012226987599681,687126683996240401,67331402804643959601,6597790348171111800481,646516122717964312487521,63351982236012331511976561,6207847743006490523861215441,608305726832400059006887136641,59607753381832199292151078175361,5840951525692723130571798774048721,572353641764505034596744128778599281,56084815941395800667350352821528680801,5495739608615023960365737832381032119201,538526396828330952315174957220519619000881
mov $3,1
lpb $0
sub $0,1
mov $1,$3
mul $1,8
add $2,$1
add $3,$2
lpe
pow $3,2
mov $0,$3
|
libsrc/enterprise/exos_reset_font.asm | andydansby/z88dk-mk2 | 1 | 165186 | <filename>libsrc/enterprise/exos_reset_font.asm<gh_stars>1-10
;
; Enterprise 64/128 specific routines
; by <NAME>, 2011
;
; exos_reset_font();
;
;
; $Id: exos_reset_font.asm,v 1.2 2011/03/15 14:34:08 stefano Exp $
;
XLIB exos_reset_font
INCLUDE "enterprise.def"
exos_reset_font:
; __FASTCALL_
ld a,l ; channel
ld b,FN_FONT ; special fn code
rst 30h
defb 11 ; call special device dependent exos functions
ld h,0
ld l,a
ret
|
oeis/024/A024630.asm | neoneye/loda-programs | 11 | 14121 | <reponame>neoneye/loda-programs
; A024630: n written in fractional base 4/2.
; 0,1,2,3,20,21,22,23,200,201,202,203,220,221,222,223,2000,2001,2002,2003,2020,2021,2022,2023,2200,2201,2202,2203,2220,2221,2222,2223,20000,20001,20002,20003,20020,20021,20022,20023,20200,20201,20202,20203,20220,20221,20222,20223,22000,22001,22002,22003,22020,22021,22022,22023,22200,22201,22202,22203,22220,22221,22222,22223,200000,200001,200002,200003,200020,200021,200022,200023,200200,200201,200202,200203,200220,200221,200222,200223,202000,202001,202002,202003,202020,202021,202022,202023,202200
mul $0,2
mov $2,$0
div $0,4
seq $0,228071 ; Write n in binary and interpret as a decimal number; a(n) is this quantity minus n.
mul $0,4
add $0,$2
div $0,2
|
gcc-gcc-7_3_0-release/gcc/ada/a-cforma.adb | best08618/asylo | 7 | 23888 | <reponame>best08618/asylo
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . C O N T A I N E R S . F O R M A L _ O R D E R E D _ M A P S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
------------------------------------------------------------------------------
with Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations;
pragma Elaborate_All
(Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations);
with Ada.Containers.Red_Black_Trees.Generic_Bounded_Keys;
pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Bounded_Keys);
with System; use type System.Address;
package body Ada.Containers.Formal_Ordered_Maps with
SPARK_Mode => Off
is
-----------------------------
-- Node Access Subprograms --
-----------------------------
-- These subprograms provide a functional interface to access fields
-- of a node, and a procedural interface for modifying these values.
function Color
(Node : Node_Type) return Ada.Containers.Red_Black_Trees.Color_Type;
pragma Inline (Color);
function Left_Son (Node : Node_Type) return Count_Type;
pragma Inline (Left_Son);
function Parent (Node : Node_Type) return Count_Type;
pragma Inline (Parent);
function Right_Son (Node : Node_Type) return Count_Type;
pragma Inline (Right_Son);
procedure Set_Color
(Node : in out Node_Type;
Color : Ada.Containers.Red_Black_Trees.Color_Type);
pragma Inline (Set_Color);
procedure Set_Left (Node : in out Node_Type; Left : Count_Type);
pragma Inline (Set_Left);
procedure Set_Right (Node : in out Node_Type; Right : Count_Type);
pragma Inline (Set_Right);
procedure Set_Parent (Node : in out Node_Type; Parent : Count_Type);
pragma Inline (Set_Parent);
-----------------------
-- Local Subprograms --
-----------------------
-- All need comments ???
generic
with procedure Set_Element (Node : in out Node_Type);
procedure Generic_Allocate
(Tree : in out Tree_Types.Tree_Type'Class;
Node : out Count_Type);
procedure Free (Tree : in out Map; X : Count_Type);
function Is_Greater_Key_Node
(Left : Key_Type;
Right : Node_Type) return Boolean;
pragma Inline (Is_Greater_Key_Node);
function Is_Less_Key_Node
(Left : Key_Type;
Right : Node_Type) return Boolean;
pragma Inline (Is_Less_Key_Node);
--------------------------
-- Local Instantiations --
--------------------------
package Tree_Operations is
new Red_Black_Trees.Generic_Bounded_Operations
(Tree_Types => Tree_Types,
Left => Left_Son,
Right => Right_Son);
use Tree_Operations;
package Key_Ops is
new Red_Black_Trees.Generic_Bounded_Keys
(Tree_Operations => Tree_Operations,
Key_Type => Key_Type,
Is_Less_Key_Node => Is_Less_Key_Node,
Is_Greater_Key_Node => Is_Greater_Key_Node);
---------
-- "=" --
---------
function "=" (Left, Right : Map) return Boolean is
Lst : Count_Type;
Node : Count_Type;
ENode : Count_Type;
begin
if Length (Left) /= Length (Right) then
return False;
end if;
if Is_Empty (Left) then
return True;
end if;
Lst := Next (Left, Last (Left).Node);
Node := First (Left).Node;
while Node /= Lst loop
ENode := Find (Right, Left.Nodes (Node).Key).Node;
if ENode = 0 or else
Left.Nodes (Node).Element /= Right.Nodes (ENode).Element
then
return False;
end if;
Node := Next (Left, Node);
end loop;
return True;
end "=";
------------
-- Assign --
------------
procedure Assign (Target : in out Map; Source : Map) is
procedure Append_Element (Source_Node : Count_Type);
procedure Append_Elements is
new Tree_Operations.Generic_Iteration (Append_Element);
--------------------
-- Append_Element --
--------------------
procedure Append_Element (Source_Node : Count_Type) is
SN : Node_Type renames Source.Nodes (Source_Node);
procedure Set_Element (Node : in out Node_Type);
pragma Inline (Set_Element);
function New_Node return Count_Type;
pragma Inline (New_Node);
procedure Insert_Post is new Key_Ops.Generic_Insert_Post (New_Node);
procedure Unconditional_Insert_Sans_Hint is
new Key_Ops.Generic_Unconditional_Insert (Insert_Post);
procedure Unconditional_Insert_Avec_Hint is
new Key_Ops.Generic_Unconditional_Insert_With_Hint
(Insert_Post,
Unconditional_Insert_Sans_Hint);
procedure Allocate is new Generic_Allocate (Set_Element);
--------------
-- New_Node --
--------------
function New_Node return Count_Type is
Result : Count_Type;
begin
Allocate (Target, Result);
return Result;
end New_Node;
-----------------
-- Set_Element --
-----------------
procedure Set_Element (Node : in out Node_Type) is
begin
Node.Key := SN.Key;
Node.Element := SN.Element;
end Set_Element;
Target_Node : Count_Type;
-- Start of processing for Append_Element
begin
Unconditional_Insert_Avec_Hint
(Tree => Target,
Hint => 0,
Key => SN.Key,
Node => Target_Node);
end Append_Element;
-- Start of processing for Assign
begin
if Target'Address = Source'Address then
return;
end if;
if Target.Capacity < Length (Source) then
raise Storage_Error with "not enough capacity"; -- SE or CE? ???
end if;
Tree_Operations.Clear_Tree (Target);
Append_Elements (Source);
end Assign;
-------------
-- Ceiling --
-------------
function Ceiling (Container : Map; Key : Key_Type) return Cursor is
Node : constant Count_Type := Key_Ops.Ceiling (Container, Key);
begin
if Node = 0 then
return No_Element;
end if;
return (Node => Node);
end Ceiling;
-----------
-- Clear --
-----------
procedure Clear (Container : in out Map) is
begin
Tree_Operations.Clear_Tree (Container);
end Clear;
-----------
-- Color --
-----------
function Color (Node : Node_Type) return Color_Type is
begin
return Node.Color;
end Color;
--------------
-- Contains --
--------------
function Contains (Container : Map; Key : Key_Type) return Boolean is
begin
return Find (Container, Key) /= No_Element;
end Contains;
----------
-- Copy --
----------
function Copy (Source : Map; Capacity : Count_Type := 0) return Map is
Node : Count_Type := 1;
N : Count_Type;
begin
if 0 < Capacity and then Capacity < Source.Capacity then
raise Capacity_Error;
end if;
return Target : Map (Count_Type'Max (Source.Capacity, Capacity)) do
if Length (Source) > 0 then
Target.Length := Source.Length;
Target.Root := Source.Root;
Target.First := Source.First;
Target.Last := Source.Last;
Target.Free := Source.Free;
while Node <= Source.Capacity loop
Target.Nodes (Node).Element :=
Source.Nodes (Node).Element;
Target.Nodes (Node).Key :=
Source.Nodes (Node).Key;
Target.Nodes (Node).Parent :=
Source.Nodes (Node).Parent;
Target.Nodes (Node).Left :=
Source.Nodes (Node).Left;
Target.Nodes (Node).Right :=
Source.Nodes (Node).Right;
Target.Nodes (Node).Color :=
Source.Nodes (Node).Color;
Target.Nodes (Node).Has_Element :=
Source.Nodes (Node).Has_Element;
Node := Node + 1;
end loop;
while Node <= Target.Capacity loop
N := Node;
Formal_Ordered_Maps.Free (Tree => Target, X => N);
Node := Node + 1;
end loop;
end if;
end return;
end Copy;
---------------------
-- Current_To_Last --
---------------------
function Current_To_Last (Container : Map; Current : Cursor) return Map is
Curs : Cursor := First (Container);
C : Map (Container.Capacity) := Copy (Container, Container.Capacity);
Node : Count_Type;
begin
if Curs = No_Element then
Clear (C);
return C;
elsif Current /= No_Element and not Has_Element (Container, Current) then
raise Constraint_Error;
else
while Curs.Node /= Current.Node loop
Node := Curs.Node;
Delete (C, Curs);
Curs := Next (Container, (Node => Node));
end loop;
return C;
end if;
end Current_To_Last;
------------
-- Delete --
------------
procedure Delete (Container : in out Map; Position : in out Cursor) is
begin
if not Has_Element (Container, Position) then
raise Constraint_Error with
"Position cursor of Delete has no element";
end if;
pragma Assert (Vet (Container, Position.Node),
"Position cursor of Delete is bad");
Tree_Operations.Delete_Node_Sans_Free (Container,
Position.Node);
Formal_Ordered_Maps.Free (Container, Position.Node);
end Delete;
procedure Delete (Container : in out Map; Key : Key_Type) is
X : constant Node_Access := Key_Ops.Find (Container, Key);
begin
if X = 0 then
raise Constraint_Error with "key not in map";
end if;
Tree_Operations.Delete_Node_Sans_Free (Container, X);
Formal_Ordered_Maps.Free (Container, X);
end Delete;
------------------
-- Delete_First --
------------------
procedure Delete_First (Container : in out Map) is
X : constant Node_Access := First (Container).Node;
begin
if X /= 0 then
Tree_Operations.Delete_Node_Sans_Free (Container, X);
Formal_Ordered_Maps.Free (Container, X);
end if;
end Delete_First;
-----------------
-- Delete_Last --
-----------------
procedure Delete_Last (Container : in out Map) is
X : constant Node_Access := Last (Container).Node;
begin
if X /= 0 then
Tree_Operations.Delete_Node_Sans_Free (Container, X);
Formal_Ordered_Maps.Free (Container, X);
end if;
end Delete_Last;
-------------
-- Element --
-------------
function Element (Container : Map; Position : Cursor) return Element_Type is
begin
if not Has_Element (Container, Position) then
raise Constraint_Error with
"Position cursor of function Element has no element";
end if;
pragma Assert (Vet (Container, Position.Node),
"Position cursor of function Element is bad");
return Container.Nodes (Position.Node).Element;
end Element;
function Element (Container : Map; Key : Key_Type) return Element_Type is
Node : constant Node_Access := Find (Container, Key).Node;
begin
if Node = 0 then
raise Constraint_Error with "key not in map";
end if;
return Container.Nodes (Node).Element;
end Element;
---------------------
-- Equivalent_Keys --
---------------------
function Equivalent_Keys (Left, Right : Key_Type) return Boolean is
begin
if Left < Right
or else Right < Left
then
return False;
else
return True;
end if;
end Equivalent_Keys;
-------------
-- Exclude --
-------------
procedure Exclude (Container : in out Map; Key : Key_Type) is
X : constant Node_Access := Key_Ops.Find (Container, Key);
begin
if X /= 0 then
Tree_Operations.Delete_Node_Sans_Free (Container, X);
Formal_Ordered_Maps.Free (Container, X);
end if;
end Exclude;
----------
-- Find --
----------
function Find (Container : Map; Key : Key_Type) return Cursor is
Node : constant Count_Type := Key_Ops.Find (Container, Key);
begin
if Node = 0 then
return No_Element;
end if;
return (Node => Node);
end Find;
-----------
-- First --
-----------
function First (Container : Map) return Cursor is
begin
if Length (Container) = 0 then
return No_Element;
end if;
return (Node => Container.First);
end First;
-------------------
-- First_Element --
-------------------
function First_Element (Container : Map) return Element_Type is
begin
if Is_Empty (Container) then
raise Constraint_Error with "map is empty";
end if;
return Container.Nodes (First (Container).Node).Element;
end First_Element;
---------------
-- First_Key --
---------------
function First_Key (Container : Map) return Key_Type is
begin
if Is_Empty (Container) then
raise Constraint_Error with "map is empty";
end if;
return Container.Nodes (First (Container).Node).Key;
end First_Key;
-----------------------
-- First_To_Previous --
-----------------------
function First_To_Previous
(Container : Map;
Current : Cursor) return Map
is
Curs : Cursor := Current;
C : Map (Container.Capacity) := Copy (Container, Container.Capacity);
Node : Count_Type;
begin
if Curs = No_Element then
return C;
elsif not Has_Element (Container, Curs) then
raise Constraint_Error;
else
while Curs.Node /= 0 loop
Node := Curs.Node;
Delete (C, Curs);
Curs := Next (Container, (Node => Node));
end loop;
return C;
end if;
end First_To_Previous;
-----------
-- Floor --
-----------
function Floor (Container : Map; Key : Key_Type) return Cursor is
Node : constant Count_Type := Key_Ops.Floor (Container, Key);
begin
if Node = 0 then
return No_Element;
end if;
return (Node => Node);
end Floor;
----------
-- Free --
----------
procedure Free
(Tree : in out Map;
X : Count_Type)
is
begin
Tree.Nodes (X).Has_Element := False;
Tree_Operations.Free (Tree, X);
end Free;
----------------------
-- Generic_Allocate --
----------------------
procedure Generic_Allocate
(Tree : in out Tree_Types.Tree_Type'Class;
Node : out Count_Type)
is
procedure Allocate is
new Tree_Operations.Generic_Allocate (Set_Element);
begin
Allocate (Tree, Node);
Tree.Nodes (Node).Has_Element := True;
end Generic_Allocate;
-----------------
-- Has_Element --
-----------------
function Has_Element (Container : Map; Position : Cursor) return Boolean is
begin
if Position.Node = 0 then
return False;
end if;
return Container.Nodes (Position.Node).Has_Element;
end Has_Element;
-------------
-- Include --
-------------
procedure Include
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type)
is
Position : Cursor;
Inserted : Boolean;
begin
Insert (Container, Key, New_Item, Position, Inserted);
if not Inserted then
declare
N : Node_Type renames Container.Nodes (Position.Node);
begin
N.Key := Key;
N.Element := New_Item;
end;
end if;
end Include;
procedure Insert
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type;
Position : out Cursor;
Inserted : out Boolean)
is
function New_Node return Node_Access;
-- Comment ???
procedure Insert_Post is
new Key_Ops.Generic_Insert_Post (New_Node);
procedure Insert_Sans_Hint is
new Key_Ops.Generic_Conditional_Insert (Insert_Post);
--------------
-- New_Node --
--------------
function New_Node return Node_Access is
procedure Initialize (Node : in out Node_Type);
procedure Allocate_Node is new Generic_Allocate (Initialize);
procedure Initialize (Node : in out Node_Type) is
begin
Node.Key := Key;
Node.Element := New_Item;
end Initialize;
X : Node_Access;
begin
Allocate_Node (Container, X);
return X;
end New_Node;
-- Start of processing for Insert
begin
Insert_Sans_Hint
(Container,
Key,
Position.Node,
Inserted);
end Insert;
procedure Insert
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type)
is
Position : Cursor;
Inserted : Boolean;
begin
Insert (Container, Key, New_Item, Position, Inserted);
if not Inserted then
raise Constraint_Error with "key already in map";
end if;
end Insert;
--------------
-- Is_Empty --
--------------
function Is_Empty (Container : Map) return Boolean is
begin
return Length (Container) = 0;
end Is_Empty;
-------------------------
-- Is_Greater_Key_Node --
-------------------------
function Is_Greater_Key_Node
(Left : Key_Type;
Right : Node_Type) return Boolean
is
begin
-- k > node same as node < k
return Right.Key < Left;
end Is_Greater_Key_Node;
----------------------
-- Is_Less_Key_Node --
----------------------
function Is_Less_Key_Node
(Left : Key_Type;
Right : Node_Type) return Boolean
is
begin
return Left < Right.Key;
end Is_Less_Key_Node;
---------
-- Key --
---------
function Key (Container : Map; Position : Cursor) return Key_Type is
begin
if not Has_Element (Container, Position) then
raise Constraint_Error with
"Position cursor of function Key has no element";
end if;
pragma Assert (Vet (Container, Position.Node),
"Position cursor of function Key is bad");
return Container.Nodes (Position.Node).Key;
end Key;
----------
-- Last --
----------
function Last (Container : Map) return Cursor is
begin
if Length (Container) = 0 then
return No_Element;
end if;
return (Node => Container.Last);
end Last;
------------------
-- Last_Element --
------------------
function Last_Element (Container : Map) return Element_Type is
begin
if Is_Empty (Container) then
raise Constraint_Error with "map is empty";
end if;
return Container.Nodes (Last (Container).Node).Element;
end Last_Element;
--------------
-- Last_Key --
--------------
function Last_Key (Container : Map) return Key_Type is
begin
if Is_Empty (Container) then
raise Constraint_Error with "map is empty";
end if;
return Container.Nodes (Last (Container).Node).Key;
end Last_Key;
--------------
-- Left_Son --
--------------
function Left_Son (Node : Node_Type) return Count_Type is
begin
return Node.Left;
end Left_Son;
------------
-- Length --
------------
function Length (Container : Map) return Count_Type is
begin
return Container.Length;
end Length;
----------
-- Move --
----------
procedure Move (Target : in out Map; Source : in out Map) is
NN : Tree_Types.Nodes_Type renames Source.Nodes;
X : Node_Access;
begin
if Target'Address = Source'Address then
return;
end if;
if Target.Capacity < Length (Source) then
raise Constraint_Error with -- ???
"Source length exceeds Target capacity";
end if;
Clear (Target);
loop
X := First (Source).Node;
exit when X = 0;
-- Here we insert a copy of the source element into the target, and
-- then delete the element from the source. Another possibility is
-- that delete it first (and hang onto its index), then insert it.
-- ???
Insert (Target, NN (X).Key, NN (X).Element); -- optimize???
Tree_Operations.Delete_Node_Sans_Free (Source, X);
Formal_Ordered_Maps.Free (Source, X);
end loop;
end Move;
----------
-- Next --
----------
procedure Next (Container : Map; Position : in out Cursor) is
begin
Position := Next (Container, Position);
end Next;
function Next (Container : Map; Position : Cursor) return Cursor is
begin
if Position = No_Element then
return No_Element;
end if;
if not Has_Element (Container, Position) then
raise Constraint_Error;
end if;
pragma Assert (Vet (Container, Position.Node),
"bad cursor in Next");
return (Node => Tree_Operations.Next (Container, Position.Node));
end Next;
-------------
-- Overlap --
-------------
function Overlap (Left, Right : Map) return Boolean is
begin
if Length (Left) = 0 or Length (Right) = 0 then
return False;
end if;
declare
L_Node : Count_Type := First (Left).Node;
R_Node : Count_Type := First (Right).Node;
L_Last : constant Count_Type := Next (Left, Last (Left).Node);
R_Last : constant Count_Type := Next (Right, Last (Right).Node);
begin
if Left'Address = Right'Address then
return True;
end if;
loop
if L_Node = L_Last
or else R_Node = R_Last
then
return False;
end if;
if Left.Nodes (L_Node).Key < Right.Nodes (R_Node).Key then
L_Node := Next (Left, L_Node);
elsif Right.Nodes (R_Node).Key < Left.Nodes (L_Node).Key then
R_Node := Next (Right, R_Node);
else
return True;
end if;
end loop;
end;
end Overlap;
------------
-- Parent --
------------
function Parent (Node : Node_Type) return Count_Type is
begin
return Node.Parent;
end Parent;
--------------
-- Previous --
--------------
procedure Previous (Container : Map; Position : in out Cursor) is
begin
Position := Previous (Container, Position);
end Previous;
function Previous (Container : Map; Position : Cursor) return Cursor is
begin
if Position = No_Element then
return No_Element;
end if;
if not Has_Element (Container, Position) then
raise Constraint_Error;
end if;
pragma Assert (Vet (Container, Position.Node),
"bad cursor in Previous");
declare
Node : constant Count_Type :=
Tree_Operations.Previous (Container, Position.Node);
begin
if Node = 0 then
return No_Element;
end if;
return (Node => Node);
end;
end Previous;
-------------
-- Replace --
-------------
procedure Replace
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type)
is
begin
declare
Node : constant Node_Access := Key_Ops.Find (Container, Key);
begin
if Node = 0 then
raise Constraint_Error with "key not in map";
end if;
declare
N : Node_Type renames Container.Nodes (Node);
begin
N.Key := Key;
N.Element := New_Item;
end;
end;
end Replace;
---------------------
-- Replace_Element --
---------------------
procedure Replace_Element
(Container : in out Map;
Position : Cursor;
New_Item : Element_Type)
is
begin
if not Has_Element (Container, Position) then
raise Constraint_Error with
"Position cursor of Replace_Element has no element";
end if;
pragma Assert (Vet (Container, Position.Node),
"Position cursor of Replace_Element is bad");
Container.Nodes (Position.Node).Element := New_Item;
end Replace_Element;
---------------
-- Right_Son --
---------------
function Right_Son (Node : Node_Type) return Count_Type is
begin
return Node.Right;
end Right_Son;
---------------
-- Set_Color --
---------------
procedure Set_Color (Node : in out Node_Type; Color : Color_Type) is
begin
Node.Color := Color;
end Set_Color;
--------------
-- Set_Left --
--------------
procedure Set_Left (Node : in out Node_Type; Left : Count_Type) is
begin
Node.Left := Left;
end Set_Left;
----------------
-- Set_Parent --
----------------
procedure Set_Parent (Node : in out Node_Type; Parent : Count_Type) is
begin
Node.Parent := Parent;
end Set_Parent;
---------------
-- Set_Right --
---------------
procedure Set_Right (Node : in out Node_Type; Right : Count_Type) is
begin
Node.Right := Right;
end Set_Right;
------------------
-- Strict_Equal --
------------------
function Strict_Equal (Left, Right : Map) return Boolean is
LNode : Count_Type := First (Left).Node;
RNode : Count_Type := First (Right).Node;
begin
if Length (Left) /= Length (Right) then
return False;
end if;
while LNode = RNode loop
if LNode = 0 then
return True;
end if;
if Left.Nodes (LNode).Element /= Right.Nodes (RNode).Element
or else Left.Nodes (LNode).Key /= Right.Nodes (RNode).Key
then
exit;
end if;
LNode := Next (Left, LNode);
RNode := Next (Right, RNode);
end loop;
return False;
end Strict_Equal;
end Ada.Containers.Formal_Ordered_Maps;
|
programs/oeis/186/A186357.asm | neoneye/loda | 22 | 4472 | <filename>programs/oeis/186/A186357.asm
; A186357: Adjusted joint rank sequence of (f(i)) and (g(j)) with f(i) after g(j) when f(i)=g(j), where f(i)=3i and g(j)=j(j+1)/2 (triangular number). Complement of A186357.
; 1,2,4,7,9,12,16,19,23,28,32,37,43,48,54,61,67,74,82,89,97,106,114,123,133,142,152,163,173,184,196,207,219,232,244,257,271,284,298,313,327,342,358,373,389,406,422,439,457,474,492,511,529,548,568,587,607,628,648,669,691,712,734,757,779,802,826,849,873,898,922,947,973,998,1024,1051,1077,1104,1132,1159,1187,1216,1244,1273,1303,1332,1362,1393,1423,1454
add $0,5
bin $0,2
sub $0,7
div $0,3
|
Definition/LogicalRelation/Substitution/Introductions/ProdBetaEta.agda | Vtec234/logrel-mltt | 0 | 10753 | {-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Substitution.Introductions.ProdBetaEta {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped as U hiding (wk)
open import Definition.Untyped.Properties
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.Typed.Weakening as T hiding (wk; wkTerm; wkEqTerm)
open import Definition.Typed.RedSteps
open import Definition.LogicalRelation
open import Definition.LogicalRelation.ShapeView
open import Definition.LogicalRelation.Irrelevance
open import Definition.LogicalRelation.Weakening
open import Definition.LogicalRelation.Properties
open import Definition.LogicalRelation.Application
open import Definition.LogicalRelation.Substitution
open import Definition.LogicalRelation.Substitution.Properties
open import Definition.LogicalRelation.Substitution.Reduction
open import Definition.LogicalRelation.Substitution.Conversion
open import Definition.LogicalRelation.Substitution.Reflexivity
open import Definition.LogicalRelation.Substitution.Introductions.Pi
open import Definition.LogicalRelation.Substitution.Introductions.SingleSubst
open import Definition.LogicalRelation.Substitution.Introductions.Prod
open import Definition.LogicalRelation.Substitution.Introductions.Fst
open import Definition.LogicalRelation.Substitution.Introductions.Snd
open import Tools.Product
import Tools.PropositionalEquality as PE
Σ-β₁ᵛ : ∀ {F G t u Γ l}
([Γ] : ⊩ᵛ Γ)
([F] : Γ ⊩ᵛ⟨ l ⟩ F / [Γ])
([G] : Γ ∙ F ⊩ᵛ⟨ l ⟩ G / [Γ] ∙ [F])
([t] : Γ ⊩ᵛ⟨ l ⟩ t ∷ F / [Γ] / [F])
([u] : Γ ⊩ᵛ⟨ l ⟩ u ∷ G [ t ] / [Γ] / substS {F} {G} [Γ] [F] [G] [t])
→ Γ ⊩ᵛ⟨ l ⟩ fst (prod t u) ≡ t ∷ F / [Γ] / [F]
Σ-β₁ᵛ {F} {G} {t} {u} {Γ} {l} [Γ] [F] [G] [t] [u] =
let [Gt] = substS {F} {G} {t} [Γ] [F] [G] [t]
fst⇒t : Γ ⊩ᵛ fst (prod t u) ⇒ t ∷ F / [Γ]
fst⇒t = (λ {Δ} {σ} ⊢Δ [σ] →
let ⊩σF = proj₁ ([F] ⊢Δ [σ])
⊢σF = escape ⊩σF
[Fσ] = liftSubstS {F = F} {σ = σ} [Γ] ⊢Δ [F] [σ]
⊩σG : Δ ∙ subst σ F ⊩⟨ l ⟩ subst (liftSubst σ) G
⊩σG = proj₁ ([G] (⊢Δ ∙ ⊢σF) [Fσ])
⊢σG = escape ⊩σG
⊩σt = proj₁ ([t] ⊢Δ [σ])
⊢σt = escapeTerm ⊩σF ⊩σt
⊩σGt₁ = proj₁ ([Gt] ⊢Δ [σ])
⊩σGt = irrelevance′ (singleSubstLift G t) ⊩σGt₁
⊩σu₁ = proj₁ ([u] ⊢Δ [σ])
⊩σu = irrelevanceTerm′ (singleSubstLift G t) ⊩σGt₁ ⊩σGt ⊩σu₁
⊢σu = escapeTerm ⊩σGt ⊩σu
in Σ-β₁ ⊢σF ⊢σG ⊢σt ⊢σu)
in proj₂ (redSubstTermᵛ {F} {fst (prod t u)} {t} [Γ] fst⇒t [F] [t])
Σ-β₂ᵛ : ∀ {F G t u Γ l}
([Γ] : ⊩ᵛ Γ)
([F] : Γ ⊩ᵛ⟨ l ⟩ F / [Γ])
([G] : Γ ∙ F ⊩ᵛ⟨ l ⟩ G / [Γ] ∙ [F])
([t] : Γ ⊩ᵛ⟨ l ⟩ t ∷ F / [Γ] / [F])
([u] : Γ ⊩ᵛ⟨ l ⟩ u ∷ G [ t ] / [Γ] / substS {F} {G} [Γ] [F] [G] [t])
→ Γ ⊩ᵛ⟨ l ⟩ snd (prod t u) ≡ u ∷ G [ fst (prod t u) ] / [Γ]
/ substS {F} {G} [Γ] [F] [G]
(fstᵛ {F} {G} {prod t u} [Γ] [F] [G]
(prodᵛ {F} {G} {t} {u} [Γ] [F] [G] [t] [u]))
Σ-β₂ᵛ {F} {G} {t} {u} {Γ} {l} [Γ] [F] [G] [t] [u] =
let [Gt] = substS {F} {G} {t} [Γ] [F] [G] [t]
[prod] = prodᵛ {F} {G} {t} {u} [Γ] [F] [G] [t] [u]
[fst] = fstᵛ {F} {G} {prod t u} [Γ] [F] [G] [prod]
[Gfst] = substS {F} {G} {fst (prod t u)} [Γ] [F] [G] [fst]
[fst≡t] = Σ-β₁ᵛ {F} {G} {t} {u} [Γ] [F] [G] [t] [u]
[Gfst≡Gt] = substSEq {F} {F} {G} {G} {fst (prod t u)} {t}
[Γ] [F] [F] (reflᵛ {F} [Γ] [F])
[G] [G] (reflᵛ {G} {Γ ∙ F} ([Γ] ∙ [F]) [G])
[fst] [t] [fst≡t]
[u]Gfst = conv₂ᵛ {u} {G [ fst (prod t u) ]} {G [ t ]}
[Γ] [Gfst] [Gt] [Gfst≡Gt] [u]
snd⇒t : Γ ⊩ᵛ snd (prod t u) ⇒ u ∷ G [ fst (prod t u) ] / [Γ]
snd⇒t = (λ {Δ} {σ} ⊢Δ [σ] →
let ⊩σF = proj₁ ([F] ⊢Δ [σ])
⊢σF = escape ⊩σF
[Fσ] = liftSubstS {F = F} {σ = σ} [Γ] ⊢Δ [F] [σ]
⊩σG : Δ ∙ subst σ F ⊩⟨ l ⟩ subst (liftSubst σ) G
⊩σG = proj₁ ([G] (⊢Δ ∙ ⊢σF) [Fσ])
⊢σG = escape ⊩σG
⊩σt = proj₁ ([t] ⊢Δ [σ])
⊢σt = escapeTerm ⊩σF ⊩σt
⊩σGt₁ = proj₁ ([Gt] ⊢Δ [σ])
⊩σGt = irrelevance′ (singleSubstLift G t) ⊩σGt₁
⊩σu₁ = proj₁ ([u] ⊢Δ [σ])
⊩σu = irrelevanceTerm′ (singleSubstLift G t) ⊩σGt₁ ⊩σGt ⊩σu₁
⊢σu = escapeTerm ⊩σGt ⊩σu
snd⇒t : Δ ⊢ _ ⇒ _ ∷ _
snd⇒t = Σ-β₂ ⊢σF ⊢σG ⊢σt ⊢σu
σGfst≡σGfst = PE.subst (λ x → Δ ⊢ x ≡ subst σ (G [ fst (prod t u) ]))
(singleSubstLift G (fst (prod t u)))
(refl (escape (proj₁ ([Gfst] ⊢Δ [σ]))))
in conv snd⇒t σGfst≡σGfst)
in proj₂ (redSubstTermᵛ {G [ fst (prod t u) ]} {snd (prod t u)} {u} [Γ] snd⇒t [Gfst] [u]Gfst)
Σ-η′ : ∀ {F G p r Γ l l′}
([F] : Γ ⊩⟨ l′ ⟩ F)
([Gfstp] : Γ ⊩⟨ l′ ⟩ G [ fst p ])
([ΣFG]₁ : Γ ⊩⟨ l ⟩B⟨ BΣ ⟩ Σ F ▹ G )
([p] : Γ ⊩⟨ l ⟩ p ∷ Σ F ▹ G / B-intr BΣ [ΣFG]₁)
([r] : Γ ⊩⟨ l ⟩ r ∷ Σ F ▹ G / B-intr BΣ [ΣFG]₁)
([fst≡] : Γ ⊩⟨ l′ ⟩ fst p ≡ fst r ∷ F / [F])
([snd≡] : Γ ⊩⟨ l′ ⟩ snd p ≡ snd r ∷ G [ fst p ] / [Gfstp])
→ Γ ⊩⟨ l ⟩ p ≡ r ∷ Σ F ▹ G / B-intr BΣ [ΣFG]₁
Σ-η′ {F} {G} {p} {r} {Γ} {l} {l′}
[F] [Gfstp]
[ΣFG]₁@(noemb (Bᵣ F₁ G₁ D ⊢F ⊢G A≡A [F]₁ [G]₁ G-ext))
[p]@(Σₜ p′ dₚ p′Prod p′≅p′ wk[fstp′] wk[sndp′])
[r]@(Σₜ r′ dᵣ r′Prod r′≅r′ wk[fstr′] wk[sndr′])
[fst≡]
[snd≡]
with B-PE-injectivity BΣ (whnfRed* (red D) Σₙ)
... | PE.refl , PE.refl =
let [ΣFG] = B-intr BΣ [ΣFG]₁
⊢Γ = wf ⊢F
wk[F] = [F]₁ id ⊢Γ
wk[Gfstp′] = [G]₁ id ⊢Γ wk[fstp′]
fstp⇒* : Γ ⊢ fst p ⇒* fst p′ ∷ U.wk id F
fstp⇒* = PE.subst (λ x → Γ ⊢ _ ⇒* _ ∷ x)
(PE.sym (wk-id F))
(fst-subst* ⊢F ⊢G (redₜ dₚ))
fstr⇒* = PE.subst (λ x → Γ ⊢ _ ⇒* _ ∷ x)
(PE.sym (wk-id F))
(fst-subst* ⊢F ⊢G (redₜ dᵣ))
--wk[fstp≡] : Γ ⊩⟨ l ⟩ fst p ≡ fst p′ ∷ U.wk id F / wk[F]
wk[fstp] , wk[fstp≡] = redSubst*Term fstp⇒* wk[F] wk[fstp′]
wk[fstr] , wk[fstr≡] = redSubst*Term fstr⇒* wk[F] wk[fstr′]
wk[fst≡] = irrelevanceEqTerm′ (PE.sym (wk-id F))
[F] wk[F]
[fst≡]
wk[fst′≡] : Γ ⊩⟨ l ⟩ fst p′ ≡ fst r′ ∷ U.wk id F / wk[F]
wk[fst′≡] = transEqTerm wk[F]
(symEqTerm wk[F] wk[fstp≡])
(transEqTerm wk[F] wk[fst≡] wk[fstr≡])
[p′] : Γ ⊩⟨ l ⟩ p′ ∷ Σ F ▹ G / [ΣFG]
[p′] = Σₜ p′ (idRedTerm:*: (⊢u-redₜ dₚ)) p′Prod p′≅p′ wk[fstp′] wk[sndp′]
[r′] = Σₜ r′ (idRedTerm:*: (⊢u-redₜ dᵣ)) r′Prod r′≅r′ wk[fstr′] wk[sndr′]
sndp⇒*₁ : Γ ⊢ snd p ⇒* snd p′ ∷ G [ fst p ]
sndp⇒*₁ = snd-subst* [F] [ΣFG] [p′] (redₜ dₚ)
sndr⇒*₁ = snd-subst* [F] [ΣFG] [r′] (redₜ dᵣ)
wk[Gfstp] = [G]₁ id ⊢Γ wk[fstp]
wk[Gfstr] = [G]₁ id ⊢Γ wk[fstr]
[Gfstr] = irrelevance′ (PE.cong (λ x → x [ fst r ]) (wk-lift-id G)) wk[Gfstr]
wk[Gfstr′] = [G]₁ id ⊢Γ wk[fstr′]
[Gfstp≡wkGfstp′] : Γ ⊩⟨ l′ ⟩ G [ fst p ] ≡ U.wk (lift id) G [ fst p′ ] / [Gfstp]
[Gfstp≡wkGfstp′] = irrelevanceEq′ (PE.cong (λ x → x [ fst p ]) (wk-lift-id G))
([G]₁ id ⊢Γ wk[fstp]) [Gfstp]
(G-ext id ⊢Γ wk[fstp] wk[fstp′] wk[fstp≡])
[Gfstr≡Gfstp] : Γ ⊩⟨ _ ⟩ G [ fst r ] ≡ G [ fst p ] / [Gfstr]
[Gfstr≡Gfstp] = irrelevanceEq″ (PE.cong (λ x → x [ fst r ]) (wk-lift-id G))
(PE.cong (λ x → x [ fst p ]) (wk-lift-id G))
wk[Gfstr] [Gfstr]
(symEq wk[Gfstp] wk[Gfstr]
(G-ext id ⊢Γ wk[fstp] wk[fstr] wk[fst≡]))
[Gfstr≡wkGfstp′] : Γ ⊩⟨ l ⟩ G [ fst r ] ≡ U.wk (lift id) G [ fst p′ ] / [Gfstr]
[Gfstr≡wkGfstp′] = transEq [Gfstr] [Gfstp] wk[Gfstp′]
[Gfstr≡Gfstp] [Gfstp≡wkGfstp′]
[wkGfstr′≡wkGfstp′] : Γ ⊩⟨ l ⟩ U.wk (lift id) G [ fst r′ ] ≡ U.wk (lift id) G [ fst p′ ] / wk[Gfstr′]
[wkGfstr′≡wkGfstp′] = G-ext id ⊢Γ wk[fstr′] wk[fstp′] (symEqTerm wk[F] wk[fst′≡])
sndp⇒* : Γ ⊢ snd p ⇒* snd p′ ∷ U.wk (lift id) G [ fst p′ ]
sndp⇒* = conv* sndp⇒*₁ (≅-eq (escapeEq [Gfstp] [Gfstp≡wkGfstp′]))
sndr⇒* = conv* sndr⇒*₁ (≅-eq (escapeEq [Gfstr] [Gfstr≡wkGfstp′]))
wk[sndp≡] : Γ ⊩⟨ l ⟩ snd p ≡ snd p′ ∷ U.wk (lift id) G [ fst p′ ] / wk[Gfstp′]
wk[sndp≡] = proj₂ (redSubst*Term sndp⇒* wk[Gfstp′] wk[sndp′])
wk[sndr≡] = proj₂ (redSubst*Term sndr⇒* wk[Gfstp′]
(convTerm₁ wk[Gfstr′] wk[Gfstp′]
[wkGfstr′≡wkGfstp′]
wk[sndr′]))
wk[snd≡] : Γ ⊩⟨ l ⟩ snd p ≡ snd r ∷ U.wk (lift id) G [ fst p′ ] / wk[Gfstp′]
wk[snd≡] = convEqTerm₁ [Gfstp] wk[Gfstp′] [Gfstp≡wkGfstp′] [snd≡]
wk[snd′≡] : Γ ⊩⟨ l ⟩ snd p′ ≡ snd r′ ∷ U.wk (lift id) G [ fst p′ ] / wk[Gfstp′]
wk[snd′≡] = transEqTerm wk[Gfstp′]
(symEqTerm wk[Gfstp′] wk[sndp≡])
(transEqTerm wk[Gfstp′] wk[snd≡] wk[sndr≡])
p′≅r′ : Γ ⊢ p′ ≅ r′ ∷ Σ F ▹ G
p′≅r′ = ≅-Σ-η ⊢F ⊢G (⊢u-redₜ dₚ) (⊢u-redₜ dᵣ)
p′Prod r′Prod
(PE.subst (λ x → Γ ⊢ _ ≅ _ ∷ x)
(wk-id F)
(escapeTermEq wk[F] wk[fst′≡]))
(PE.subst (λ x → Γ ⊢ _ ≅ _ ∷ x [ fst p′ ])
(wk-lift-id G)
(escapeTermEq wk[Gfstp′] wk[snd′≡]))
in Σₜ₌ p′ r′ dₚ dᵣ p′Prod r′Prod
p′≅r′ [p] [r]
wk[fstp′]
wk[fstr′]
wk[fst′≡]
wk[snd′≡]
Σ-η′ [F] [Gfst] (emb 0<1 x) = Σ-η′ [F] [Gfst] x
Σ-η″ : ∀ {F G p r Γ l}
([F] : Γ ⊩⟨ l ⟩ F)
([Gfst] : Γ ⊩⟨ l ⟩ G [ fst p ])
([ΣFG] : Γ ⊩⟨ l ⟩ Σ F ▹ G)
([p] : Γ ⊩⟨ l ⟩ p ∷ Σ F ▹ G / [ΣFG])
([r] : Γ ⊩⟨ l ⟩ r ∷ Σ F ▹ G / [ΣFG])
([fst≡] : Γ ⊩⟨ l ⟩ fst p ≡ fst r ∷ F / [F])
([snd≡] : Γ ⊩⟨ l ⟩ snd p ≡ snd r ∷ G [ fst p ] / [Gfst])
→ Γ ⊩⟨ l ⟩ p ≡ r ∷ Σ F ▹ G / [ΣFG]
Σ-η″ {F} {G} {t} {Γ} {l} [F] [Gfst] [ΣFG] [p] [r] [fst≡] [snd≡] =
let [ΣFG]′ = B-intr BΣ (B-elim BΣ [ΣFG])
[p]′ = irrelevanceTerm [ΣFG] [ΣFG]′ [p]
[r]′ = irrelevanceTerm [ΣFG] [ΣFG]′ [r]
[p≡]′ = Σ-η′ [F] [Gfst] (B-elim BΣ [ΣFG]) [p]′ [r]′ [fst≡] [snd≡]
in irrelevanceEqTerm [ΣFG]′ [ΣFG] [p≡]′
Σ-ηᵛ : ∀ {F G p r Γ l}
([Γ] : ⊩ᵛ Γ)
([F] : Γ ⊩ᵛ⟨ l ⟩ F / [Γ])
([G] : Γ ∙ F ⊩ᵛ⟨ l ⟩ G / [Γ] ∙ [F])
→ let [ΣFG] = Σᵛ {F} {G} [Γ] [F] [G] in
([p] : Γ ⊩ᵛ⟨ l ⟩ p ∷ Σ F ▹ G / [Γ] / [ΣFG])
([r] : Γ ⊩ᵛ⟨ l ⟩ r ∷ Σ F ▹ G / [Γ] / [ΣFG])
([fst≡] : Γ ⊩ᵛ⟨ l ⟩ fst p ≡ fst r ∷ F / [Γ] / [F])
→ let [Gfst] = substS {F} {G} [Γ] [F] [G] (fstᵛ {F} {G} {p} [Γ] [F] [G] [p]) in
([snd≡] : Γ ⊩ᵛ⟨ l ⟩ snd p ≡ snd r ∷ G [ fst p ] / [Γ] / [Gfst])
→ Γ ⊩ᵛ⟨ l ⟩ p ≡ r ∷ Σ F ▹ G / [Γ] / [ΣFG]
Σ-ηᵛ {F} {G} {p} {r} {Γ} {l} [Γ] [F] [G] [p] [r] [fst≡] [snd≡] {Δ} {σ} ⊢Δ [σ] =
let [ΣFG] = Σᵛ {F} {G} [Γ] [F] [G]
[Gfst] = substS {F} {G} [Γ] [F] [G] (fstᵛ {F} {G} {p} [Γ] [F] [G] [p])
⊩σF = proj₁ ([F] ⊢Δ [σ])
⊩σGfst₁ = proj₁ ([Gfst] ⊢Δ [σ])
⊩σGfst = irrelevance′ (singleSubstLift G (fst p)) ⊩σGfst₁
⊩σΣFG = proj₁ ([ΣFG] ⊢Δ [σ])
⊩σp = proj₁ ([p] ⊢Δ [σ])
⊩σr = proj₁ ([r] ⊢Δ [σ])
σfst≡ = [fst≡] ⊢Δ [σ]
σsnd≡₁ = [snd≡] ⊢Δ [σ]
σsnd≡ = irrelevanceEqTerm′ (singleSubstLift G (fst p)) ⊩σGfst₁ ⊩σGfst σsnd≡₁
in Σ-η″ ⊩σF ⊩σGfst ⊩σΣFG ⊩σp ⊩σr σfst≡ σsnd≡
|
oeis/035/A035011.asm | neoneye/loda-programs | 11 | 175700 | <reponame>neoneye/loda-programs
; A035011: A006318(n) - 1.
; Submitted by <NAME>
; 0,1,5,21,89,393,1805,8557,41585,206097,1037717,5293445,27297737,142078745,745387037,3937603037,20927156705,111818026017,600318853925,3236724317173,17518619320889,95149655201961,518431875418925,2832923350929741,15521467648875089,85249942588971313,469286147871837365,2588758890960637797,14308406109097843625,79228031819993134649,439442782615614361661,2441263009246175852477,13582285614213903189953,75672545337796460900417,422158527806921249683013,2358045034996817096518613,13186762229969911326195737
mov $1,1
mov $2,1
mov $3,$0
lpb $3
mul $1,$0
add $3,1
mul $2,$3
sub $3,1
mul $2,$3
div $2,2
add $1,$2
sub $3,1
max $3,1
add $0,$3
lpe
mul $1,$0
div $1,$2
mov $0,$1
|
oeis/023/A023961.asm | neoneye/loda-programs | 11 | 84614 | <gh_stars>10-100
; A023961: First digit after decimal point of square root of n.
; Submitted by <NAME>
; 0,4,7,0,2,4,6,8,0,1,3,4,6,7,8,0,1,2,3,4,5,6,7,8,0,0,1,2,3,4,5,6,7,8,9,0,0,1,2,3,4,4,5,6,7,7,8,9,0,0,1,2,2,3,4,4,5,6,6,7,8,8,9,0,0,1,1,2,3,3,4,4,5,6,6,7,7,8,8,9,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,0
add $0,1
mul $0,100
mov $2,$0
lpb $0
mov $0,$2
add $3,1
div $0,$3
sub $0,$3
lpe
mov $0,$3
mod $0,10
|
sound/musicasm/Invincibility.asm | NatsumiFox/Sonic-3-93-Nov-03 | 7 | 102003 | Invincibility_Header:
sHeaderInit ; Z80 offset is $CA38
sHeaderPatch Invincibility_Patches
sHeaderCh $06, $03
sHeaderTempo $01, $2C
sHeaderDAC Invincibility_DAC
sHeaderFM Invincibility_FM1, $18, $14
sHeaderFM Invincibility_FM2, $00, $0B
sHeaderFM Invincibility_FM3, $18, $1E
sHeaderFM Invincibility_FM4, $00, $1E
sHeaderFM Invincibility_FM5, $00, $1E
sHeaderPSG Invincibility_PSG1, $F4, $06, $00, v00
sHeaderPSG Invincibility_PSG2, $F4, $06, $00, v00
sHeaderPSG Invincibility_PSG3, $3B, $02, $00, v00
Invincibility_FM1:
sPatFM $00
ssModZ80 $14, $01, $06, $06
dc.b nB3, $04, nRst, nB3, $08, nC4, $04, nRst
dc.b nC4, $08, nD4, $08, nRst, nD4, $04, nRst
dc.b nBb3, $04, sHold, nB3, $08, nRst, $04, nB3
dc.b $08, nC4, $04, nRst, nD4, $0C, nRst, $04
dc.b nD4, nRst, nD4, $0C, nRst, $04, nF4, $0C
dc.b nRst, $04, nF4, $0C, nRst, $04, nF4, $0C
dc.b nRst, $04, nF4, $0C, nRst, $04
saVolFM $FE
Invincibility_Loop1:
dc.b nF4, $03, nRst, $05
sLoop $00, $08, Invincibility_Loop1
saVolFM $02
dc.b nB3, $04, nRst, nB3, $08, nC4, $04, nRst
dc.b nC4, $08, nD4, $08, nRst, nD4, $04, nRst
dc.b nBb3, $04, sHold, nB3, $08, nRst, $04, nB3
dc.b $08, nC4, $04, nRst, nD4, $0C, nRst, $04
dc.b nD4, nRst, nD4, $0C, nRst, $04, nF4, $0C
dc.b nRst, $04, nF4, $0C, nRst, $04, nF4, $0C
dc.b nRst, $04, nF4, $0C, nRst, $04
saVolFM $FE
Invincibility_Loop2:
dc.b nA4, $03, nRst, $05
sLoop $00, $08, Invincibility_Loop2
saVolFM $02
sJump Invincibility_FM1
dc.b $F2 ; Unused
Invincibility_FM2:
sPatFM $01
dc.b nG2, $04, nRst, nG2, nRst, nG2, nRst, nG2
dc.b nRst, nD2, $0C, nRst, $04, nD2, nRst, nG2
dc.b $08, nRst, $08, nG2, $04, nRst, nG2, nRst
dc.b nD2, $08, nRst, nD2, $04, nRst, nD2, $0C
dc.b nRst, $04
Invincibility_Loop3:
dc.b nF2, $03, nRst, $05
sLoop $00, $10, Invincibility_Loop3
dc.b nG2, $04, nRst, nG2, nRst, nG2, nRst, nG2
dc.b nRst, nD2, $0C, nRst, $04, nD2, nRst, nG2
dc.b $08, nRst, $08, nG2, $04, nRst, nG2, nRst
dc.b nD2, $08, nRst, nD2, $04, nRst, nD2, $0C
dc.b nRst, $04
Invincibility_Loop4:
dc.b nF2, $03, nRst, $05
sLoop $00, $08, Invincibility_Loop4
Invincibility_Loop5:
dc.b nA2, $03, nRst, $05
sLoop $00, $08, Invincibility_Loop5
sJump Invincibility_FM2
dc.b $F2 ; Unused
Invincibility_FM3:
sPatFM $00
ssModZ80 $15, $01, $06, $06
dc.b nRst, $03
ssDetune $03
Invincibility_Jump1:
dc.b nG3, $04, nRst, nG3, $08, nA3, $04, nRst
dc.b nA3, $08, nB3, $08, nRst, nB3, $04, nRst
dc.b nFs3, $04, sHold, nG3, $08, nRst, $04, nG3
dc.b $08, nA3, $04, nRst, nB3, $0C, nRst, $04
dc.b nB3, nRst, nB3, $0C, nRst, $04, nC4, $0C
dc.b nRst, $04, nC4, $0C, nRst, $04, nC4, $0C
dc.b nRst, $04, nC4, $0C, nRst, $04
saVolFM $FE
Invincibility_Loop6:
dc.b nC4, $03, nRst, $05
sLoop $00, $08, Invincibility_Loop6
saVolFM $02
dc.b nG3, $04, nRst, nG3, $08, nA3, $04, nRst
dc.b nA3, $08, nB3, $08, nRst, nB3, $04, nRst
dc.b nFs3, $04, sHold, nG3, $08, nRst, $04, nG3
dc.b $08, nA3, $04, nRst, nB3, $0C, nRst, $04
dc.b nB3, nRst, nB3, $0C, nRst, $04, nC4, $0C
dc.b nRst, $04, nC4, $0C, nRst, $04, nC4, $0C
dc.b nRst, $04, nC4, $0C, nRst, $04
saVolFM $FE
Invincibility_Loop7:
dc.b nA4, $03, nRst, $05
sLoop $00, $08, Invincibility_Loop7
saVolFM $02
sJump Invincibility_Jump1
dc.b $F2 ; Unused
Invincibility_FM4:
sPatFM $02
sPan spRight
Invincibility_Loop8:
dc.b nG5, $04, nD5
sLoop $00, $10, Invincibility_Loop8
Invincibility_Loop9:
dc.b nA5, $04, nF5
sLoop $00, $10, Invincibility_Loop9
Invincibility_Loop10:
dc.b nG5, $04, nD5
sLoop $00, $10, Invincibility_Loop10
Invincibility_Loop11:
dc.b nA5, $04, nF5
sLoop $00, $08, Invincibility_Loop11
Invincibility_Loop12:
dc.b nC6, $04, nF5
sLoop $00, $08, Invincibility_Loop12
sJump Invincibility_Loop8
dc.b $F2 ; Unused
Invincibility_FM5:
sPatFM $02
sPan spLeft
Invincibility_Loop13:
dc.b nB4, $04, nG4
sLoop $00, $10, Invincibility_Loop13
Invincibility_Loop14:
dc.b nC5, $04, nA4
sLoop $00, $10, Invincibility_Loop14
Invincibility_Loop15:
dc.b nB4, $04, nG4
sLoop $00, $10, Invincibility_Loop15
Invincibility_Loop16:
dc.b nC5, $04, nA4
sLoop $00, $08, Invincibility_Loop16
Invincibility_Loop17:
dc.b nF5, $04, nA4
sLoop $00, $08, Invincibility_Loop17
sJump Invincibility_Loop13
dc.b $F2 ; Unused
Invincibility_DAC:
dc.b dKick, $10, dKick, dKick, dKick
sJump Invincibility_DAC
dc.b $F2 ; Unused
Invincibility_PSG1:
sVolEnvPSG v0A
dc.b nRst, $02
sJump Invincibility_Loop8
dc.b $F2 ; Unused
Invincibility_PSG2:
sVolEnvPSG v0A
dc.b nRst, $02
sJump Invincibility_Loop13
dc.b $F2 ; Unused
Invincibility_PSG3:
sStop
Invincibility_Patches:
; Patch $00
; $3D
; $01, $00, $04, $03, $1F, $1F, $1F, $1F
; $10, $06, $06, $06, $01, $06, $06, $06
; $35, $1A, $18, $1A, $12, $82, $82, $80
spAlgorithm $05
spFeedback $07
spDetune $00, $00, $00, $00
spMultiple $01, $04, $00, $03
spRateScale $00, $00, $00, $00
spAttackRt $1F, $1F, $1F, $1F
spAmpMod $00, $00, $00, $00
spSustainRt $10, $06, $06, $06
spSustainLv $03, $01, $01, $01
spDecayRt $01, $06, $06, $06
spReleaseRt $05, $08, $0A, $0A
spTotalLv $12, $02, $02, $00
; Patch $01
; $3A
; $01, $02, $01, $01, $1F, $5F, $5F, $5F
; $10, $11, $09, $09, $07, $00, $00, $00
; $CF, $FF, $FF, $FF, $1C, $22, $18, $80
spAlgorithm $02
spFeedback $07
spDetune $00, $00, $00, $00
spMultiple $01, $01, $02, $01
spRateScale $00, $01, $01, $01
spAttackRt $1F, $1F, $1F, $1F
spAmpMod $00, $00, $00, $00
spSustainRt $10, $09, $11, $09
spSustainLv $0C, $0F, $0F, $0F
spDecayRt $07, $00, $00, $00
spReleaseRt $0F, $0F, $0F, $0F
spTotalLv $1C, $18, $22, $00
; Patch $02
; $3D
; $01, $01, $01, $01, $94, $19, $19, $19
; $0F, $0D, $0D, $0D, $07, $04, $04, $04
; $25, $1A, $1A, $1A, $15, $80, $80, $80
spAlgorithm $05
spFeedback $07
spDetune $00, $00, $00, $00
spMultiple $01, $01, $01, $01
spRateScale $02, $00, $00, $00
spAttackRt $14, $19, $19, $19
spAmpMod $00, $00, $00, $00
spSustainRt $0F, $0D, $0D, $0D
spSustainLv $02, $01, $01, $01
spDecayRt $07, $04, $04, $04
spReleaseRt $05, $0A, $0A, $0A
spTotalLv $15, $00, $00, $00
|
Transynther/x86/_processed/NC/_st_zr_/i7-7700_9_0xca_notsx.log_21829_945.asm | ljhsiun2/medusa | 9 | 28205 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x17219, %r8
nop
nop
nop
nop
xor %rdx, %rdx
mov $0x6162636465666768, %r9
movq %r9, %xmm1
and $0xffffffffffffffc0, %r8
movaps %xmm1, (%r8)
nop
nop
add $38735, %r9
lea addresses_D_ht+0x99, %rsi
lea addresses_UC_ht+0xcfd9, %rdi
clflush (%rsi)
nop
sub %r9, %r9
mov $9, %rcx
rep movsb
nop
nop
sub $33653, %r9
lea addresses_normal_ht+0x1cc19, %rdx
nop
nop
nop
nop
nop
sub %rbp, %rbp
movb (%rdx), %r9b
nop
nop
nop
xor $34125, %rbp
lea addresses_UC_ht+0x141d9, %r8
nop
nop
xor %rdi, %rdi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm1
movups %xmm1, (%r8)
xor $2927, %rdx
lea addresses_A_ht+0xff19, %rsi
nop
nop
nop
nop
nop
sub %r8, %r8
movb (%rsi), %r9b
and %rdx, %rdx
lea addresses_WT_ht+0x1c999, %rdx
nop
nop
nop
nop
sub $37569, %rdi
mov (%rdx), %si
nop
nop
nop
nop
nop
sub $56855, %rcx
lea addresses_UC_ht+0x1b319, %rbp
inc %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm5
movups %xmm5, (%rbp)
nop
nop
dec %rcx
lea addresses_WT_ht+0x7419, %rcx
nop
nop
xor $63847, %rsi
movb (%rcx), %dl
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0x1a019, %rdx
nop
nop
nop
nop
nop
and $18141, %rdi
mov $0x6162636465666768, %r8
movq %r8, (%rdx)
nop
nop
add $47880, %rsi
lea addresses_WT_ht+0x14425, %r9
nop
and $28329, %r8
movw $0x6162, (%r9)
add %r9, %r9
lea addresses_WC_ht+0x4219, %rcx
nop
nop
nop
nop
nop
cmp $10449, %rdi
mov (%rcx), %r8d
nop
cmp $27041, %rbp
lea addresses_WT_ht+0x2c69, %rsi
lea addresses_A_ht+0x999, %rdi
clflush (%rsi)
add $53963, %r12
mov $3, %rcx
rep movsb
nop
nop
nop
nop
dec %r9
lea addresses_WT_ht+0x14cb9, %r8
nop
nop
nop
nop
cmp $62110, %r12
movl $0x61626364, (%r8)
nop
nop
nop
xor $45975, %rbp
lea addresses_WC_ht+0x5369, %rsi
lea addresses_A_ht+0xc6a9, %rdi
nop
nop
nop
nop
dec %rbp
mov $12, %rcx
rep movsq
nop
nop
xor $3781, %r8
lea addresses_D_ht+0xf019, %r9
xor %rcx, %rcx
vmovups (%r9), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %rdx
nop
nop
nop
cmp %rbp, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_D+0x19819, %rdi
nop
nop
nop
nop
add $22835, %r10
movw $0x5152, (%rdi)
sub %r12, %r12
// Store
lea addresses_WT+0xefed, %r15
nop
nop
xor $5696, %r12
movb $0x51, (%r15)
nop
sub %r10, %r10
// REPMOV
lea addresses_PSE+0x12481, %rsi
lea addresses_UC+0x2419, %rdi
nop
nop
nop
nop
sub $11988, %rbx
mov $28, %rcx
rep movsl
nop
nop
nop
nop
nop
sub $49405, %r15
// Store
lea addresses_WT+0xc2d9, %r12
nop
nop
nop
cmp $11, %rsi
movb $0x51, (%r12)
nop
nop
nop
nop
cmp %rbx, %rbx
// Store
lea addresses_RW+0x1a319, %rbx
nop
cmp %rcx, %rcx
movb $0x51, (%rbx)
add %rdi, %rdi
// Faulty Load
mov $0x6d5ec0000000419, %r15
nop
nop
nop
nop
cmp $14836, %rsi
movups (%r15), %xmm5
vpextrq $1, %xmm5, %r10
lea oracles, %rbx
and $0xff, %r10
shlq $12, %r10
mov (%rbx,%r10,1), %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_PSE'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_UC'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': True, 'AVXalign': True, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 9, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'00': 21551, '33': 278}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00
*/
|
unicode/unicode16/classify.g4 | augustand/grammars-v4 | 0 | 427 | /** classify16.g4
Automatically generated Unicode 9.0.0 codepoint classification grammar.
Generated by "UniGrammar.py".
Author: <NAME> (<EMAIL>)
Date: 2016-11-11T15:29:54.400898
Legal: Copyright(c) <NAME>, All Rights Reserved
License:GPL 3.0
Rules are generated by extracting from:
local/UnicodeData.txt
local/PropList.txt
acquired from
site: ftp://ftp.unicode.org/Public/
*/
grammar classify;
codepoint:
CLASSIFY___ // Error
| CLASSIFY_Cc // Control
| CLASSIFY_Cf // Format
| CLASSIFY_Cn // Unassigned
| CLASSIFY_Co // Private_Use
| CLASSIFY_Cs // Surrogate
| CLASSIFY_Ll // Lowercase_Letter
| CLASSIFY_Lm // Modifier_Letter
| CLASSIFY_Lo // Other_Letter
| CLASSIFY_Lt // Titlecase_Letter
| CLASSIFY_Lu // Uppercase_Letter
| CLASSIFY_Mc // Spacing_Mark
| CLASSIFY_Me // Enclosing_Mark
| CLASSIFY_Mn // Nonspacing_Mark
| CLASSIFY_Nd // Decimal_Number
| CLASSIFY_Nl // Letter_Number
| CLASSIFY_No // Other_Number
| CLASSIFY_Pc // Connector_Punctuation
| CLASSIFY_Pd // Dash_Punctuation
| CLASSIFY_Pe // Close_Punctuation
| CLASSIFY_Pf // Final_Punctuation
| CLASSIFY_Pi // Initial_Punctuation
| CLASSIFY_Po // Other_Punctuation
| CLASSIFY_Ps // Open_Punctuation
| CLASSIFY_Sc // Currency_Symbol
| CLASSIFY_Sk // Modifier_Symbol
| CLASSIFY_Sm // Math_Symbol
| CLASSIFY_So // Other_Symbol
| CLASSIFY_Zl // Line_Separator
| CLASSIFY_Zp // Paragraph_Separator
| CLASSIFY_Zs // Space_Separator
;
CLASSIFY___:
'\u0378'..'\u037a' // Greek_and_Coptic
| '\u0380'..'\u0384' // Greek_and_Coptic
| '\u038b' // Greek_and_Coptic
| '\u038d' // Greek_and_Coptic
| '\u03a2' // Greek_and_Coptic
| '\u0530' // Armenian
| '\u0557'..'\u0559' // Armenian
| '\u0560' // Armenian
| '\u0588' // Armenian
| '\u058b'..'\u058d' // Armenian
| '\u0590' // Hebrew
| '\u05c8'..'\u05d0' // Hebrew
| '\u05eb'..'\u05f0' // Hebrew
| '\u05f5'..'\u0600' // Hebrew
| '\u061d' // Arabic
| '\u070e' // Syriac
| '\u074b'..'\u074d' // Syriac
| '\u07b2'..'\u07c0' // Thaana
| '\u07fb'..'\u0800' // NKo
| '\u082e'..'\u0830' // Samaritan
| '\u083f' // (Absent from Blocks.txt)
| '\u085c'..'\u085e' // Mandaic
| '\u085f'..'\u08a0' // (Absent from Blocks.txt)
| '\u08b5' // Arabic_Extended-A
| '\u08be'..'\u08d4' // Arabic_Extended-A
| '\u0984' // Bengali
| '\u098d'..'\u098f' // Bengali
| '\u0991'..'\u0993' // Bengali
| '\u09a9' // Bengali
| '\u09b1' // Bengali
| '\u09b3'..'\u09b6' // Bengali
| '\u09ba'..'\u09bc' // Bengali
| '\u09c5'..'\u09c7' // Bengali
| '\u09c9'..'\u09cb' // Bengali
| '\u09cf'..'\u09d7' // Bengali
| '\u09d8'..'\u09dc' // Bengali
| '\u09de' // Bengali
| '\u09e4'..'\u09e6' // Bengali
| '\u09fc'..'\u0a01' // Bengali
| '\u0a04' // Gurmukhi
| '\u0a0b'..'\u0a0f' // Gurmukhi
| '\u0a11'..'\u0a13' // Gurmukhi
| '\u0a29' // Gurmukhi
| '\u0a31' // Gurmukhi
| '\u0a34' // Gurmukhi
| '\u0a37' // Gurmukhi
| '\u0a3a'..'\u0a3c' // Gurmukhi
| '\u0a3d' // Gurmukhi
| '\u0a43'..'\u0a47' // Gurmukhi
| '\u0a49'..'\u0a4b' // Gurmukhi
| '\u0a4e'..'\u0a51' // Gurmukhi
| '\u0a52'..'\u0a59' // Gurmukhi
| '\u0a5d' // Gurmukhi
| '\u0a5f'..'\u0a66' // Gurmukhi
| '\u0a76'..'\u0a81' // Gurmukhi
| '\u0a84' // Gujarati
| '\u0a8e' // Gujarati
| '\u0a92' // Gujarati
| '\u0aa9' // Gujarati
| '\u0ab1' // Gujarati
| '\u0ab4' // Gujarati
| '\u0aba'..'\u0abc' // Gujarati
| '\u0ac6' // Gujarati
| '\u0aca' // Gujarati
| '\u0ace'..'\u0ad0' // Gujarati
| '\u0ad1'..'\u0ae0' // Gujarati
| '\u0ae4'..'\u0ae6' // Gujarati
| '\u0af2'..'\u0af9' // Gujarati
| '\u0afa'..'\u0b01' // Gujarati
| '\u0b04' // Oriya
| '\u0b0d'..'\u0b0f' // Oriya
| '\u0b11'..'\u0b13' // Oriya
| '\u0b29' // Oriya
| '\u0b31' // Oriya
| '\u0b34' // Oriya
| '\u0b3a'..'\u0b3c' // Oriya
| '\u0b45'..'\u0b47' // Oriya
| '\u0b49'..'\u0b4b' // Oriya
| '\u0b4e'..'\u0b56' // Oriya
| '\u0b58'..'\u0b5c' // Oriya
| '\u0b5e' // Oriya
| '\u0b64'..'\u0b66' // Oriya
| '\u0b78'..'\u0b82' // Oriya
| '\u0b84' // Tamil
| '\u0b8b'..'\u0b8e' // Tamil
| '\u0b91' // Tamil
| '\u0b96'..'\u0b99' // Tamil
| '\u0b9b' // Tamil
| '\u0b9d' // Tamil
| '\u0ba0'..'\u0ba3' // Tamil
| '\u0ba5'..'\u0ba8' // Tamil
| '\u0bab'..'\u0bae' // Tamil
| '\u0bba'..'\u0bbe' // Tamil
| '\u0bc3'..'\u0bc6' // Tamil
| '\u0bc9' // Tamil
| '\u0bce'..'\u0bd0' // Tamil
| '\u0bd1'..'\u0bd7' // Tamil
| '\u0bd8'..'\u0be6' // Tamil
| '\u0bfb'..'\u0c00' // Tamil
| '\u0c04' // Telugu
| '\u0c0d' // Telugu
| '\u0c11' // Telugu
| '\u0c29' // Telugu
| '\u0c3a'..'\u0c3d' // Telugu
| '\u0c45' // Telugu
| '\u0c49' // Telugu
| '\u0c4e'..'\u0c55' // Telugu
| '\u0c57' // Telugu
| '\u0c5b'..'\u0c60' // Telugu
| '\u0c64'..'\u0c66' // Telugu
| '\u0c70'..'\u0c78' // Telugu
| '\u0c84' // Kannada
| '\u0c8d' // Kannada
| '\u0c91' // Kannada
| '\u0ca9' // Kannada
| '\u0cb4' // Kannada
| '\u0cba'..'\u0cbc' // Kannada
| '\u0cc5' // Kannada
| '\u0cc9' // Kannada
| '\u0cce'..'\u0cd5' // Kannada
| '\u0cd7'..'\u0cde' // Kannada
| '\u0cdf' // Kannada
| '\u0ce4'..'\u0ce6' // Kannada
| '\u0cf0' // Kannada
| '\u0cf3'..'\u0d01' // Kannada
| '\u0d04' // Malayalam
| '\u0d0d' // Malayalam
| '\u0d11' // Malayalam
| '\u0d3b'..'\u0d3d' // Malayalam
| '\u0d45' // Malayalam
| '\u0d49' // Malayalam
| '\u0d50'..'\u0d54' // Malayalam
| '\u0d64'..'\u0d66' // Malayalam
| '\u0d80'..'\u0d82' // Sinhala
| '\u0d84' // Sinhala
| '\u0d97'..'\u0d9a' // Sinhala
| '\u0db2' // Sinhala
| '\u0dbc' // Sinhala
| '\u0dbe'..'\u0dc0' // Sinhala
| '\u0dc7'..'\u0dca' // Sinhala
| '\u0dcb'..'\u0dcf' // Sinhala
| '\u0dd5' // Sinhala
| '\u0dd7' // Sinhala
| '\u0de0'..'\u0de6' // Sinhala
| '\u0df0'..'\u0df2' // Sinhala
| '\u0df5'..'\u0e01' // Sinhala
| '\u0e3b'..'\u0e3f' // Thai
| '\u0e5c'..'\u0e81' // Thai
| '\u0e83' // Lao
| '\u0e85'..'\u0e87' // Lao
| '\u0e89' // Lao
| '\u0e8b'..'\u0e8d' // Lao
| '\u0e8e'..'\u0e94' // Lao
| '\u0e98' // Lao
| '\u0ea0' // Lao
| '\u0ea4' // Lao
| '\u0ea6' // Lao
| '\u0ea8'..'\u0eaa' // Lao
| '\u0eac' // Lao
| '\u0eba' // Lao
| '\u0ebe'..'\u0ec0' // Lao
| '\u0ec5' // Lao
| '\u0ec7' // Lao
| '\u0ece'..'\u0ed0' // Lao
| '\u0eda'..'\u0edc' // Lao
| '\u0ee0'..'\u0f00' // Lao
| '\u0f48' // Tibetan
| '\u0f6d'..'\u0f71' // Tibetan
| '\u0f98' // Tibetan
| '\u0fbd' // Tibetan
| '\u0fcd' // Tibetan
| '\u0fdb'..'\u1000' // Tibetan
| '\u10c6' // Georgian
| '\u10c8'..'\u10cd' // Georgian
| '\u10ce'..'\u10d0' // Georgian
| '\u1249' // Ethiopic
| '\u124e'..'\u1250' // Ethiopic
| '\u1257' // Ethiopic
| '\u1259' // Ethiopic
| '\u125e'..'\u1260' // Ethiopic
| '\u1289' // Ethiopic
| '\u128e'..'\u1290' // Ethiopic
| '\u12b1' // Ethiopic
| '\u12b6'..'\u12b8' // Ethiopic
| '\u12bf' // Ethiopic
| '\u12c1' // Ethiopic
| '\u12c6'..'\u12c8' // Ethiopic
| '\u12d7' // Ethiopic
| '\u1311' // Ethiopic
| '\u1316'..'\u1318' // Ethiopic
| '\u135b'..'\u135d' // Ethiopic
| '\u137d'..'\u1380' // Ethiopic
| '\u139a'..'\u13a0' // Ethiopic_Supplement
| '\u13f6'..'\u13f8' // Cherokee
| '\u13fe'..'\u1400' // Cherokee
| '\u169d'..'\u16a0' // Ogham
| '\u16f9'..'\u1700' // Runic
| '\u170d' // Tagalog
| '\u1715'..'\u1720' // Tagalog
| '\u1737'..'\u1740' // Hanunoo
| '\u1754'..'\u1760' // Buhid
| '\u176d' // Tagbanwa
| '\u1771' // Tagbanwa
| '\u1774'..'\u1780' // Tagbanwa
| '\u17de'..'\u17e0' // Khmer
| '\u17ea'..'\u17f0' // Khmer
| '\u17fa'..'\u1800' // Khmer
| '\u180f' // Mongolian
| '\u181a'..'\u1820' // Mongolian
| '\u1878'..'\u1880' // Mongolian
| '\u18ab'..'\u18b0' // Mongolian
| '\u18f6'..'\u1900' // Unified_Canadian_Aboriginal_Syllabics_Extended
| '\u191f' // Limbu
| '\u192c'..'\u1930' // Limbu
| '\u193c'..'\u1940' // Limbu
| '\u1941'..'\u1944' // Limbu
| '\u196e'..'\u1970' // Tai_Le
| '\u1975'..'\u1980' // Tai_Le
| '\u19ac'..'\u19b0' // New_Tai_Lue
| '\u19ca'..'\u19d0' // New_Tai_Lue
| '\u19db'..'\u19de' // New_Tai_Lue
| '\u1a1c'..'\u1a1e' // Buginese
| '\u1a5f' // Tai_Tham
| '\u1a7d'..'\u1a7f' // Tai_Tham
| '\u1a8a'..'\u1a90' // Tai_Tham
| '\u1a9a'..'\u1aa0' // Tai_Tham
| '\u1aae'..'\u1ab0' // Tai_Tham
| '\u1abf'..'\u1b00' // Combining_Diacritical_Marks_Extended
| '\u1b4c'..'\u1b50' // Balinese
| '\u1b7d'..'\u1b80' // Balinese
| '\u1bf4'..'\u1bfc' // Batak
| '\u1c38'..'\u1c3b' // Lepcha
| '\u1c4a'..'\u1c4d' // Lepcha
| '\u1c89'..'\u1cc0' // Cyrillic_Extended-C
| '\u1cc8'..'\u1cd0' // Sundanese_Supplement
| '\u1cf7' // Vedic_Extensions
| '\u1cfa'..'\u1d00' // Vedic_Extensions
| '\u1df6'..'\u1dfb' // Combining_Diacritical_Marks_Supplement
| '\u1f16'..'\u1f18' // Greek_Extended
| '\u1f1e'..'\u1f20' // Greek_Extended
| '\u1f46'..'\u1f48' // Greek_Extended
| '\u1f4e'..'\u1f50' // Greek_Extended
| '\u1f58' // Greek_Extended
| '\u1f5a' // Greek_Extended
| '\u1f5c' // Greek_Extended
| '\u1f5e' // Greek_Extended
| '\u1f7e'..'\u1f80' // Greek_Extended
| '\u1fb5' // Greek_Extended
| '\u1fc5' // Greek_Extended
| '\u1fd4'..'\u1fd6' // Greek_Extended
| '\u1fdc' // Greek_Extended
| '\u1ff0'..'\u1ff2' // Greek_Extended
| '\u1ff5' // Greek_Extended
| '\u1fff' // (Absent from Blocks.txt)
| '\u2072'..'\u2074' // Superscripts_and_Subscripts
| '\u208f' // Superscripts_and_Subscripts
| '\u209d'..'\u20a0' // Superscripts_and_Subscripts
| '\u20bf'..'\u20d0' // Currency_Symbols
| '\u20f1'..'\u2100' // Combining_Diacritical_Marks_for_Symbols
| '\u218c'..'\u2190' // Number_Forms
| '\u2c2f' // Glagolitic
| '\u2c5f' // (Absent from Blocks.txt)
| '\u2cf4'..'\u2cf9' // Coptic
| '\u2d26' // Georgian_Supplement
| '\u2d28'..'\u2d2d' // Georgian_Supplement
| '\u2d2e'..'\u2d30' // Georgian_Supplement
| '\u2d68'..'\u2d6f' // Tifinagh
| '\u2d71'..'\u2d7f' // Tifinagh
| '\u2d97'..'\u2da0' // Ethiopic_Extended
| '\u2da7' // Ethiopic_Extended
| '\u2daf' // Ethiopic_Extended
| '\u2db7' // Ethiopic_Extended
| '\u2dbf' // Ethiopic_Extended
| '\u2dc7' // Ethiopic_Extended
| '\u2dcf' // Ethiopic_Extended
| '\u2dd7' // Ethiopic_Extended
| '\u2ddf' // (Absent from Blocks.txt)
| '\u2e9a' // CJK_Radicals_Supplement
| '\u2ef4'..'\u2f00' // CJK_Radicals_Supplement
| '\u2fd6'..'\u2ff0' // Kangxi_Radicals
| '\u2ffc'..'\u3000' // Ideographic_Description_Characters
| '\u3040' // Hiragana
| '\u3097'..'\u3099' // Hiragana
| '\u3100'..'\u3105' // Bopomofo
| '\u312e'..'\u3131' // Bopomofo
| '\u318f' // (Absent from Blocks.txt)
| '\u31bb'..'\u31c0' // Bopomofo_Extended
| '\u31e4'..'\u31f0' // CJK_Strokes
| '\u321f' // Enclosed_CJK_Letters_and_Months
| '\u32ff' // (Absent from Blocks.txt)
| '\u4db6'..'\u4dc0' // CJK_Unified_Ideographs_Extension_A
| '\u9fd6'..'\ua000' // CJK_Unified_Ideographs
| '\ua48d'..'\ua490' // Yi_Syllables
| '\ua4c7'..'\ua4d0' // Yi_Radicals
| '\ua62c'..'\ua640' // Vai
| '\ua6f8'..'\ua700' // Bamum
| '\ua7af' // Latin_Extended-D
| '\ua7b8'..'\ua7f7' // Latin_Extended-D
| '\ua82c'..'\ua830' // Syloti_Nagri
| '\ua83a'..'\ua840' // Common_Indic_Number_Forms
| '\ua878'..'\ua880' // Phags-pa
| '\ua8c6'..'\ua8ce' // Saurashtra
| '\ua8da'..'\ua8e0' // Saurashtra
| '\ua8fe'..'\ua900' // Devanagari_Extended
| '\ua954'..'\ua95f' // Rejang
| '\ua97d'..'\ua980' // Hangul_Jamo_Extended-A
| '\ua9ce' // Javanese
| '\ua9da'..'\ua9de' // Javanese
| '\ua9ff' // (Absent from Blocks.txt)
| '\uaa37'..'\uaa40' // Cham
| '\uaa4e'..'\uaa50' // Cham
| '\uaa5a'..'\uaa5c' // Cham
| '\uaac3'..'\uaadb' // Tai_Viet
| '\uaaf7'..'\uab01' // Meetei_Mayek_Extensions
| '\uab07'..'\uab09' // Ethiopic_Extended-A
| '\uab0f'..'\uab11' // Ethiopic_Extended-A
| '\uab17'..'\uab20' // Ethiopic_Extended-A
| '\uab27' // Ethiopic_Extended-A
| '\uab2f' // (Absent from Blocks.txt)
| '\uab66'..'\uab70' // Latin_Extended-E
| '\uabee'..'\uabf0' // Meetei_Mayek
| '\uabfa'..'\uac00' // Meetei_Mayek
| '\uac01'..'\ud7a3' // Hangul_Syllables
| '\ud7a4'..'\ud7b0' // Hangul_Syllables
| '\ud7c7'..'\ud7cb' // Hangul_Jamo_Extended-B
| '\ud7fc'..'\ud800' // Hangul_Jamo_Extended-B
| '\ud801'..'\udb7f' // High_Surrogates
| '\udb81'..'\udbff' // High_Private_Use_Surrogates
| '\udc01'..'\udfff' // Low_Surrogates
| '\ue001'..'\uf8ff' // Private_Use_Area
| '\ufa6e'..'\ufa70' // CJK_Compatibility_Ideographs
| '\ufada'..'\ufb00' // CJK_Compatibility_Ideographs
| '\ufb07'..'\ufb13' // Alphabetic_Presentation_Forms
| '\ufb18'..'\ufb1d' // Alphabetic_Presentation_Forms
| '\ufb37' // Alphabetic_Presentation_Forms
| '\ufb3d' // Alphabetic_Presentation_Forms
| '\ufb3f' // Alphabetic_Presentation_Forms
| '\ufb42' // Alphabetic_Presentation_Forms
| '\ufb45' // Alphabetic_Presentation_Forms
| '\ufbc2'..'\ufbd3' // Arabic_Presentation_Forms-A
| '\ufd40'..'\ufd50' // Arabic_Presentation_Forms-A
| '\ufd90'..'\ufd92' // Arabic_Presentation_Forms-A
| '\ufdc8'..'\ufdd0' // Arabic_Presentation_Forms-A
| '\ufdfe'..'\ufe00' // Arabic_Presentation_Forms-A
| '\ufe1a'..'\ufe20' // Vertical_Forms
| '\ufe53' // Small_Form_Variants
| '\ufe67' // Small_Form_Variants
| '\ufe6c'..'\ufe70' // Small_Form_Variants
| '\ufe75' // Arabic_Presentation_Forms-B
| '\ufefd'..'\ufeff' // Arabic_Presentation_Forms-B
| '\uff00' // Halfwidth_and_Fullwidth_Forms
| '\uffbf'..'\uffc2' // Halfwidth_and_Fullwidth_Forms
| '\uffc8'..'\uffca' // Halfwidth_and_Fullwidth_Forms
| '\uffd0'..'\uffd2' // Halfwidth_and_Fullwidth_Forms
| '\uffd8'..'\uffda' // Halfwidth_and_Fullwidth_Forms
| '\uffdd'..'\uffe0' // Halfwidth_and_Fullwidth_Forms
| '\uffe7' // Halfwidth_and_Fullwidth_Forms
| '\uffef' // (Absent from Blocks.txt)
;
CLASSIFY_Cc:
'\u0000'..'\u0020' // Basic_Latin
| '\u007f'..'\u00a0' // (Absent from Blocks.txt)
;
CLASSIFY_Cf:
'\u00ad' // Latin-1_Supplement
| '\u0600'..'\u0606' // Arabic
| '\u061c' // Arabic
| '\u06dd' // Arabic
| '\u070f' // Syriac
| '\u08e2' // Arabic_Extended-A
| '\u180e' // Mongolian
| '\u200b'..'\u2010' // General_Punctuation
| '\u202a'..'\u202f' // General_Punctuation
| '\u2060'..'\u2065' // General_Punctuation
| '\u2066'..'\u2070' // General_Punctuation
| '\ufeff' // (Absent from Blocks.txt)
| '\ufff9'..'\ufffc' // Specials
;
CLASSIFY_Cn:
'\u2065' // General_Punctuation
| '\u23ff' // (Absent from Blocks.txt)
| '\u2427'..'\u2440' // Control_Pictures
| '\u244b'..'\u2460' // Optical_Character_Recognition
| '\u2b74'..'\u2b76' // Miscellaneous_Symbols_and_Arrows
| '\u2b96'..'\u2b98' // Miscellaneous_Symbols_and_Arrows
| '\u2bba'..'\u2bbd' // Miscellaneous_Symbols_and_Arrows
| '\u2bc9' // Miscellaneous_Symbols_and_Arrows
| '\u2bd2'..'\u2bec' // Miscellaneous_Symbols_and_Arrows
| '\u2bf0'..'\u2c00' // Miscellaneous_Symbols_and_Arrows
| '\u2e45'..'\u2e80' // Supplemental_Punctuation
| '\ufdd0'..'\ufdf0' // Arabic_Presentation_Forms-A
| '\ufff0'..'\ufff9' // Specials
;
CLASSIFY_Co:
'\ue000' // Private_Use_Area
| '\uf8ff' // (Absent from Blocks.txt)
;
CLASSIFY_Cs:
'\ud800' // High_Surrogates
| '\udb7f'..'\udb81' // (Absent from Blocks.txt)
| '\udbff'..'\udc01' // (Absent from Blocks.txt)
| '\udfff' // (Absent from Blocks.txt)
;
CLASSIFY_Ll:
'\u0061'..'\u007b' // Basic_Latin
| '\u00b5' // Latin-1_Supplement
| '\u00df'..'\u00f7' // Latin-1_Supplement
| '\u00f8'..'\u0100' // Latin-1_Supplement
| '\u0101' // Latin_Extended-A
| '\u0103' // Latin_Extended-A
| '\u0105' // Latin_Extended-A
| '\u0107' // Latin_Extended-A
| '\u0109' // Latin_Extended-A
| '\u010b' // Latin_Extended-A
| '\u010d' // Latin_Extended-A
| '\u010f' // Latin_Extended-A
| '\u0111' // Latin_Extended-A
| '\u0113' // Latin_Extended-A
| '\u0115' // Latin_Extended-A
| '\u0117' // Latin_Extended-A
| '\u0119' // Latin_Extended-A
| '\u011b' // Latin_Extended-A
| '\u011d' // Latin_Extended-A
| '\u011f' // Latin_Extended-A
| '\u0121' // Latin_Extended-A
| '\u0123' // Latin_Extended-A
| '\u0125' // Latin_Extended-A
| '\u0127' // Latin_Extended-A
| '\u0129' // Latin_Extended-A
| '\u012b' // Latin_Extended-A
| '\u012d' // Latin_Extended-A
| '\u012f' // Latin_Extended-A
| '\u0131' // Latin_Extended-A
| '\u0133' // Latin_Extended-A
| '\u0135' // Latin_Extended-A
| '\u0137'..'\u0139' // Latin_Extended-A
| '\u013a' // Latin_Extended-A
| '\u013c' // Latin_Extended-A
| '\u013e' // Latin_Extended-A
| '\u0140' // Latin_Extended-A
| '\u0142' // Latin_Extended-A
| '\u0144' // Latin_Extended-A
| '\u0146' // Latin_Extended-A
| '\u0148'..'\u014a' // Latin_Extended-A
| '\u014b' // Latin_Extended-A
| '\u014d' // Latin_Extended-A
| '\u014f' // Latin_Extended-A
| '\u0151' // Latin_Extended-A
| '\u0153' // Latin_Extended-A
| '\u0155' // Latin_Extended-A
| '\u0157' // Latin_Extended-A
| '\u0159' // Latin_Extended-A
| '\u015b' // Latin_Extended-A
| '\u015d' // Latin_Extended-A
| '\u015f' // Latin_Extended-A
| '\u0161' // Latin_Extended-A
| '\u0163' // Latin_Extended-A
| '\u0165' // Latin_Extended-A
| '\u0167' // Latin_Extended-A
| '\u0169' // Latin_Extended-A
| '\u016b' // Latin_Extended-A
| '\u016d' // Latin_Extended-A
| '\u016f' // Latin_Extended-A
| '\u0171' // Latin_Extended-A
| '\u0173' // Latin_Extended-A
| '\u0175' // Latin_Extended-A
| '\u0177' // Latin_Extended-A
| '\u017a' // Latin_Extended-A
| '\u017c' // Latin_Extended-A
| '\u017e'..'\u0181' // Latin_Extended-A
| '\u0183' // Latin_Extended-B
| '\u0185' // Latin_Extended-B
| '\u0188' // Latin_Extended-B
| '\u018c'..'\u018e' // Latin_Extended-B
| '\u0192' // Latin_Extended-B
| '\u0195' // Latin_Extended-B
| '\u0199'..'\u019c' // Latin_Extended-B
| '\u019e' // Latin_Extended-B
| '\u01a1' // Latin_Extended-B
| '\u01a3' // Latin_Extended-B
| '\u01a5' // Latin_Extended-B
| '\u01a8' // Latin_Extended-B
| '\u01aa'..'\u01ac' // Latin_Extended-B
| '\u01ad' // Latin_Extended-B
| '\u01b0' // Latin_Extended-B
| '\u01b4' // Latin_Extended-B
| '\u01b6' // Latin_Extended-B
| '\u01b9'..'\u01bb' // Latin_Extended-B
| '\u01bd'..'\u01c0' // Latin_Extended-B
| '\u01c6' // Latin_Extended-B
| '\u01c9' // Latin_Extended-B
| '\u01cc' // Latin_Extended-B
| '\u01ce' // Latin_Extended-B
| '\u01d0' // Latin_Extended-B
| '\u01d2' // Latin_Extended-B
| '\u01d4' // Latin_Extended-B
| '\u01d6' // Latin_Extended-B
| '\u01d8' // Latin_Extended-B
| '\u01da' // Latin_Extended-B
| '\u01dc'..'\u01de' // Latin_Extended-B
| '\u01df' // Latin_Extended-B
| '\u01e1' // Latin_Extended-B
| '\u01e3' // Latin_Extended-B
| '\u01e5' // Latin_Extended-B
| '\u01e7' // Latin_Extended-B
| '\u01e9' // Latin_Extended-B
| '\u01eb' // Latin_Extended-B
| '\u01ed' // Latin_Extended-B
| '\u01ef'..'\u01f1' // Latin_Extended-B
| '\u01f3' // Latin_Extended-B
| '\u01f5' // Latin_Extended-B
| '\u01f9' // Latin_Extended-B
| '\u01fb' // Latin_Extended-B
| '\u01fd' // Latin_Extended-B
| '\u01ff' // Latin_Extended-B
| '\u0201' // Latin_Extended-B
| '\u0203' // Latin_Extended-B
| '\u0205' // Latin_Extended-B
| '\u0207' // Latin_Extended-B
| '\u0209' // Latin_Extended-B
| '\u020b' // Latin_Extended-B
| '\u020d' // Latin_Extended-B
| '\u020f' // Latin_Extended-B
| '\u0211' // Latin_Extended-B
| '\u0213' // Latin_Extended-B
| '\u0215' // Latin_Extended-B
| '\u0217' // Latin_Extended-B
| '\u0219' // Latin_Extended-B
| '\u021b' // Latin_Extended-B
| '\u021d' // Latin_Extended-B
| '\u021f' // Latin_Extended-B
| '\u0221' // Latin_Extended-B
| '\u0223' // Latin_Extended-B
| '\u0225' // Latin_Extended-B
| '\u0227' // Latin_Extended-B
| '\u0229' // Latin_Extended-B
| '\u022b' // Latin_Extended-B
| '\u022d' // Latin_Extended-B
| '\u022f' // Latin_Extended-B
| '\u0231' // Latin_Extended-B
| '\u0233'..'\u023a' // Latin_Extended-B
| '\u023c' // Latin_Extended-B
| '\u023f'..'\u0241' // Latin_Extended-B
| '\u0242' // Latin_Extended-B
| '\u0247' // Latin_Extended-B
| '\u0249' // Latin_Extended-B
| '\u024b' // Latin_Extended-B
| '\u024d' // Latin_Extended-B
| '\u024f'..'\u0294' // (Absent from Blocks.txt)
| '\u0295'..'\u02b0' // IPA_Extensions
| '\u0371' // Greek_and_Coptic
| '\u0373' // Greek_and_Coptic
| '\u0377' // Greek_and_Coptic
| '\u037b'..'\u037e' // Greek_and_Coptic
| '\u0390' // Greek_and_Coptic
| '\u03ac'..'\u03cf' // Greek_and_Coptic
| '\u03d0'..'\u03d2' // Greek_and_Coptic
| '\u03d5'..'\u03d8' // Greek_and_Coptic
| '\u03d9' // Greek_and_Coptic
| '\u03db' // Greek_and_Coptic
| '\u03dd' // Greek_and_Coptic
| '\u03df' // Greek_and_Coptic
| '\u03e1' // Greek_and_Coptic
| '\u03e3' // Greek_and_Coptic
| '\u03e5' // Greek_and_Coptic
| '\u03e7' // Greek_and_Coptic
| '\u03e9' // Greek_and_Coptic
| '\u03eb' // Greek_and_Coptic
| '\u03ed' // Greek_and_Coptic
| '\u03ef'..'\u03f4' // Greek_and_Coptic
| '\u03f5' // Greek_and_Coptic
| '\u03f8' // Greek_and_Coptic
| '\u03fb'..'\u03fd' // Greek_and_Coptic
| '\u0430'..'\u0460' // Cyrillic
| '\u0461' // Cyrillic
| '\u0463' // Cyrillic
| '\u0465' // Cyrillic
| '\u0467' // Cyrillic
| '\u0469' // Cyrillic
| '\u046b' // Cyrillic
| '\u046d' // Cyrillic
| '\u046f' // Cyrillic
| '\u0471' // Cyrillic
| '\u0473' // Cyrillic
| '\u0475' // Cyrillic
| '\u0477' // Cyrillic
| '\u0479' // Cyrillic
| '\u047b' // Cyrillic
| '\u047d' // Cyrillic
| '\u047f' // Cyrillic
| '\u0481' // Cyrillic
| '\u048b' // Cyrillic
| '\u048d' // Cyrillic
| '\u048f' // Cyrillic
| '\u0491' // Cyrillic
| '\u0493' // Cyrillic
| '\u0495' // Cyrillic
| '\u0497' // Cyrillic
| '\u0499' // Cyrillic
| '\u049b' // Cyrillic
| '\u049d' // Cyrillic
| '\u049f' // Cyrillic
| '\u04a1' // Cyrillic
| '\u04a3' // Cyrillic
| '\u04a5' // Cyrillic
| '\u04a7' // Cyrillic
| '\u04a9' // Cyrillic
| '\u04ab' // Cyrillic
| '\u04ad' // Cyrillic
| '\u04af' // Cyrillic
| '\u04b1' // Cyrillic
| '\u04b3' // Cyrillic
| '\u04b5' // Cyrillic
| '\u04b7' // Cyrillic
| '\u04b9' // Cyrillic
| '\u04bb' // Cyrillic
| '\u04bd' // Cyrillic
| '\u04bf' // Cyrillic
| '\u04c2' // Cyrillic
| '\u04c4' // Cyrillic
| '\u04c6' // Cyrillic
| '\u04c8' // Cyrillic
| '\u04ca' // Cyrillic
| '\u04cc' // Cyrillic
| '\u04ce'..'\u04d0' // Cyrillic
| '\u04d1' // Cyrillic
| '\u04d3' // Cyrillic
| '\u04d5' // Cyrillic
| '\u04d7' // Cyrillic
| '\u04d9' // Cyrillic
| '\u04db' // Cyrillic
| '\u04dd' // Cyrillic
| '\u04df' // Cyrillic
| '\u04e1' // Cyrillic
| '\u04e3' // Cyrillic
| '\u04e5' // Cyrillic
| '\u04e7' // Cyrillic
| '\u04e9' // Cyrillic
| '\u04eb' // Cyrillic
| '\u04ed' // Cyrillic
| '\u04ef' // Cyrillic
| '\u04f1' // Cyrillic
| '\u04f3' // Cyrillic
| '\u04f5' // Cyrillic
| '\u04f7' // Cyrillic
| '\u04f9' // Cyrillic
| '\u04fb' // Cyrillic
| '\u04fd' // Cyrillic
| '\u04ff' // (Absent from Blocks.txt)
| '\u0501' // Cyrillic_Supplement
| '\u0503' // Cyrillic_Supplement
| '\u0505' // Cyrillic_Supplement
| '\u0507' // Cyrillic_Supplement
| '\u0509' // Cyrillic_Supplement
| '\u050b' // Cyrillic_Supplement
| '\u050d' // Cyrillic_Supplement
| '\u050f' // Cyrillic_Supplement
| '\u0511' // Cyrillic_Supplement
| '\u0513' // Cyrillic_Supplement
| '\u0515' // Cyrillic_Supplement
| '\u0517' // Cyrillic_Supplement
| '\u0519' // Cyrillic_Supplement
| '\u051b' // Cyrillic_Supplement
| '\u051d' // Cyrillic_Supplement
| '\u051f' // Cyrillic_Supplement
| '\u0521' // Cyrillic_Supplement
| '\u0523' // Cyrillic_Supplement
| '\u0525' // Cyrillic_Supplement
| '\u0527' // Cyrillic_Supplement
| '\u0529' // Cyrillic_Supplement
| '\u052b' // Cyrillic_Supplement
| '\u052d' // Cyrillic_Supplement
| '\u052f' // (Absent from Blocks.txt)
| '\u0561'..'\u0588' // Armenian
| '\u13f8'..'\u13fe' // Cherokee
| '\u1c80'..'\u1c89' // Cyrillic_Extended-C
| '\u1d00'..'\u1d2c' // Phonetic_Extensions
| '\u1d6b'..'\u1d78' // Phonetic_Extensions
| '\u1d79'..'\u1d9b' // Phonetic_Extensions
| '\u1e01' // Latin_Extended_Additional
| '\u1e03' // Latin_Extended_Additional
| '\u1e05' // Latin_Extended_Additional
| '\u1e07' // Latin_Extended_Additional
| '\u1e09' // Latin_Extended_Additional
| '\u1e0b' // Latin_Extended_Additional
| '\u1e0d' // Latin_Extended_Additional
| '\u1e0f' // Latin_Extended_Additional
| '\u1e11' // Latin_Extended_Additional
| '\u1e13' // Latin_Extended_Additional
| '\u1e15' // Latin_Extended_Additional
| '\u1e17' // Latin_Extended_Additional
| '\u1e19' // Latin_Extended_Additional
| '\u1e1b' // Latin_Extended_Additional
| '\u1e1d' // Latin_Extended_Additional
| '\u1e1f' // Latin_Extended_Additional
| '\u1e21' // Latin_Extended_Additional
| '\u1e23' // Latin_Extended_Additional
| '\u1e25' // Latin_Extended_Additional
| '\u1e27' // Latin_Extended_Additional
| '\u1e29' // Latin_Extended_Additional
| '\u1e2b' // Latin_Extended_Additional
| '\u1e2d' // Latin_Extended_Additional
| '\u1e2f' // Latin_Extended_Additional
| '\u1e31' // Latin_Extended_Additional
| '\u1e33' // Latin_Extended_Additional
| '\u1e35' // Latin_Extended_Additional
| '\u1e37' // Latin_Extended_Additional
| '\u1e39' // Latin_Extended_Additional
| '\u1e3b' // Latin_Extended_Additional
| '\u1e3d' // Latin_Extended_Additional
| '\u1e3f' // Latin_Extended_Additional
| '\u1e41' // Latin_Extended_Additional
| '\u1e43' // Latin_Extended_Additional
| '\u1e45' // Latin_Extended_Additional
| '\u1e47' // Latin_Extended_Additional
| '\u1e49' // Latin_Extended_Additional
| '\u1e4b' // Latin_Extended_Additional
| '\u1e4d' // Latin_Extended_Additional
| '\u1e4f' // Latin_Extended_Additional
| '\u1e51' // Latin_Extended_Additional
| '\u1e53' // Latin_Extended_Additional
| '\u1e55' // Latin_Extended_Additional
| '\u1e57' // Latin_Extended_Additional
| '\u1e59' // Latin_Extended_Additional
| '\u1e5b' // Latin_Extended_Additional
| '\u1e5d' // Latin_Extended_Additional
| '\u1e5f' // Latin_Extended_Additional
| '\u1e61' // Latin_Extended_Additional
| '\u1e63' // Latin_Extended_Additional
| '\u1e65' // Latin_Extended_Additional
| '\u1e67' // Latin_Extended_Additional
| '\u1e69' // Latin_Extended_Additional
| '\u1e6b' // Latin_Extended_Additional
| '\u1e6d' // Latin_Extended_Additional
| '\u1e6f' // Latin_Extended_Additional
| '\u1e71' // Latin_Extended_Additional
| '\u1e73' // Latin_Extended_Additional
| '\u1e75' // Latin_Extended_Additional
| '\u1e77' // Latin_Extended_Additional
| '\u1e79' // Latin_Extended_Additional
| '\u1e7b' // Latin_Extended_Additional
| '\u1e7d' // Latin_Extended_Additional
| '\u1e7f' // Latin_Extended_Additional
| '\u1e81' // Latin_Extended_Additional
| '\u1e83' // Latin_Extended_Additional
| '\u1e85' // Latin_Extended_Additional
| '\u1e87' // Latin_Extended_Additional
| '\u1e89' // Latin_Extended_Additional
| '\u1e8b' // Latin_Extended_Additional
| '\u1e8d' // Latin_Extended_Additional
| '\u1e8f' // Latin_Extended_Additional
| '\u1e91' // Latin_Extended_Additional
| '\u1e93' // Latin_Extended_Additional
| '\u1e95'..'\u1e9e' // Latin_Extended_Additional
| '\u1e9f' // Latin_Extended_Additional
| '\u1ea1' // Latin_Extended_Additional
| '\u1ea3' // Latin_Extended_Additional
| '\u1ea5' // Latin_Extended_Additional
| '\u1ea7' // Latin_Extended_Additional
| '\u1ea9' // Latin_Extended_Additional
| '\u1eab' // Latin_Extended_Additional
| '\u1ead' // Latin_Extended_Additional
| '\u1eaf' // Latin_Extended_Additional
| '\u1eb1' // Latin_Extended_Additional
| '\u1eb3' // Latin_Extended_Additional
| '\u1eb5' // Latin_Extended_Additional
| '\u1eb7' // Latin_Extended_Additional
| '\u1eb9' // Latin_Extended_Additional
| '\u1ebb' // Latin_Extended_Additional
| '\u1ebd' // Latin_Extended_Additional
| '\u1ebf' // Latin_Extended_Additional
| '\u1ec1' // Latin_Extended_Additional
| '\u1ec3' // Latin_Extended_Additional
| '\u1ec5' // Latin_Extended_Additional
| '\u1ec7' // Latin_Extended_Additional
| '\u1ec9' // Latin_Extended_Additional
| '\u1ecb' // Latin_Extended_Additional
| '\u1ecd' // Latin_Extended_Additional
| '\u1ecf' // Latin_Extended_Additional
| '\u1ed1' // Latin_Extended_Additional
| '\u1ed3' // Latin_Extended_Additional
| '\u1ed5' // Latin_Extended_Additional
| '\u1ed7' // Latin_Extended_Additional
| '\u1ed9' // Latin_Extended_Additional
| '\u1edb' // Latin_Extended_Additional
| '\u1edd' // Latin_Extended_Additional
| '\u1edf' // Latin_Extended_Additional
| '\u1ee1' // Latin_Extended_Additional
| '\u1ee3' // Latin_Extended_Additional
| '\u1ee5' // Latin_Extended_Additional
| '\u1ee7' // Latin_Extended_Additional
| '\u1ee9' // Latin_Extended_Additional
| '\u1eeb' // Latin_Extended_Additional
| '\u1eed' // Latin_Extended_Additional
| '\u1eef' // Latin_Extended_Additional
| '\u1ef1' // Latin_Extended_Additional
| '\u1ef3' // Latin_Extended_Additional
| '\u1ef5' // Latin_Extended_Additional
| '\u1ef7' // Latin_Extended_Additional
| '\u1ef9' // Latin_Extended_Additional
| '\u1efb' // Latin_Extended_Additional
| '\u1efd' // Latin_Extended_Additional
| '\u1eff'..'\u1f08' // (Absent from Blocks.txt)
| '\u1f10'..'\u1f16' // Greek_Extended
| '\u1f20'..'\u1f28' // Greek_Extended
| '\u1f30'..'\u1f38' // Greek_Extended
| '\u1f40'..'\u1f46' // Greek_Extended
| '\u1f50'..'\u1f58' // Greek_Extended
| '\u1f60'..'\u1f68' // Greek_Extended
| '\u1f70'..'\u1f7e' // Greek_Extended
| '\u1f80'..'\u1f88' // Greek_Extended
| '\u1f90'..'\u1f98' // Greek_Extended
| '\u1fa0'..'\u1fa8' // Greek_Extended
| '\u1fb0'..'\u1fb5' // Greek_Extended
| '\u1fb6'..'\u1fb8' // Greek_Extended
| '\u1fbe' // Greek_Extended
| '\u1fc2'..'\u1fc5' // Greek_Extended
| '\u1fc6'..'\u1fc8' // Greek_Extended
| '\u1fd0'..'\u1fd4' // Greek_Extended
| '\u1fd6'..'\u1fd8' // Greek_Extended
| '\u1fe0'..'\u1fe8' // Greek_Extended
| '\u1ff2'..'\u1ff5' // Greek_Extended
| '\u1ff6'..'\u1ff8' // Greek_Extended
| '\u210a' // Letterlike_Symbols
| '\u210e'..'\u2110' // Letterlike_Symbols
| '\u2113' // Letterlike_Symbols
| '\u212f' // Letterlike_Symbols
| '\u2134' // Letterlike_Symbols
| '\u2139' // Letterlike_Symbols
| '\u213c'..'\u213e' // Letterlike_Symbols
| '\u2146'..'\u214a' // Letterlike_Symbols
| '\u214e' // Letterlike_Symbols
| '\u2184' // Number_Forms
| '\u2c30'..'\u2c5f' // Glagolitic
| '\u2c61' // Latin_Extended-C
| '\u2c65'..'\u2c67' // Latin_Extended-C
| '\u2c68' // Latin_Extended-C
| '\u2c6a' // Latin_Extended-C
| '\u2c6c' // Latin_Extended-C
| '\u2c71' // Latin_Extended-C
| '\u2c73'..'\u2c75' // Latin_Extended-C
| '\u2c76'..'\u2c7c' // Latin_Extended-C
| '\u2c81' // Coptic
| '\u2c83' // Coptic
| '\u2c85' // Coptic
| '\u2c87' // Coptic
| '\u2c89' // Coptic
| '\u2c8b' // Coptic
| '\u2c8d' // Coptic
| '\u2c8f' // Coptic
| '\u2c91' // Coptic
| '\u2c93' // Coptic
| '\u2c95' // Coptic
| '\u2c97' // Coptic
| '\u2c99' // Coptic
| '\u2c9b' // Coptic
| '\u2c9d' // Coptic
| '\u2c9f' // Coptic
| '\u2ca1' // Coptic
| '\u2ca3' // Coptic
| '\u2ca5' // Coptic
| '\u2ca7' // Coptic
| '\u2ca9' // Coptic
| '\u2cab' // Coptic
| '\u2cad' // Coptic
| '\u2caf' // Coptic
| '\u2cb1' // Coptic
| '\u2cb3' // Coptic
| '\u2cb5' // Coptic
| '\u2cb7' // Coptic
| '\u2cb9' // Coptic
| '\u2cbb' // Coptic
| '\u2cbd' // Coptic
| '\u2cbf' // Coptic
| '\u2cc1' // Coptic
| '\u2cc3' // Coptic
| '\u2cc5' // Coptic
| '\u2cc7' // Coptic
| '\u2cc9' // Coptic
| '\u2ccb' // Coptic
| '\u2ccd' // Coptic
| '\u2ccf' // Coptic
| '\u2cd1' // Coptic
| '\u2cd3' // Coptic
| '\u2cd5' // Coptic
| '\u2cd7' // Coptic
| '\u2cd9' // Coptic
| '\u2cdb' // Coptic
| '\u2cdd' // Coptic
| '\u2cdf' // Coptic
| '\u2ce1' // Coptic
| '\u2ce3'..'\u2ce5' // Coptic
| '\u2cec' // Coptic
| '\u2cee' // Coptic
| '\u2cf3' // Coptic
| '\u2d00'..'\u2d26' // Georgian_Supplement
| '\u2d27' // Georgian_Supplement
| '\u2d2d' // Georgian_Supplement
| '\ua641' // Cyrillic_Extended-B
| '\ua643' // Cyrillic_Extended-B
| '\ua645' // Cyrillic_Extended-B
| '\ua647' // Cyrillic_Extended-B
| '\ua649' // Cyrillic_Extended-B
| '\ua64b' // Cyrillic_Extended-B
| '\ua64d' // Cyrillic_Extended-B
| '\ua64f' // Cyrillic_Extended-B
| '\ua651' // Cyrillic_Extended-B
| '\ua653' // Cyrillic_Extended-B
| '\ua655' // Cyrillic_Extended-B
| '\ua657' // Cyrillic_Extended-B
| '\ua659' // Cyrillic_Extended-B
| '\ua65b' // Cyrillic_Extended-B
| '\ua65d' // Cyrillic_Extended-B
| '\ua65f' // Cyrillic_Extended-B
| '\ua661' // Cyrillic_Extended-B
| '\ua663' // Cyrillic_Extended-B
| '\ua665' // Cyrillic_Extended-B
| '\ua667' // Cyrillic_Extended-B
| '\ua669' // Cyrillic_Extended-B
| '\ua66b' // Cyrillic_Extended-B
| '\ua66d' // Cyrillic_Extended-B
| '\ua681' // Cyrillic_Extended-B
| '\ua683' // Cyrillic_Extended-B
| '\ua685' // Cyrillic_Extended-B
| '\ua687' // Cyrillic_Extended-B
| '\ua689' // Cyrillic_Extended-B
| '\ua68b' // Cyrillic_Extended-B
| '\ua68d' // Cyrillic_Extended-B
| '\ua68f' // Cyrillic_Extended-B
| '\ua691' // Cyrillic_Extended-B
| '\ua693' // Cyrillic_Extended-B
| '\ua695' // Cyrillic_Extended-B
| '\ua697' // Cyrillic_Extended-B
| '\ua699' // Cyrillic_Extended-B
| '\ua69b' // Cyrillic_Extended-B
| '\ua723' // Latin_Extended-D
| '\ua725' // Latin_Extended-D
| '\ua727' // Latin_Extended-D
| '\ua729' // Latin_Extended-D
| '\ua72b' // Latin_Extended-D
| '\ua72d' // Latin_Extended-D
| '\ua72f'..'\ua732' // Latin_Extended-D
| '\ua733' // Latin_Extended-D
| '\ua735' // Latin_Extended-D
| '\ua737' // Latin_Extended-D
| '\ua739' // Latin_Extended-D
| '\ua73b' // Latin_Extended-D
| '\ua73d' // Latin_Extended-D
| '\ua73f' // Latin_Extended-D
| '\ua741' // Latin_Extended-D
| '\ua743' // Latin_Extended-D
| '\ua745' // Latin_Extended-D
| '\ua747' // Latin_Extended-D
| '\ua749' // Latin_Extended-D
| '\ua74b' // Latin_Extended-D
| '\ua74d' // Latin_Extended-D
| '\ua74f' // Latin_Extended-D
| '\ua751' // Latin_Extended-D
| '\ua753' // Latin_Extended-D
| '\ua755' // Latin_Extended-D
| '\ua757' // Latin_Extended-D
| '\ua759' // Latin_Extended-D
| '\ua75b' // Latin_Extended-D
| '\ua75d' // Latin_Extended-D
| '\ua75f' // Latin_Extended-D
| '\ua761' // Latin_Extended-D
| '\ua763' // Latin_Extended-D
| '\ua765' // Latin_Extended-D
| '\ua767' // Latin_Extended-D
| '\ua769' // Latin_Extended-D
| '\ua76b' // Latin_Extended-D
| '\ua76d' // Latin_Extended-D
| '\ua76f' // Latin_Extended-D
| '\ua771'..'\ua779' // Latin_Extended-D
| '\ua77a' // Latin_Extended-D
| '\ua77c' // Latin_Extended-D
| '\ua77f' // Latin_Extended-D
| '\ua781' // Latin_Extended-D
| '\ua783' // Latin_Extended-D
| '\ua785' // Latin_Extended-D
| '\ua787' // Latin_Extended-D
| '\ua78c' // Latin_Extended-D
| '\ua78e' // Latin_Extended-D
| '\ua791' // Latin_Extended-D
| '\ua793'..'\ua796' // Latin_Extended-D
| '\ua797' // Latin_Extended-D
| '\ua799' // Latin_Extended-D
| '\ua79b' // Latin_Extended-D
| '\ua79d' // Latin_Extended-D
| '\ua79f' // Latin_Extended-D
| '\ua7a1' // Latin_Extended-D
| '\ua7a3' // Latin_Extended-D
| '\ua7a5' // Latin_Extended-D
| '\ua7a7' // Latin_Extended-D
| '\ua7a9' // Latin_Extended-D
| '\ua7b5' // Latin_Extended-D
| '\ua7b7' // Latin_Extended-D
| '\ua7fa' // Latin_Extended-D
| '\uab30'..'\uab5b' // Latin_Extended-E
| '\uab60'..'\uab66' // Latin_Extended-E
| '\uab70'..'\uabc0' // Cherokee_Supplement
| '\ufb00'..'\ufb07' // Alphabetic_Presentation_Forms
| '\ufb13'..'\ufb18' // Alphabetic_Presentation_Forms
| '\uff41'..'\uff5b' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Lm:
'\u02b0'..'\u02c2' // Spacing_Modifier_Letters
| '\u02c6'..'\u02d2' // Spacing_Modifier_Letters
| '\u02e0'..'\u02e5' // Spacing_Modifier_Letters
| '\u02ec' // Spacing_Modifier_Letters
| '\u02ee' // Spacing_Modifier_Letters
| '\u0374' // Greek_and_Coptic
| '\u037a' // Greek_and_Coptic
| '\u0559' // Armenian
| '\u0640' // Arabic
| '\u06e5'..'\u06e7' // Arabic
| '\u07f4'..'\u07f6' // NKo
| '\u07fa' // NKo
| '\u081a' // Samaritan
| '\u0824' // Samaritan
| '\u0828' // Samaritan
| '\u0971' // Devanagari
| '\u0e46' // Thai
| '\u0ec6' // Lao
| '\u10fc' // Georgian
| '\u17d7' // Khmer
| '\u1843' // Mongolian
| '\u1aa7' // Tai_Tham
| '\u1c78'..'\u1c7e' // Ol_Chiki
| '\u1d2c'..'\u1d6b' // Phonetic_Extensions
| '\u1d78' // Phonetic_Extensions
| '\u1d9b'..'\u1dc0' // Phonetic_Extensions_Supplement
| '\u2071' // Superscripts_and_Subscripts
| '\u207f' // Superscripts_and_Subscripts
| '\u2090'..'\u209d' // Superscripts_and_Subscripts
| '\u2c7c'..'\u2c7e' // Latin_Extended-C
| '\u2d6f' // Tifinagh
| '\u2e2f' // Supplemental_Punctuation
| '\u3005' // CJK_Symbols_and_Punctuation
| '\u3031'..'\u3036' // CJK_Symbols_and_Punctuation
| '\u303b' // CJK_Symbols_and_Punctuation
| '\u309d'..'\u309f' // Hiragana
| '\u30fc'..'\u30ff' // Katakana
| '\ua015' // Yi_Syllables
| '\ua4f8'..'\ua4fe' // Lisu
| '\ua60c' // Vai
| '\ua67f' // Cyrillic_Extended-B
| '\ua69c'..'\ua69e' // Cyrillic_Extended-B
| '\ua717'..'\ua720' // Modifier_Tone_Letters
| '\ua770' // Latin_Extended-D
| '\ua788' // Latin_Extended-D
| '\ua7f8'..'\ua7fa' // Latin_Extended-D
| '\ua9cf' // Javanese
| '\ua9e6' // Myanmar_Extended-B
| '\uaa70' // Myanmar_Extended-A
| '\uaadd' // Tai_Viet
| '\uaaf3'..'\uaaf5' // Meetei_Mayek_Extensions
| '\uab5c'..'\uab60' // Latin_Extended-E
| '\uff70' // Halfwidth_and_Fullwidth_Forms
| '\uff9e'..'\uffa0' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Lo:
'\u00aa' // Latin-1_Supplement
| '\u00ba' // Latin-1_Supplement
| '\u01bb' // Latin_Extended-B
| '\u01c0'..'\u01c4' // Latin_Extended-B
| '\u0294' // IPA_Extensions
| '\u05d0'..'\u05eb' // Hebrew
| '\u05f0'..'\u05f3' // Hebrew
| '\u0620'..'\u0640' // Arabic
| '\u0641'..'\u064b' // Arabic
| '\u066e'..'\u0670' // Arabic
| '\u0671'..'\u06d4' // Arabic
| '\u06d5' // Arabic
| '\u06ee'..'\u06f0' // Arabic
| '\u06fa'..'\u06fd' // Arabic
| '\u06ff' // (Absent from Blocks.txt)
| '\u0710' // Syriac
| '\u0712'..'\u0730' // Syriac
| '\u074d'..'\u07a6' // Syriac
| '\u07b1' // Thaana
| '\u07ca'..'\u07eb' // NKo
| '\u0800'..'\u0816' // Samaritan
| '\u0840'..'\u0859' // Mandaic
| '\u08a0'..'\u08b5' // Arabic_Extended-A
| '\u08b6'..'\u08be' // Arabic_Extended-A
| '\u0904'..'\u093a' // Devanagari
| '\u093d' // Devanagari
| '\u0950' // Devanagari
| '\u0958'..'\u0962' // Devanagari
| '\u0972'..'\u0981' // Devanagari
| '\u0985'..'\u098d' // Bengali
| '\u098f'..'\u0991' // Bengali
| '\u0993'..'\u09a9' // Bengali
| '\u09aa'..'\u09b1' // Bengali
| '\u09b2' // Bengali
| '\u09b6'..'\u09ba' // Bengali
| '\u09bd' // Bengali
| '\u09ce' // Bengali
| '\u09dc'..'\u09de' // Bengali
| '\u09df'..'\u09e2' // Bengali
| '\u09f0'..'\u09f2' // Bengali
| '\u0a05'..'\u0a0b' // Gurmukhi
| '\u0a0f'..'\u0a11' // Gurmukhi
| '\u0a13'..'\u0a29' // Gurmukhi
| '\u0a2a'..'\u0a31' // Gurmukhi
| '\u0a32'..'\u0a34' // Gurmukhi
| '\u0a35'..'\u0a37' // Gurmukhi
| '\u0a38'..'\u0a3a' // Gurmukhi
| '\u0a59'..'\u0a5d' // Gurmukhi
| '\u0a5e' // Gurmukhi
| '\u0a72'..'\u0a75' // Gurmukhi
| '\u0a85'..'\u0a8e' // Gujarati
| '\u0a8f'..'\u0a92' // Gujarati
| '\u0a93'..'\u0aa9' // Gujarati
| '\u0aaa'..'\u0ab1' // Gujarati
| '\u0ab2'..'\u0ab4' // Gujarati
| '\u0ab5'..'\u0aba' // Gujarati
| '\u0abd' // Gujarati
| '\u0ad0' // Gujarati
| '\u0ae0'..'\u0ae2' // Gujarati
| '\u0af9' // Gujarati
| '\u0b05'..'\u0b0d' // Oriya
| '\u0b0f'..'\u0b11' // Oriya
| '\u0b13'..'\u0b29' // Oriya
| '\u0b2a'..'\u0b31' // Oriya
| '\u0b32'..'\u0b34' // Oriya
| '\u0b35'..'\u0b3a' // Oriya
| '\u0b3d' // Oriya
| '\u0b5c'..'\u0b5e' // Oriya
| '\u0b5f'..'\u0b62' // Oriya
| '\u0b71' // Oriya
| '\u0b83' // Tamil
| '\u0b85'..'\u0b8b' // Tamil
| '\u0b8e'..'\u0b91' // Tamil
| '\u0b92'..'\u0b96' // Tamil
| '\u0b99'..'\u0b9b' // Tamil
| '\u0b9c' // Tamil
| '\u0b9e'..'\u0ba0' // Tamil
| '\u0ba3'..'\u0ba5' // Tamil
| '\u0ba8'..'\u0bab' // Tamil
| '\u0bae'..'\u0bba' // Tamil
| '\u0bd0' // Tamil
| '\u0c05'..'\u0c0d' // Telugu
| '\u0c0e'..'\u0c11' // Telugu
| '\u0c12'..'\u0c29' // Telugu
| '\u0c2a'..'\u0c3a' // Telugu
| '\u0c3d' // Telugu
| '\u0c58'..'\u0c5b' // Telugu
| '\u0c60'..'\u0c62' // Telugu
| '\u0c80' // Kannada
| '\u0c85'..'\u0c8d' // Kannada
| '\u0c8e'..'\u0c91' // Kannada
| '\u0c92'..'\u0ca9' // Kannada
| '\u0caa'..'\u0cb4' // Kannada
| '\u0cb5'..'\u0cba' // Kannada
| '\u0cbd' // Kannada
| '\u0cde' // Kannada
| '\u0ce0'..'\u0ce2' // Kannada
| '\u0cf1'..'\u0cf3' // Kannada
| '\u0d05'..'\u0d0d' // Malayalam
| '\u0d0e'..'\u0d11' // Malayalam
| '\u0d12'..'\u0d3b' // Malayalam
| '\u0d3d' // Malayalam
| '\u0d4e' // Malayalam
| '\u0d54'..'\u0d57' // Malayalam
| '\u0d5f'..'\u0d62' // Malayalam
| '\u0d7a'..'\u0d80' // Malayalam
| '\u0d85'..'\u0d97' // Sinhala
| '\u0d9a'..'\u0db2' // Sinhala
| '\u0db3'..'\u0dbc' // Sinhala
| '\u0dbd' // Sinhala
| '\u0dc0'..'\u0dc7' // Sinhala
| '\u0e01'..'\u0e31' // Thai
| '\u0e32'..'\u0e34' // Thai
| '\u0e40'..'\u0e46' // Thai
| '\u0e81'..'\u0e83' // Lao
| '\u0e84' // Lao
| '\u0e87'..'\u0e89' // Lao
| '\u0e8a' // Lao
| '\u0e8d' // Lao
| '\u0e94'..'\u0e98' // Lao
| '\u0e99'..'\u0ea0' // Lao
| '\u0ea1'..'\u0ea4' // Lao
| '\u0ea5' // Lao
| '\u0ea7' // Lao
| '\u0eaa'..'\u0eac' // Lao
| '\u0ead'..'\u0eb1' // Lao
| '\u0eb2'..'\u0eb4' // Lao
| '\u0ebd' // Lao
| '\u0ec0'..'\u0ec5' // Lao
| '\u0edc'..'\u0ee0' // Lao
| '\u0f00' // Tibetan
| '\u0f40'..'\u0f48' // Tibetan
| '\u0f49'..'\u0f6d' // Tibetan
| '\u0f88'..'\u0f8d' // Tibetan
| '\u1000'..'\u102b' // Myanmar
| '\u103f' // Myanmar
| '\u1050'..'\u1056' // Myanmar
| '\u105a'..'\u105e' // Myanmar
| '\u1061' // Myanmar
| '\u1065'..'\u1067' // Myanmar
| '\u106e'..'\u1071' // Myanmar
| '\u1075'..'\u1082' // Myanmar
| '\u108e' // Myanmar
| '\u10d0'..'\u10fb' // Georgian
| '\u10fd'..'\u1249' // Georgian
| '\u124a'..'\u124e' // Ethiopic
| '\u1250'..'\u1257' // Ethiopic
| '\u1258' // Ethiopic
| '\u125a'..'\u125e' // Ethiopic
| '\u1260'..'\u1289' // Ethiopic
| '\u128a'..'\u128e' // Ethiopic
| '\u1290'..'\u12b1' // Ethiopic
| '\u12b2'..'\u12b6' // Ethiopic
| '\u12b8'..'\u12bf' // Ethiopic
| '\u12c0' // Ethiopic
| '\u12c2'..'\u12c6' // Ethiopic
| '\u12c8'..'\u12d7' // Ethiopic
| '\u12d8'..'\u1311' // Ethiopic
| '\u1312'..'\u1316' // Ethiopic
| '\u1318'..'\u135b' // Ethiopic
| '\u1380'..'\u1390' // Ethiopic_Supplement
| '\u1401'..'\u166d' // Unified_Canadian_Aboriginal_Syllabics
| '\u166f'..'\u1680' // Unified_Canadian_Aboriginal_Syllabics
| '\u1681'..'\u169b' // Ogham
| '\u16a0'..'\u16eb' // Runic
| '\u16f1'..'\u16f9' // Runic
| '\u1700'..'\u170d' // Tagalog
| '\u170e'..'\u1712' // Tagalog
| '\u1720'..'\u1732' // Hanunoo
| '\u1740'..'\u1752' // Buhid
| '\u1760'..'\u176d' // Tagbanwa
| '\u176e'..'\u1771' // Tagbanwa
| '\u1780'..'\u17b4' // Khmer
| '\u17dc' // Khmer
| '\u1820'..'\u1843' // Mongolian
| '\u1844'..'\u1878' // Mongolian
| '\u1880'..'\u1885' // Mongolian
| '\u1887'..'\u18a9' // Mongolian
| '\u18aa' // Mongolian
| '\u18b0'..'\u18f6' // Unified_Canadian_Aboriginal_Syllabics_Extended
| '\u1900'..'\u191f' // Limbu
| '\u1950'..'\u196e' // Tai_Le
| '\u1970'..'\u1975' // Tai_Le
| '\u1980'..'\u19ac' // New_Tai_Lue
| '\u19b0'..'\u19ca' // New_Tai_Lue
| '\u1a00'..'\u1a17' // Buginese
| '\u1a20'..'\u1a55' // Tai_Tham
| '\u1b05'..'\u1b34' // Balinese
| '\u1b45'..'\u1b4c' // Balinese
| '\u1b83'..'\u1ba1' // Sundanese
| '\u1bae'..'\u1bb0' // Sundanese
| '\u1bba'..'\u1be6' // Sundanese
| '\u1c00'..'\u1c24' // Lepcha
| '\u1c4d'..'\u1c50' // Lepcha
| '\u1c5a'..'\u1c78' // Ol_Chiki
| '\u1ce9'..'\u1ced' // Vedic_Extensions
| '\u1cee'..'\u1cf2' // Vedic_Extensions
| '\u1cf5'..'\u1cf7' // Vedic_Extensions
| '\u2135'..'\u2139' // Letterlike_Symbols
| '\u2d30'..'\u2d68' // Tifinagh
| '\u2d80'..'\u2d97' // Ethiopic_Extended
| '\u2da0'..'\u2da7' // Ethiopic_Extended
| '\u2da8'..'\u2daf' // Ethiopic_Extended
| '\u2db0'..'\u2db7' // Ethiopic_Extended
| '\u2db8'..'\u2dbf' // Ethiopic_Extended
| '\u2dc0'..'\u2dc7' // Ethiopic_Extended
| '\u2dc8'..'\u2dcf' // Ethiopic_Extended
| '\u2dd0'..'\u2dd7' // Ethiopic_Extended
| '\u2dd8'..'\u2ddf' // Ethiopic_Extended
| '\u3006' // CJK_Symbols_and_Punctuation
| '\u303c' // CJK_Symbols_and_Punctuation
| '\u3041'..'\u3097' // Hiragana
| '\u309f' // (Absent from Blocks.txt)
| '\u30a1'..'\u30fb' // Katakana
| '\u30ff' // (Absent from Blocks.txt)
| '\u3105'..'\u312e' // Bopomofo
| '\u3131'..'\u318f' // Hangul_Compatibility_Jamo
| '\u31a0'..'\u31bb' // Bopomofo_Extended
| '\u31f0'..'\u3200' // Katakana_Phonetic_Extensions
| '\u3400'..'\u4db6' // CJK_Unified_Ideographs_Extension_A
| '\u4e00'..'\u9fd6' // CJK_Unified_Ideographs
| '\ua000'..'\ua015' // Yi_Syllables
| '\ua016'..'\ua48d' // Yi_Syllables
| '\ua4d0'..'\ua4f8' // Lisu
| '\ua500'..'\ua60c' // Vai
| '\ua610'..'\ua620' // Vai
| '\ua62a'..'\ua62c' // Vai
| '\ua66e' // Cyrillic_Extended-B
| '\ua6a0'..'\ua6e6' // Bamum
| '\ua78f' // Latin_Extended-D
| '\ua7f7' // Latin_Extended-D
| '\ua7fb'..'\ua802' // Latin_Extended-D
| '\ua803'..'\ua806' // Syloti_Nagri
| '\ua807'..'\ua80b' // Syloti_Nagri
| '\ua80c'..'\ua823' // Syloti_Nagri
| '\ua840'..'\ua874' // Phags-pa
| '\ua882'..'\ua8b4' // Saurashtra
| '\ua8f2'..'\ua8f8' // Devanagari_Extended
| '\ua8fb' // Devanagari_Extended
| '\ua8fd' // Devanagari_Extended
| '\ua90a'..'\ua926' // Kayah_Li
| '\ua930'..'\ua947' // Rejang
| '\ua960'..'\ua97d' // Hangul_Jamo_Extended-A
| '\ua984'..'\ua9b3' // Javanese
| '\ua9e0'..'\ua9e5' // Myanmar_Extended-B
| '\ua9e7'..'\ua9f0' // Myanmar_Extended-B
| '\ua9fa'..'\ua9ff' // Myanmar_Extended-B
| '\uaa00'..'\uaa29' // Cham
| '\uaa40'..'\uaa43' // Cham
| '\uaa44'..'\uaa4c' // Cham
| '\uaa60'..'\uaa70' // Myanmar_Extended-A
| '\uaa71'..'\uaa77' // Myanmar_Extended-A
| '\uaa7a' // Myanmar_Extended-A
| '\uaa7e'..'\uaab0' // Myanmar_Extended-A
| '\uaab1' // Tai_Viet
| '\uaab5'..'\uaab7' // Tai_Viet
| '\uaab9'..'\uaabe' // Tai_Viet
| '\uaac0' // Tai_Viet
| '\uaac2' // Tai_Viet
| '\uaadb'..'\uaadd' // Tai_Viet
| '\uaae0'..'\uaaeb' // Meetei_Mayek_Extensions
| '\uaaf2' // Meetei_Mayek_Extensions
| '\uab01'..'\uab07' // Ethiopic_Extended-A
| '\uab09'..'\uab0f' // Ethiopic_Extended-A
| '\uab11'..'\uab17' // Ethiopic_Extended-A
| '\uab20'..'\uab27' // Ethiopic_Extended-A
| '\uab28'..'\uab2f' // Ethiopic_Extended-A
| '\uabc0'..'\uabe3' // Meetei_Mayek
| '\uac00' // Hangul_Syllables
| '\ud7a3' // Hangul_Syllables
| '\ud7b0'..'\ud7c7' // Hangul_Jamo_Extended-B
| '\ud7cb'..'\ud7fc' // Hangul_Jamo_Extended-B
| '\uf900'..'\ufa6e' // CJK_Compatibility_Ideographs
| '\ufa70'..'\ufada' // CJK_Compatibility_Ideographs
| '\ufb1d' // Alphabetic_Presentation_Forms
| '\ufb1f'..'\ufb29' // Alphabetic_Presentation_Forms
| '\ufb2a'..'\ufb37' // Alphabetic_Presentation_Forms
| '\ufb38'..'\ufb3d' // Alphabetic_Presentation_Forms
| '\ufb3e' // Alphabetic_Presentation_Forms
| '\ufb40'..'\ufb42' // Alphabetic_Presentation_Forms
| '\ufb43'..'\ufb45' // Alphabetic_Presentation_Forms
| '\ufb46'..'\ufbb2' // Alphabetic_Presentation_Forms
| '\ufbd3'..'\ufd3e' // Arabic_Presentation_Forms-A
| '\ufd50'..'\ufd90' // Arabic_Presentation_Forms-A
| '\ufd92'..'\ufdc8' // Arabic_Presentation_Forms-A
| '\ufdf0'..'\ufdfc' // Arabic_Presentation_Forms-A
| '\ufe70'..'\ufe75' // Arabic_Presentation_Forms-B
| '\ufe76'..'\ufefd' // Arabic_Presentation_Forms-B
| '\uff66'..'\uff70' // Halfwidth_and_Fullwidth_Forms
| '\uff71'..'\uff9e' // Halfwidth_and_Fullwidth_Forms
| '\uffa0'..'\uffbf' // Halfwidth_and_Fullwidth_Forms
| '\uffc2'..'\uffc8' // Halfwidth_and_Fullwidth_Forms
| '\uffca'..'\uffd0' // Halfwidth_and_Fullwidth_Forms
| '\uffd2'..'\uffd8' // Halfwidth_and_Fullwidth_Forms
| '\uffda'..'\uffdd' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Lt:
'\u01c5' // Latin_Extended-B
| '\u01c8' // Latin_Extended-B
| '\u01cb' // Latin_Extended-B
| '\u01f2' // Latin_Extended-B
| '\u1f88'..'\u1f90' // Greek_Extended
| '\u1f98'..'\u1fa0' // Greek_Extended
| '\u1fa8'..'\u1fb0' // Greek_Extended
| '\u1fbc' // Greek_Extended
| '\u1fcc' // Greek_Extended
| '\u1ffc' // Greek_Extended
;
CLASSIFY_Lu:
'\u0041'..'\u005b' // Basic_Latin
| '\u00c0'..'\u00d7' // Latin-1_Supplement
| '\u00d8'..'\u00df' // Latin-1_Supplement
| '\u0100' // Latin_Extended-A
| '\u0102' // Latin_Extended-A
| '\u0104' // Latin_Extended-A
| '\u0106' // Latin_Extended-A
| '\u0108' // Latin_Extended-A
| '\u010a' // Latin_Extended-A
| '\u010c' // Latin_Extended-A
| '\u010e' // Latin_Extended-A
| '\u0110' // Latin_Extended-A
| '\u0112' // Latin_Extended-A
| '\u0114' // Latin_Extended-A
| '\u0116' // Latin_Extended-A
| '\u0118' // Latin_Extended-A
| '\u011a' // Latin_Extended-A
| '\u011c' // Latin_Extended-A
| '\u011e' // Latin_Extended-A
| '\u0120' // Latin_Extended-A
| '\u0122' // Latin_Extended-A
| '\u0124' // Latin_Extended-A
| '\u0126' // Latin_Extended-A
| '\u0128' // Latin_Extended-A
| '\u012a' // Latin_Extended-A
| '\u012c' // Latin_Extended-A
| '\u012e' // Latin_Extended-A
| '\u0130' // Latin_Extended-A
| '\u0132' // Latin_Extended-A
| '\u0134' // Latin_Extended-A
| '\u0136' // Latin_Extended-A
| '\u0139' // Latin_Extended-A
| '\u013b' // Latin_Extended-A
| '\u013d' // Latin_Extended-A
| '\u013f' // Latin_Extended-A
| '\u0141' // Latin_Extended-A
| '\u0143' // Latin_Extended-A
| '\u0145' // Latin_Extended-A
| '\u0147' // Latin_Extended-A
| '\u014a' // Latin_Extended-A
| '\u014c' // Latin_Extended-A
| '\u014e' // Latin_Extended-A
| '\u0150' // Latin_Extended-A
| '\u0152' // Latin_Extended-A
| '\u0154' // Latin_Extended-A
| '\u0156' // Latin_Extended-A
| '\u0158' // Latin_Extended-A
| '\u015a' // Latin_Extended-A
| '\u015c' // Latin_Extended-A
| '\u015e' // Latin_Extended-A
| '\u0160' // Latin_Extended-A
| '\u0162' // Latin_Extended-A
| '\u0164' // Latin_Extended-A
| '\u0166' // Latin_Extended-A
| '\u0168' // Latin_Extended-A
| '\u016a' // Latin_Extended-A
| '\u016c' // Latin_Extended-A
| '\u016e' // Latin_Extended-A
| '\u0170' // Latin_Extended-A
| '\u0172' // Latin_Extended-A
| '\u0174' // Latin_Extended-A
| '\u0176' // Latin_Extended-A
| '\u0178'..'\u017a' // Latin_Extended-A
| '\u017b' // Latin_Extended-A
| '\u017d' // Latin_Extended-A
| '\u0181'..'\u0183' // Latin_Extended-B
| '\u0184' // Latin_Extended-B
| '\u0186'..'\u0188' // Latin_Extended-B
| '\u0189'..'\u018c' // Latin_Extended-B
| '\u018e'..'\u0192' // Latin_Extended-B
| '\u0193'..'\u0195' // Latin_Extended-B
| '\u0196'..'\u0199' // Latin_Extended-B
| '\u019c'..'\u019e' // Latin_Extended-B
| '\u019f'..'\u01a1' // Latin_Extended-B
| '\u01a2' // Latin_Extended-B
| '\u01a4' // Latin_Extended-B
| '\u01a6'..'\u01a8' // Latin_Extended-B
| '\u01a9' // Latin_Extended-B
| '\u01ac' // Latin_Extended-B
| '\u01ae'..'\u01b0' // Latin_Extended-B
| '\u01b1'..'\u01b4' // Latin_Extended-B
| '\u01b5' // Latin_Extended-B
| '\u01b7'..'\u01b9' // Latin_Extended-B
| '\u01bc' // Latin_Extended-B
| '\u01c4' // Latin_Extended-B
| '\u01c7' // Latin_Extended-B
| '\u01ca' // Latin_Extended-B
| '\u01cd' // Latin_Extended-B
| '\u01cf' // Latin_Extended-B
| '\u01d1' // Latin_Extended-B
| '\u01d3' // Latin_Extended-B
| '\u01d5' // Latin_Extended-B
| '\u01d7' // Latin_Extended-B
| '\u01d9' // Latin_Extended-B
| '\u01db' // Latin_Extended-B
| '\u01de' // Latin_Extended-B
| '\u01e0' // Latin_Extended-B
| '\u01e2' // Latin_Extended-B
| '\u01e4' // Latin_Extended-B
| '\u01e6' // Latin_Extended-B
| '\u01e8' // Latin_Extended-B
| '\u01ea' // Latin_Extended-B
| '\u01ec' // Latin_Extended-B
| '\u01ee' // Latin_Extended-B
| '\u01f1' // Latin_Extended-B
| '\u01f4' // Latin_Extended-B
| '\u01f6'..'\u01f9' // Latin_Extended-B
| '\u01fa' // Latin_Extended-B
| '\u01fc' // Latin_Extended-B
| '\u01fe' // Latin_Extended-B
| '\u0200' // Latin_Extended-B
| '\u0202' // Latin_Extended-B
| '\u0204' // Latin_Extended-B
| '\u0206' // Latin_Extended-B
| '\u0208' // Latin_Extended-B
| '\u020a' // Latin_Extended-B
| '\u020c' // Latin_Extended-B
| '\u020e' // Latin_Extended-B
| '\u0210' // Latin_Extended-B
| '\u0212' // Latin_Extended-B
| '\u0214' // Latin_Extended-B
| '\u0216' // Latin_Extended-B
| '\u0218' // Latin_Extended-B
| '\u021a' // Latin_Extended-B
| '\u021c' // Latin_Extended-B
| '\u021e' // Latin_Extended-B
| '\u0220' // Latin_Extended-B
| '\u0222' // Latin_Extended-B
| '\u0224' // Latin_Extended-B
| '\u0226' // Latin_Extended-B
| '\u0228' // Latin_Extended-B
| '\u022a' // Latin_Extended-B
| '\u022c' // Latin_Extended-B
| '\u022e' // Latin_Extended-B
| '\u0230' // Latin_Extended-B
| '\u0232' // Latin_Extended-B
| '\u023a'..'\u023c' // Latin_Extended-B
| '\u023d'..'\u023f' // Latin_Extended-B
| '\u0241' // Latin_Extended-B
| '\u0243'..'\u0247' // Latin_Extended-B
| '\u0248' // Latin_Extended-B
| '\u024a' // Latin_Extended-B
| '\u024c' // Latin_Extended-B
| '\u024e' // Latin_Extended-B
| '\u0370' // Greek_and_Coptic
| '\u0372' // Greek_and_Coptic
| '\u0376' // Greek_and_Coptic
| '\u037f' // Greek_and_Coptic
| '\u0386' // Greek_and_Coptic
| '\u0388'..'\u038b' // Greek_and_Coptic
| '\u038c' // Greek_and_Coptic
| '\u038e'..'\u0390' // Greek_and_Coptic
| '\u0391'..'\u03a2' // Greek_and_Coptic
| '\u03a3'..'\u03ac' // Greek_and_Coptic
| '\u03cf' // Greek_and_Coptic
| '\u03d2'..'\u03d5' // Greek_and_Coptic
| '\u03d8' // Greek_and_Coptic
| '\u03da' // Greek_and_Coptic
| '\u03dc' // Greek_and_Coptic
| '\u03de' // Greek_and_Coptic
| '\u03e0' // Greek_and_Coptic
| '\u03e2' // Greek_and_Coptic
| '\u03e4' // Greek_and_Coptic
| '\u03e6' // Greek_and_Coptic
| '\u03e8' // Greek_and_Coptic
| '\u03ea' // Greek_and_Coptic
| '\u03ec' // Greek_and_Coptic
| '\u03ee' // Greek_and_Coptic
| '\u03f4' // Greek_and_Coptic
| '\u03f7' // Greek_and_Coptic
| '\u03f9'..'\u03fb' // Greek_and_Coptic
| '\u03fd'..'\u0430' // Greek_and_Coptic
| '\u0460' // Cyrillic
| '\u0462' // Cyrillic
| '\u0464' // Cyrillic
| '\u0466' // Cyrillic
| '\u0468' // Cyrillic
| '\u046a' // Cyrillic
| '\u046c' // Cyrillic
| '\u046e' // Cyrillic
| '\u0470' // Cyrillic
| '\u0472' // Cyrillic
| '\u0474' // Cyrillic
| '\u0476' // Cyrillic
| '\u0478' // Cyrillic
| '\u047a' // Cyrillic
| '\u047c' // Cyrillic
| '\u047e' // Cyrillic
| '\u0480' // Cyrillic
| '\u048a' // Cyrillic
| '\u048c' // Cyrillic
| '\u048e' // Cyrillic
| '\u0490' // Cyrillic
| '\u0492' // Cyrillic
| '\u0494' // Cyrillic
| '\u0496' // Cyrillic
| '\u0498' // Cyrillic
| '\u049a' // Cyrillic
| '\u049c' // Cyrillic
| '\u049e' // Cyrillic
| '\u04a0' // Cyrillic
| '\u04a2' // Cyrillic
| '\u04a4' // Cyrillic
| '\u04a6' // Cyrillic
| '\u04a8' // Cyrillic
| '\u04aa' // Cyrillic
| '\u04ac' // Cyrillic
| '\u04ae' // Cyrillic
| '\u04b0' // Cyrillic
| '\u04b2' // Cyrillic
| '\u04b4' // Cyrillic
| '\u04b6' // Cyrillic
| '\u04b8' // Cyrillic
| '\u04ba' // Cyrillic
| '\u04bc' // Cyrillic
| '\u04be' // Cyrillic
| '\u04c0'..'\u04c2' // Cyrillic
| '\u04c3' // Cyrillic
| '\u04c5' // Cyrillic
| '\u04c7' // Cyrillic
| '\u04c9' // Cyrillic
| '\u04cb' // Cyrillic
| '\u04cd' // Cyrillic
| '\u04d0' // Cyrillic
| '\u04d2' // Cyrillic
| '\u04d4' // Cyrillic
| '\u04d6' // Cyrillic
| '\u04d8' // Cyrillic
| '\u04da' // Cyrillic
| '\u04dc' // Cyrillic
| '\u04de' // Cyrillic
| '\u04e0' // Cyrillic
| '\u04e2' // Cyrillic
| '\u04e4' // Cyrillic
| '\u04e6' // Cyrillic
| '\u04e8' // Cyrillic
| '\u04ea' // Cyrillic
| '\u04ec' // Cyrillic
| '\u04ee' // Cyrillic
| '\u04f0' // Cyrillic
| '\u04f2' // Cyrillic
| '\u04f4' // Cyrillic
| '\u04f6' // Cyrillic
| '\u04f8' // Cyrillic
| '\u04fa' // Cyrillic
| '\u04fc' // Cyrillic
| '\u04fe' // Cyrillic
| '\u0500' // Cyrillic_Supplement
| '\u0502' // Cyrillic_Supplement
| '\u0504' // Cyrillic_Supplement
| '\u0506' // Cyrillic_Supplement
| '\u0508' // Cyrillic_Supplement
| '\u050a' // Cyrillic_Supplement
| '\u050c' // Cyrillic_Supplement
| '\u050e' // Cyrillic_Supplement
| '\u0510' // Cyrillic_Supplement
| '\u0512' // Cyrillic_Supplement
| '\u0514' // Cyrillic_Supplement
| '\u0516' // Cyrillic_Supplement
| '\u0518' // Cyrillic_Supplement
| '\u051a' // Cyrillic_Supplement
| '\u051c' // Cyrillic_Supplement
| '\u051e' // Cyrillic_Supplement
| '\u0520' // Cyrillic_Supplement
| '\u0522' // Cyrillic_Supplement
| '\u0524' // Cyrillic_Supplement
| '\u0526' // Cyrillic_Supplement
| '\u0528' // Cyrillic_Supplement
| '\u052a' // Cyrillic_Supplement
| '\u052c' // Cyrillic_Supplement
| '\u052e' // Cyrillic_Supplement
| '\u0531'..'\u0557' // Armenian
| '\u10a0'..'\u10c6' // Georgian
| '\u10c7' // Georgian
| '\u10cd' // Georgian
| '\u13a0'..'\u13f6' // Cherokee
| '\u1e00' // Latin_Extended_Additional
| '\u1e02' // Latin_Extended_Additional
| '\u1e04' // Latin_Extended_Additional
| '\u1e06' // Latin_Extended_Additional
| '\u1e08' // Latin_Extended_Additional
| '\u1e0a' // Latin_Extended_Additional
| '\u1e0c' // Latin_Extended_Additional
| '\u1e0e' // Latin_Extended_Additional
| '\u1e10' // Latin_Extended_Additional
| '\u1e12' // Latin_Extended_Additional
| '\u1e14' // Latin_Extended_Additional
| '\u1e16' // Latin_Extended_Additional
| '\u1e18' // Latin_Extended_Additional
| '\u1e1a' // Latin_Extended_Additional
| '\u1e1c' // Latin_Extended_Additional
| '\u1e1e' // Latin_Extended_Additional
| '\u1e20' // Latin_Extended_Additional
| '\u1e22' // Latin_Extended_Additional
| '\u1e24' // Latin_Extended_Additional
| '\u1e26' // Latin_Extended_Additional
| '\u1e28' // Latin_Extended_Additional
| '\u1e2a' // Latin_Extended_Additional
| '\u1e2c' // Latin_Extended_Additional
| '\u1e2e' // Latin_Extended_Additional
| '\u1e30' // Latin_Extended_Additional
| '\u1e32' // Latin_Extended_Additional
| '\u1e34' // Latin_Extended_Additional
| '\u1e36' // Latin_Extended_Additional
| '\u1e38' // Latin_Extended_Additional
| '\u1e3a' // Latin_Extended_Additional
| '\u1e3c' // Latin_Extended_Additional
| '\u1e3e' // Latin_Extended_Additional
| '\u1e40' // Latin_Extended_Additional
| '\u1e42' // Latin_Extended_Additional
| '\u1e44' // Latin_Extended_Additional
| '\u1e46' // Latin_Extended_Additional
| '\u1e48' // Latin_Extended_Additional
| '\u1e4a' // Latin_Extended_Additional
| '\u1e4c' // Latin_Extended_Additional
| '\u1e4e' // Latin_Extended_Additional
| '\u1e50' // Latin_Extended_Additional
| '\u1e52' // Latin_Extended_Additional
| '\u1e54' // Latin_Extended_Additional
| '\u1e56' // Latin_Extended_Additional
| '\u1e58' // Latin_Extended_Additional
| '\u1e5a' // Latin_Extended_Additional
| '\u1e5c' // Latin_Extended_Additional
| '\u1e5e' // Latin_Extended_Additional
| '\u1e60' // Latin_Extended_Additional
| '\u1e62' // Latin_Extended_Additional
| '\u1e64' // Latin_Extended_Additional
| '\u1e66' // Latin_Extended_Additional
| '\u1e68' // Latin_Extended_Additional
| '\u1e6a' // Latin_Extended_Additional
| '\u1e6c' // Latin_Extended_Additional
| '\u1e6e' // Latin_Extended_Additional
| '\u1e70' // Latin_Extended_Additional
| '\u1e72' // Latin_Extended_Additional
| '\u1e74' // Latin_Extended_Additional
| '\u1e76' // Latin_Extended_Additional
| '\u1e78' // Latin_Extended_Additional
| '\u1e7a' // Latin_Extended_Additional
| '\u1e7c' // Latin_Extended_Additional
| '\u1e7e' // Latin_Extended_Additional
| '\u1e80' // Latin_Extended_Additional
| '\u1e82' // Latin_Extended_Additional
| '\u1e84' // Latin_Extended_Additional
| '\u1e86' // Latin_Extended_Additional
| '\u1e88' // Latin_Extended_Additional
| '\u1e8a' // Latin_Extended_Additional
| '\u1e8c' // Latin_Extended_Additional
| '\u1e8e' // Latin_Extended_Additional
| '\u1e90' // Latin_Extended_Additional
| '\u1e92' // Latin_Extended_Additional
| '\u1e94' // Latin_Extended_Additional
| '\u1e9e' // Latin_Extended_Additional
| '\u1ea0' // Latin_Extended_Additional
| '\u1ea2' // Latin_Extended_Additional
| '\u1ea4' // Latin_Extended_Additional
| '\u1ea6' // Latin_Extended_Additional
| '\u1ea8' // Latin_Extended_Additional
| '\u1eaa' // Latin_Extended_Additional
| '\u1eac' // Latin_Extended_Additional
| '\u1eae' // Latin_Extended_Additional
| '\u1eb0' // Latin_Extended_Additional
| '\u1eb2' // Latin_Extended_Additional
| '\u1eb4' // Latin_Extended_Additional
| '\u1eb6' // Latin_Extended_Additional
| '\u1eb8' // Latin_Extended_Additional
| '\u1eba' // Latin_Extended_Additional
| '\u1ebc' // Latin_Extended_Additional
| '\u1ebe' // Latin_Extended_Additional
| '\u1ec0' // Latin_Extended_Additional
| '\u1ec2' // Latin_Extended_Additional
| '\u1ec4' // Latin_Extended_Additional
| '\u1ec6' // Latin_Extended_Additional
| '\u1ec8' // Latin_Extended_Additional
| '\u1eca' // Latin_Extended_Additional
| '\u1ecc' // Latin_Extended_Additional
| '\u1ece' // Latin_Extended_Additional
| '\u1ed0' // Latin_Extended_Additional
| '\u1ed2' // Latin_Extended_Additional
| '\u1ed4' // Latin_Extended_Additional
| '\u1ed6' // Latin_Extended_Additional
| '\u1ed8' // Latin_Extended_Additional
| '\u1eda' // Latin_Extended_Additional
| '\u1edc' // Latin_Extended_Additional
| '\u1ede' // Latin_Extended_Additional
| '\u1ee0' // Latin_Extended_Additional
| '\u1ee2' // Latin_Extended_Additional
| '\u1ee4' // Latin_Extended_Additional
| '\u1ee6' // Latin_Extended_Additional
| '\u1ee8' // Latin_Extended_Additional
| '\u1eea' // Latin_Extended_Additional
| '\u1eec' // Latin_Extended_Additional
| '\u1eee' // Latin_Extended_Additional
| '\u1ef0' // Latin_Extended_Additional
| '\u1ef2' // Latin_Extended_Additional
| '\u1ef4' // Latin_Extended_Additional
| '\u1ef6' // Latin_Extended_Additional
| '\u1ef8' // Latin_Extended_Additional
| '\u1efa' // Latin_Extended_Additional
| '\u1efc' // Latin_Extended_Additional
| '\u1efe' // Latin_Extended_Additional
| '\u1f08'..'\u1f10' // Greek_Extended
| '\u1f18'..'\u1f1e' // Greek_Extended
| '\u1f28'..'\u1f30' // Greek_Extended
| '\u1f38'..'\u1f40' // Greek_Extended
| '\u1f48'..'\u1f4e' // Greek_Extended
| '\u1f59' // Greek_Extended
| '\u1f5b' // Greek_Extended
| '\u1f5d' // Greek_Extended
| '\u1f5f' // Greek_Extended
| '\u1f68'..'\u1f70' // Greek_Extended
| '\u1fb8'..'\u1fbc' // Greek_Extended
| '\u1fc8'..'\u1fcc' // Greek_Extended
| '\u1fd8'..'\u1fdc' // Greek_Extended
| '\u1fe8'..'\u1fed' // Greek_Extended
| '\u1ff8'..'\u1ffc' // Greek_Extended
| '\u2102' // Letterlike_Symbols
| '\u2107' // Letterlike_Symbols
| '\u210b'..'\u210e' // Letterlike_Symbols
| '\u2110'..'\u2113' // Letterlike_Symbols
| '\u2115' // Letterlike_Symbols
| '\u2119'..'\u211e' // Letterlike_Symbols
| '\u2124' // Letterlike_Symbols
| '\u2126' // Letterlike_Symbols
| '\u2128' // Letterlike_Symbols
| '\u212a'..'\u212e' // Letterlike_Symbols
| '\u2130'..'\u2134' // Letterlike_Symbols
| '\u213e'..'\u2140' // Letterlike_Symbols
| '\u2145' // Letterlike_Symbols
| '\u2183' // Number_Forms
| '\u2c00'..'\u2c2f' // Glagolitic
| '\u2c60' // Latin_Extended-C
| '\u2c62'..'\u2c65' // Latin_Extended-C
| '\u2c67' // Latin_Extended-C
| '\u2c69' // Latin_Extended-C
| '\u2c6b' // Latin_Extended-C
| '\u2c6d'..'\u2c71' // Latin_Extended-C
| '\u2c72' // Latin_Extended-C
| '\u2c75' // Latin_Extended-C
| '\u2c7e'..'\u2c81' // Latin_Extended-C
| '\u2c82' // Coptic
| '\u2c84' // Coptic
| '\u2c86' // Coptic
| '\u2c88' // Coptic
| '\u2c8a' // Coptic
| '\u2c8c' // Coptic
| '\u2c8e' // Coptic
| '\u2c90' // Coptic
| '\u2c92' // Coptic
| '\u2c94' // Coptic
| '\u2c96' // Coptic
| '\u2c98' // Coptic
| '\u2c9a' // Coptic
| '\u2c9c' // Coptic
| '\u2c9e' // Coptic
| '\u2ca0' // Coptic
| '\u2ca2' // Coptic
| '\u2ca4' // Coptic
| '\u2ca6' // Coptic
| '\u2ca8' // Coptic
| '\u2caa' // Coptic
| '\u2cac' // Coptic
| '\u2cae' // Coptic
| '\u2cb0' // Coptic
| '\u2cb2' // Coptic
| '\u2cb4' // Coptic
| '\u2cb6' // Coptic
| '\u2cb8' // Coptic
| '\u2cba' // Coptic
| '\u2cbc' // Coptic
| '\u2cbe' // Coptic
| '\u2cc0' // Coptic
| '\u2cc2' // Coptic
| '\u2cc4' // Coptic
| '\u2cc6' // Coptic
| '\u2cc8' // Coptic
| '\u2cca' // Coptic
| '\u2ccc' // Coptic
| '\u2cce' // Coptic
| '\u2cd0' // Coptic
| '\u2cd2' // Coptic
| '\u2cd4' // Coptic
| '\u2cd6' // Coptic
| '\u2cd8' // Coptic
| '\u2cda' // Coptic
| '\u2cdc' // Coptic
| '\u2cde' // Coptic
| '\u2ce0' // Coptic
| '\u2ce2' // Coptic
| '\u2ceb' // Coptic
| '\u2ced' // Coptic
| '\u2cf2' // Coptic
| '\ua640' // Cyrillic_Extended-B
| '\ua642' // Cyrillic_Extended-B
| '\ua644' // Cyrillic_Extended-B
| '\ua646' // Cyrillic_Extended-B
| '\ua648' // Cyrillic_Extended-B
| '\ua64a' // Cyrillic_Extended-B
| '\ua64c' // Cyrillic_Extended-B
| '\ua64e' // Cyrillic_Extended-B
| '\ua650' // Cyrillic_Extended-B
| '\ua652' // Cyrillic_Extended-B
| '\ua654' // Cyrillic_Extended-B
| '\ua656' // Cyrillic_Extended-B
| '\ua658' // Cyrillic_Extended-B
| '\ua65a' // Cyrillic_Extended-B
| '\ua65c' // Cyrillic_Extended-B
| '\ua65e' // Cyrillic_Extended-B
| '\ua660' // Cyrillic_Extended-B
| '\ua662' // Cyrillic_Extended-B
| '\ua664' // Cyrillic_Extended-B
| '\ua666' // Cyrillic_Extended-B
| '\ua668' // Cyrillic_Extended-B
| '\ua66a' // Cyrillic_Extended-B
| '\ua66c' // Cyrillic_Extended-B
| '\ua680' // Cyrillic_Extended-B
| '\ua682' // Cyrillic_Extended-B
| '\ua684' // Cyrillic_Extended-B
| '\ua686' // Cyrillic_Extended-B
| '\ua688' // Cyrillic_Extended-B
| '\ua68a' // Cyrillic_Extended-B
| '\ua68c' // Cyrillic_Extended-B
| '\ua68e' // Cyrillic_Extended-B
| '\ua690' // Cyrillic_Extended-B
| '\ua692' // Cyrillic_Extended-B
| '\ua694' // Cyrillic_Extended-B
| '\ua696' // Cyrillic_Extended-B
| '\ua698' // Cyrillic_Extended-B
| '\ua69a' // Cyrillic_Extended-B
| '\ua722' // Latin_Extended-D
| '\ua724' // Latin_Extended-D
| '\ua726' // Latin_Extended-D
| '\ua728' // Latin_Extended-D
| '\ua72a' // Latin_Extended-D
| '\ua72c' // Latin_Extended-D
| '\ua72e' // Latin_Extended-D
| '\ua732' // Latin_Extended-D
| '\ua734' // Latin_Extended-D
| '\ua736' // Latin_Extended-D
| '\ua738' // Latin_Extended-D
| '\ua73a' // Latin_Extended-D
| '\ua73c' // Latin_Extended-D
| '\ua73e' // Latin_Extended-D
| '\ua740' // Latin_Extended-D
| '\ua742' // Latin_Extended-D
| '\ua744' // Latin_Extended-D
| '\ua746' // Latin_Extended-D
| '\ua748' // Latin_Extended-D
| '\ua74a' // Latin_Extended-D
| '\ua74c' // Latin_Extended-D
| '\ua74e' // Latin_Extended-D
| '\ua750' // Latin_Extended-D
| '\ua752' // Latin_Extended-D
| '\ua754' // Latin_Extended-D
| '\ua756' // Latin_Extended-D
| '\ua758' // Latin_Extended-D
| '\ua75a' // Latin_Extended-D
| '\ua75c' // Latin_Extended-D
| '\ua75e' // Latin_Extended-D
| '\ua760' // Latin_Extended-D
| '\ua762' // Latin_Extended-D
| '\ua764' // Latin_Extended-D
| '\ua766' // Latin_Extended-D
| '\ua768' // Latin_Extended-D
| '\ua76a' // Latin_Extended-D
| '\ua76c' // Latin_Extended-D
| '\ua76e' // Latin_Extended-D
| '\ua779' // Latin_Extended-D
| '\ua77b' // Latin_Extended-D
| '\ua77d'..'\ua77f' // Latin_Extended-D
| '\ua780' // Latin_Extended-D
| '\ua782' // Latin_Extended-D
| '\ua784' // Latin_Extended-D
| '\ua786' // Latin_Extended-D
| '\ua78b' // Latin_Extended-D
| '\ua78d' // Latin_Extended-D
| '\ua790' // Latin_Extended-D
| '\ua792' // Latin_Extended-D
| '\ua796' // Latin_Extended-D
| '\ua798' // Latin_Extended-D
| '\ua79a' // Latin_Extended-D
| '\ua79c' // Latin_Extended-D
| '\ua79e' // Latin_Extended-D
| '\ua7a0' // Latin_Extended-D
| '\ua7a2' // Latin_Extended-D
| '\ua7a4' // Latin_Extended-D
| '\ua7a6' // Latin_Extended-D
| '\ua7a8' // Latin_Extended-D
| '\ua7aa'..'\ua7af' // Latin_Extended-D
| '\ua7b0'..'\ua7b5' // Latin_Extended-D
| '\ua7b6' // Latin_Extended-D
| '\uff21'..'\uff3b' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Mc:
'\u0903' // Devanagari
| '\u093b' // Devanagari
| '\u093e'..'\u0941' // Devanagari
| '\u0949'..'\u094d' // Devanagari
| '\u094e'..'\u0950' // Devanagari
| '\u0982'..'\u0984' // Bengali
| '\u09be'..'\u09c1' // Bengali
| '\u09c7'..'\u09c9' // Bengali
| '\u09cb'..'\u09cd' // Bengali
| '\u09d7' // Bengali
| '\u0a03' // Gurmukhi
| '\u0a3e'..'\u0a41' // Gurmukhi
| '\u0a83' // Gujarati
| '\u0abe'..'\u0ac1' // Gujarati
| '\u0ac9' // Gujarati
| '\u0acb'..'\u0acd' // Gujarati
| '\u0b02'..'\u0b04' // Oriya
| '\u0b3e' // Oriya
| '\u0b40' // Oriya
| '\u0b47'..'\u0b49' // Oriya
| '\u0b4b'..'\u0b4d' // Oriya
| '\u0b57' // Oriya
| '\u0bbe'..'\u0bc0' // Tamil
| '\u0bc1'..'\u0bc3' // Tamil
| '\u0bc6'..'\u0bc9' // Tamil
| '\u0bca'..'\u0bcd' // Tamil
| '\u0bd7' // Tamil
| '\u0c01'..'\u0c04' // Telugu
| '\u0c41'..'\u0c45' // Telugu
| '\u0c82'..'\u0c84' // Kannada
| '\u0cbe' // Kannada
| '\u0cc0'..'\u0cc5' // Kannada
| '\u0cc7'..'\u0cc9' // Kannada
| '\u0cca'..'\u0ccc' // Kannada
| '\u0cd5'..'\u0cd7' // Kannada
| '\u0d02'..'\u0d04' // Malayalam
| '\u0d3e'..'\u0d41' // Malayalam
| '\u0d46'..'\u0d49' // Malayalam
| '\u0d4a'..'\u0d4d' // Malayalam
| '\u0d57' // Malayalam
| '\u0d82'..'\u0d84' // Sinhala
| '\u0dcf'..'\u0dd2' // Sinhala
| '\u0dd8'..'\u0de0' // Sinhala
| '\u0df2'..'\u0df4' // Sinhala
| '\u0f3e'..'\u0f40' // Tibetan
| '\u0f7f' // Tibetan
| '\u102b'..'\u102d' // Myanmar
| '\u1031' // Myanmar
| '\u1038' // Myanmar
| '\u103b'..'\u103d' // Myanmar
| '\u1056'..'\u1058' // Myanmar
| '\u1062'..'\u1065' // Myanmar
| '\u1067'..'\u106e' // Myanmar
| '\u1083'..'\u1085' // Myanmar
| '\u1087'..'\u108d' // Myanmar
| '\u108f' // Myanmar
| '\u109a'..'\u109d' // Myanmar
| '\u17b6' // Khmer
| '\u17be'..'\u17c6' // Khmer
| '\u17c7'..'\u17c9' // Khmer
| '\u1923'..'\u1927' // Limbu
| '\u1929'..'\u192c' // Limbu
| '\u1930'..'\u1932' // Limbu
| '\u1933'..'\u1939' // Limbu
| '\u1a19'..'\u1a1b' // Buginese
| '\u1a55' // Tai_Tham
| '\u1a57' // Tai_Tham
| '\u1a61' // Tai_Tham
| '\u1a63'..'\u1a65' // Tai_Tham
| '\u1a6d'..'\u1a73' // Tai_Tham
| '\u1b04' // Balinese
| '\u1b35' // Balinese
| '\u1b3b' // Balinese
| '\u1b3d'..'\u1b42' // Balinese
| '\u1b43'..'\u1b45' // Balinese
| '\u1b82' // Sundanese
| '\u1ba1' // Sundanese
| '\u1ba6'..'\u1ba8' // Sundanese
| '\u1baa' // Sundanese
| '\u1be7' // Batak
| '\u1bea'..'\u1bed' // Batak
| '\u1bee' // Batak
| '\u1bf2'..'\u1bf4' // Batak
| '\u1c24'..'\u1c2c' // Lepcha
| '\u1c34'..'\u1c36' // Lepcha
| '\u1ce1' // Vedic_Extensions
| '\u1cf2'..'\u1cf4' // Vedic_Extensions
| '\u302e'..'\u3030' // CJK_Symbols_and_Punctuation
| '\ua823'..'\ua825' // Syloti_Nagri
| '\ua827' // Syloti_Nagri
| '\ua880'..'\ua882' // Saurashtra
| '\ua8b4'..'\ua8c4' // Saurashtra
| '\ua952'..'\ua954' // Rejang
| '\ua983' // Javanese
| '\ua9b4'..'\ua9b6' // Javanese
| '\ua9ba'..'\ua9bc' // Javanese
| '\ua9bd'..'\ua9c1' // Javanese
| '\uaa2f'..'\uaa31' // Cham
| '\uaa33'..'\uaa35' // Cham
| '\uaa4d' // Cham
| '\uaa7b' // Myanmar_Extended-A
| '\uaa7d' // Myanmar_Extended-A
| '\uaaeb' // Meetei_Mayek_Extensions
| '\uaaee'..'\uaaf0' // Meetei_Mayek_Extensions
| '\uaaf5' // Meetei_Mayek_Extensions
| '\uabe3'..'\uabe5' // Meetei_Mayek
| '\uabe6'..'\uabe8' // Meetei_Mayek
| '\uabe9'..'\uabeb' // Meetei_Mayek
| '\uabec' // Meetei_Mayek
;
CLASSIFY_Me:
'\u0488'..'\u048a' // Cyrillic
| '\u1abe' // Combining_Diacritical_Marks_Extended
| '\u20dd'..'\u20e1' // Combining_Diacritical_Marks_for_Symbols
| '\u20e2'..'\u20e5' // Combining_Diacritical_Marks_for_Symbols
| '\ua670'..'\ua673' // Cyrillic_Extended-B
;
CLASSIFY_Mn:
'\u0300'..'\u0370' // Combining_Diacritical_Marks
| '\u0483'..'\u0488' // Cyrillic
| '\u0591'..'\u05be' // Hebrew
| '\u05bf' // Hebrew
| '\u05c1'..'\u05c3' // Hebrew
| '\u05c4'..'\u05c6' // Hebrew
| '\u05c7' // Hebrew
| '\u0610'..'\u061b' // Arabic
| '\u064b'..'\u0660' // Arabic
| '\u0670' // Arabic
| '\u06d6'..'\u06dd' // Arabic
| '\u06df'..'\u06e5' // Arabic
| '\u06e7'..'\u06e9' // Arabic
| '\u06ea'..'\u06ee' // Arabic
| '\u0711' // Syriac
| '\u0730'..'\u074b' // Syriac
| '\u07a6'..'\u07b1' // Thaana
| '\u07eb'..'\u07f4' // NKo
| '\u0816'..'\u081a' // Samaritan
| '\u081b'..'\u0824' // Samaritan
| '\u0825'..'\u0828' // Samaritan
| '\u0829'..'\u082e' // Samaritan
| '\u0859'..'\u085c' // Mandaic
| '\u08d4'..'\u08e2' // Arabic_Extended-A
| '\u08e3'..'\u0903' // Arabic_Extended-A
| '\u093a' // Devanagari
| '\u093c' // Devanagari
| '\u0941'..'\u0949' // Devanagari
| '\u094d' // Devanagari
| '\u0951'..'\u0958' // Devanagari
| '\u0962'..'\u0964' // Devanagari
| '\u0981' // Bengali
| '\u09bc' // Bengali
| '\u09c1'..'\u09c5' // Bengali
| '\u09cd' // Bengali
| '\u09e2'..'\u09e4' // Bengali
| '\u0a01'..'\u0a03' // Gurmukhi
| '\u0a3c' // Gurmukhi
| '\u0a41'..'\u0a43' // Gurmukhi
| '\u0a47'..'\u0a49' // Gurmukhi
| '\u0a4b'..'\u0a4e' // Gurmukhi
| '\u0a51' // Gurmukhi
| '\u0a70'..'\u0a72' // Gurmukhi
| '\u0a75' // Gurmukhi
| '\u0a81'..'\u0a83' // Gujarati
| '\u0abc' // Gujarati
| '\u0ac1'..'\u0ac6' // Gujarati
| '\u0ac7'..'\u0ac9' // Gujarati
| '\u0acd' // Gujarati
| '\u0ae2'..'\u0ae4' // Gujarati
| '\u0b01' // Oriya
| '\u0b3c' // Oriya
| '\u0b3f' // Oriya
| '\u0b41'..'\u0b45' // Oriya
| '\u0b4d' // Oriya
| '\u0b56' // Oriya
| '\u0b62'..'\u0b64' // Oriya
| '\u0b82' // Tamil
| '\u0bc0' // Tamil
| '\u0bcd' // Tamil
| '\u0c00' // Telugu
| '\u0c3e'..'\u0c41' // Telugu
| '\u0c46'..'\u0c49' // Telugu
| '\u0c4a'..'\u0c4e' // Telugu
| '\u0c55'..'\u0c57' // Telugu
| '\u0c62'..'\u0c64' // Telugu
| '\u0c81' // Kannada
| '\u0cbc' // Kannada
| '\u0cbf' // Kannada
| '\u0cc6' // Kannada
| '\u0ccc'..'\u0cce' // Kannada
| '\u0ce2'..'\u0ce4' // Kannada
| '\u0d01' // Malayalam
| '\u0d41'..'\u0d45' // Malayalam
| '\u0d4d' // Malayalam
| '\u0d62'..'\u0d64' // Malayalam
| '\u0dca' // Sinhala
| '\u0dd2'..'\u0dd5' // Sinhala
| '\u0dd6' // Sinhala
| '\u0e31' // Thai
| '\u0e34'..'\u0e3b' // Thai
| '\u0e47'..'\u0e4f' // Thai
| '\u0eb1' // Lao
| '\u0eb4'..'\u0eba' // Lao
| '\u0ebb'..'\u0ebd' // Lao
| '\u0ec8'..'\u0ece' // Lao
| '\u0f18'..'\u0f1a' // Tibetan
| '\u0f35' // Tibetan
| '\u0f37' // Tibetan
| '\u0f39' // Tibetan
| '\u0f71'..'\u0f7f' // Tibetan
| '\u0f80'..'\u0f85' // Tibetan
| '\u0f86'..'\u0f88' // Tibetan
| '\u0f8d'..'\u0f98' // Tibetan
| '\u0f99'..'\u0fbd' // Tibetan
| '\u0fc6' // Tibetan
| '\u102d'..'\u1031' // Myanmar
| '\u1032'..'\u1038' // Myanmar
| '\u1039'..'\u103b' // Myanmar
| '\u103d'..'\u103f' // Myanmar
| '\u1058'..'\u105a' // Myanmar
| '\u105e'..'\u1061' // Myanmar
| '\u1071'..'\u1075' // Myanmar
| '\u1082' // Myanmar
| '\u1085'..'\u1087' // Myanmar
| '\u108d' // Myanmar
| '\u109d' // Myanmar
| '\u135d'..'\u1360' // Ethiopic
| '\u1712'..'\u1715' // Tagalog
| '\u1732'..'\u1735' // Hanunoo
| '\u1752'..'\u1754' // Buhid
| '\u1772'..'\u1774' // Tagbanwa
| '\u17b4'..'\u17b6' // Khmer
| '\u17b7'..'\u17be' // Khmer
| '\u17c6' // Khmer
| '\u17c9'..'\u17d4' // Khmer
| '\u17dd' // Khmer
| '\u180b'..'\u180e' // Mongolian
| '\u1885'..'\u1887' // Mongolian
| '\u18a9' // Mongolian
| '\u1920'..'\u1923' // Limbu
| '\u1927'..'\u1929' // Limbu
| '\u1932' // Limbu
| '\u1939'..'\u193c' // Limbu
| '\u1a17'..'\u1a19' // Buginese
| '\u1a1b' // Buginese
| '\u1a56' // Tai_Tham
| '\u1a58'..'\u1a5f' // Tai_Tham
| '\u1a60' // Tai_Tham
| '\u1a62' // Tai_Tham
| '\u1a65'..'\u1a6d' // Tai_Tham
| '\u1a73'..'\u1a7d' // Tai_Tham
| '\u1a7f' // Tai_Tham
| '\u1ab0'..'\u1abe' // Combining_Diacritical_Marks_Extended
| '\u1b00'..'\u1b04' // Balinese
| '\u1b34' // Balinese
| '\u1b36'..'\u1b3b' // Balinese
| '\u1b3c' // Balinese
| '\u1b42' // Balinese
| '\u1b6b'..'\u1b74' // Balinese
| '\u1b80'..'\u1b82' // Sundanese
| '\u1ba2'..'\u1ba6' // Sundanese
| '\u1ba8'..'\u1baa' // Sundanese
| '\u1bab'..'\u1bae' // Sundanese
| '\u1be6' // Batak
| '\u1be8'..'\u1bea' // Batak
| '\u1bed' // Batak
| '\u1bef'..'\u1bf2' // Batak
| '\u1c2c'..'\u1c34' // Lepcha
| '\u1c36'..'\u1c38' // Lepcha
| '\u1cd0'..'\u1cd3' // Vedic_Extensions
| '\u1cd4'..'\u1ce1' // Vedic_Extensions
| '\u1ce2'..'\u1ce9' // Vedic_Extensions
| '\u1ced' // Vedic_Extensions
| '\u1cf4' // Vedic_Extensions
| '\u1cf8'..'\u1cfa' // Vedic_Extensions
| '\u1dc0'..'\u1df6' // Combining_Diacritical_Marks_Supplement
| '\u1dfb'..'\u1e00' // Combining_Diacritical_Marks_Supplement
| '\u20d0'..'\u20dd' // Combining_Diacritical_Marks_for_Symbols
| '\u20e1' // Combining_Diacritical_Marks_for_Symbols
| '\u20e5'..'\u20f1' // Combining_Diacritical_Marks_for_Symbols
| '\u2cef'..'\u2cf2' // Coptic
| '\u2d7f' // (Absent from Blocks.txt)
| '\u2de0'..'\u2e00' // Cyrillic_Extended-A
| '\u302a'..'\u302e' // CJK_Symbols_and_Punctuation
| '\u3099'..'\u309b' // Hiragana
| '\ua66f' // Cyrillic_Extended-B
| '\ua674'..'\ua67e' // Cyrillic_Extended-B
| '\ua69e'..'\ua6a0' // Cyrillic_Extended-B
| '\ua6f0'..'\ua6f2' // Bamum
| '\ua802' // Syloti_Nagri
| '\ua806' // Syloti_Nagri
| '\ua80b' // Syloti_Nagri
| '\ua825'..'\ua827' // Syloti_Nagri
| '\ua8c4'..'\ua8c6' // Saurashtra
| '\ua8e0'..'\ua8f2' // Devanagari_Extended
| '\ua926'..'\ua92e' // Kayah_Li
| '\ua947'..'\ua952' // Rejang
| '\ua980'..'\ua983' // Javanese
| '\ua9b3' // Javanese
| '\ua9b6'..'\ua9ba' // Javanese
| '\ua9bc' // Javanese
| '\ua9e5' // Myanmar_Extended-B
| '\uaa29'..'\uaa2f' // Cham
| '\uaa31'..'\uaa33' // Cham
| '\uaa35'..'\uaa37' // Cham
| '\uaa43' // Cham
| '\uaa4c' // Cham
| '\uaa7c' // Myanmar_Extended-A
| '\uaab0' // Tai_Viet
| '\uaab2'..'\uaab5' // Tai_Viet
| '\uaab7'..'\uaab9' // Tai_Viet
| '\uaabe'..'\uaac0' // Tai_Viet
| '\uaac1' // Tai_Viet
| '\uaaec'..'\uaaee' // Meetei_Mayek_Extensions
| '\uaaf6' // Meetei_Mayek_Extensions
| '\uabe5' // Meetei_Mayek
| '\uabe8' // Meetei_Mayek
| '\uabed' // Meetei_Mayek
| '\ufb1e' // Alphabetic_Presentation_Forms
| '\ufe00'..'\ufe10' // Variation_Selectors
| '\ufe20'..'\ufe30' // Combining_Half_Marks
;
CLASSIFY_Nd:
'\u0030'..'\u003a' // Basic_Latin
| '\u0660'..'\u066a' // Arabic
| '\u06f0'..'\u06fa' // Arabic
| '\u07c0'..'\u07ca' // NKo
| '\u0966'..'\u0970' // Devanagari
| '\u09e6'..'\u09f0' // Bengali
| '\u0a66'..'\u0a70' // Gurmukhi
| '\u0ae6'..'\u0af0' // Gujarati
| '\u0b66'..'\u0b70' // Oriya
| '\u0be6'..'\u0bf0' // Tamil
| '\u0c66'..'\u0c70' // Telugu
| '\u0ce6'..'\u0cf0' // Kannada
| '\u0d66'..'\u0d70' // Malayalam
| '\u0de6'..'\u0df0' // Sinhala
| '\u0e50'..'\u0e5a' // Thai
| '\u0ed0'..'\u0eda' // Lao
| '\u0f20'..'\u0f2a' // Tibetan
| '\u1040'..'\u104a' // Myanmar
| '\u1090'..'\u109a' // Myanmar
| '\u17e0'..'\u17ea' // Khmer
| '\u1810'..'\u181a' // Mongolian
| '\u1946'..'\u1950' // Limbu
| '\u19d0'..'\u19da' // New_Tai_Lue
| '\u1a80'..'\u1a8a' // Tai_Tham
| '\u1a90'..'\u1a9a' // Tai_Tham
| '\u1b50'..'\u1b5a' // Balinese
| '\u1bb0'..'\u1bba' // Sundanese
| '\u1c40'..'\u1c4a' // Lepcha
| '\u1c50'..'\u1c5a' // Ol_Chiki
| '\ua620'..'\ua62a' // Vai
| '\ua8d0'..'\ua8da' // Saurashtra
| '\ua900'..'\ua90a' // Kayah_Li
| '\ua9d0'..'\ua9da' // Javanese
| '\ua9f0'..'\ua9fa' // Myanmar_Extended-B
| '\uaa50'..'\uaa5a' // Cham
| '\uabf0'..'\uabfa' // Meetei_Mayek
| '\uff10'..'\uff1a' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Nl:
'\u16ee'..'\u16f1' // Runic
| '\u2160'..'\u2183' // Number_Forms
| '\u2185'..'\u2189' // Number_Forms
| '\u3007' // CJK_Symbols_and_Punctuation
| '\u3021'..'\u302a' // CJK_Symbols_and_Punctuation
| '\u3038'..'\u303b' // CJK_Symbols_and_Punctuation
| '\ua6e6'..'\ua6f0' // Bamum
;
CLASSIFY_No:
'\u00b2'..'\u00b4' // Latin-1_Supplement
| '\u00b9' // Latin-1_Supplement
| '\u00bc'..'\u00bf' // Latin-1_Supplement
| '\u09f4'..'\u09fa' // Bengali
| '\u0b72'..'\u0b78' // Oriya
| '\u0bf0'..'\u0bf3' // Tamil
| '\u0c78'..'\u0c7f' // Telugu
| '\u0d58'..'\u0d5f' // Malayalam
| '\u0d70'..'\u0d79' // Malayalam
| '\u0f2a'..'\u0f34' // Tibetan
| '\u1369'..'\u137d' // Ethiopic
| '\u17f0'..'\u17fa' // Khmer
| '\u19da' // New_Tai_Lue
| '\u2070' // Superscripts_and_Subscripts
| '\u2074'..'\u207a' // Superscripts_and_Subscripts
| '\u2080'..'\u208a' // Superscripts_and_Subscripts
| '\u2150'..'\u2160' // Number_Forms
| '\u2189' // Number_Forms
| '\u2460'..'\u249c' // Enclosed_Alphanumerics
| '\u24ea'..'\u2500' // Enclosed_Alphanumerics
| '\u2776'..'\u2794' // Dingbats
| '\u2cfd' // Coptic
| '\u3192'..'\u3196' // Kanbun
| '\u3220'..'\u322a' // Enclosed_CJK_Letters_and_Months
| '\u3248'..'\u3250' // Enclosed_CJK_Letters_and_Months
| '\u3251'..'\u3260' // Enclosed_CJK_Letters_and_Months
| '\u3280'..'\u328a' // Enclosed_CJK_Letters_and_Months
| '\u32b1'..'\u32c0' // Enclosed_CJK_Letters_and_Months
| '\ua830'..'\ua836' // Common_Indic_Number_Forms
;
CLASSIFY_Pc:
'\u005f' // Basic_Latin
| '\u203f'..'\u2041' // General_Punctuation
| '\u2054' // General_Punctuation
| '\ufe33'..'\ufe35' // CJK_Compatibility_Forms
| '\ufe4d'..'\ufe50' // CJK_Compatibility_Forms
| '\uff3f' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Pd:
'\u002d' // Basic_Latin
| '\u058a' // Armenian
| '\u05be' // Hebrew
| '\u1400' // Unified_Canadian_Aboriginal_Syllabics
| '\u1806' // Mongolian
| '\u2010'..'\u2016' // General_Punctuation
| '\u2e17' // Supplemental_Punctuation
| '\u2e1a' // Supplemental_Punctuation
| '\u2e3a'..'\u2e3c' // Supplemental_Punctuation
| '\u2e40' // Supplemental_Punctuation
| '\u301c' // CJK_Symbols_and_Punctuation
| '\u3030' // CJK_Symbols_and_Punctuation
| '\u30a0' // Katakana
| '\ufe31'..'\ufe33' // CJK_Compatibility_Forms
| '\ufe58' // Small_Form_Variants
| '\ufe63' // Small_Form_Variants
| '\uff0d' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Pe:
'\u0029' // Basic_Latin
| '\u005d' // Basic_Latin
| '\u007d' // Basic_Latin
| '\u0f3b' // Tibetan
| '\u0f3d' // Tibetan
| '\u169c' // Ogham
| '\u2046' // General_Punctuation
| '\u207e' // Superscripts_and_Subscripts
| '\u208e' // Superscripts_and_Subscripts
| '\u2309' // Miscellaneous_Technical
| '\u230b' // Miscellaneous_Technical
| '\u232a' // Miscellaneous_Technical
| '\u2769' // Dingbats
| '\u276b' // Dingbats
| '\u276d' // Dingbats
| '\u276f' // Dingbats
| '\u2771' // Dingbats
| '\u2773' // Dingbats
| '\u2775' // Dingbats
| '\u27c6' // Miscellaneous_Mathematical_Symbols-A
| '\u27e7' // Miscellaneous_Mathematical_Symbols-A
| '\u27e9' // Miscellaneous_Mathematical_Symbols-A
| '\u27eb' // Miscellaneous_Mathematical_Symbols-A
| '\u27ed' // Miscellaneous_Mathematical_Symbols-A
| '\u27ef' // (Absent from Blocks.txt)
| '\u2984' // Miscellaneous_Mathematical_Symbols-B
| '\u2986' // Miscellaneous_Mathematical_Symbols-B
| '\u2988' // Miscellaneous_Mathematical_Symbols-B
| '\u298a' // Miscellaneous_Mathematical_Symbols-B
| '\u298c' // Miscellaneous_Mathematical_Symbols-B
| '\u298e' // Miscellaneous_Mathematical_Symbols-B
| '\u2990' // Miscellaneous_Mathematical_Symbols-B
| '\u2992' // Miscellaneous_Mathematical_Symbols-B
| '\u2994' // Miscellaneous_Mathematical_Symbols-B
| '\u2996' // Miscellaneous_Mathematical_Symbols-B
| '\u2998' // Miscellaneous_Mathematical_Symbols-B
| '\u29d9' // Miscellaneous_Mathematical_Symbols-B
| '\u29db' // Miscellaneous_Mathematical_Symbols-B
| '\u29fd' // Miscellaneous_Mathematical_Symbols-B
| '\u2e23' // Supplemental_Punctuation
| '\u2e25' // Supplemental_Punctuation
| '\u2e27' // Supplemental_Punctuation
| '\u2e29' // Supplemental_Punctuation
| '\u3009' // CJK_Symbols_and_Punctuation
| '\u300b' // CJK_Symbols_and_Punctuation
| '\u300d' // CJK_Symbols_and_Punctuation
| '\u300f' // CJK_Symbols_and_Punctuation
| '\u3011' // CJK_Symbols_and_Punctuation
| '\u3015' // CJK_Symbols_and_Punctuation
| '\u3017' // CJK_Symbols_and_Punctuation
| '\u3019' // CJK_Symbols_and_Punctuation
| '\u301b' // CJK_Symbols_and_Punctuation
| '\u301e'..'\u3020' // CJK_Symbols_and_Punctuation
| '\ufd3e' // Arabic_Presentation_Forms-A
| '\ufe18' // Vertical_Forms
| '\ufe36' // CJK_Compatibility_Forms
| '\ufe38' // CJK_Compatibility_Forms
| '\ufe3a' // CJK_Compatibility_Forms
| '\ufe3c' // CJK_Compatibility_Forms
| '\ufe3e' // CJK_Compatibility_Forms
| '\ufe40' // CJK_Compatibility_Forms
| '\ufe42' // CJK_Compatibility_Forms
| '\ufe44' // CJK_Compatibility_Forms
| '\ufe48' // CJK_Compatibility_Forms
| '\ufe5a' // Small_Form_Variants
| '\ufe5c' // Small_Form_Variants
| '\ufe5e' // Small_Form_Variants
| '\uff09' // Halfwidth_and_Fullwidth_Forms
| '\uff3d' // Halfwidth_and_Fullwidth_Forms
| '\uff5d' // Halfwidth_and_Fullwidth_Forms
| '\uff60' // Halfwidth_and_Fullwidth_Forms
| '\uff63' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Pf:
'\u00bb' // Latin-1_Supplement
| '\u2019' // General_Punctuation
| '\u201d' // General_Punctuation
| '\u203a' // General_Punctuation
| '\u2e03' // Supplemental_Punctuation
| '\u2e05' // Supplemental_Punctuation
| '\u2e0a' // Supplemental_Punctuation
| '\u2e0d' // Supplemental_Punctuation
| '\u2e1d' // Supplemental_Punctuation
| '\u2e21' // Supplemental_Punctuation
;
CLASSIFY_Pi:
'\u00ab' // Latin-1_Supplement
| '\u2018' // General_Punctuation
| '\u201b'..'\u201d' // General_Punctuation
| '\u201f' // General_Punctuation
| '\u2039' // General_Punctuation
| '\u2e02' // Supplemental_Punctuation
| '\u2e04' // Supplemental_Punctuation
| '\u2e09' // Supplemental_Punctuation
| '\u2e0c' // Supplemental_Punctuation
| '\u2e1c' // Supplemental_Punctuation
| '\u2e20' // Supplemental_Punctuation
;
CLASSIFY_Po:
'\u0021'..'\u0024' // Basic_Latin
| '\u0025'..'\u0028' // Basic_Latin
| '\u002a' // Basic_Latin
| '\u002c' // Basic_Latin
| '\u002e'..'\u0030' // Basic_Latin
| '\u003a'..'\u003c' // Basic_Latin
| '\u003f'..'\u0041' // Basic_Latin
| '\u005c' // Basic_Latin
| '\u00a1' // Latin-1_Supplement
| '\u00a7' // Latin-1_Supplement
| '\u00b6'..'\u00b8' // Latin-1_Supplement
| '\u00bf' // Latin-1_Supplement
| '\u037e' // Greek_and_Coptic
| '\u0387' // Greek_and_Coptic
| '\u055a'..'\u0560' // Armenian
| '\u0589' // Armenian
| '\u05c0' // Hebrew
| '\u05c3' // Hebrew
| '\u05c6' // Hebrew
| '\u05f3'..'\u05f5' // Hebrew
| '\u0609'..'\u060b' // Arabic
| '\u060c'..'\u060e' // Arabic
| '\u061b' // Arabic
| '\u061e'..'\u0620' // Arabic
| '\u066a'..'\u066e' // Arabic
| '\u06d4' // Arabic
| '\u0700'..'\u070e' // Syriac
| '\u07f7'..'\u07fa' // NKo
| '\u0830'..'\u083f' // Samaritan
| '\u085e' // Mandaic
| '\u0964'..'\u0966' // Devanagari
| '\u0970' // Devanagari
| '\u0af0' // Gujarati
| '\u0df4' // Sinhala
| '\u0e4f' // Thai
| '\u0e5a'..'\u0e5c' // Thai
| '\u0f04'..'\u0f13' // Tibetan
| '\u0f14' // Tibetan
| '\u0f85' // Tibetan
| '\u0fd0'..'\u0fd5' // Tibetan
| '\u0fd9'..'\u0fdb' // Tibetan
| '\u104a'..'\u1050' // Myanmar
| '\u10fb' // Georgian
| '\u1360'..'\u1369' // Ethiopic
| '\u166d'..'\u166f' // Unified_Canadian_Aboriginal_Syllabics
| '\u16eb'..'\u16ee' // Runic
| '\u1735'..'\u1737' // Hanunoo
| '\u17d4'..'\u17d7' // Khmer
| '\u17d8'..'\u17db' // Khmer
| '\u1800'..'\u1806' // Mongolian
| '\u1807'..'\u180b' // Mongolian
| '\u1944'..'\u1946' // Limbu
| '\u1a1e'..'\u1a20' // Buginese
| '\u1aa0'..'\u1aa7' // Tai_Tham
| '\u1aa8'..'\u1aae' // Tai_Tham
| '\u1b5a'..'\u1b61' // Balinese
| '\u1bfc'..'\u1c00' // Batak
| '\u1c3b'..'\u1c40' // Lepcha
| '\u1c7e'..'\u1c80' // Ol_Chiki
| '\u1cc0'..'\u1cc8' // Sundanese_Supplement
| '\u1cd3' // Vedic_Extensions
| '\u2016'..'\u2018' // General_Punctuation
| '\u2020'..'\u2028' // General_Punctuation
| '\u2030'..'\u2039' // General_Punctuation
| '\u203b'..'\u203f' // General_Punctuation
| '\u2041'..'\u2044' // General_Punctuation
| '\u2047'..'\u2052' // General_Punctuation
| '\u2053' // General_Punctuation
| '\u2055'..'\u205f' // General_Punctuation
| '\u2cf9'..'\u2cfd' // Coptic
| '\u2cfe'..'\u2d00' // Coptic
| '\u2d70' // Tifinagh
| '\u2e00'..'\u2e02' // Supplemental_Punctuation
| '\u2e06'..'\u2e09' // Supplemental_Punctuation
| '\u2e0b' // Supplemental_Punctuation
| '\u2e0e'..'\u2e17' // Supplemental_Punctuation
| '\u2e18'..'\u2e1a' // Supplemental_Punctuation
| '\u2e1b' // Supplemental_Punctuation
| '\u2e1e'..'\u2e20' // Supplemental_Punctuation
| '\u2e2a'..'\u2e2f' // Supplemental_Punctuation
| '\u2e30'..'\u2e3a' // Supplemental_Punctuation
| '\u2e3c'..'\u2e40' // Supplemental_Punctuation
| '\u2e41' // Supplemental_Punctuation
| '\u2e43'..'\u2e45' // Supplemental_Punctuation
| '\u3001'..'\u3004' // CJK_Symbols_and_Punctuation
| '\u303d' // CJK_Symbols_and_Punctuation
| '\u30fb' // Katakana
| '\ua4fe'..'\ua500' // Lisu
| '\ua60d'..'\ua610' // Vai
| '\ua673' // Cyrillic_Extended-B
| '\ua67e' // Cyrillic_Extended-B
| '\ua6f2'..'\ua6f8' // Bamum
| '\ua874'..'\ua878' // Phags-pa
| '\ua8ce'..'\ua8d0' // Saurashtra
| '\ua8f8'..'\ua8fb' // Devanagari_Extended
| '\ua8fc' // Devanagari_Extended
| '\ua92e'..'\ua930' // Kayah_Li
| '\ua95f' // (Absent from Blocks.txt)
| '\ua9c1'..'\ua9ce' // Javanese
| '\ua9de'..'\ua9e0' // Javanese
| '\uaa5c'..'\uaa60' // Cham
| '\uaade'..'\uaae0' // Tai_Viet
| '\uaaf0'..'\uaaf2' // Meetei_Mayek_Extensions
| '\uabeb' // Meetei_Mayek
| '\ufe10'..'\ufe17' // Vertical_Forms
| '\ufe19' // Vertical_Forms
| '\ufe30' // CJK_Compatibility_Forms
| '\ufe45'..'\ufe47' // CJK_Compatibility_Forms
| '\ufe49'..'\ufe4d' // CJK_Compatibility_Forms
| '\ufe50'..'\ufe53' // Small_Form_Variants
| '\ufe54'..'\ufe58' // Small_Form_Variants
| '\ufe5f'..'\ufe62' // Small_Form_Variants
| '\ufe68' // Small_Form_Variants
| '\ufe6a'..'\ufe6c' // Small_Form_Variants
| '\uff01'..'\uff04' // Halfwidth_and_Fullwidth_Forms
| '\uff05'..'\uff08' // Halfwidth_and_Fullwidth_Forms
| '\uff0a' // Halfwidth_and_Fullwidth_Forms
| '\uff0c' // Halfwidth_and_Fullwidth_Forms
| '\uff0e'..'\uff10' // Halfwidth_and_Fullwidth_Forms
| '\uff1a'..'\uff1c' // Halfwidth_and_Fullwidth_Forms
| '\uff1f'..'\uff21' // Halfwidth_and_Fullwidth_Forms
| '\uff3c' // Halfwidth_and_Fullwidth_Forms
| '\uff61' // Halfwidth_and_Fullwidth_Forms
| '\uff64'..'\uff66' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Ps:
'\u0028' // Basic_Latin
| '\u005b' // Basic_Latin
| '\u007b' // Basic_Latin
| '\u0f3a' // Tibetan
| '\u0f3c' // Tibetan
| '\u169b' // Ogham
| '\u201a' // General_Punctuation
| '\u201e' // General_Punctuation
| '\u2045' // General_Punctuation
| '\u207d' // Superscripts_and_Subscripts
| '\u208d' // Superscripts_and_Subscripts
| '\u2308' // Miscellaneous_Technical
| '\u230a' // Miscellaneous_Technical
| '\u2329' // Miscellaneous_Technical
| '\u2768' // Dingbats
| '\u276a' // Dingbats
| '\u276c' // Dingbats
| '\u276e' // Dingbats
| '\u2770' // Dingbats
| '\u2772' // Dingbats
| '\u2774' // Dingbats
| '\u27c5' // Miscellaneous_Mathematical_Symbols-A
| '\u27e6' // Miscellaneous_Mathematical_Symbols-A
| '\u27e8' // Miscellaneous_Mathematical_Symbols-A
| '\u27ea' // Miscellaneous_Mathematical_Symbols-A
| '\u27ec' // Miscellaneous_Mathematical_Symbols-A
| '\u27ee' // Miscellaneous_Mathematical_Symbols-A
| '\u2983' // Miscellaneous_Mathematical_Symbols-B
| '\u2985' // Miscellaneous_Mathematical_Symbols-B
| '\u2987' // Miscellaneous_Mathematical_Symbols-B
| '\u2989' // Miscellaneous_Mathematical_Symbols-B
| '\u298b' // Miscellaneous_Mathematical_Symbols-B
| '\u298d' // Miscellaneous_Mathematical_Symbols-B
| '\u298f' // Miscellaneous_Mathematical_Symbols-B
| '\u2991' // Miscellaneous_Mathematical_Symbols-B
| '\u2993' // Miscellaneous_Mathematical_Symbols-B
| '\u2995' // Miscellaneous_Mathematical_Symbols-B
| '\u2997' // Miscellaneous_Mathematical_Symbols-B
| '\u29d8' // Miscellaneous_Mathematical_Symbols-B
| '\u29da' // Miscellaneous_Mathematical_Symbols-B
| '\u29fc' // Miscellaneous_Mathematical_Symbols-B
| '\u2e22' // Supplemental_Punctuation
| '\u2e24' // Supplemental_Punctuation
| '\u2e26' // Supplemental_Punctuation
| '\u2e28' // Supplemental_Punctuation
| '\u2e42' // Supplemental_Punctuation
| '\u3008' // CJK_Symbols_and_Punctuation
| '\u300a' // CJK_Symbols_and_Punctuation
| '\u300c' // CJK_Symbols_and_Punctuation
| '\u300e' // CJK_Symbols_and_Punctuation
| '\u3010' // CJK_Symbols_and_Punctuation
| '\u3014' // CJK_Symbols_and_Punctuation
| '\u3016' // CJK_Symbols_and_Punctuation
| '\u3018' // CJK_Symbols_and_Punctuation
| '\u301a' // CJK_Symbols_and_Punctuation
| '\u301d' // CJK_Symbols_and_Punctuation
| '\ufd3f' // Arabic_Presentation_Forms-A
| '\ufe17' // Vertical_Forms
| '\ufe35' // CJK_Compatibility_Forms
| '\ufe37' // CJK_Compatibility_Forms
| '\ufe39' // CJK_Compatibility_Forms
| '\ufe3b' // CJK_Compatibility_Forms
| '\ufe3d' // CJK_Compatibility_Forms
| '\ufe3f' // CJK_Compatibility_Forms
| '\ufe41' // CJK_Compatibility_Forms
| '\ufe43' // CJK_Compatibility_Forms
| '\ufe47' // CJK_Compatibility_Forms
| '\ufe59' // Small_Form_Variants
| '\ufe5b' // Small_Form_Variants
| '\ufe5d' // Small_Form_Variants
| '\uff08' // Halfwidth_and_Fullwidth_Forms
| '\uff3b' // Halfwidth_and_Fullwidth_Forms
| '\uff5b' // Halfwidth_and_Fullwidth_Forms
| '\uff5f' // Halfwidth_and_Fullwidth_Forms
| '\uff62' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Sc:
'\u0024' // Basic_Latin
| '\u00a2'..'\u00a6' // Latin-1_Supplement
| '\u058f' // (Absent from Blocks.txt)
| '\u060b' // Arabic
| '\u09f2'..'\u09f4' // Bengali
| '\u09fb' // Bengali
| '\u0af1' // Gujarati
| '\u0bf9' // Tamil
| '\u0e3f' // Thai
| '\u17db' // Khmer
| '\u20a0'..'\u20bf' // Currency_Symbols
| '\ua838' // Common_Indic_Number_Forms
| '\ufdfc' // Arabic_Presentation_Forms-A
| '\ufe69' // Small_Form_Variants
| '\uff04' // Halfwidth_and_Fullwidth_Forms
| '\uffe0'..'\uffe2' // Halfwidth_and_Fullwidth_Forms
| '\uffe5'..'\uffe7' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Sk:
'\u005e' // Basic_Latin
| '\u0060' // Basic_Latin
| '\u00a8' // Latin-1_Supplement
| '\u00af' // Latin-1_Supplement
| '\u00b4' // Latin-1_Supplement
| '\u00b8' // Latin-1_Supplement
| '\u02c2'..'\u02c6' // Spacing_Modifier_Letters
| '\u02d2'..'\u02e0' // Spacing_Modifier_Letters
| '\u02e5'..'\u02ec' // Spacing_Modifier_Letters
| '\u02ed' // Spacing_Modifier_Letters
| '\u02ef'..'\u0300' // Spacing_Modifier_Letters
| '\u0375' // Greek_and_Coptic
| '\u0384'..'\u0386' // Greek_and_Coptic
| '\u1fbd' // Greek_Extended
| '\u1fbf'..'\u1fc2' // Greek_Extended
| '\u1fcd'..'\u1fd0' // Greek_Extended
| '\u1fdd'..'\u1fe0' // Greek_Extended
| '\u1fed'..'\u1ff0' // Greek_Extended
| '\u1ffd'..'\u1fff' // Greek_Extended
| '\u309b'..'\u309d' // Hiragana
| '\ua700'..'\ua717' // Modifier_Tone_Letters
| '\ua720'..'\ua722' // Latin_Extended-D
| '\ua789'..'\ua78b' // Latin_Extended-D
| '\uab5b' // Latin_Extended-E
| '\ufbb2'..'\ufbc2' // Arabic_Presentation_Forms-A
| '\uff3e' // Halfwidth_and_Fullwidth_Forms
| '\uff40' // Halfwidth_and_Fullwidth_Forms
| '\uffe3' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_Sm:
'\u002b' // Basic_Latin
| '\u003c'..'\u003f' // Basic_Latin
| '\u007c' // Basic_Latin
| '\u007e' // Basic_Latin
| '\u00ac' // Latin-1_Supplement
| '\u00b1' // Latin-1_Supplement
| '\u00d7' // Latin-1_Supplement
| '\u00f7' // Latin-1_Supplement
| '\u03f6' // Greek_and_Coptic
| '\u0606'..'\u0609' // Arabic
| '\u2044' // General_Punctuation
| '\u2052' // General_Punctuation
| '\u207a'..'\u207d' // Superscripts_and_Subscripts
| '\u208a'..'\u208d' // Superscripts_and_Subscripts
| '\u2118' // Letterlike_Symbols
| '\u2140'..'\u2145' // Letterlike_Symbols
| '\u214b' // Letterlike_Symbols
| '\u2190'..'\u2195' // Arrows
| '\u219a'..'\u219c' // Arrows
| '\u21a0' // Arrows
| '\u21a3' // Arrows
| '\u21a6' // Arrows
| '\u21ae' // Arrows
| '\u21ce'..'\u21d0' // Arrows
| '\u21d2' // Arrows
| '\u21d4' // Arrows
| '\u21f4'..'\u2300' // Arrows
| '\u2320'..'\u2322' // Miscellaneous_Technical
| '\u237c' // Miscellaneous_Technical
| '\u239b'..'\u23b4' // Miscellaneous_Technical
| '\u23dc'..'\u23e2' // Miscellaneous_Technical
| '\u25b7' // Geometric_Shapes
| '\u25c1' // Geometric_Shapes
| '\u25f8'..'\u2600' // Geometric_Shapes
| '\u266f' // Miscellaneous_Symbols
| '\u27c0'..'\u27c5' // Miscellaneous_Mathematical_Symbols-A
| '\u27c7'..'\u27e6' // Miscellaneous_Mathematical_Symbols-A
| '\u27f0'..'\u2800' // Supplemental_Arrows-A
| '\u2900'..'\u2983' // Supplemental_Arrows-B
| '\u2999'..'\u29d8' // Miscellaneous_Mathematical_Symbols-B
| '\u29dc'..'\u29fc' // Miscellaneous_Mathematical_Symbols-B
| '\u29fe'..'\u2b00' // Miscellaneous_Mathematical_Symbols-B
| '\u2b30'..'\u2b45' // Miscellaneous_Symbols_and_Arrows
| '\u2b47'..'\u2b4d' // Miscellaneous_Symbols_and_Arrows
| '\ufb29' // Alphabetic_Presentation_Forms
| '\ufe62' // Small_Form_Variants
| '\ufe64'..'\ufe67' // Small_Form_Variants
| '\uff0b' // Halfwidth_and_Fullwidth_Forms
| '\uff1c'..'\uff1f' // Halfwidth_and_Fullwidth_Forms
| '\uff5c' // Halfwidth_and_Fullwidth_Forms
| '\uff5e' // Halfwidth_and_Fullwidth_Forms
| '\uffe2' // Halfwidth_and_Fullwidth_Forms
| '\uffe9'..'\uffed' // Halfwidth_and_Fullwidth_Forms
;
CLASSIFY_So:
'\u00a6' // Latin-1_Supplement
| '\u00a9' // Latin-1_Supplement
| '\u00ae' // Latin-1_Supplement
| '\u00b0' // Latin-1_Supplement
| '\u0482' // Cyrillic
| '\u058d'..'\u058f' // Armenian
| '\u060e'..'\u0610' // Arabic
| '\u06de' // Arabic
| '\u06e9' // Arabic
| '\u06fd'..'\u06ff' // Arabic
| '\u07f6' // NKo
| '\u09fa' // Bengali
| '\u0b70' // Oriya
| '\u0bf3'..'\u0bf9' // Tamil
| '\u0bfa' // Tamil
| '\u0c7f' // (Absent from Blocks.txt)
| '\u0d4f' // Malayalam
| '\u0d79' // Malayalam
| '\u0f01'..'\u0f04' // Tibetan
| '\u0f13' // Tibetan
| '\u0f15'..'\u0f18' // Tibetan
| '\u0f1a'..'\u0f20' // Tibetan
| '\u0f34' // Tibetan
| '\u0f36' // Tibetan
| '\u0f38' // Tibetan
| '\u0fbe'..'\u0fc6' // Tibetan
| '\u0fc7'..'\u0fcd' // Tibetan
| '\u0fce'..'\u0fd0' // Tibetan
| '\u0fd5'..'\u0fd9' // Tibetan
| '\u109e'..'\u10a0' // Myanmar
| '\u1390'..'\u139a' // Ethiopic_Supplement
| '\u1940' // Limbu
| '\u19de'..'\u1a00' // New_Tai_Lue
| '\u1b61'..'\u1b6b' // Balinese
| '\u1b74'..'\u1b7d' // Balinese
| '\u2100'..'\u2102' // Letterlike_Symbols
| '\u2103'..'\u2107' // Letterlike_Symbols
| '\u2108'..'\u210a' // Letterlike_Symbols
| '\u2114' // Letterlike_Symbols
| '\u2116'..'\u2118' // Letterlike_Symbols
| '\u211e'..'\u2124' // Letterlike_Symbols
| '\u2125' // Letterlike_Symbols
| '\u2127' // Letterlike_Symbols
| '\u2129' // Letterlike_Symbols
| '\u212e' // Letterlike_Symbols
| '\u213a'..'\u213c' // Letterlike_Symbols
| '\u214a' // Letterlike_Symbols
| '\u214c'..'\u214e' // Letterlike_Symbols
| '\u214f' // (Absent from Blocks.txt)
| '\u218a'..'\u218c' // Number_Forms
| '\u2195'..'\u219a' // Arrows
| '\u219c'..'\u21a0' // Arrows
| '\u21a1'..'\u21a3' // Arrows
| '\u21a4'..'\u21a6' // Arrows
| '\u21a7'..'\u21ae' // Arrows
| '\u21af'..'\u21ce' // Arrows
| '\u21d0'..'\u21d2' // Arrows
| '\u21d3' // Arrows
| '\u21d5'..'\u21f4' // Arrows
| '\u2300'..'\u2308' // Miscellaneous_Technical
| '\u230c'..'\u2320' // Miscellaneous_Technical
| '\u2322'..'\u2329' // Miscellaneous_Technical
| '\u232b'..'\u237c' // Miscellaneous_Technical
| '\u237d'..'\u239b' // Miscellaneous_Technical
| '\u23b4'..'\u23dc' // Miscellaneous_Technical
| '\u23e2'..'\u23ff' // Miscellaneous_Technical
| '\u2400'..'\u2427' // Control_Pictures
| '\u2440'..'\u244b' // Optical_Character_Recognition
| '\u249c'..'\u24ea' // Enclosed_Alphanumerics
| '\u2500'..'\u25b7' // Box_Drawing
| '\u25b8'..'\u25c1' // Geometric_Shapes
| '\u25c2'..'\u25f8' // Geometric_Shapes
| '\u2600'..'\u266f' // Miscellaneous_Symbols
| '\u2670'..'\u2768' // Miscellaneous_Symbols
| '\u2794'..'\u27c0' // Dingbats
| '\u2800'..'\u2900' // Braille_Patterns
| '\u2b00'..'\u2b30' // Miscellaneous_Symbols_and_Arrows
| '\u2b45'..'\u2b47' // Miscellaneous_Symbols_and_Arrows
| '\u2b4d'..'\u2b74' // Miscellaneous_Symbols_and_Arrows
| '\u2b76'..'\u2b96' // Miscellaneous_Symbols_and_Arrows
| '\u2b98'..'\u2bba' // Miscellaneous_Symbols_and_Arrows
| '\u2bbd'..'\u2bc9' // Miscellaneous_Symbols_and_Arrows
| '\u2bca'..'\u2bd2' // Miscellaneous_Symbols_and_Arrows
| '\u2bec'..'\u2bf0' // Miscellaneous_Symbols_and_Arrows
| '\u2ce5'..'\u2ceb' // Coptic
| '\u2e80'..'\u2e9a' // CJK_Radicals_Supplement
| '\u2e9b'..'\u2ef4' // CJK_Radicals_Supplement
| '\u2f00'..'\u2fd6' // Kangxi_Radicals
| '\u2ff0'..'\u2ffc' // Ideographic_Description_Characters
| '\u3004' // CJK_Symbols_and_Punctuation
| '\u3012'..'\u3014' // CJK_Symbols_and_Punctuation
| '\u3020' // CJK_Symbols_and_Punctuation
| '\u3036'..'\u3038' // CJK_Symbols_and_Punctuation
| '\u303e'..'\u3040' // CJK_Symbols_and_Punctuation
| '\u3190'..'\u3192' // Kanbun
| '\u3196'..'\u31a0' // Kanbun
| '\u31c0'..'\u31e4' // CJK_Strokes
| '\u3200'..'\u321f' // Enclosed_CJK_Letters_and_Months
| '\u322a'..'\u3248' // Enclosed_CJK_Letters_and_Months
| '\u3250' // Enclosed_CJK_Letters_and_Months
| '\u3260'..'\u3280' // Enclosed_CJK_Letters_and_Months
| '\u328a'..'\u32b1' // Enclosed_CJK_Letters_and_Months
| '\u32c0'..'\u32ff' // Enclosed_CJK_Letters_and_Months
| '\u3300'..'\u3400' // CJK_Compatibility
| '\u4dc0'..'\u4e00' // Yijing_Hexagram_Symbols
| '\ua490'..'\ua4c7' // Yi_Radicals
| '\ua828'..'\ua82c' // Syloti_Nagri
| '\ua836'..'\ua838' // Common_Indic_Number_Forms
| '\ua839' // Common_Indic_Number_Forms
| '\uaa77'..'\uaa7a' // Myanmar_Extended-A
| '\ufdfd' // Arabic_Presentation_Forms-A
| '\uffe4' // Halfwidth_and_Fullwidth_Forms
| '\uffe8' // Halfwidth_and_Fullwidth_Forms
| '\uffed'..'\uffef' // Halfwidth_and_Fullwidth_Forms
| '\ufffc'..'\ufffe' // Specials
;
CLASSIFY_Zl:
'\u2028' // General_Punctuation
;
CLASSIFY_Zp:
'\u2029' // General_Punctuation
;
CLASSIFY_Zs:
'\u0020' // Basic_Latin
| '\u00a0' // Latin-1_Supplement
| '\u1680' // Ogham
| '\u2000'..'\u200b' // General_Punctuation
| '\u202f' // General_Punctuation
| '\u205f' // General_Punctuation
| '\u3000' // CJK_Symbols_and_Punctuation
;
CLASSIFY_C :
CLASSIFY_Cc
| CLASSIFY_Cf
| CLASSIFY_Co
| CLASSIFY_Cs // from local/PropertyValueAliases.txt
;
CLASSIFY_LC :
CLASSIFY_Ll
| CLASSIFY_Lt
| CLASSIFY_Lu // from local/PropertyValueAliases.txt
;
CLASSIFY_M :
CLASSIFY_Mc
| CLASSIFY_Me
| CLASSIFY_Mn // from local/PropertyValueAliases.txt
;
CLASSIFY_L :
CLASSIFY_Ll
| CLASSIFY_Lm
| CLASSIFY_Lo
| CLASSIFY_Lt
| CLASSIFY_Lu // from local/PropertyValueAliases.txt
;
CLASSIFY_N :
CLASSIFY_Nd
| CLASSIFY_Nl
| CLASSIFY_No // from local/PropertyValueAliases.txt
;
CLASSIFY_P :
CLASSIFY_Pc
| CLASSIFY_Pd
| CLASSIFY_Pe
| CLASSIFY_Pf
| CLASSIFY_Pi
| CLASSIFY_Po
| CLASSIFY_Ps // from local/PropertyValueAliases.txt
;
CLASSIFY_S :
CLASSIFY_Sc
| CLASSIFY_Sk
| CLASSIFY_Sm
| CLASSIFY_So // from local/PropertyValueAliases.txt
;
CLASSIFY_Z :
CLASSIFY_Zl
| CLASSIFY_Zp
| CLASSIFY_Zs // from local/PropertyValueAliases.txt
;
/* Unicode codepoint classification */
CLASSIFY_WS : CLASSIFY_Z + // hand-written rule
;
CLASSIFY_ID0 : CLASSIFY_L | '_' // hand-written rule
;
CLASSIFY_ID1 : CLASSIFY_ID0 | CLASSIFY_N // hand-written rule
;
ID : CLASSIFY_ID0 CLASSIFY_ID1 * // hand-written rule
;
|
alloy4fun_models/trashltl/models/15/TvHhAoQ8ze6AdZ5hX.als | Kaixi26/org.alloytools.alloy | 0 | 3048 | open main
pred idTvHhAoQ8ze6AdZ5hX_prop16 {
all p: Protected | historically p in Protected
}
pred __repair { idTvHhAoQ8ze6AdZ5hX_prop16 }
check __repair { idTvHhAoQ8ze6AdZ5hX_prop16 <=> prop16o } |
kraken-model-dsl/src/main/antlr4/kraken/model/dsl/KrakenDSL.g4 | eisgroup/kraken-rules | 10 | 3272 | <reponame>eisgroup/kraken-rules<filename>kraken-model-dsl/src/main/antlr4/kraken/model/dsl/KrakenDSL.g4
parser grammar KrakenDSL;
import Value;
options {tokenVocab=Common;}
kraken : namespace? anImport* model* EOF;
namespace : NAMESPACE namespaceName;
namespaceName : IDENTIFIER (DOT IDENTIFIER)*;
anImport : namespaceImport
| ruleImport
;
namespaceImport : INCLUDE namespaceName;
ruleImport : IMPORT RULE ruleNames FROM namespaceName;
model : contexts
| context
| externalContext
| externalContextDefinition
| rules
| aRule
| entryPoints
| entryPoint
| functionSignature;
contexts : CONTEXTS L_CURLY_BRACKETS (context | contexts)* R_CURLY_BRACKETS;
context : (ETA NOTSTRICT)? ROOT? CONTEXT contextName inheritedContexts? L_CURLY_BRACKETS (child | field)* R_CURLY_BRACKETS;
externalContext : EXTERNALCONTEXT L_CURLY_BRACKETS externalContextItems? R_CURLY_BRACKETS;
externalContextItem : extContextNodeItem | extContextEntityItem;
extContextNodeItem : key=identifier COLON L_CURLY_BRACKETS externalContextItems R_CURLY_BRACKETS;
extContextEntityItem : key=identifier COLON externalContextDefinitionName=identifier;
externalContextItems : externalContextItem (COMMA externalContextItem)*;
externalContextDefinition : EXTERNALENTITY contextName L_CURLY_BRACKETS (externalContextField)* R_CURLY_BRACKETS;
inheritedContexts : IS contextName (COMMA contextName)*;
contextName : identifier;
externalContextField : fieldType OP_MULT? fieldName=identifier;
field : EXTERNAL? fieldType OP_MULT? fieldName=identifier (COLON pathExpression)?;
child : CHILD OP_MULT? contextName (COLON inlineExpression)?;
rules : annotations? RULES L_CURLY_BRACKETS (aRule | rules)* R_CURLY_BRACKETS;
aRule : annotations? RULE ruleName ON contextName DOT pathExpression L_CURLY_BRACKETS (DESCRIPTION ruleDescription)? ruleCondition? payload R_CURLY_BRACKETS;
ruleDescription : STRING;
ruleName : STRING;
ruleCondition : WHEN inlineExpression;
payload : usagePayload
| defaultValuePayload
| accessibilityPayload
| visibilityPayload
| regExpPayload
| lengthPayload
| sizePayload
| sizeRangePayload
| assertionPayload
;
usagePayload : SET MANDATORY payloadMessage? override? #Mandatory
| ASSERT EMPTY payloadMessage? override? #Empty
;
assertionPayload : ASSERT inlineExpression payloadMessage? override?;
defaultValuePayload : DEFAULT TO inlineExpression #Default
| RESET TO inlineExpression #Reset
| RESET #ResetToNull
;
accessibilityPayload : SET TODISABLED;
visibilityPayload : SET TOHIDDEN;
regExpPayload : ASSERT MATCHES regExp=STRING payloadMessage? override?;
sizePayload : ASSERT SIZE (MIN | MAX)? size=positiveIntegerLiteral payloadMessage? override?;
sizeRangePayload : ASSERT SIZE MIN sizeFrom=positiveIntegerLiteral MAX sizeTo=positiveIntegerLiteral payloadMessage? override?;
lengthPayload : ASSERT LENGTH length=positiveIntegerLiteral payloadMessage? override?;
override : OVERRIDABLE group=STRING?;
payloadMessage : (ERROR | WARN | INFO) code=STRING (COLON message=STRING)?;
entryPoints : annotations? ENTRYPOINTS L_CURLY_BRACKETS (entryPoint | entryPoints)* R_CURLY_BRACKETS;
entryPoint : annotations? ENTRYPOINT entryPointName=STRING L_CURLY_BRACKETS entryPointItems? R_CURLY_BRACKETS;
entryPointItems : entryPointItem (COMMA entryPointItem)*;
entryPointItem : ruleName | ENTRYPOINT entryPointName=STRING;
ruleNames : ruleName (COMMA ruleName)*;
functionSignature : FUNCTION functionName=identifier L_ROUND_BRACKETS parameters? R_ROUND_BRACKETS COLON returnType=type;
parameters : parameter (COMMA parameter)*;
parameter : type;
annotations: annotationEntry+;
annotationEntry : metadataEntry | serverSideOnlyEntry;
serverSideOnlyEntry : ETA SERVERSIDEONLY;
metadataEntry : ETA DIMENSION L_ROUND_BRACKETS metadataKey=inlineExpression COMMA metadataValue=inlineExpression R_ROUND_BRACKETS;
pathExpression : identifier (DOT identifier)*;
inlineExpression : value;
fieldType : IDENTIFIER | reservedWordNoChild;
|
tests/test7bg.asm | dasien/mfc6502 | 0 | 83736 | <reponame>dasien/mfc6502<filename>tests/test7bg.asm
; Testing increment, decrement, and compare.
LDA #04
STA $04
LDX $04
INX
INX
LDY #01
INY
INY
DEX
DEY
DEY |
deps/gid/test/is_opaque.adb | Roldak/OpenGLAda | 0 | 17705 | <gh_stars>0
--
-- Check if an image is opaque (fully non-transparent).
--
-- Small-size demo for the GID (Generic Image Decoder) package.
-- For a larger example, look for to_bmp.adb .
--
with GID;
with Ada.Calendar;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
with Ada.Text_IO; use Ada.Text_IO;
with Interfaces;
procedure Is_opaque is
procedure Blurb is
begin
Put_Line(Current_Error, "Is_opaque * check if an image is opaque (fully non-transparent)");
Put_Line(Current_Error, "GID (Generic Image Decoder) package version " &
GID.version & " dated " & GID.reference);
Put_Line(Current_Error, "URL: " & GID.web);
New_Line(Current_Error);
Put_Line(Current_Error, "Syntax:");
Put_Line(Current_Error, "is_opaque <image_1> [<image_2>...]");
New_Line(Current_Error);
end Blurb;
procedure Check_raw_image(
image : in out GID.Image_descriptor;
next_frame: out Ada.Calendar.Day_Duration;
opaque : out Boolean
)
is
use Interfaces;
subtype Primary_color_range is Unsigned_8;
--
procedure Set_X_Y (x, y: Natural) is
begin
null;
end Set_X_Y;
--
procedure Put_Pixel (
red, green, blue : Primary_color_range;
alpha : Primary_color_range
)
is
pragma Unreferenced (blue, green, red);
begin
opaque:= opaque and alpha = Primary_color_range'Last;
end Put_Pixel;
stars: Natural:= 0;
procedure Feedback(percents: Natural) is
so_far: constant Natural:= percents / 5;
begin
for i in stars+1..so_far loop
Put( Current_Error, '*');
end loop;
stars:= so_far;
end Feedback;
procedure Load_image is
new GID.Load_image_contents(
Primary_color_range, Set_X_Y,
Put_Pixel, Feedback, GID.fast
);
begin
opaque:= True;
Load_image(image, next_frame);
end Check_raw_image;
procedure Process(name: String) is
f: Ada.Streams.Stream_IO.File_Type;
i: GID.Image_descriptor;
up_name: constant String:= To_Upper(name);
--
next_frame: Ada.Calendar.Day_Duration:= 0.0;
opaque_frame: Boolean;
begin
--
-- Load the image in its original format
--
Open(f, In_File, name);
Put_Line(Current_Error, "Checking " & name & "...");
--
GID.Load_image_header(
i,
Stream(f).all,
try_tga =>
name'Length >= 4 and then
up_name(up_name'Last-3..up_name'Last) = ".TGA"
);
if GID.Expect_transparency(i) then
Put_Line(Current_Error, ".........v.........v");
--
loop
Check_raw_image(i, next_frame, opaque_frame);
New_Line(Current_Error);
exit when next_frame = 0.0 or not opaque_frame;
end loop;
if opaque_frame then
Put_Line(Current_Error, " Opaque: all pixels of all frames are opaque.");
else
Put_Line(Current_Error, " Not opaque: at least one pixel of one frame is not opaque.");
end if;
else
Put_Line(Current_Error, " Opaque: no transparency information.");
end if;
Close(f);
end Process;
begin
if Argument_Count=0 then
Blurb;
return;
end if;
for i in 1..Argument_Count loop
Process(Argument(i));
end loop;
end Is_opaque;
|
src/main/antlr4/me/ivanyu/ExprEvaluate.g4 | thesi/antlr-java-demo | 0 | 5971 | <filename>src/main/antlr4/me/ivanyu/ExprEvaluate.g4<gh_stars>0
grammar ExprEvaluate;
@header {
import java.util.HashMap;
}
@members {
/** Map variable name to Integer object holding value */
HashMap memory = new HashMap();
}
prog: stat+ ;
stat: expr NEWLINE {System.out.println($expr.value);}
| ID '=' expr NEWLINE
{memory.put($ID.text, new Integer($expr.value));}
| NEWLINE
;
expr returns [int value]
: e=multExpr {$value = $e.value;}
( '+' e=multExpr {$value += $e.value;}
| '-' e=multExpr {$value -= $e.value;}
)*
;
multExpr returns [int value]
: e=atom {$value = $e.value;} ('*' e=atom {$value *= $e.value;})*
;
atom returns [int value]
: INT {$value = Integer.parseInt($INT.text);}
| ID
{
Integer v = (Integer)memory.get($ID.text);
if ( v!=null ) $value = v.intValue();
else System.err.println("undefined variable "+$ID.text);
}
| '(' expr ')' {$value = $expr.value;}
;
ID : ('a'..'z'|'A'..'Z')+ ;
INT : '0'..'9'+ ;
NEWLINE:'\r'? '\n' ;
WS : (' '|'\t')+ {skip();} ; |
oeis/177/A177187.asm | neoneye/loda-programs | 11 | 29722 | ; A177187: Union of A057080 and A001090
; Submitted by <NAME>(s4)
; 1,1,9,8,71,63,559,496,4401,3905,34649,30744,272791,242047,2147679,1905632,16908641,15003009,133121449,118118440,1048062951,929944511,8251382159,7321437648,64962994321,57641556673,511452572409,453811015736,4026657584951,3572846569215
mov $2,1
mov $3,1
lpb $0
sub $0,$3
mov $1,$4
trn $1,$0
mul $1,6
add $2,$1
add $4,$2
lpe
add $3,$4
dif $3,2
mov $0,$3
|
src/sound/song364restored.asm | MusicTheorist/Mother2GbaTranslation | 1 | 14712 | <reponame>MusicTheorist/Mother2GbaTranslation
song364restored_pri equ 100
song364restored_rev equ 0
song364restored_mvl equ 127
song364restored_key equ 0
song364restored_tbs equ 1
song364restored_exg equ 0
song364restored_cmp equ 1
.align 4
;**************** Track 1 (Midi-Chn.7) ****************;
@song364restored_1:
.byte KEYSH , song364restored_key+0
; 000 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte c_v+45
.byte VOL , 94*song364restored_mvl/mxv
.byte BEND , c_v-1
.byte W14
.byte c_v-1
.byte N01 , As4 , v100
.byte W02
.byte BEND , c_v-1
.byte N01 , An4
.byte W03
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 82*song364restored_mvl/mxv
.byte PAN , c_v+52
.byte W01
.byte BEND , c_v-1
.byte N01 , Fn4
.byte W02
.byte En4
.byte W02
.byte Dn4
.byte W03
.byte Cs4
.byte W02
.byte Bn3
.byte W02
.byte VOL , 100*song364restored_mvl/mxv
.byte PAN , c_v+49
.byte W01
.byte BEND , c_v-1
.byte N01 , Cn5
.byte W02
.byte Bn4
.byte W02
.byte An4
.byte W03
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 63*song364restored_mvl/mxv
.byte PAN , c_v+63
.byte W01
.byte N01 , Gs4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W03
.byte BEND , c_v-1
.byte N01 , En4
.byte W01
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v+51
.byte W01
.byte N01 , Ds4
.byte W03
.byte Dn4
.byte W02
.byte Cs4
.byte W02
.byte Bn3
.byte W03
.byte BEND , c_v-1
.byte N01 , An3
.byte W02
.byte BEND , c_v-1
.byte N01 , As4
.byte W03
.byte BEND , c_v-1
.byte N01 , An4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 82*song364restored_mvl/mxv
.byte PAN , c_v+52
.byte W01
.byte BEND , c_v-1
.byte N01 , Fn4
.byte W02
.byte En4
.byte W03
.byte Dn4
.byte W02
.byte Cs4
.byte W02
.byte Bn3
.byte W02
.byte VOL , 100*song364restored_mvl/mxv
.byte PAN , c_v+49
.byte W01
.byte BEND , c_v-1
.byte N01 , Cn5
.byte W02
.byte Bn4
.byte W03
; 001 ----------------------------------------
.byte An4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W02
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte VOL , 63*song364restored_mvl/mxv
.byte PAN , c_v+63
.byte W01
.byte N01 , Gs4
.byte W02
.byte BEND , c_v-1
.byte N01 , Gn4
.byte W03
.byte BEND , c_v-1
.byte N01 , Fs4
.byte W02
.byte BEND , c_v-1
.byte N01 , En4
.byte W02
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v+51
.byte N01 , Ds4
.byte W03
.byte Dn4
.byte W02
.byte Cs4
.byte W03
.byte Bn3
.byte W02
.byte BEND , c_v-1
.byte N01 , An3
.byte W02
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v+46
.byte W66
.byte W01
.byte VOL , 94*song364restored_mvl/mxv
.byte PAN , c_v+45
.byte W01
; 002 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v+46
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v+46
.byte VOL , 92*song364restored_mvl/mxv
.byte BEND , c_v-1
.byte FINE
;**************** Track 2 (Midi-Chn.8) ****************;
@song364restored_2:
.byte KEYSH , song364restored_key+0
; 000 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte c_v-20
.byte VOL , 95*song364restored_mvl/mxv
.byte BEND , c_v+0
.byte N01 , An4 , v100
.byte W02
.byte Gs4
.byte W02
.byte Fs4
.byte W03
.byte Fn4
.byte W01
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v-25
.byte W01
.byte N01 , En4
.byte W03
.byte Ds4
.byte W02
.byte Cs4
.byte W02
.byte Cn4
.byte W03
.byte As3
.byte W01
.byte VOL , 104*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte W01
.byte N01 , Bn4
.byte W03
.byte As4
.byte W02
.byte Gs4
.byte W02
.byte Fs4
.byte W03
.byte Fn4
.byte W01
.byte VOL , 73*song364restored_mvl/mxv
.byte PAN , c_v-21
.byte W01
.byte N01 , Gn4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W02
.byte Ds4
.byte W02
.byte VOL , 90*song364restored_mvl/mxv
.byte W01
.byte N01 , Dn4
.byte W02
.byte Cs4
.byte W03
.byte Cn4
.byte W02
.byte As3
.byte W02
.byte Gs3
.byte W03
.byte An4
.byte W02
.byte Gs4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W02
.byte VOL , 85*song364restored_mvl/mxv
.byte PAN , c_v-25
.byte N01 , En4
.byte W03
.byte Ds4
.byte W02
.byte Cs4
.byte W03
.byte Cn4
.byte W02
.byte As3
.byte W02
.byte VOL , 104*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte N01 , Bn4
.byte W03
.byte As4
.byte W02
.byte Gs4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W02
.byte VOL , 73*song364restored_mvl/mxv
.byte PAN , c_v-21
.byte N01 , Gn4
.byte W03
.byte Fs4
.byte W02
.byte Fn4
.byte W03
; 001 ----------------------------------------
.byte Ds4
.byte W01
.byte VOL , 90*song364restored_mvl/mxv
.byte W01
.byte N01 , Dn4
.byte W02
.byte Cs4
.byte W03
.byte Cn4
.byte W02
.byte As3
.byte W03
.byte Gs3
.byte W01
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v-44
.byte W80
.byte W02
.byte VOL , 95*song364restored_mvl/mxv
.byte PAN , c_v-20
.byte BEND , c_v+0
.byte W01
; 002 ----------------------------------------
.byte VOICE , 13
.byte PAN , c_v-44
.byte VOL , 92*song364restored_mvl/mxv
.byte PAN , c_v-44
.byte VOL , 92*song364restored_mvl/mxv
.byte BEND , c_v+0
.byte FINE
;******************************************************;
.align 4
song364restored:
.byte 2 ; NumTrks
.byte 0 ; NumBlks
.byte song364restored_pri ; Priority
.byte song364restored_rev ; Reverb.
//emit_clean_voicegroup_offset_for_song 364
.word 0x81071B4 //Voice Table
.word @song364restored_1
.word @song364restored_2
|
Source/sonic.asm | AAKMakes/ASM-projects | 0 | 172376 | <filename>Source/sonic.asm
;
; Comment
;
; === STACK SEGMENT ===
MyStack segment stack
DB 64 dup('12345678')
MyStack endS
; === DATA SEGMENT ===
MyData segment
; --- Declare your variables here ---
nlength DW ?
note DW ?
MyData endS
MyCode segment
Assume CS:Mycode,DS:MyData
;Includes go here
INCLUDE TIME.INC
INCLUDE CONIO.INC
;End of includes
playNote PROC ;Hertz should be in note, length in centiseconds should be in nlength
PUSH AX
PUSH BX
PUSH CX
PUSH DX
;Prep time divisor
MOV AL,0B6h
OUT 43h,AL
;Calculate time divisor
MOV DX,0012h
MOV AX,2870h
DIV note
;Set speaker
OUT 42h,AL
MOV AL,AH
OUT 42h,AL
;Activate pc speaker
IN AL,61h
OR AL,00000011b
OUT 61h,AL
;Wait time
MOV AX,nlength
CALL DelayFor100ths
;Stop playing
IN AL,61h
AND AL,11111100b
OUT 61h,AL
RET
playNote ENDP
Main PROC
Start:
MOV AX, MYDATA
MOV DS, AX
;Start of your code
;Play the note A for 1 sec
MOV note,440
MOV nlength,100
CALL playNote
;End of your code.
XOR AX,AX
XOR BX,BX
XOR CX,CX
XOR DX,DX
MOV AH, 4Ch
XOR AL, AL
INT 21h
Main ENDP
MyCode endS
End Start |
unix/inet-ip.adb | annexi-strayline/ASAP-INET | 0 | 14366 | <reponame>annexi-strayline/ASAP-INET
------------------------------------------------------------------------------
-- --
-- Internet Protocol Suite Package --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Interfaces.C;
with Interfaces.C.Strings;
with Ada.Strings.Maps;
with INET.Internal.OS_Constants; use INET.Internal.OS_Constants;
package body INET.IP is
-------------------------
-- From_String_Address --
-------------------------
function From_String_Address (Address: String) return IP_Address is
use Interfaces.C;
use Ada.Strings.Maps;
function inet4_pton (af : in int := AF_INET;
src : in char_array;
dst : out IPv4_Address)
return int
with
Convention => C,
Import => True,
External_Name => "inet_pton";
function inet6_pton (af : in int := AF_INET6;
src : in char_array;
dst : out IPv6_Address)
return int
with
Convention => C,
Import => True,
External_Name => "inet_pton";
Legal_Decimal : Character_Set := To_Set ("0123456789");
Legal_Hex : Character_Set := Legal_Decimal or To_Set ("abcdefABCDEF");
Legal_IPv4 : Character_Set := Legal_Decimal or To_Set (".");
Legal_IPv6 : Character_Set := Legal_Hex or To_Set (":");
-- Legal_Characters : Character_Set := To_Set ("0123456789abcdefABCDEF:.");
-- Legal_IPv46 : Character_Set := Legal_IPv4 and Legal_IPv6;
Retval : int;
IPv4_Valid : Boolean := True;
IPv6_Valid : Boolean := True;
pragma Assertion_Policy (Check);
begin
-- We first check the legality of the address provided
for C of Address loop
IPv4_Valid := IPv4_Valid and Is_In(Element => C,
Set => Legal_IPv4);
IPv6_Valid := IPv6_Valid and Is_In(Element => C,
Set => Legal_IPv6);
exit when not (IPv4_Valid or IPv6_Valid);
end loop;
-- It will never be the case that an address fulfills requirements for
-- both IPv4 and IPv6, so we can directly check each individually
if IPv4_Valid then
return A: IP_Address (Version => IPv4) do
Retval := inet4_pton (src => To_C (Address),
dst => A.v4_Address);
if Retval /= 1 then
raise Invalid_Address;
end if;
end return;
elsif IPv6_Valid then
return A: IP_Address (Version => IPv6) do
Retval := inet6_pton (src => To_C (Address),
dst => A.v6_Address);
if Retval /= 1 then
raise Invalid_Address;
end if;
end return;
else
raise Invalid_Address;
end if;
end From_String_Address;
-----------------------
-- To_String_Address --
-----------------------
function To_String_Address (Address: IP_Address) return String is
use Interfaces.C;
use Interfaces.C.Strings;
-- Address is in network byte order
function inet4_ntop (af : in int := AF_INET;
src : in IPv4_Address;
dst : out Interfaces.C.Char_Array;
size : in socklen_t)
return Interfaces.C.Strings.chars_ptr
with
Convention => C,
Import => True,
External_Name => "inet_ntop";
function inet6_ntop (af : in int := AF_INET6;
src : in IPv6_Address;
dst : out Interfaces.C.Char_Array;
size : in socklen_t)
return Interfaces.C.Strings.chars_ptr
with
Convention => C,
Import => True,
External_Name => "inet_ntop";
-- Output_IPv* is the buffer to which the dst out address will be written
-- Output_IPv* contains one additional position for the null terminator
-- The longest possible IPv4 will be 16 bytes long
-- The longest possible IPv6 will be 46 bytes long
-- Since we are only returning one string, we can just take the longest
-- possible array size and use that for the output
Retval: Interfaces.C.Strings.chars_ptr;
Address_Buffer: Interfaces.C.Char_Array(1 .. 40);
-- Based on the longest-possible IPv6 address, which is eight groups
-- of four hex digits (32), separated by colons (7), with room for a null
-- terminator = 32 + 7 + 1 = 40
begin
case Address.Version is
when IPv4 =>
Retval := inet4_ntop(src => Address.v4_Address,
dst => Address_Buffer,
size => Address_Buffer'Length);
when IPv6 =>
Retval := inet6_ntop(src => Address.v6_Address,
dst => Address_Buffer,
size => Address_Buffer'Length);
end case;
if Retval = Interfaces.C.Strings.Null_Ptr then
raise Invalid_Address;
else
return To_Ada (Address_Buffer);
end if;
end To_String_Address;
end INET.IP;
|
Engine Hacks/DragonVeins/asm/Dragon Vein Usability.asm | sme23/MekkahRestrictedHackComp1 | 3 | 1811 | <gh_stars>1-10
.thumb
.equ SkillTester, DVTrapID+4
.equ DragonsBloodID, SkillTester+4
push {r14}
ldr r0, CurrentUnit @Active unit
ldr r2,[r0]
@ ldr r0,[r2]
@ ldr r1,[r2,#0x4]
@ ldr r0,[r0,#0x28] @Skills
@ ldr r1,[r1,#0x28]
@ orr r0,r1
@ mov r1,#0x20
@ lsl r1, #0x8
@ and r0,r1 @Lord skill
@ cmp r0,#0x0
@check for DragonsBlood skill
ldr r0, SkillTester
mov lr, r0
mov r0, r2
ldr r1, DragonsBloodID
.short 0xF800
cmp r0, #0
beq retFalse @No
ldr r0, CurrentUnit @Active unit
ldr r2,[r0]
ldr r0,[r2,#0xC] @Turn status
mov r1,#0x60 @0x60 - being rescued, has moved
and r0,r1
cmp r0,#0x0
bne retFalse @No
@080248E8 480A ldr r0,=#0x202BCB0 @Something about current/selected unit data? Map state? Skirmish?
@080248EA 303D add r0,#0x3D
@080248EC 7801 ldrb r1,[r0]
@080248EE 2008 mov r0,#0x8
@080248F0 4008 and r0,r1
@080248F2 2800 cmp r0,#0x0
@080248F4 D110 bne #0x8024918
mov r0,#0x10 @X
ldsb r0,[r2,r0]
mov r1,#0x11 @Y
ldsb r1,[r2,r1]
ldr r3, GetTrap @Gets the (first) trap that is on the same XY as this unit.
bl goto_r3
@mov lr, r3
@.short 0xF800 @bl lr
cmp r0,#0x0
beq retFalse @If no trap
ldrb r0,[r0,#0x2] @trap type
ldr r1, DVTrapID
cmp r0,r1 @DV
bne retFalse @
mov r0,#0x1
b end
.align
CurrentUnit:
.long 0x03004E50
GetTrap:
.long 0x0802E1F1
retFalse:
mov r0,#0x3
end:
pop {r3}
goto_r3:
bx r3
.align
.ltorg
DVTrapID:
@WORD DVTrapID
@POIN SkillTester
@WORD DragonsBloodID
|
src/words-editor.asm | ras88/stereo-editor | 0 | 103384 | ; -----------------------------------------------------------------------------
; Copyright (c) 1988-2018 <NAME>
;
; Permission to use, copy, modify, and/or distribute this software for any
; purpose with or without fee is hereby granted, provided that the above
; copyright notice and this permission notice appear in all copies.
;
; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
; PERFORMANCE OF THIS SOFTWARE.
; -----------------------------------------------------------------------------
;This source file contains code for the SID Editor's "Words File Editor"
;transient application. Transient applications load at $C000. If SID data
;reside that high, they are moved down, overwriting the player module.
;Transient applictions may use only the memory between $C000 and $CFFF, and
;zero page locations 100-131. Return with carry set ONLY if sid file needs
;to be saved after this application.
;
.org $c000
.obj "009"
;
;Interface storage
;
start_heap = $7000
end_heap = $bffc
voice_start = 2
voice_end = 16
voice_pos = 30
;
;NEW Kernal routine equates:
;
setirq = $e000
print = $e003
lprint = $e006
printchar = $e009
printbyte = $e00c
printword = $e00f
select_string = $e012
save_screen = $e015
recall_screen = $e018
getrom = $e01b
clear_screen = $e01e
menudef = $e021
menuset = $e024
select = $e027
select_0 = $e02a
headerdef = $e02d
sizedef = $e030
s_itemx = $e033
s_itemy = $e036
s_itemlen = $e039
s_itemvecl = $e03c
s_itemvech = $e03f
s_itemvarl = $e042
s_itemvarh = $e045
s_itemmin = $e048
s_itemmax = $e04b
s_itemtype = $e04e
read_item = $e051
cursor_on = $e054
cursor_off = $e057
move_up = $e05a
move_down = $e05d
read_prdir = $e060
init_drive = $e063
load_prfile = $e066
preparef = $e069
releasef = $e06c
setlfs = $e06f
setnam = $e072
open = $e075
close = $e078
chkin = $e07b
chkout = $e07e
clrchn = $e081
chrin = $e084
chrout = $e087
getin = $e08a
set_item = $e08d
get_adr = $e090
backspace = $e093
read_err = $e096
read_error = $e099
;
;Zero-page start of storage equate
;
zp = 100 ;Start of zero page storage for this module
;
;Major storage
;
ascii_buf = $cf00
linebuf = $cf80
line_buf = linebuf
clinebuf = $cfc0
cline_buf = clinebuf
;
;Zero-page pointers
;
ptr = zp ;General-use pointer
topptr = zp+2 ;Address of line displayed at top of window
line = zp+4 ;Screen pointer
cline = zp+6 ;Color pointer
rvs_flag = zp+8 ;128=reverse, 0=normal
color = zp+9 ;Current color (0-15)
xpos = zp+10 ;Cursor X position (0-32)
ypos = zp+11 ;Cursor row (0-4)
under_char = zp+12 ;Character under cursor
under_color = zp+13 ;Color under cursor
flash = zp+14 ;1=flash cursor, 0=don't
count = zp+15 ;Countdown to next cursor flash
cmode = zp+16 ;128=flash on, 0=flash off
ps1 = zp+17 ;Scrolling pointer
ps2 = zp+19 ;Scrolling pointer
txtptr = zp+21 ;Pointer to current line
endptr = zp+23 ;Pointer to end of words data
mod_flag = zp+25 ;1=modified, 0=not
line_count = zp+26 ;Number of lines left to display
tx = zp+27 ;Temporary storage
color_t = zp+28 ;Temporary color storage
rvs_t = zp+29 ;Temporary reverse mode storage
line_len = zp+30 ;Length of current line (ASCII)
new_len = zp+31 ;Length of replacement line (ASCII)
maxptr = zp+32 ;Points to start of SID data.
k_txtptr = $e0 ;Kernal interface variable
colptr = $e2 ;Kernal interface variable
start_m = $e2 ;Start of block to be moved
end_m = $e4 ;End of block
dest_m = $e6 ;Destination address for block
;
;Constants used by Kernal routines
;
screen = $f400
vic = $d000
kernal_in = %00000110
kernal_out = %00000101
eof = 1
def = 2
tab = 3
rvs = 4
rvsoff = 5
defl = 6
defr = 7
clr = 8
fkey = 10
box = 12
xx = 96
col = 176
yy = 224
eot = 255
dispatch = 1
service = 2
numeric = 3
string = 4
null'item = 5
eom = 0
;
;Transient application ID text
;
.asc "sid/app"
.byte 009 ;File number
.word init ;Starting address
return_vec .word $ffff ;Filled in by main program - Return location
;
;Special interrupt routine for cursor flashing
;
inter = *
lda flash
beq end_int
dec count
bne end_int
lda #20
sta count
ldy xpos
lda cmode
eor #128
sta cmode
bmi +
lda under_char
sta (line),y
lda under_color
sta (cline),y
rts
+ lda under_char
eor #128
sta (line),y
lda color
sta (cline),y
end_int rts
;
;Convert any ASCII code to its corresponding ROM code.
;Return with carry set only if it's non-printable
;
ascii_to_rom = *
cmp #160
beq sub128
cmp #32
bcc non_printable
cmp #96
bcc sub0
cmp #128
bcc sub32
cmp #160
bcc non_printable
cmp #192
bcc sub64
cmp #255
bcc sub192
lda #94
clc
rts
sub192 sbc #191
clc
rts
sub128 sec
sbc #32
sub96 sec
sbc #32
sub64 sec
sbc #32
sub32 sec
sbc #32
sub0 clc
rts
non_printable = *
sec
rts
;
;Convert ROM to ASCII.
;
rom_to_ascii = *
cmp #32
bcc add192
cmp #64
bcc add0
cmp #96
bcc add0
bcs add64
add128 clc
adc #64
add64 clc
adc #64
add0 rts
add192 adc #192
rts
;
;Establish cursor at current position.
;
put_cursor = *
jsr calc_line
ldy xpos
lda (cline),y
sta under_color
lda (line),y
sta under_char
eor #128
sta (line),y
lda color
sta (cline),y
lda #20
sta count
sta flash
lda #128
sta cmode
rts
;
;Remove cursor from current position.
;
remove_cursor = *
lda #0
sta flash
ldy xpos
lda under_color
sta (cline),y
lda under_char
sta (line),y
rts
;
;Calculate screen/color addressed based on cursor position
;
calc_line = *
ldx #1
ldy ypos
iny
iny
iny
jsr get_adr
lda colptr
sta cline
lda colptr+1
sta cline+1
lda k_txtptr
sta line
lda k_txtptr+1
sta line+1
rts
;
;Table of screen color changing ASCII codes.
;
color_table .byte 144,5,28,159,156,30,31,158,129,149,150,151,152,153,154
.byte 155
;
;Grab and convert line at TXTPTR.
;
grab_line = *
jsr txt_2_ptr
jsr convert_line
sty line_len
rts
;
;Convert ASCII line pointed to by PTR to character and color codes in
;LINE_BUF and CLINE_BUF.
;
convert_line = *
lda #7
sta ps1
lda #0
sta ps2
tax
ldy #255
cin1 = *
iny
lda (ptr),y
beq cin3
jsr ascii_to_rom
bcs cin2
ora ps2
sta line_buf,x
lda ps1
sta cline_buf,x
inx
bne cin1
cin2 = *
cmp #13
beq eoln
cmp #18
bne +
lda #128
sta ps2
bne cin1
+ cmp #18+128
bne +
lda #0
sta ps2
beq cin1
+ stx tx
ldx #15
- cmp color_table,x
beq +
dex
bpl -
ldx tx
bpl cin1
+ stx ps1
ldx tx
bpl cin1
eoln = *
iny
cin3 = *
- cpx #38
bcs +
lda #32
sta line_buf,x
lda ps1
sta cline_buf,x
inx
bne -
+ rts
;
;Display current 12 lines of text.
;
disp_lines = *
lda #<40*3+screen+1
sta line
sta cline
lda #>40*3+screen+1
sta line+1
lda #>40*3+55297
sta cline+1
lda topptr
sta ptr
lda topptr+1
sta ptr+1
lda #12
sta line_count
- jsr convert_line
tya
clc
adc ptr
sta ptr
bcc +
inc ptr+1
+ ldy #37
- lda line_buf,y
sta (line),y
lda cline_buf,y
sta (cline),y
dey
bpl -
lda line
clc
adc #40
sta line
sta cline
bcc +
inc line+1
inc cline+1
+ dec line_count
bne --
rts
;
;----- Main Program -----
;
init = *
jsr print
.byte clr,xx+14,yy+0,col+1
.asc "Words Editor"
.byte box,0,2,39,15,11
.byte eot
jsr help
lda #0
sta mod_flag
sta flash
sta rvs_flag
ldx #<inter
ldy #>inter
jsr setirq
lda #1
sta color
jsr move_out
;
;Home cursor
;
home = *
lda #<start_heap
sta topptr
sta txtptr
lda #>start_heap
sta topptr+1
sta txtptr+1
jsr disp_lines
jsr grab_line
lda #0
sta xpos
sta ypos
loop = *
jsr put_cursor
wait = *
jsr getin
beq wait
pha
jsr remove_cursor
pla
jsr key_to_rom
bcs special_key
ldy xpos
ora rvs_flag
sta (line),y
lda color
sta (cline),y
sta cline_buf,y
jsr modify
cright inc xpos
lda xpos
cmp #38
bcc loop
lda #37
sta xpos
bne loop
special_key = *
ldx #15
- cmp color_table,x
bne +
txa
sta color
bpl loop
+ dex
bpl -
ldx #cmd_key1-cmd_key-1
- cmp cmd_key,x
beq +
dex
bpl -
jmp loop
+ txa
asl
tax
lda cmd_vec+1,x
pha
lda cmd_vec,x
pha
rts
;
;Command keys and dispatch vectors
;
cmd_key .byte 29,29+128,17+128,17,13,18,18+128,3,135,19,147,136,138
.byte 140,134,20,148,133,137,139,147
cmd_key1 = *
cmd_vec .word cright-1,cleft-1,cup-1,cdown-1,cret-1,rvs_on-1,rvs_off-1
.word cancel-1,cancel-1,home-1,cclr-1,paint-1,invert-1
.word invert_c-1,center_line-1,edel-1,eins-1
.word del_line-1,ins_line-1,end_of_line-1,clear_all-1
;
;Handle cursor movements
;
cleft lda xpos
beq +
dec xpos
+ jmp loop
;
;Cursor up
;
cup dec ypos
bpl ju
inc ypos
jsr top_2_ptr
jsr find_last
jsr ptr_2_top
jsr txt_2_ptr
jsr find_last
jsr ptr_2_txt
jsr disp_lines
jmp jq
ju jsr txt_2_ptr
jsr find_last
jsr ptr_2_txt
jq jsr grab_line
jmp loop
;
;Cursor down
;
cdown ldy #0
lda (txtptr),y
beq jm
inc ypos
lda ypos
cmp #12
bcc jl
dec ypos
jsr txt_2_ptr
jsr find_next
jsr ptr_2_txt
jsr top_2_ptr
jsr find_next
jsr ptr_2_top
jsr disp_lines
jmp jq
jl jsr txt_2_ptr
jsr find_next
jsr ptr_2_txt
jm jmp jq
;
;Carriage return
;
cret ldy #0
lda (txtptr),y
bne +
jsr insert_line
+ lda #0
sta xpos
sta rvs_flag
jmp cdown
;
;Reverse on/off
;
rvs_on lda #128
.byte $2c
rvs_off lda #0
sta rvs_flag
jmp loop
;
;Return to main program
;
cancel = *
jsr move_back
lsr mod_flag
jmp (return_vec)
;
;Clear all words.
;
cclr = *
jmp home
;
;"Paint" entire line in current color
;
paint_proc = *
ldy #37
lda color
- sta (cline),y
dey
bpl -
rts
paint jsr paint_proc
jsr modify
jmp loop
;
;Reverse entire line, affecting color.
;
invert_c jsr paint_proc
;
;Reverse entire line, not affecting color.
;
invert = *
ldy #37
- lda (line),y
eor #128
sta (line),y
dey
bpl -
jsr modify
jmp loop
;
;Center current line
;
center_line = *
ldy #0
- lda (line),y
cmp #32
bne +
iny
cpy #38
bcc -
jmp loop
+ ldx #0
- lda (line),y
sta linebuf,x
lda (cline),y
sta clinebuf,x
inx
iny
cpy #38
bcc -
lda #32
- dex
bmi +
cmp linebuf,x
beq -
+ inx
stx ptr
+ lda #39
sec
sbc ptr
lsr
sta ptr+1
ldy #0
lda #32
- cpy ptr+1
bcs +
sta (line),y
iny
bne -
+ ldx #0
- cpx ptr
bcs +
lda linebuf,x
sta (line),y
lda clinebuf,x
sta (cline),y
iny
inx
bne -
+ lda #32
- cpy #38
bcs +
sta (line),y
iny
bne -
+ jsr modify
jmp loop
;
;Delete a character
;
edel ldy xpos
beq edel1
edel0 cpy #38
bcs +
lda (line),y
dey
sta (line),y
iny
lda (cline),y
dey
sta (cline),y
iny
iny
bne edel0
+ lda #32
dey
sta (line),y
dec xpos
edel1 jsr modify
jmp loop
;
;Insert a character
;
eins ldy #37
lda (line),y
cmp #32
bne edel1
ldy xpos
dey
sty ptr
ldy #36
- cpy ptr
beq +
lda (line),y
iny
sta (line),y
dey
lda (cline),y
iny
sta (cline),y
dey
dey
bpl -
+ lda #32
iny
sta (line),y
jsr modify
jloop jmp loop
;
;Given PTR is a pointer to a line, find next line and return it in PTR.
;
find_next = *
ldy #0
- lda (ptr),y
cmp #13
beq +
iny
bne -
+ iny
tya
clc
adc ptr
sta ptr
bcc +
inc ptr+1
+ rts
;
;Given PTR is a pointer to a line, find previous line and return it in PTR.
;
find_last = *
lda ptr+1
cmp #>start_heap
bne +
lda ptr
cmp #<start_heap
+ beq fl
lda ptr
bne +
dec ptr+1
+ dec ptr
ldy #0
- lda ptr
cmp #<start_heap
bne +
lda ptr+1
cmp #>start_heap
beq fl
+ lda ptr
bne +
dec ptr+1
+ dec ptr
lda (ptr),y
cmp #13
bne -
inc ptr
bne fl
inc ptr+1
fl rts
;
;Copy TXT_PTR to PTR
;
txt_2_ptr = *
lda txtptr
sta ptr
lda txtptr+1
sta ptr+1
rts
;
;Copy PTR to TXT_PTR
;
ptr_2_txt = *
lda ptr
sta txtptr
lda ptr+1
sta txtptr+1
rts
;
;Copy TOP_PTR to PTR
;
top_2_ptr = *
lda topptr
sta ptr
lda topptr+1
sta ptr+1
rts
;
;Copy PTR to TOP_PTR
;
ptr_2_top = *
lda ptr
sta topptr
lda ptr+1
sta topptr+1
rts
;
;Convert current line back to ASCII (in ASCII_BUF).
;
convert_back = *
lda #255
sta color_t
sta rvs_t
ldx #0
cb1 = *
ldy #38
lda #32
- dey
bmi +
cmp (line),y
beq -
+ iny
beq justret
sty ps1+1
ldy #0
- lda (line),y
cmp #32
beq skipsp
lda (cline),y
and #15
cmp color_t
beq +
sta color_t
stx ps1
tax
lda color_table,x
ldx ps1
sta ascii_buf,x
inx
skipsp = *
+ lda (line),y
and #128
cmp rvs_t
beq ++
sta rvs_t
cmp #128
bne +
lda #18
.byte $2c
+ lda #18+128
sta ascii_buf,x
inx
+ lda (line),y
and #127
jsr rom_to_ascii
sta ascii_buf,x
inx
iny
cpy ps1+1
bcc -
justret lda #13
sta ascii_buf,x
inx
rts
;
;Set modify flag and replace line in memory.
;
modify lda #1
sta mod_flag
;
;Replace current line in memory.
;
put_line = *
jsr convert_back
stx new_len
txa
sec
sbc line_len
bne pl2
replace ldy #0
- cpy new_len
bcs +
lda ascii_buf,y
sta (txtptr),y
iny
bne -
+ sty line_len
rts
pl2 bcs pl3
lda line_len
sec
sbc new_len
sta ps1
lda txtptr
sta dest_m
clc
adc ps1
sta start_m
lda txtptr+1
sta dest_m+1
adc #0
sta start_m+1
jsr usual_end
jsr move_down
lda endptr
sec
sbc ps1
sta endptr
bcs +
dec endptr+1
+ jmp replace
pl3 sta ps1
lda txtptr
sta start_m
clc
adc ps1
sta dest_m
lda txtptr+1
sta start_m+1
adc #0
sta dest_m+1
jsr usual_end
ldy endptr+1
lda endptr
clc
adc ps1
bcc +
iny
+ cpy maxptr+1
bcs hit_max
sta endptr
sty endptr+1
jsr move_up
jmp replace
hit_max = *
jsr disp_lines
jmp jq
;
;Translate ASCII keypress to character code. Return with carry set
;only if it's a control code or unimplemented character.
;
key_to_rom = *
cmp #32
bcc unimp
cmp #64
bcc ksub0
cmp #96
bcc ksub64
cmp #193
bcc unimp
cmp #193+26
bcs unimp
sbc #63
ksub64 sec
sbc #64
ksub0 clc
rts
unimp sec
rts
;
;Set END_M to ENDPTR.
;
usual_end = *
lda endptr
sta end_m
lda endptr+1
sta end_m+1
rts
;
;Move SID data out of way, put a zero at end of word data if necessary.
;
move_out = *
lda voice_start+12
sta end_m
sec
sbc voice_start
sta ptr
lda voice_start+13
sta end_m+1
sbc voice_start+1
sta ptr+1
lda #<end_heap
sec
sbc ptr
sta dest_m
sta maxptr
lda #>end_heap
sbc ptr+1
sta dest_m+1
sta maxptr+1
lda voice_start
sta start_m
sta endptr
lda voice_start+1
sta start_m+1
sta endptr+1
lda dest_m
sec
sbc start_m
sta ptr
lda dest_m+1
sbc start_m+1
sta ptr+1
jsr move_up
ldx #12
- lda voice_start,x
clc
adc ptr
sta voice_start,x
lda voice_start+1,x
adc ptr+1
sta voice_start+1,x
lda voice_end,x
clc
adc ptr
sta voice_end,x
lda voice_end+1,x
adc ptr+1
sta voice_end+1,x
lda voice_pos,x
clc
adc ptr
sta voice_pos,x
lda voice_pos+1,x
adc ptr+1
sta voice_pos+1,x
dex
dex
bpl -
lda endptr+1
cmp #>start_heap
bne +
lda endptr
cmp #<start_heap
bne +
lda #0
sta start_heap
inc endptr
bne +
inc endptr+1
+ rts
;
;Move SID data back prior to exiting.
;
move_back = *
lda endptr
cmp #<start_heap+1
bne +
lda endptr+1
cmp #>start_heap+1
bne +
lda #<start_heap
sta endptr
lda #>start_heap
sta endptr+1
+ lda endptr
sta dest_m
lda endptr+1
sta dest_m+1
lda maxptr
sta start_m
lda maxptr+1
sta start_m+1
lda #<end_heap
sta end_m
lda #>end_heap
sta end_m+1
lda start_m
sec
sbc dest_m
sta ptr
lda start_m+1
sbc dest_m+1
sta ptr+1
jsr move_down
ldx #12
- lda voice_start,x
sec
sbc ptr
sta voice_start,x
lda voice_start+1,x
sbc ptr+1
sta voice_start+1,x
lda voice_end,x
sec
sbc ptr
sta voice_end,x
lda voice_end+1,x
sbc ptr+1
sta voice_end+1,x
lda voice_pos,x
sec
sbc ptr
sta voice_pos,x
lda voice_pos+1,x
sbc ptr+1
sta voice_pos+1,x
dex
dex
bpl -
rts
;
;Delete current line.
;
del_line = *
ldy #0
lda (txtptr),y
bne +
jmp loop
+ lda txtptr
sta dest_m
clc
adc line_len
sta start_m
lda txtptr+1
sta dest_m+1
adc #0
sta start_m+1
jsr usual_end
jsr move_down
lda endptr
sec
sbc line_len
sta endptr
bcs +
dec endptr+1
+ lda #1
sta mod_flag
jsr disp_lines
jmp jq
;
;Insert current line.
;
ins_line = *
jsr insert_line
jsr disp_lines
jmp jq
;
;Insert current line - subroutine.
;
insert_line = *
lda txtptr
sta start_m
clc
adc #1
sta dest_m
lda txtptr+1
sta start_m+1
adc #0
sta dest_m+1
jsr usual_end
jsr move_up
lda #1
sta mod_flag
ldy #0
lda #13
sta (txtptr),y
ldy endptr+1
ldx endptr
inx
bne +
iny
+ cpy maxptr+1
bcs +
sty endptr+1
stx endptr
rts
+ jmp hit_max
;
;Display instructions at bottom of screen.
;
help = *
jsr print
.byte xx+1,yy+17,col+7,"[",col+15
.asc "F1"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "Delete Line"
.byte xx+20,col+7,"[",col+15
.asc "F2"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "Insert Line"
.byte 13,xx+1,col+7,"[",col+15
.asc "F3"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "Center Line"
.byte xx+20,col+7,"[",col+15
.asc "F4"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "Invert Line"
.byte 13,xx+1,col+7,"[",col+15
.asc "F5"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "Exit"
.byte xx+20,col+7,"[",col+15
.asc "F6"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "End of Line"
.byte 13,xx+1,col+7,"[",col+15
.asc "F7"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "Paint Line"
.byte xx+20,col+7,"[",col+15
.asc "F8"
.byte col+7,"]",col+11," ","-"," ",col+12
.asc "Paint/Invert"
.byte eot
rts
;
;Go to end of current line.
;
end_of_line = *
ldy #38
lda #32
- dey
bmi +
cmp (line),y
beq -
cpy #37
bcs ++
+ iny
+ sty xpos
jmp loop
;
;Clear entire document
;
clear_all = *
jsr print
.byte xx+1,yy+22,col+15
.asc "Clear all: Are you sure (Y/N)?"
.byte eot
- jsr getin
beq -
pha
jsr print
.byte xx+0,yy+22,tab,40,eot
pla
cmp #"y"
beq +
jmp loop
+ lda #0
sta start_heap
lda #<start_heap+1
sta endptr
lda #>start_heap+1
sta endptr+1
lda #1
sta mod_flag
jmp home
|
src/gl/mac/gl-api-mac_os_x.adb | Roldak/OpenGLAda | 79 | 6652 | <reponame>Roldak/OpenGLAda
-- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
package body GL.API.Mac_OS_X is
OpenGLFramework_Cached : CFBundleRef;
function OpenGLFramework return CFBundleRef is
use type System.Address;
begin
if OpenGLFramework_Cached = System.Null_Address then
declare
OpenGLFramework_ID : constant CFStringRef
:= CFStringCreateWithCString (System.Null_Address,
IFC.To_C ("com.apple.opengl"),
kCFStringEncodingASCII);
begin
OpenGLFramework_Cached
:= CFBundleGetBundleWithIdentifier (OpenGLFramework_ID);
end;
end if;
return OpenGLFramework_Cached;
end OpenGLFramework;
end GL.API.Mac_OS_X;
|
audio/sfx/cry19_1.asm | opiter09/ASM-Machina | 1 | 102675 | SFX_Cry19_1_Ch5:
duty_cycle_pattern 0, 1, 2, 3
square_note 7, 13, 2, 1856
square_note 15, 14, 5, 1888
square_note 15, 12, 1, 1840
sound_ret
SFX_Cry19_1_Ch6:
duty_cycle_pattern 2, 0, 0, 1
square_note 2, 12, 2, 1793
square_note 4, 12, 2, 1800
square_note 15, 13, 7, 1857
square_note 15, 10, 2, 1793
SFX_Cry19_1_Ch8:
sound_ret
|
src/firmware-tests/Platform/Timer0/Initialisation/InitialisationChainTest.asm | pete-restall/Cluck2Sesame-Prototype | 1 | 17760 | <reponame>pete-restall/Cluck2Sesame-Prototype<filename>src/firmware-tests/Platform/Timer0/Initialisation/InitialisationChainTest.asm<gh_stars>1-10
#include "Platform.inc"
#include "FarCalls.inc"
#include "Timer0.inc"
#include "TestFixture.inc"
#include "../InitialiseAfterTimer0Mock.inc"
radix decimal
InitialisationChainTest code
global testArrange
testArrange:
fcall initialiseInitialiseAfterTimer0Mock
testAct:
fcall initialiseTimer0
testAssert:
banksel calledInitialiseAfterTimer0
.assert "calledInitialiseAfterTimer0 != 0, 'Next initialiser in chain was not called.'"
return
end
|
pyArduinoML/antlr/Arduinoml.g4 | FlorianLehmann/dsl | 0 | 1905 | <filename>pyArduinoML/antlr/Arduinoml.g4<gh_stars>0
grammar Arduinoml;
root : declaration showStateMachine? bricks modes EOF;
declaration : 'application' name=IDENTIFIER;
showStateMachine : 'SHOW STATE MACHINE';
bricks : (sensor|actuator)+;
sensor : 'sensor' location debug?;
actuator : 'actuator' location debug?;
location : identifier=IDENTIFIER ':' port=PORT_NUMBER;
debug : 'DEBUG' debug_type=DEBUG_TYPE;
modes : customMode* initialMode customMode*;
initialMode : INITIAL customMode;
customMode : identifier=IDENTIFIER '{' states modeTransition* '}';
modeTransition : expression '=>' next_mode=IDENTIFIER;
states : customState* initialState customState*;
initialState : INITIAL customState;
customState : identifier=IDENTIFIER '{' action+ stateTransition* '}';
action : receiver=IDENTIFIER '<=' value=SIGNAL;
stateTransition : expression '=>' next_state=IDENTIFIER;
expression : expression operator=OPERATOR expression | comparison;
comparison : analogicComparison | discreteComparison | temporalComparison;
analogicComparison : trigger=IDENTIFIER operator=ANALOGIC_OPERATOR threshold=INTEGER;
discreteComparison : trigger=IDENTIFIER 'IS' value=SIGNAL;
temporalComparison : 'AFTER' delay=INTEGER;
/*****************
** Lexer rules **
*****************/
PORT_NUMBER : [1-9] | '11' | '12';
IDENTIFIER : LOWERCASE (LOWERCASE|UPPERCASE|NUMBER|UNDERSCORE)+;
SIGNAL : 'HIGH' | 'LOW';
INTEGER : [1-9][0-9]*;
INITIAL : '->';
OPERATOR : 'AND';
ANALOGIC_OPERATOR : '<' | '>';
DEBUG_TYPE : 'TEXT' | 'GRAPH';
/*************
** Helpers **
*************/
fragment LOWERCASE : [a-z]; // abstract rule, does not really exists
fragment UPPERCASE : [A-Z];
fragment NUMBER : [0-9];
fragment UNDERSCORE : '_';
NEWLINE : ('\r'? '\n' | '\r')+ -> skip;
WS : ((' ' | '\t')+) -> skip; // who cares about whitespaces?
COMMENT : '#' ~( '\r' | '\n' )* -> skip; // Single line comments, starting with a # |
libsrc/math/mbf32/c/asm/___mbf32_TAN.asm | jpoikela/z88dk | 640 | 102613 | SECTION code_fp_mbf32
PUBLIC ___mbf32_TAN
EXTERN TAN
defc ___mbf32_TAN = TAN
|
programs/oeis/166/A166523.asm | neoneye/loda | 22 | 178234 | <filename>programs/oeis/166/A166523.asm<gh_stars>10-100
; A166523: a(n) = 8*n - a(n-1), with n>1, a(1)=1.
; 1,15,9,23,17,31,25,39,33,47,41,55,49,63,57,71,65,79,73,87,81,95,89,103,97,111,105,119,113,127,121,135,129,143,137,151,145,159,153,167,161,175,169,183,177,191,185,199,193,207,201,215,209,223,217,231,225,239,233,247,241,255,249,263,257,271,265,279,273,287,281,295,289,303,297,311,305,319,313,327,321,335,329,343,337,351,345,359,353,367,361,375,369,383,377,391,385,399,393,407
mov $1,11
mov $2,$0
mod $0,2
pow $1,$0
mov $3,$2
mul $3,4
add $1,$3
mov $0,$1
|
oeis/142/A142139.asm | neoneye/loda-programs | 11 | 171195 | ; A142139: Primes congruent to 30 mod 37.
; Submitted by <NAME>
; 67,659,733,881,1103,1399,1621,2213,2287,2657,2731,2879,2953,3323,3767,3989,4211,4507,4729,4877,4951,5099,5839,5987,6653,6949,7393,7541,8059,8429,9391,9539,9613,10427,10501,10723,11093,11833,11981,12203,12277,12647,12721,13313,13757,13831,14423,14867,15607,16273,16421,17383,17827,18049,18493,19381,19603,19751,19973,20047,20269,20639,21157,21379,21601,22193,22637,22859,23081,23599,23747,24043,24413,24709,25153,25301,25523,25819,26041,26189,26263,26633,27077,27299,27743,27817,28409,28631,28927
mov $2,7776
mov $4,9
lpb $2
mov $3,$4
add $3,20
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,37
lpe
mov $0,$4
add $0,21
|
programs/oeis/047/A047520.asm | neoneye/loda | 22 | 167445 | <gh_stars>10-100
; A047520: a(n) = 2*a(n-1) + n^2, a(0) = 0.
; 0,1,6,21,58,141,318,685,1434,2949,5998,12117,24378,48925,98046,196317,392890,786069,1572462,3145285,6290970,12582381,25165246,50331021,100662618,201325861,402652398,805305525,1610611834,3221224509,6442449918,12884900797,25769802618,51539606325,103079213806,206158428837,412316858970,824633719309,1649267440062,3298534881645,6597069764890,13194139531461,26388279064686,52776558131221,105553116264378,211106232530781,422212465063678,844424930129565,1688849860261434,3377699720525269,6755399441053038,13510798882108677,27021597764220058,54043195528442925,108086391056888766,216172782113780557,432345564227564250,864691128455131749,1729382256910266862,3458764513820537205,6917529027641078010,13835058055282159741,27670116110564323326,55340232221128650621,110680464442257305338,221360928884514614901,442721857769029234158,885443715538058472805,1770887431076116950234,3541774862152233905229,7083549724304467815358,14167099448608935635757,28334198897217871276698,56668397794435742558725,113336795588871485122926,226673591177742970251477,453347182355485940508730,906694364710971881023389,1813388729421943762052862,3626777458843887524111965,7253554917687775048230330,14507109835375550096467221,29014219670751100192941166,58028439341502200385889221,116056878683004400771785498,232113757366008801543578221,464227514732017603087163838,928455029464035206174335245,1856910058928070412348678234,3713820117856140824697364389,7427640235712281649394736878,14855280471424563298789482037,29710560942849126597578972538,59421121885698253195157953725,118842243771396506390315916286,237684487542793012780631841597,475368975085586025561263692410,950737950171172051122527394229,1901475900342344102245054798062,3802951800684688204490109605925
lpb $0
sub $0,1
add $3,1
add $2,$3
add $1,$2
mul $3,2
add $3,1
lpe
mov $0,$1
|
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_1416.asm | ljhsiun2/medusa | 9 | 23005 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x373e, %rsi
lea addresses_UC_ht+0x10846, %rdi
clflush (%rdi)
nop
nop
nop
nop
cmp $7889, %rax
mov $56, %rcx
rep movsw
nop
nop
nop
nop
inc %rbp
lea addresses_WC_ht+0x17be, %rsi
lea addresses_D_ht+0x87be, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor %r10, %r10
mov $103, %rcx
rep movsq
cmp %rcx, %rcx
lea addresses_WC_ht+0x186ee, %rdi
nop
nop
nop
nop
nop
cmp $51654, %r13
mov (%rdi), %r10d
nop
nop
nop
nop
and %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r15
push %rax
push %rbp
// Store
mov $0x2f9b450000000e96, %r10
nop
nop
nop
nop
nop
and %r11, %r11
movl $0x51525354, (%r10)
nop
nop
nop
nop
nop
sub $58419, %r15
// Faulty Load
lea addresses_normal+0x180be, %r15
nop
nop
and $26577, %r10
mov (%r15), %ax
lea oracles, %r11
and $0xff, %rax
shlq $12, %rax
mov (%r11,%rax,1), %rax
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': True, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
libsrc/stdio/abc80/fputc_cons.asm | meesokim/z88dk | 0 | 100342 | ;
; ABC80 Routines
;
; Print character to the screen
;
; We can corrupt any register
;
;
; $Id: fputc_cons.asm,v 1.4 2015/01/19 01:33:17 pauloscustodio Exp $
;
PUBLIC fputc_cons
;
; Entry: char to print
;
.fputc_cons
ld hl,2
add hl,sp
ld a,(hl); Now A contains the char to be printed
cp 13
jr nz,nocrlf
ld a,13
call printchar
ld a,10
.nocrlf
cp 12 ; CLS
jp z,$276
.printchar
ld bc,1
ld hl,mychar
ld (hl),a
jp 1a8h
.mychar defb 0
|
UnorderedSet/Definition.agda | Smaug123/agdaproofs | 4 | 55 | <filename>UnorderedSet/Definition.agda
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Decidable.Sets
open import Lists.Lists
open import Numbers.Naturals.Semiring
module UnorderedSet.Definition {a : _} {V : Set a} (dec : DecidableSet V) where
data UnorderedSetOf : List V → Set a where
empty' : UnorderedSetOf []
addCons : (v : V) → (vs : List V) → .(contains vs v → False) → UnorderedSetOf vs → UnorderedSetOf (v :: vs)
record UnorderedSet : Set a where
field
elts : List V
set : UnorderedSetOf elts
empty : UnorderedSet
empty = record { elts = [] ; set = empty' }
add : V → UnorderedSet → UnorderedSet
add v record { elts = elts ; set = set } with containsDecidable dec elts v
... | inl x = record { elts = elts ; set = set }
... | inr x = record { elts = v :: elts ; set = addCons v elts x set }
singleton : V → UnorderedSet
singleton v = record { elts = v :: [] ; set = addCons v [] (λ ()) empty' }
ofList : (l : List V) → UnorderedSet
ofList [] = record { elts = [] ; set = empty' }
ofList (x :: l) = add x (ofList l)
union : UnorderedSet → UnorderedSet → UnorderedSet
union record { elts = eltsA ; set = setA } record { elts = eltsB ; set = setB } = ofList (eltsA ++ eltsB)
count : UnorderedSet → ℕ
count record { elts = e ; set = _ } = length e
setContains : (v : V) → UnorderedSet → Set a
setContains v record { elts = elts ; set = set } = contains elts v
|
programs/oeis/069/A069513.asm | jmorken/loda | 1 | 21158 | <filename>programs/oeis/069/A069513.asm
; A069513: Characteristic function of the prime powers p^k, k >= 1.
; 0,1,1,1,1,0,1,1,1,0,1,0,1,0,0,1,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0
mov $2,$0
cal $0,10055 ; 1 if n is a prime power p^k (k >= 0), otherwise 0.
lpb $0
mul $0,$2
lpe
mov $1,$0
|
Control Statements/tell/iCal/calendars/properties.applescript | looking-for-a-job/applescript-examples | 1 | 3374 | <filename>Control Statements/tell/iCal/calendars/properties.applescript<gh_stars>1-10
#!/usr/loca/bin/osascript
tell application "iCal"
repeat with c in every calendar
tell c
get properties of c
#return uid
end tell
end repeat
end tell |
Code_20.asm | vishnuajith/PIC-18-Example-Codes | 0 | 28572 | ;*******************************************************
;* Description : Using Timer0 and Timer1
;*
;*******************************************************
#INCLUDE<P18F452.INC>
CONFIG WDT=OFF
CONFIG OSC=HS
CONFIG OSCS=OFF
ORG 0H
GOTO MAIN
ORG 0008H
BTFSS INTCON,TMR0IF
RETFIE
GOTO T0_ISR
ORG 100H
MAIN BSF TRISC,6
BCF TRISD,1
BCF TRISB,7
MOVLW 0x08
MOVWF T0CON
MOVLW 0x63
MOVWF TMR0H
MOVLW 0xBF
MOVWF TMR0L
BCF INTCON,TMR0IF
BSF T0CON,TMR0ON
BSF INTCON,TMR0IE
BSF INTCON,GIE
OVR BTFSC PORTC,6 ;POLLING RC6
GOTO ATW
BRA OVR
ORG 200H
ATW BCF INTCON,TMR0ON ;1KHz @ RB7 AND RD1 HIGH
BCF TRISB,7
BCF TRISD,1
BSF PORTD,1
MOVLW 0x30
MOVWF T1CON
HERE MOVLW 0xF6
MOVWF TMR1H
MOVLW 0x3B
MOVWF TMR1L
BCF PIR1,TMR1IF
CALL DELAY
BTG PORTB,7
BRA HERE
RETURN
DELAY BSF T1CON,TMR1ON
AGAIN BTFSS PIR1,TMR1IF
BRA AGAIN
BCF PIR1,TMR1ON
RETURN
ORG 500H
T0_ISR MOVLW 0x63 ;500HZ @ RD1
MOVWF TMR0H
MOVLW 0xBF
MOVWF TMR0L
BTG PORTD,1
BCF INTCON,TMR0IF
RETFIE
END
|
src/_test/scenarios/apsepp_test_reporter_class_struct_builder_early_test_case.ads | thierr26/ada-apsepp | 0 | 22650 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Apsepp.Abstract_Early_Test_Case; use Apsepp.Abstract_Early_Test_Case;
package Apsepp_Test_Reporter_Class_Struct_Builder_Early_Test_Case is
-- TODOC: This test case uses the same fixture as
-- Apsepp_Test_Node_Class_Early_Test_Case.Apsepp_Test_Node_Class_E_T_C
-- (simulation test cases run concurrently thanks to a special blocking test
-- reporter using a "test node barrier") to benefit from the already coded
-- traces. The test case could have been designed differently with a direct
-- exercising of an instance of
-- Apsepp.Test_Reporter_Class.Struct_Builder.Test_Reporter_Struct_Builder
-- and in this case would have been a "normal" test case (not an "early"
-- test case). <2019-09-08>
type Apsepp_Test_Reporter_Class_Struct_Builder_E_T_C
is limited new Early_Test_Case with null record;
overriding
function Early_Routine
(Obj : Apsepp_Test_Reporter_Class_Struct_Builder_E_T_C)
return Test_Routine;
end Apsepp_Test_Reporter_Class_Struct_Builder_Early_Test_Case;
|
programs/oeis/316/A316826.asm | neoneye/loda | 0 | 172598 | <filename>programs/oeis/316/A316826.asm<gh_stars>0
; A316826: Image of 3 under repeated application of the morphism 3 -> 3,2, 2 -> 1,0,2,0,1,2, 1 -> 1,0,1,2, 0 -> 0,2.
; 3,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,2,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,0,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,2,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,0,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,1,2,1,0
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
trn $0,1
seq $0,1969 ; Evil numbers: nonnegative integers with an even number of 1's in their binary expansion.
add $0,4
mov $2,$3
mul $2,$0
add $1,$2
mov $4,$0
lpe
min $5,1
mul $5,$4
sub $1,$5
sub $1,1
mov $0,$1
|
Appendix E - Microcontroller Code/Redundant/Buffers.asm | liwenyip/adhoc | 0 | 1321 | <reponame>liwenyip/adhoc<gh_stars>0
;*************************************************************************
; SOFTWARE BUFFERS MODULE
;
; Version 0.10
; 17/07/2005
;
; <NAME>
; Ad Hoc Radio Networking Research Project
; School Of Engineering
; James Cook University
;
;
; The RAM allocated for each buffer must not overlap two RAM banks. This allows
; faster loading and saving of the pointer values.
;
; Resources Requiring Exclusive Use:
; RAM Bank 4, FSR0
;
; Notes:
;
;
; What you need to understand to work with this code:
;
;
;
;
;*************************************************************************
; INCLUDE FILES
LIST P=18C452, F=INHX32 ;directive to define processor and file format
#include <P18C452.INC> ;processor specific variable definitions
#include "macrolib.inc" ; common macros
#include "swstack.inc" ; software stack
;*************************************************************************
; CONFIGURATION SECTION
;*************************************************************************
; CONSTANTS
getter equ 0
putter equ 1
bdata equ 2
;*************************************************************************
; VARIABLES
; Access RAM
udata_acs
BUF_FLAGS res 1
#define BUF_EOF BUF_FLAGS, 0
#define BUF_FULL BUF_FLAGS, 1
#define RXBUF_SW BUF_FLAGS, 2
#define TXBUF_SW BUF_FLAGS, 3
#define RXBUF_LOCK BUF_FLAGS, 4
#define TXBUF_LOCK BUF_FLAGS, 5
; Put all buffer storage in a high bank, as it will never be addressed directly
; Byte 0 = Read Pointer (Getter)
; Byte 1 = Write Pointer (Putter)
; Bytes 2->63 = Buffer Storage
.BUFFERS udata 0x400
BUF0 res 0x40 ; Buffer 0
BUF1 res 0x40 ; Buffer 1
BUF2 res 0x40 ; Buffer 2
BUF3 res 0x40 ; Buffer 3
;*************************************************************************
; START OF CODE
CODE
;***************************************************************
; MACRO: BUFPUT
;
; Description: Push WREG into the buffer.
; Arguments: buf - The buffer to push to.
; Precond'ns: -
; Postcond'ns: WREG -> BUFn + PUTTERn++.
; Regs Used: FSRO (Stacked).
;***************************************************************
BUFPUT macro buf
; Context Saving
SWPUSH FSR0L, 2 ; Stack FSR0.
SWPUSH BSR, 1 ; Stack BSR.
; Save WREG, Set BSR
SWPUSH WREG, 1 ; WREG -> TOS.
movlb high buf ; Select bank containing buffer.
; Load the address of the buffer & offset, write to the buffer.
lfsr 0, buf + bdata ; Address of buffer data -> FSR0.
movf buf + putter, w ; Putter -> WREG.
SWPOP PLUSW0, 1 ; TOS -> Buffer Addr + Putter.
; Increment the putter and check if the buffer is full.
incf buf + putter ; Putter + 1 -> Putter.
movlw scnsz_low buf - 2 ; Calculate buffer length.
bcf BUF_FULL ; Clear the FULL flag.
cpfslt buf + putter ; Is putter < buffer length?
bsf BUF_FULL ; NO - set the FULL flag.
; Context Restoring
SWPOP BSR, 1 ; Unstack BSR.
SWPOP FSR0L, 2 ; Unstack FSR0.
return
endm
;***************************************************************
; MACRO: BUFGET
;
; Description: Pop to WREG from buffer.
; Arguments: buf - The buffer to pop from.
; Precond'ns: -
; Postcond'ns: BUFn + PUTTERn-- -> WREG.
; Regs Used: FSRO (Stacked).
;***************************************************************
BUFGET macro buf
; Context Saving
SWPUSH FSR0L, 2 ; Stack FSR0.
SWPUSH BSR, 1 ; Stack BSR.
movlb high buf ; Select bank containing buffer.
; Load the address of the buffer & offset, read from the buffer.
lfsr 0, buf + bdata ; Address of buffer data -> FSR0.
movf buf + getter, w ; Getter -> WREG.
SWPUSH PLUSW0, 1 ; Buffer Addr + Getter -> TOS.
; Increment the getter and check for EOF.
incf buf + getter ; Increment the getter.
movf buf + putter, w ; Load up the putter.
bcf BUF_EOF ; Clear the EOF flag.
cpfslt buf + getter ; Is getter < putter?
bsf BUF_EOF ; NO - Set the EOF flag.
; Put result in WREG
SWPOP WREG, 1 ; TOS -> WREG.
; Context Restoring
SWPOP BSR, 1 ; Unstack BSR.
SWPOP FSR0L, 2 ; Unstack FSR0.
return
endm
;***************************************************************
; MACRO: BUFCLR
;
; Description: Clear buffer.
; Arguments: buf - The buffer to clear.
; Precond'ns: -
; Postcond'ns: putter = getter = 0.
; Regs Used:
;***************************************************************
BUFCLR macro buf
clrf buf + getter ; 0 -> Getter.
clrf buf + putter ; 0 -> Putter.
return
endm
;***************************************************************
; MACRO: BUFRST
;
; Description: Reset buffer.
; Arguments: buf - The buffer to clear.
; Precond'ns: -
; Postcond'ns: getter = 0.
; Regs Used:
;***************************************************************
BUFRST macro buf
clrf buf + getter ; 0 -> Getter.
return
endm
; Subroutines for each buffer
PUT0: BUFPUT 0
GET0: BUFGET 0
CLR0: BUFCLR 0
PUT1: BUFPUT 1
GET1: BUFGET 1
CLR1: BUFCLR 1
PUT2: BUFPUT 2
GET2: BUFGET 2
CLR2: BUFCLR 2
PUT3: BUFPUT 3
GET3: BUFGET 3
CLR3: BUFCLR 3
RXBUFA_PUT:
btfss RXBUF_SW
bra PUT0
bra PUT1
RXBUFA_GET:
btfss RXBUF_SW
bra GET0
bra GET1
RXBUFA_CLR:
btfss RXBUF_SW
bra CLR0
bra CLR1
RXBUFA_RST:
btfss RXBUF_SW
bra RST0
bra RST1
RXBUFB_PUT:
btfss RXBUF_SW
bra PUT1
bra PUT0
RXBUFB_GET:
btfss RXBUF_SW
bra GET1
bra GET0
RXBUFB_CLR:
btfss RXBUF_SW
bra CLR1
bra CLR0
RXBUFB_RST:
btfss RXBUF_SW
bra RST1
bra RST0
TXBUFA_PUT:
btfss TXBUF_SW
bra PUT2
bra PUT3
TXBUFA_GET:
btfss TXBUF_SW
bra GET2
bra GET3
TXBUFA_CLR:
btfss TXBUF_SW
bra CLR2
bra CLR3
TXBUFA_RST:
btfss TXBUF_SW
bra RST2
bra RST3
TXBUFB_PUT:
btfss TXBUF_SW
bra PUT3
bra PUT2
TXBUFB_GET:
btfss TXBUF_SW
bra GET3
bra GET2
TXBUFB_CLR:
btfss TXBUF_SW
bra CLR3
bra CLR2
TXBUFB_RST:
btfss TXBUF_SW
bra RST3
bra RST2
end
|
1-base/math/source/generic/pure/geometry/any_math-any_geometry-any_d3.ads | charlie5/lace | 20 | 25334 | <reponame>charlie5/lace<gh_stars>10-100
generic
package any_Math.any_Geometry.any_d3
--
-- Provides a namespace and core types for 3D geometry.
--
is
pragma Pure;
--------------
-- Core Types
--
subtype Site is Vector_3;
type Sites is array (Positive range <>) of Site;
type a_Model (Site_Count : Positive;
Tri_Count : Positive) is
record
Sites : any_d3 .Sites (1 .. Site_Count);
Triangles : any_Geometry.Triangles (1 .. Tri_Count);
end record;
function Image (the_Model : in a_Model) return String;
---------
-- Planes
--
type Plane is new Vector_4; -- A general plane equation.
procedure normalise (the_Plane : in out Plane);
----------
-- Bounds
--
type bounding_Box is
record
Lower,
Upper : Site;
end record;
null_Bounds : constant bounding_Box;
function to_bounding_Box (Self : Sites) return bounding_Box;
function "or" (Left : in bounding_Box; Right : in Site) return bounding_Box;
--
-- Returns the bounds expanded to include the vector.
function "or" (Left : in bounding_Box; Right : in bounding_Box) return bounding_Box;
--
-- Returns the bounds expanded to include both Left and Right.
function "+" (Left : in bounding_Box; Right : in Vector_3) return bounding_Box;
--
-- Returns the bounds translated by the vector.
function Extent (Self : in bounding_Box; Dimension : in Index) return Real;
function Image (Self : in bounding_Box) return String;
private
null_Bounds : constant bounding_Box := (Lower => (Real'Last, Real'Last, Real'Last),
Upper => (Real'First, Real'First, Real'First));
end any_Math.any_Geometry.any_d3;
|
libsrc/_DEVELOPMENT/alloc/obstack/z80/asm_obstack_init.asm | Toysoft/z88dk | 8 | 97724 |
; ===============================================================
; Dec 2013
; ===============================================================
;
; void *obstack_init(struct obstack *ob, size_t size)
;
; Create an obstack at address ob, size bytes long.
; Size must be at least seven bytes to hold obstack header.
;
; ===============================================================
SECTION code_clib
SECTION code_alloc_obstack
PUBLIC asm_obstack_init
EXTERN error_zc
asm_obstack_init:
; enter : de = struct obstack *ob
; bc = size_t size
;
; exit : success
;
; carry reset
; hl = struct obstack *ob
;
; fail if obstack wraps 64k boundary
;
; carry set
; hl = 0
;
; uses : af, de, hl
push de ; save ob
ld hl,6
add hl,de ; hl = & first allocatable byte = new fence
ex de,hl ; de = new fence, hl = ob
ld (hl),e
inc hl
ld (hl),d ; ob->fence = new fence
inc hl
ld (hl),e
inc hl
ld (hl),d ; ob->object = new fence
inc hl
ex de,hl ; de = & ob->end
pop hl ; hl = ob
add hl,bc ; hl = & byte following obstack
jp c, error_zc ; forbid wrapping 64k boundary
ex de,hl
ld (hl),e
inc hl
ld (hl),d ; ob->end = & byte following obstack
ex de,hl
sbc hl,bc ; hl = ob
ret
|
Driver/Socket/EtherPKT/ethpktTransceive.asm | steakknife/pcgeos | 504 | 86614 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) <NAME>. 2002 -- All Rights Reserved
PROJECT: Native ethernet support
MODULE: Ethernet link driver
FILE: ethodiTransceive.asm
AUTHOR: <NAME>.
ROUTINES:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ed 2/24/02 Initial revision
DESCRIPTION:
$Id:$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MovableCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EthPktTransmitPacket
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Transmit a packet to the remote host.
CALLED BY: EtherSendDatagram
PASS: dx:bp = optr of buffer to send (PacketHeader)
ds = dgroup
RETURN: carry clear if success
buffer may be locked or unlocked or freed. If not
freed yet, will be freed (after unlocking if needed)
later.
carry set if error
ax = SocketDrError
buffer not locked and not freed
DESTROYED: ax, bx, cx, si, di, ds, es
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
First, the passed buffer starts with this layout:
PacketHeader, padded to PACKET_HEADER_MAX_SIZE
ECB with one PacketFragmentPtr
Then, these structures follow:
For TCP:
tcpiphdr (in Driver/Socket/TCPIP/tcp.h)
ipovly (in Driver/Socket/TCPIP/ip.h)
tcphdr (in Driver/Socket/TCPIP/tcp.h)
TCP options, variable size
For UDP:
9 unused bytes (size TcpAccPntResolvedAddress, resulted
from UdpOutput() removing the TcpAccPntResolvedAddress between
udpiphdr and data by shifting udpiphdr forward to overwrite
it.)
udpiphdr (in Driver/Socket/TCPIP/udp.h)
ipovly (in Driver/Socket/TCPIP/ip.h)
udphdr (in Driver/Socket/TCPIP/udp.h)
packet data
ipovly overlays ip (which is IpHeader in asm).
Most things are passed in network byte order.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ed 04/24/02 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
EthPktTransmitPacket proc near
uses ds
.enter
ifdef LOG
pusha
pushf
cli
push ds
segmov ds, dgroup
mov si, ds:[currentIndex]
mov ds:[logBuf][si], LOG_TRANSMIT_START
inc ds:[currentIndex]
cmp ds:[currentIndex], size logBuf
jb popDS
clr ds:[currentIndex]
popDS:
pop ds
popf
popa
endif
Assert dgroup, ds
;
; Fill in the self reference for this packet
;
pushdw dxbp
mov bx, dx ; ^lbx:bp = buffer
call HugeLMemLock ; ax = buffer sptr
mov es, ax ; es = buffer sptr
mov ds, ax ; *ds:bp = buffer
mov si, ds:[bp] ; ds:si = PacketHeader
mov cx, ds:[si].PH_dataSize ; cx = packet data size
add cx, size MACHeader
EC < cmp cx, MIN_PACKET_SIZE >
EC < WARNING_B IP_PACKET_TOO_SMALL >
jae largePacket
minPacket:
inc cx
dec cx
mov cx, MIN_PACKET_SIZE
largePacket:
add si, ds:[si].PH_dataOffset
mov di, si ; ds:di = PacketHeader
sub si, size MACHeader
; ds:si = es:si = MACHeader
push cx ; need size later
;
; Look up ethernet address of the node that handles this destination
; IP address.
;
movdw dxax, es:[di].IH_dest ; dxax = IPAddr
lea di, ds:[si].MACH_dest ; es:di = buffer mac dest
mov cx, -1 ; say we've got a packet
push es
call EthPktArpIpToEther ; CF if ether addr not known yet
pop es
jc etherAddrNotKnownYet
;
; Fill in other stuff.
;
mov cx, size NodeAddr
lea di, ds:[si].MACH_source
GetDGroup ds, ax
mov cx, size NodeAddr / 2
push si
mov si, offset localEtherAddr
rep movsw
pop si
segmov ds, es, ax
mov ds:[si].MACH_type, PACKET_TYPE_IP
;
; Send it. If error, try again until max retries.
;
; Using bx, as it's as good as any other register available
; at this point.
pop cx ; get the packet size back
mov bx, MAX_SEND_ATTEMPTS
mov ah, PDF_SEND_PKT
retrySend:
pusha
call callPacketDriver
popa
jnc sentPacket
dec bx
jnz retrySend
cantSend2:
popdw dxcx
stc
jmp cantSend
sentPacket:
mov ax, MSG_EP_SEND_PACKET_DONE
popdw dxcx
GetDGroup es, bx
mov bx, es:[etherThread]
Assert ne, bx, NULL ; It may be bad to "Assert thread" at
; interrupt time.
mov di, mask MF_FORCE_QUEUE
call ObjMessage ; returns interrupt on
exit:
ifdef LOG
pusha
push ds
segmov ds, dgroup
mov si, ds:[currentIndex]
inc ds:[currentIndex]
mov ds:[logBuf][si], LOG_TRANSMIT_END
pop ds
popa
endif
clc ; return success
cantSend:
.leave
ret
etherAddrNotKnownYet:
;
; Unlock packet
;
call HugeLMemUnlock
add sp, 6 ; size word, buffer optr
jmp exit
EthPktTransmitPacket endp
MovableCode ends
ResidentCode segment resource
EthPktRecvHandlerThread proc far
GetDGroup ds, ax
again:
tst ds:[currentRecvBuf]
jz done
INT_OFF
mov si, ds:[currentRecvBuf]
mov ds:[currentRecvBuf], 0
INT_ON
doNext:
movdw dxcx, dssi ; dx:cx = buffer
mov ax, MSG_EP_PROCESS_IP_PACKET
cmp ds:[si].RB_macHeader.MACH_type, PACKET_TYPE_IP
je sendMsg
mov ax, MSG_EP_PROCESS_ARP_PACKET
cmp ds:[si].RB_macHeader.MACH_type, PACKET_TYPE_ARP
je sendMsg
; free buffer, should not happen
jmp done2
sendMsg:
mov bx, ds:[si].RB_nextLink
push bx
mov bx, ds:[etherThread]
Assert ne, bx, NULL ; It may be bad to "Assert thread" at
; interrupt time.
mov di, mask MF_FORCE_QUEUE
;WARNING ENTER_OBJ_MESSAGE
push ds
push si
call ObjMessage ; returns interrupt on
pop si
pop ds
;WARNING LEFT_OBJ_MESSAGE
pop bx
done2:
mov si, bx
cmp si, 0
jne doNext
done:
; wait some time
jmp again
EthPktRecvHandlerThread endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EthPktRecvHandler
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Routine called by the packet driver when a packet is ready
to be received. This routine gets called twice; once when
a packet begins coming in, to ensure that there is buffer
space available, and a second time when the transfer is
complete.
CALLED BY: EXTERNAL (packet driver), at interrupt time
PASS: Always:
bx = handle
cx = length
interrupts off (???)
Packet begins coming in:
ax = 0
Packet finished coming in:
ax = 1
ds:si = buffer
RETURN: es:di = buffer (0:0 to reject packet)
DESTROYED:
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
We don't need to call SysEnterInterrupt/SysExitInterrupt, because
the kernel Irq?Intercept routine already calls them.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ed 04/24/02 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
EthPktRecvHandler proc far
uses ds
; no defined stack on call in
; test system (DosEMU) enters with interrupts of
;GetDGroup ss, di
; setup own stack
;mov sp, offset endLocalStack
.enter
;call SysEnterInterrupt
;WARNING ENTER_RECEIVE
ifdef LOG
pusha
push ds
segmov ds, dgroup
mov si, ds:[currentIndex]
inc ds:[currentIndex]
mov ds:[logBuf][si], LOG_IPRECV_START
pop ds
popa
endif
tst ax
jnz receiveComplete
CheckHack <IP_MIN_HEADER le (size IpEtherArp)>
WARNING_B PACKET_TOO_SMALL
jb reject
cmp cx, RECV_BUFFER_SIZE + size MACHeader
EC < WARNING_A PACKET_TOO_LARGE_FOR_US >
ja reject
;
; If driver thread does not exist (ie. TCPIP is not registered with
; us), we can't deliver IP packets.
;
GetDGroup es, ax
tst es:[etherThread]
jz reject
;
; Allocate a free buffer, if any.
;
INT_OFF ; make sure
mov di, es:[recvBufFreeList] ; es:si = free buffer
tst di
EC < WARNING_Z OUT_OF_RECV_BUFFERS >
jz reject
mov ax, es:[di].RB_nextLink
mov es:[recvBufFreeList], ax
sub cx, size MACHeader
mov es:[di].RB_size, cx
lea di, es:[di].RB_macHeader
exit:
ifdef LOG
pusha
push ds
segmov ds, dgroup
mov si, ds:[currentIndex]
inc ds:[currentIndex]
mov ds:[logBuf][si], LOG_IPRECV_END
pop ds
popa
endif
;WARNING LEAVE_RECEIVE
;INT_ON
;call SysExitInterrupt
.leave
ret
reject:
clr di
mov es, di
jmp exit
receiveComplete:
INT_OFF
sub si, offset RB_macHeader
movdw dxcx, dssi ; dx:cx = buffer
mov ax, MSG_EP_PROCESS_IP_PACKET
cmp ds:[si].RB_macHeader.MACH_type, PACKET_TYPE_IP
je sendMsg
mov ax, MSG_EP_PROCESS_ARP_PACKET
cmp ds:[si].RB_macHeader.MACH_type, PACKET_TYPE_ARP
je sendMsg
;
; Other - discard
;
mov ax, si ; ds:ax = buffer to free
xchg ax, ds:[recvBufFreeList] ; ds:ax = old head of buf list
mov ds:[si].RB_nextLink, ax
jmp exit
sendMsg:
clr bx
tst ds:[currentRecvBuf]
jz newRecvStack
mov bx, ds:[currentRecvBuf]
newRecvStack:
cmp bx, si
;WARNING_Z ENTER_RECEIVE
mov ds:[si].RB_nextLink, bx
mov ds:[currentRecvBuf], si
;tst ds:[saveSS]
;jnz alreadyUsingStack
;mov ds:[saveSS], ss
;mov ds:[saveSP], sp
;mov bx, ds
;mov ss, bx
;mov sp, offset endLocalStack
;mov bx, ds:[etherThread]
;Assert ne, bx, NULL ; It may be bad to "Assert thread" at
; interrupt time.
;mov di, mask MF_FORCE_QUEUE
;WARNING ENTER_OBJ_MESSAGE
;;INT_ON
;push ds
;call ObjMessage ; returns interrupt on
;pop ds
;WARNING LEFT_OBJ_MESSAGE
;INT_OFF
;;mov ss, ds:[saveSS]
;;mov sp, ds:[saveSP]
;WARNING LEFT_OBJ_MESSAGE
;clr ds:[saveSS]
;WARNING LEFT_OBJ_MESSAGE
;WARNING LEFT_OBJ_MESSAGE
jmp exit
alreadyUsingStack:
; already using the stack. discard packet.
EC < WARNING DISCARDING_PACKET_ALREADY_USING_STACK >
mov ax, si
xchg ax, ds:[recvBufFreeList]
mov ds:[si].RB_nextLink, ax
jmp exit
EthPktRecvHandler endp
ResidentCode ends
MovableCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EthPktProcessIpPacket
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Process an incoming IP packet.
CALLED BY: EthDevProcessIpPacket
PASS: ds = dgroup
dx:cx = Buffer allocated from our buffer list
RETURN: nothing
DESTROYED: ax, bx, cx, dx, si, di, ds, es
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Free receiving buffer as soon as possible, even before unlocking
packet chunk.
We can check and discard packets whose IH_dest is different from
ours (this can happen if the source machine's IP->Ether address
lookup is invalid), but this happens only rarely. Therefore we
skip the check to save some cycles, and let any bad packets go all
the way to IpInput() and be discarded there.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ed 04/29/02 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
EthPktProcessIpPacket proc far
.enter
Assert dgroup, ds
Assert dgroup, dx
Assert fptr, dxcx
;
; Allocate a HugeLMem block to store a packet. No need to check
; if HugeLMem has already been created, since we create it before
; hooking up to the packet driver, and destroy it after unhooking
; from the packet driver.
;
mov si, cx ; ds:si = ECB
mov ax, ds:[si].RB_size
add ax, PACKET_HEADER_MAX_SIZE + LINK_HEADER_SIZE
; ax = size of chunk needed
add ax, 100
mov bx, ds:[recvHugeLMem]
mov cx, HUGELMEM_ALLOC_WAIT_TIME
call HugeLMemAllocLock ; ^lax:cx = ds:di = buffer, CF on error
jc errorFreeBuf
;
; Fill in PacketHeader
;
mov ds:[di].PH_dataOffset, PACKET_HEADER_MAX_SIZE+LINK_HEADER_SIZE
pushdw axcx ; save packet optr
segmov es, ds ; es:di = PacketHeader
mov ds, dx ; ds = dgroup, ds:si = buffer
mov ax, ds:[clientDomainHandle]
mov es:[di].PH_domain, ax
mov cx, ds:[si].RB_size
mov es:[di].PH_dataSize, cx
;
; Copy data into packet.
;
push si ; save buffer offset
lea si, ds:[si].RB_data
add di, PACKET_HEADER_MAX_SIZE + LINK_HEADER_SIZE
; es:di = buffer for data
shr cx
rep movsw
jnc afterCopy
movsb
afterCopy:
pop si ; ds:si = buffer
;
; Free recv buffer.
; Need to disable interrupt here since allocation can be done at
; interrupt time.
;
INT_OFF
mov ax, si ; ds:ax = buffer to free
xchg ax, ds:[recvBufFreeList] ; ds:ax = old head of buf list
mov ds:[si].RB_nextLink, ax
INT_ON
;
; Unlock packet and forward it.
;
popdw cxdx ; ^lcx:dx = packet
mov bx, cx
call HugeLMemUnlock
mov di, SCO_RECEIVE_PACKET
SCOIndication
exit:
.leave
ret
errorFreeBuf:
;
; Free buffer. Need to disable interrupt here since allocation
; is done at interrupt time.
;
INT_OFF
mov ax, si ; ds:ax = buffer to free
xchg ax, ds:[recvBufFreeList] ; ds:ax = old head of buf list
mov ds:[si].RB_nextLink, ax
INT_ON
jmp exit
EthPktProcessIpPacket endp
MovableCode ends
|
pipeargvtofile.scpt | TyrfingMjolnir/applescript-re | 0 | 203 | on run argv
repeat with v in argv
do shell script "echo \"" & ( current date ) & " " & ( v ) & "\" >> /tmp/some_file.txt"
end repeat
end run
|
Applications/Terminal/Select Tab 4.scpt | caius/special_keys | 0 | 4692 | <filename>Applications/Terminal/Select Tab 4.scpt
try
tell application "Terminal" to tell window 1 to set selected tab to tab 4
end try
|
3-mid/opengl/private/gl/source/gl-lean.ads | charlie5/lace | 20 | 20794 | <filename>3-mid/opengl/private/gl/source/gl-lean.ads
with
Interfaces.C.Pointers,
System;
package GL.lean
--
-- Provides types, constants and functions specific to the openGL 'Embedded' profile.
--
is
---------
-- Types
--
subtype GLchar is GL_Types.GLchar;
subtype GLfixed is GL_Types.GLfixed;
type GLintptr is new Integer;
type GLsizeiptr is new Integer;
-- GLchar_Pointer
--
type GLchar_array is array (C.size_t range <>) of aliased GLchar;
package GLchar_Pointers is new C.Pointers (Index => C.size_t,
Element => GLchar,
Element_Array => GLchar_array,
Default_Terminator => C.nul);
subtype GLchar_Pointer is GLchar_Pointers.Pointer;
subtype GLfloat_Address is system.Address;
-------------
-- Constants
--
GL_ACTIVE_ATTRIBUTES : constant := 16#8B89#;
GL_ACTIVE_ATTRIBUTE_MAX_LENGTH : constant := 16#8B8A#;
GL_ACTIVE_UNIFORMS : constant := 16#8B86#;
GL_ACTIVE_UNIFORM_MAX_LENGTH : constant := 16#8B87#;
GL_ARRAY_BUFFER : constant := 16#8892#;
GL_ARRAY_BUFFER_BINDING : constant := 16#8894#;
GL_ATTACHED_SHADERS : constant := 16#8B85#;
GL_BLEND_COLOR : constant := 16#8005#;
GL_BLEND_DST_ALPHA : constant := 16#80CA#;
GL_BLEND_DST_RGB : constant := 16#80C8#;
GL_BLEND_EQUATION : constant := 16#8009#;
GL_BLEND_EQUATION_ALPHA : constant := 16#883D#;
GL_BLEND_EQUATION_RGB : constant := 16#8009#; -- Same as BLEND_EQUATION.
GL_BLEND_SRC_ALPHA : constant := 16#80CB#;
GL_BLEND_SRC_RGB : constant := 16#80C9#;
GL_BOOL : constant := 16#8B56#;
GL_BOOL_VEC2 : constant := 16#8B57#;
GL_BOOL_VEC3 : constant := 16#8B58#;
GL_BOOL_VEC4 : constant := 16#8B59#;
GL_BUFFER_SIZE : constant := 16#8764#;
GL_BUFFER_USAGE : constant := 16#8765#;
GL_COLOR_ATTACHMENT0 : constant := 16#8CE0#;
GL_COMPILE_STATUS : constant := 16#8B81#;
GL_COMPRESSED_TEXTURE_FORMATS : constant := 16#86A3#;
GL_CONSTANT_ALPHA : constant := 16#8003#;
GL_CONSTANT_COLOR : constant := 16#8001#;
GL_CURRENT_PROGRAM : constant := 16#8B8D#;
GL_CURRENT_VERTEX_ATTRIB : constant := 16#8626#;
GL_DECR_WRAP : constant := 16#8508#;
GL_DELETE_STATUS : constant := 16#8B80#;
GL_DEPTH_ATTACHMENT : constant := 16#8D00#;
GL_DEPTH_COMPONENT : constant := 16#1902#;
GL_DEPTH_COMPONENT16 : constant := 16#81A5#;
GL_DITHER : constant := 16#0BD0#;
GL_DST_ALPHA : constant := 16#0304#;
GL_DST_COLOR : constant := 16#0306#;
GL_DYNAMIC_DRAW : constant := 16#88E8#;
GL_ELEMENT_ARRAY_BUFFER : constant := 16#8893#;
GL_ELEMENT_ARRAY_BUFFER_BINDING : constant := 16#8895#;
GL_ES_VERSION_2_0 : constant := 1;
GL_FIXED : constant := 16#140C#;
GL_FLOAT_MAT2 : constant := 16#8B5A#;
GL_FLOAT_MAT3 : constant := 16#8B5B#;
GL_FLOAT_MAT4 : constant := 16#8B5C#;
GL_FLOAT_VEC2 : constant := 16#8B50#;
GL_FLOAT_VEC3 : constant := 16#8B51#;
GL_FLOAT_VEC4 : constant := 16#8B52#;
GL_FRAGMENT_SHADER : constant := 16#8B30#;
GL_FRAMEBUFFER : constant := 16#8D40#;
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME : constant := 16#8CD1#;
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE : constant := 16#8CD0#;
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
: constant := 16#8CD3#;
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
: constant := 16#8CD2#;
GL_FRAMEBUFFER_BINDING : constant := 16#8CA6#;
GL_FRAMEBUFFER_COMPLETE : constant := 16#8CD5#;
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT : constant := 16#8CD6#;
GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS : constant := 16#8CD9#;
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
: constant := 16#8CD7#;
GL_FRAMEBUFFER_UNSUPPORTED : constant := 16#8CDD#;
GL_FUNC_ADD : constant := 16#8006#;
GL_FUNC_REVERSE_SUBTRACT : constant := 16#800B#;
GL_FUNC_SUBTRACT : constant := 16#800A#;
GL_GENERATE_MIPMAP_HINT : constant := 16#8192#;
GL_HIGH_FLOAT : constant := 16#8DF2#;
GL_HIGH_INT : constant := 16#8DF5#;
GL_IMPLEMENTATION_COLOR_READ_FORMAT : constant := 16#8B9B#;
GL_IMPLEMENTATION_COLOR_READ_TYPE : constant := 16#8B9A#;
GL_INCR_WRAP : constant := 16#8507#;
GL_INFO_LOG_LENGTH : constant := 16#8B84#;
GL_INT_VEC2 : constant := 16#8B53#;
GL_INT_VEC3 : constant := 16#8B54#;
GL_INT_VEC4 : constant := 16#8B55#;
GL_INVALID_FRAMEBUFFER_OPERATION : constant := 16#0506#;
GL_LINK_STATUS : constant := 16#8B82#;
GL_LOW_FLOAT : constant := 16#8DF0#;
GL_LOW_INT : constant := 16#8DF3#;
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS : constant := 16#8B4D#;
GL_MAX_CUBE_MAP_TEXTURE_SIZE : constant := 16#851C#;
GL_MAX_FRAGMENT_UNIFORM_VECTORS : constant := 16#8DFD#;
GL_MAX_RENDERBUFFER_SIZE : constant := 16#84E8#;
GL_MAX_TEXTURE_IMAGE_UNITS : constant := 16#8872#;
GL_MAX_VARYING_VECTORS : constant := 16#8DFC#;
GL_MAX_VERTEX_ATTRIBS : constant := 16#8869#;
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS : constant := 16#8B4C#;
GL_MAX_VERTEX_UNIFORM_VECTORS : constant := 16#8DFB#;
GL_MEDIUM_FLOAT : constant := 16#8DF1#;
GL_MEDIUM_INT : constant := 16#8DF4#;
GL_MIRRORED_REPEAT : constant := 16#8370#;
GL_NONE : constant := 0;
GL_NUM_COMPRESSED_TEXTURE_FORMATS : constant := 16#86A2#;
GL_NUM_SHADER_BINARY_FORMATS : constant := 16#8DF9#;
GL_ONE_MINUS_CONSTANT_ALPHA : constant := 16#8004#;
GL_ONE_MINUS_CONSTANT_COLOR : constant := 16#8002#;
GL_ONE_MINUS_DST_ALPHA : constant := 16#0305#;
GL_ONE_MINUS_DST_COLOR : constant := 16#0307#;
GL_ONE_MINUS_SRC_COLOR : constant := 16#0301#;
GL_RENDERBUFFER : constant := 16#8D41#;
GL_RENDERBUFFER_ALPHA_SIZE : constant := 16#8D53#;
GL_RENDERBUFFER_BINDING : constant := 16#8CA7#;
GL_RENDERBUFFER_BLUE_SIZE : constant := 16#8D52#;
GL_RENDERBUFFER_DEPTH_SIZE : constant := 16#8D54#;
GL_RENDERBUFFER_GREEN_SIZE : constant := 16#8D51#;
GL_RENDERBUFFER_HEIGHT : constant := 16#8D43#;
GL_RENDERBUFFER_INTERNAL_FORMAT : constant := 16#8D44#;
GL_RENDERBUFFER_RED_SIZE : constant := 16#8D50#;
GL_RENDERBUFFER_STENCIL_SIZE : constant := 16#8D55#;
GL_RENDERBUFFER_WIDTH : constant := 16#8D42#;
GL_RGB565 : constant := 16#8D62#;
GL_RGB5_A1 : constant := 16#8057#;
GL_RGBA4 : constant := 16#8056#;
GL_SAMPLER_2D : constant := 16#8B5E#;
GL_SAMPLER_CUBE : constant := 16#8B60#;
GL_SAMPLES : constant := 16#80A9#;
GL_SAMPLE_ALPHA_TO_COVERAGE : constant := 16#809E#;
GL_SAMPLE_BUFFERS : constant := 16#80A8#;
GL_SAMPLE_COVERAGE : constant := 16#80A0#;
GL_SAMPLE_COVERAGE_INVERT : constant := 16#80AB#;
GL_SAMPLE_COVERAGE_VALUE : constant := 16#80AA#;
GL_SHADER_BINARY_FORMATS : constant := 16#8DF8#;
GL_SHADER_COMPILER : constant := 16#8DFA#;
GL_SHADER_SOURCE_LENGTH : constant := 16#8B88#;
GL_SHADER_TYPE : constant := 16#8B4F#;
GL_SHADING_LANGUAGE_VERSION : constant := 16#8B8C#;
GL_SHORT : constant := 16#1402#;
GL_SRC_COLOR : constant := 16#0300#;
GL_STATIC_DRAW : constant := 16#88E4#;
GL_STENCIL_ATTACHMENT : constant := 16#8D20#;
GL_STENCIL_BACK_FAIL : constant := 16#8801#;
GL_STENCIL_BACK_FUNC : constant := 16#8800#;
GL_STENCIL_BACK_PASS_DEPTH_FAIL : constant := 16#8802#;
GL_STENCIL_BACK_PASS_DEPTH_PASS : constant := 16#8803#;
GL_STENCIL_BACK_REF : constant := 16#8CA3#;
GL_STENCIL_BACK_VALUE_MASK : constant := 16#8CA4#;
GL_STENCIL_BACK_WRITEMASK : constant := 16#8CA5#;
GL_STENCIL_INDEX8 : constant := 16#8D48#;
GL_STREAM_DRAW : constant := 16#88E0#;
GL_TEXTURE : constant := 16#1702#;
GL_TEXTURE_BINDING_CUBE_MAP : constant := 16#8514#;
GL_TEXTURE_CUBE_MAP : constant := 16#8513#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_X : constant := 16#8516#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y : constant := 16#8518#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z : constant := 16#851A#;
GL_TEXTURE_CUBE_MAP_POSITIVE_X : constant := 16#8515#;
GL_TEXTURE_CUBE_MAP_POSITIVE_Y : constant := 16#8517#;
GL_TEXTURE_CUBE_MAP_POSITIVE_Z : constant := 16#8519#;
GL_UNSIGNED_SHORT : constant := 16#1403#;
GL_UNSIGNED_SHORT_4_4_4_4 : constant := 16#8033#;
GL_UNSIGNED_SHORT_5_5_5_1 : constant := 16#8034#;
GL_UNSIGNED_SHORT_5_6_5 : constant := 16#8363#;
GL_VALIDATE_STATUS : constant := 16#8B83#;
GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING : constant := 16#889F#;
GL_VERTEX_ATTRIB_ARRAY_ENABLED : constant := 16#8622#;
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED : constant := 16#886A#;
GL_VERTEX_ATTRIB_ARRAY_Pointer : constant := 16#8645#;
GL_VERTEX_ATTRIB_ARRAY_Size : constant := 16#8623#;
GL_VERTEX_ATTRIB_ARRAY_STRIDE : constant := 16#8624#;
GL_VERTEX_ATTRIB_ARRAY_TYPE : constant := 16#8625#;
GL_VERTEX_SHADER : constant := 16#8B31#;
-------------
-- Functions
--
procedure glAttachShader (Program : in GLuint;
Shader : in GLuint);
procedure glBindAttribLocation (Program : in GLuint;
Index : in GLuint;
Name : access GLchar);
procedure glBindBuffer (Target : in GLenum;
Buffer : in GLuint);
procedure glBindFramebuffer (Target : in GLenum;
FrameBuffer : in GLuint);
procedure glBindRenderbuffer (Target : in GLenum;
RenderBuffer : in GLuint);
procedure glBlendColor (Red : in GLclampf;
Green : in GLclampf;
Blue : in GLclampf;
Alpha : in GLclampf);
procedure glBlendEquation (Mode : in GLenum);
procedure glBlendEquationSeparate (modeRGB : in GLenum;
modeAlpha : in GLenum);
procedure glBlendFuncSeparate (srcRGB : in GLenum;
dstRGB : in GLenum;
srcAlpha : in GLenum;
dstAlpha : in GLenum);
procedure glBufferData (Target : in GLenum;
Size : in GLsizeiptr;
Data : access GLvoid;
Usage : in GLenum);
procedure glBufferSubData (Target : in GLenum;
Offset : in GLintptr;
Size : in GLsizeiptr;
Data : access GLvoid);
function glCheckFramebufferStatus (Target : in GLenum) return GLenum;
procedure glCompileShader (Shader : in GLuint);
procedure glCompressedTexImage2D (Target : in GLenum;
Level : in GLint;
internalFormat : in GLenum;
Width : in GLsizei;
Height : in GLsizei;
Border : in GLint;
imageSize : in GLsizei;
Data : access GLvoid);
procedure glCompressedTexSubImage2D (Target : in GLenum;
Level : in GLint;
xOffset : in GLint;
yOffset : in GLint;
Width : in GLsizei;
Height : in GLsizei;
format : in GLenum;
imageSize : in GLsizei;
Data : access GLvoid);
procedure glCopyTexImage2D (Target : in GLenum;
Level : in GLint;
internalFormat : in GLenum;
X : in GLint;
Y : in GLint;
Width : in GLsizei;
Height : in GLsizei;
Border : in GLint);
procedure glCopyTexSubImage2D (Target : in GLenum;
Level : in GLint;
xOffset : in GLint;
yOffset : in GLint;
X : in GLint;
Y : in GLint;
Width : in GLsizei;
Height : in GLsizei);
function glCreateProgram return GLuint;
function glCreateShader (the_Type : in GLenum) return GLuint;
procedure glDeleteBuffers (N : in GLsizei;
Buffers : access GLuint);
procedure glDeleteFramebuffers (N : in GLsizei;
FrameBuffers : access GLuint);
procedure glDeleteProgram (Program : in GLuint);
procedure glDeleteRenderbuffers (N : in GLsizei;
RenderBuffers : access GLuint);
procedure glDeleteShader (Shader : in GLuint);
procedure glDeleteTextures (N : in GLsizei;
Textures : access GLuint);
procedure glDetachShader (Program : in GLuint;
Shader : in GLuint);
procedure glDisableVertexAttribArray (Index : in GLuint);
procedure glEnableVertexAttribArray (Index : in GLuint);
procedure glFramebufferRenderbuffer (Target : in GLenum;
Attachment : in GLenum;
RenderBufferTarget
: in GLenum;
RenderBuffer : in GLuint);
procedure glFramebufferTexture2D (Target : in GLenum;
Attachment : in GLenum;
TexTarget : in GLenum;
Texture : in GLuint;
Level : in GLint);
procedure glGenBuffers (N : in GLsizei;
Buffers : access GLuint);
procedure glGenFramebuffers (N : in GLsizei;
FrameBuffers : access GLuint);
procedure glGenRenderbuffers (N : in GLsizei;
RenderBuffers : access GLuint);
procedure glGenerateMipmap (Target : in GLenum);
procedure glGetActiveAttrib (Program : in GLuint;
Index : in GLuint;
BufSize : in GLsizei;
Length : access GLsizei;
Size : access GLint;
the_Type : access GLenum;
Name : access GLchar);
procedure glGetActiveUniform (Program : in GLuint;
Index : in GLuint;
BufSize : in GLsizei;
Length : access GLsizei;
Size : access GLint;
the_Type : access GLenum;
Name : access GLchar);
procedure glGetAttachedShaders (Program : in GLuint;
maxCount : in GLsizei;
Count : access GLsizei;
Shaders : access GLuint);
function glGetAttribLocation (Program : in GLuint;
Name : access GLchar) return Interfaces.C.int;
procedure glGetBufferParameteriv (Target : in GLenum;
pName : in GLenum;
Params : access GLint);
procedure glGetFramebufferAttachmentParameteriv
(Target : in GLenum;
Attachment : in GLenum;
pName : in GLenum;
Params : access GLint);
procedure glGetProgramiv (Program : in GLuint;
pName : in GLenum;
Params : access GLint);
procedure glGetProgramInfoLog (Program : in GLuint;
BufSize : in GLsizei;
Length : access GLsizei;
infoLog : access GLchar);
procedure glGetRenderbufferParameteriv
(Target : in GLenum;
pName : in GLenum;
Params : access GLint);
procedure glGetShaderiv (Shader : in GLuint;
pName : in GLenum;
Params : access GLint);
procedure glGetShaderInfoLog (Shader : in GLuint;
BufSize : in GLsizei;
Length : access GLsizei;
infoLog : access GLchar);
procedure glGetShaderPrecisionFormat (ShaderType : in GLenum;
PrecisionType : in GLenum;
the_Range : access GLint;
Precision : access GLint);
procedure glGetShaderSource (Shader : in GLuint;
BufSize : in GLsizei;
Length : access GLsizei;
Source : access GLchar);
procedure glGetTexParameterfv (Target : in GLenum;
pName : in GLenum;
Params : in GLfloat_Address);
procedure glGetUniformfv (Program : in GLuint;
Location : in GLint;
Params : in GLfloat_Address);
procedure glGetUniformiv (Program : in GLuint;
Location : in GLint;
Params : access GLint);
function glGetUniformLocation (Program : in GLuint;
Name : access GLchar) return Interfaces.C.int;
procedure glGetVertexAttribfv (Index : in GLuint;
pName : in GLenum;
Params : in GLfloat_Address);
procedure glGetVertexAttribiv (Index : in GLuint;
pName : in GLenum;
Params : access GLint);
procedure glGetVertexAttribPointerv (Index : in GLuint;
pName : in GLenum;
Pointer : access GLvoid);
function glIsBuffer (Buffer : in GLuint) return GLboolean;
function glIsFramebuffer (FrameBuffer : in GLuint) return GLboolean;
function glIsProgram (Program : in GLuint) return GLboolean;
function glIsRenderbuffer (RenderBuffer : in GLuint) return GLboolean;
function glIsShader (Shader : in GLuint) return GLboolean;
function glIsTexture (Texture : in GLuint) return GLboolean;
procedure glLinkProgram (Program : in GLuint);
procedure glReleaseShaderCompiler;
procedure glRenderbufferStorage (Target : in GLenum;
internalFormat : in GLenum;
Width : in GLsizei;
Height : in GLsizei);
procedure glSampleCoverage (Value : in GLclampf;
Invert : in GLboolean);
procedure glShaderBinary (N : in GLint;
Shaders : access GLuint;
BinaryFormat : in GLenum;
Binary : access GLvoid;
Length : in GLint);
procedure glShaderSource (Shader : in GLuint;
Count : in GLsizei;
String : access GLchar_Pointer;
Length : access GLint);
procedure glStencilFuncSeparate (Face : in GLenum;
Func : in GLenum;
Ref : in GLint;
Mask : in GLuint);
procedure glStencilMaskSeparate (Face : in GLenum;
Mask : in GLuint);
procedure glStencilOpSeparate (Face : in GLenum;
Fail : in GLenum;
zFail : in GLenum;
zPass : in GLenum);
procedure glTexParameterf (Target : in GLenum;
pName : in GLenum;
Param : in GLfloat);
procedure glTexParameterfv (Target : in GLenum;
pName : in GLenum;
Params : in GLfloat_Address);
procedure glTexParameteriv (Target : in GLenum;
pName : in GLenum;
Params : access GLint);
procedure glUniform1f (Location : in GLint;
X : in GLfloat);
procedure glUniform1fv (Location : in GLint;
Count : in GLsizei;
V : in GLfloat_Address);
procedure glUniform1i (Location : in GLint;
X : in GLint);
procedure glUniform1iv (Location : in GLint;
Count : in GLsizei;
V : access GLint);
procedure glUniform2f (Location : in GLint;
X : in GLfloat;
Y : in GLfloat);
procedure glUniform2fv (Location : in GLint;
Count : in GLsizei;
V : in GLfloat_Address);
procedure glUniform2i (Location : in GLint;
X : in GLint;
Y : in GLint);
procedure glUniform2iv (Location : in GLint;
Count : in GLsizei;
V : access GLint);
procedure glUniform3f (Location : in GLint;
X : in GLfloat;
Y : in GLfloat;
Z : in GLfloat);
procedure glUniform3fv (Location : in GLint;
Count : in GLsizei;
V : in GLfloat_Address);
procedure glUniform3i (Location : in GLint;
X : in GLint;
Y : in GLint;
Z : in GLint);
procedure glUniform3iv (Location : in GLint;
Count : in GLsizei;
V : access GLint);
procedure glUniform4f (Location : in GLint;
X : in GLfloat;
Y : in GLfloat;
Z : in GLfloat;
W : in GLfloat);
procedure glUniform4fv (Location : in GLint;
Count : in GLsizei;
V : in GLfloat_Address);
procedure glUniform4i (Location : in GLint;
X : in GLint;
Y : in GLint;
Z : in GLint;
W : in GLint);
procedure glUniform4iv (Location : in GLint;
Count : in GLsizei;
V : access GLint);
procedure glUniformMatrix2fv (Location : in GLint;
Count : in GLsizei;
Transpose : in GLboolean;
Value : in GLfloat_Address);
procedure glUniformMatrix3fv (Location : in GLint;
Count : in GLsizei;
Transpose : in GLboolean;
Value : in GLfloat_Address);
procedure glUniformMatrix4fv (Location : in GLint;
Count : in GLsizei;
Transpose : in GLboolean;
Value : in GLfloat_Address);
procedure glUseProgram (Program : in GLuint);
procedure glValidateProgram (Program : in GLuint);
procedure glVertexAttrib1f (Index : in GLuint;
X : in GLfloat);
procedure glVertexAttrib1fv (Index : in GLuint;
Values : in GLfloat_Address);
procedure glVertexAttrib2f (Index : in GLuint;
X : in GLfloat;
Y : in GLfloat);
procedure glVertexAttrib2fv (Index : in GLuint;
Values : in GLfloat_Address);
procedure glVertexAttrib3f (Index : in GLuint;
X : in GLfloat;
Y : in GLfloat;
Z : in GLfloat);
procedure glVertexAttrib3fv (Index : in GLuint;
Values : in GLfloat_Address);
procedure glVertexAttrib4f (Index : in GLuint;
X : in GLfloat;
Y : in GLfloat;
Z : in GLfloat;
W : in GLfloat);
procedure glVertexAttrib4fv (Index : in GLuint;
Values : in GLfloat_Address);
procedure glVertexAttribPointer (Index : in GLuint;
Size : in GLint;
the_Type : in GLenum;
Normalized : in GLboolean;
Stride : in GLsizei;
Ptr : access GLvoid);
private
for GLintptr 'Size use standard'Address_Size;
for GLsizeiptr'Size use standard'Address_Size;
-------------
-- Functions
--
pragma Import (StdCall, glAttachShader, "glAttachShader");
pragma Import (StdCall, glBindAttribLocation, "glBindAttribLocation");
pragma Import (StdCall, glBindBuffer, "glBindBuffer");
pragma Import (StdCall, glBindFramebuffer, "glBindFramebuffer");
pragma Import (StdCall, glBindRenderbuffer, "glBindRenderbuffer");
pragma Import (StdCall, glBlendColor, "glBlendColor");
pragma Import (StdCall, glBlendEquation, "glBlendEquation");
pragma Import (StdCall, glBlendEquationSeparate, "glBlendEquationSeparate");
pragma Import (StdCall, glBlendFuncSeparate, "glBlendFuncSeparate");
pragma Import (StdCall, glBufferData, "glBufferData");
pragma Import (StdCall, glBufferSubData, "glBufferSubData");
pragma Import (StdCall, glCheckFramebufferStatus, "glCheckFramebufferStatus");
pragma Import (StdCall, glCompileShader, "glCompileShader");
pragma Import (StdCall, glCompressedTexImage2D, "glCompressedTexImage2D");
pragma Import (StdCall, glCompressedTexSubImage2D, "glCompressedTexSubImage2D");
pragma Import (StdCall, glCopyTexImage2D, "glCopyTexImage2D");
pragma Import (StdCall, glCopyTexSubImage2D, "glCopyTexSubImage2D");
pragma Import (StdCall, glCreateProgram, "glCreateProgram");
pragma Import (StdCall, glCreateShader, "glCreateShader");
pragma Import (StdCall, glDeleteBuffers, "glDeleteBuffers");
pragma Import (StdCall, glDeleteFramebuffers, "glDeleteFramebuffers");
pragma Import (StdCall, glDeleteProgram, "glDeleteProgram");
pragma Import (StdCall, glDeleteRenderbuffers, "glDeleteRenderbuffers");
pragma Import (StdCall, glDeleteShader, "glDeleteShader");
pragma Import (StdCall, glDeleteTextures, "glDeleteTextures");
pragma Import (StdCall, glDetachShader, "glDetachShader");
pragma Import (StdCall, glDisableVertexAttribArray, "glDisableVertexAttribArray");
pragma Import (StdCall, glEnableVertexAttribArray, "glEnableVertexAttribArray");
pragma Import (StdCall, glFramebufferRenderbuffer, "glFramebufferRenderbuffer");
pragma Import (StdCall, glFramebufferTexture2D, "glFramebufferTexture2D");
pragma Import (StdCall, glGenBuffers, "glGenBuffers");
pragma Import (StdCall, glGenerateMipmap, "glGenerateMipmap");
pragma Import (StdCall, glGenFramebuffers, "glGenFramebuffers");
pragma Import (StdCall, glGenRenderbuffers, "glGenRenderbuffers");
pragma Import (StdCall, glGetActiveAttrib, "glGetActiveAttrib");
pragma Import (StdCall, glGetActiveUniform, "glGetActiveUniform");
pragma Import (StdCall, glGetAttachedShaders, "glGetAttachedShaders");
pragma Import (StdCall, glGetAttribLocation, "glGetAttribLocation");
pragma Import (StdCall, glGetBufferParameteriv, "glGetBufferParameteriv");
pragma Import (StdCall, glGetFramebufferAttachmentParameteriv,
"glGetFramebufferAttachmentParameteriv");
pragma Import (StdCall, glGetProgramiv, "glGetProgramiv");
pragma Import (StdCall, glGetProgramInfoLog, "glGetProgramInfoLog");
pragma Import (StdCall, glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv");
pragma Import (StdCall, glGetShaderiv, "glGetShaderiv");
pragma Import (StdCall, glGetShaderInfoLog, "glGetShaderInfoLog");
pragma Import (StdCall, glGetShaderPrecisionFormat, "glGetShaderPrecisionFormat");
pragma Import (StdCall, glGetShaderSource, "glGetShaderSource");
pragma Import (StdCall, glGetTexParameterfv, "glGetTexParameterfv");
pragma Import (StdCall, glGetUniformfv, "glGetUniformfv");
pragma Import (StdCall, glGetUniformiv, "glGetUniformiv");
pragma Import (StdCall, glGetUniformLocation, "glGetUniformLocation");
pragma Import (StdCall, glGetVertexAttribfv, "glGetVertexAttribfv");
pragma Import (StdCall, glGetVertexAttribiv, "glGetVertexAttribiv");
pragma Import (StdCall, glGetVertexAttribPointerv, "glGetVertexAttribPointerv");
pragma Import (StdCall, glIsBuffer, "glIsBuffer");
pragma Import (StdCall, glIsFramebuffer, "glIsFramebuffer");
pragma Import (StdCall, glIsProgram, "glIsProgram");
pragma Import (StdCall, glIsRenderbuffer, "glIsRenderbuffer");
pragma Import (StdCall, glIsShader, "glIsShader");
pragma Import (StdCall, glIsTexture, "glIsTexture");
pragma Import (StdCall, glLinkProgram, "glLinkProgram");
pragma Import (StdCall, glReleaseShaderCompiler, "glReleaseShaderCompiler");
pragma Import (StdCall, glRenderbufferStorage, "glRenderbufferStorage");
pragma Import (StdCall, glSampleCoverage, "glSampleCoverage");
pragma Import (StdCall, glShaderBinary, "glShaderBinary");
pragma Import (StdCall, glShaderSource, "glShaderSource");
pragma Import (StdCall, glStencilFuncSeparate, "glStencilFuncSeparate");
pragma Import (StdCall, glStencilMaskSeparate, "glStencilMaskSeparate");
pragma Import (StdCall, glStencilOpSeparate, "glStencilOpSeparate");
pragma Import (StdCall, glTexParameterf, "glTexParameterf");
pragma Import (StdCall, glTexParameterfv, "glTexParameterfv");
pragma Import (StdCall, glTexParameteriv, "glTexParameteriv");
pragma Import (StdCall, glUniform1f, "glUniform1f");
pragma Import (StdCall, glUniform1fv, "glUniform1fv");
pragma Import (StdCall, glUniform1i, "glUniform1i");
pragma Import (StdCall, glUniform1iv, "glUniform1iv");
pragma Import (StdCall, glUniform2f, "glUniform2f");
pragma Import (StdCall, glUniform2fv, "glUniform2fv");
pragma Import (StdCall, glUniform2i, "glUniform2i");
pragma Import (StdCall, glUniform2iv, "glUniform2iv");
pragma Import (StdCall, glUniform3f, "glUniform3f");
pragma Import (StdCall, glUniform3fv, "glUniform3fv");
pragma Import (StdCall, glUniform3i, "glUniform3i");
pragma Import (StdCall, glUniform3iv, "glUniform3iv");
pragma Import (StdCall, glUniform4f, "glUniform4f");
pragma Import (StdCall, glUniform4fv, "glUniform4fv");
pragma Import (StdCall, glUniform4i, "glUniform4i");
pragma Import (StdCall, glUniform4iv, "glUniform4iv");
pragma Import (StdCall, glUniformMatrix2fv, "glUniformMatrix2fv");
pragma Import (StdCall, glUniformMatrix3fv, "glUniformMatrix3fv");
pragma Import (StdCall, glUniformMatrix4fv, "glUniformMatrix4fv");
pragma Import (StdCall, glUseProgram, "glUseProgram");
pragma Import (StdCall, glValidateProgram, "glValidateProgram");
pragma Import (StdCall, glVertexAttrib1f, "glVertexAttrib1f");
pragma Import (StdCall, glVertexAttrib1fv, "glVertexAttrib1fv");
pragma Import (StdCall, glVertexAttrib2f, "glVertexAttrib2f");
pragma Import (StdCall, glVertexAttrib2fv, "glVertexAttrib2fv");
pragma Import (StdCall, glVertexAttrib3f, "glVertexAttrib3f");
pragma Import (StdCall, glVertexAttrib3fv, "glVertexAttrib3fv");
pragma Import (StdCall, glVertexAttrib4f, "glVertexAttrib4f");
pragma Import (StdCall, glVertexAttrib4fv, "glVertexAttrib4fv");
pragma Import (StdCall, glVertexAttribPointer, "glVertexAttribPointer");
end GL.lean;
|
opengl/src/implementation/gl-objects-textures.adb | Cre8or/OpenGLAda | 79 | 25808 | <filename>opengl/src/implementation/gl-objects-textures.adb
-- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
with Ada.Unchecked_Conversion;
with Ada.Containers.Indefinite_Hashed_Maps;
with GL.API;
with GL.Helpers;
with GL.Enums.Getter;
with GL.Enums.Indexes;
with GL.Enums.Textures;
package body GL.Objects.Textures is
use type Low_Level.Enums.Texture_Kind;
function Width (Object : Texture_Proxy; Level : Mipmap_Level) return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Width, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Width;
function Height (Object : Texture_Proxy; Level : Mipmap_Level) return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Height, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Height;
function Depth (Object : Texture_Proxy; Level : Mipmap_Level) return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Depth_Size, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Depth;
function Format (Object : Texture_Proxy; Level : Mipmap_Level)
return Pixels.Internal_Format is
Ret : Pixels.Internal_Format;
begin
API.Get_Tex_Level_Parameter_Format (Object.Kind, Level,
Enums.Textures.Internal_Format, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Format;
function Red_Type (Object : Texture_Proxy; Level : Mipmap_Level)
return Pixels.Channel_Data_Type is
Ret : Pixels.Channel_Data_Type;
begin
API.Get_Tex_Level_Parameter_Type (Object.Kind, Level,
Enums.Textures.Red_Type, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Red_Type;
function Green_Type (Object : Texture_Proxy; Level : Mipmap_Level)
return Pixels.Channel_Data_Type is
Ret : Pixels.Channel_Data_Type;
begin
API.Get_Tex_Level_Parameter_Type (Object.Kind, Level,
Enums.Textures.Green_Type, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Green_Type;
function Blue_Type (Object : Texture_Proxy; Level : Mipmap_Level)
return Pixels.Channel_Data_Type is
Ret : Pixels.Channel_Data_Type;
begin
API.Get_Tex_Level_Parameter_Type (Object.Kind, Level,
Enums.Textures.Blue_Type, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Blue_Type;
function Alpha_Type (Object : Texture_Proxy; Level : Mipmap_Level)
return Pixels.Channel_Data_Type is
Ret : Pixels.Channel_Data_Type;
begin
API.Get_Tex_Level_Parameter_Type (Object.Kind, Level,
Enums.Textures.Alpha_Type, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Alpha_Type;
function Depth_Type (Object : Texture_Proxy; Level : Mipmap_Level)
return Pixels.Channel_Data_Type is
Ret : Pixels.Channel_Data_Type;
begin
API.Get_Tex_Level_Parameter_Type (Object.Kind, Level,
Enums.Textures.Depth_Type, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Depth_Type;
function Red_Size (Object : Texture_Proxy; Level : Mipmap_Level)
return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Red_Size, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Red_Size;
function Green_Size (Object : Texture_Proxy; Level : Mipmap_Level)
return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Green_Size, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Green_Size;
function Blue_Size (Object : Texture_Proxy; Level : Mipmap_Level)
return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Blue_Size, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Blue_Size;
function Alpha_Size (Object : Texture_Proxy; Level : Mipmap_Level)
return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Alpha_Size, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Alpha_Size;
function Depth_Size (Object : Texture_Proxy; Level : Mipmap_Level)
return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Depth_Size, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Depth_Size;
function Compressed (Object : Texture_Proxy; Level : Mipmap_Level)
return Boolean is
Ret : Low_Level.Bool;
begin
API.Get_Tex_Level_Parameter_Bool (Object.Kind, Level,
Enums.Textures.Compressed, Ret);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Compressed;
function Compressed_Image_Size (Object : Texture_Proxy; Level : Mipmap_Level)
return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Compressed_Image_Size,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Compressed_Image_Size;
function Raw_Kind (Object : Texture_Proxy)
return Low_Level.Enums.Texture_Kind is
begin
return Object.Kind;
end Raw_Kind;
function Hash (Key : Low_Level.Enums.Texture_Kind)
return Ada.Containers.Hash_Type is
function Value is new Ada.Unchecked_Conversion
(Source => Low_Level.Enums.Texture_Kind, Target => Low_Level.Enum);
begin
return Ada.Containers.Hash_Type (Value (Key));
end Hash;
package Texture_Maps is new Ada.Containers.Indefinite_Hashed_Maps
(Key_Type => Low_Level.Enums.Texture_Kind,
Element_Type => Texture'Class,
Hash => Hash,
Equivalent_Keys => Low_Level.Enums."=");
use type Texture_Maps.Cursor;
Current_Textures : Texture_Maps.Map;
procedure Bind (Target : Texture_Target; Object : Texture'Class) is
Cursor : constant Texture_Maps.Cursor
:= Current_Textures.Find (Target.Kind);
begin
if Cursor = Texture_Maps.No_Element or else
Texture_Maps.Element (Cursor).Reference.GL_Id /= Object.Reference.GL_Id
then
API.Bind_Texture (Target.Kind, Object.Reference.GL_Id);
Raise_Exception_On_OpenGL_Error;
if Cursor = Texture_Maps.No_Element then
Current_Textures.Insert (Target.Kind, Object);
else
Current_Textures.Replace_Element (Cursor, Object);
end if;
end if;
end Bind;
function Is_Texture (Texture : UInt) return Boolean is
Ret : Boolean;
begin
Ret := API.Is_Texture (Texture);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Is_Texture;
function Current_Texture (Target : Texture_Target) return Texture'Class is
Cursor : constant Texture_Maps.Cursor
:= Current_Textures.Find (Target.Kind);
begin
if Cursor /= Texture_Maps.No_Element then
return Texture_Maps.Element (Cursor);
else
raise No_Object_Bound_Exception with Target.Kind'Img;
end if;
end Current_Texture;
overriding
procedure Internal_Create_Id (Object : Texture; Id : out UInt) is
pragma Unreferenced (Object);
begin
API.Gen_Textures (1, Id);
Raise_Exception_On_OpenGL_Error;
end Internal_Create_Id;
overriding
procedure Internal_Release_Id (Object : Texture; Id : UInt) is
pragma Unreferenced (Object);
begin
API.Delete_Textures (1, (1 => Id));
Raise_Exception_On_OpenGL_Error;
end Internal_Release_Id;
procedure Invalidate_Image (Object : Texture; Level : Mipmap_Level) is
begin
API.Invalidate_Tex_Image (Object.Reference.GL_Id, Level);
Raise_Exception_On_OpenGL_Error;
end Invalidate_Image;
procedure Invalidate_Sub_Image (Object : Texture; Level : Mipmap_Level;
X, Y, Z : Int; Width, Height, Depth : Size)
is
begin
API.Invalidate_Tex_Sub_Image (Object.Reference.GL_Id, Level, X, Y, Z,
Width, Height, Depth);
Raise_Exception_On_OpenGL_Error;
end Invalidate_Sub_Image;
procedure Set_Minifying_Filter (Target : Texture_Target;
Filter : Minifying_Function) is
begin
API.Tex_Parameter_Min_Filter (Target.Kind, Enums.Textures.Min_Filter,
Filter);
Raise_Exception_On_OpenGL_Error;
end Set_Minifying_Filter;
function Minifying_Filter (Target : Texture_Target)
return Minifying_Function is
function Convert is new Ada.Unchecked_Conversion
(Source => Int, Target => Minifying_Function);
Ret : Int;
begin
API.Get_Tex_Parameter_Int (Target.Kind, Enums.Textures.Min_Filter,
Ret);
Raise_Exception_On_OpenGL_Error;
return Convert (Ret);
end Minifying_Filter;
procedure Set_Magnifying_Filter (Target : Texture_Target;
Filter : Magnifying_Function) is
begin
API.Tex_Parameter_Mag_Filter (Target.Kind, Enums.Textures.Mag_Filter,
Filter);
Raise_Exception_On_OpenGL_Error;
end Set_Magnifying_Filter;
function Magnifying_Filter (Target : Texture_Target)
return Magnifying_Function is
function Convert is new Ada.Unchecked_Conversion
(Source => Int, Target => Minifying_Function);
Ret : Int;
begin
API.Get_Tex_Parameter_Int (Target.Kind, Enums.Textures.Mag_Filter,
Ret);
Raise_Exception_On_OpenGL_Error;
return Convert (Ret);
end Magnifying_Filter;
procedure Set_Minimum_LoD (Target : Texture_Target; Level : Double) is
begin
API.Tex_Parameter_Float (Target.Kind, Enums.Textures.Min_LoD,
Single (Level));
Raise_Exception_On_OpenGL_Error;
end Set_Minimum_LoD;
function Minimum_LoD (Target : Texture_Target) return Double is
Ret : Single;
begin
API.Get_Tex_Parameter_Float (Target.Kind, Enums.Textures.Min_LoD,
Ret);
Raise_Exception_On_OpenGL_Error;
return Double (Ret);
end Minimum_LoD;
procedure Set_Maximum_LoD (Target : Texture_Target; Level : Double) is
begin
API.Tex_Parameter_Float (Target.Kind, Enums.Textures.Max_LoD,
Single (Level));
Raise_Exception_On_OpenGL_Error;
end Set_Maximum_LoD;
function Maximum_LoD (Target : Texture_Target) return Double is
Ret : Single;
begin
API.Get_Tex_Parameter_Float (Target.Kind, Enums.Textures.Max_LoD,
Ret);
Raise_Exception_On_OpenGL_Error;
return Double (Ret);
end Maximum_LoD;
procedure Set_Lowest_Mipmap_Level (Target : Texture_Target;
Level : Mipmap_Level) is
begin
API.Tex_Parameter_Int (Target.Kind, Enums.Textures.Base_Level, Level);
Raise_Exception_On_OpenGL_Error;
end Set_Lowest_Mipmap_Level;
function Lowest_Mipmap_Level (Target : Texture_Target) return Mipmap_Level is
Ret : Int;
begin
API.Get_Tex_Parameter_Int (Target.Kind, Enums.Textures.Base_Level,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Lowest_Mipmap_Level;
procedure Set_Highest_Mipmap_Level (Target : Texture_Target;
Level : Mipmap_Level) is
begin
API.Tex_Parameter_Int (Target.Kind, Enums.Textures.Max_Level, Level);
Raise_Exception_On_OpenGL_Error;
end Set_Highest_Mipmap_Level;
function Highest_Mipmap_Level (Target : Texture_Target)
return Mipmap_Level is
Ret : Int;
begin
API.Get_Tex_Parameter_Int (Target.Kind, Enums.Textures.Max_Level,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Highest_Mipmap_Level;
procedure Set_X_Wrapping (Target : Texture_Target; Mode : Wrapping_Mode) is
begin
API.Tex_Parameter_Wrap_Mode (Target.Kind, Enums.Textures.Wrap_S,
Mode);
Raise_Exception_On_OpenGL_Error;
end Set_X_Wrapping;
function X_Wrapping (Target : Texture_Target) return Wrapping_Mode is
Ret : Wrapping_Mode;
begin
API.Get_Tex_Parameter_Wrap_Mode (Target.Kind, Enums.Textures.Wrap_S,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end X_Wrapping;
procedure Set_Y_Wrapping (Target : Texture_Target; Mode : Wrapping_Mode) is
begin
API.Tex_Parameter_Wrap_Mode (Target.Kind, Enums.Textures.Wrap_T,
Mode);
Raise_Exception_On_OpenGL_Error;
end Set_Y_Wrapping;
function Y_Wrapping (Target : Texture_Target) return Wrapping_Mode is
Ret : Wrapping_Mode;
begin
API.Get_Tex_Parameter_Wrap_Mode (Target.Kind, Enums.Textures.Wrap_T,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Y_Wrapping;
procedure Set_Z_Wrapping (Target : Texture_Target; Mode : Wrapping_Mode) is
begin
API.Tex_Parameter_Wrap_Mode (Target.Kind, Enums.Textures.Wrap_R,
Mode);
Raise_Exception_On_OpenGL_Error;
end Set_Z_Wrapping;
function Z_Wrapping (Target : Texture_Target) return Wrapping_Mode is
Ret : Wrapping_Mode;
begin
API.Get_Tex_Parameter_Wrap_Mode (Target.Kind, Enums.Textures.Wrap_R,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Z_Wrapping;
procedure Set_Border_Color (Target : Texture_Target; Color : Colors.Color) is
Raw : constant Single_Array := Helpers.Float_Array (Color);
begin
API.Tex_Parameter_Floats (Target.Kind, Enums.Textures.Border_Color,
Raw);
Raise_Exception_On_OpenGL_Error;
end Set_Border_Color;
function Border_Color (Target : Texture_Target) return Colors.Color is
Raw : Single_Array (1 .. 4);
begin
API.Get_Tex_Parameter_Floats (Target.Kind, Enums.Textures.Border_Color,
Raw);
Raise_Exception_On_OpenGL_Error;
return Helpers.Color (Raw);
end Border_Color;
procedure Set_Texture_Priority (Target : Texture_Target;
Value : Priority) is
begin
API.Tex_Parameter_Float (Target.Kind, Enums.Textures.Priority,
Single (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Texture_Priority;
function Texture_Priority (Target : Texture_Target) return Priority is
Ret : Single;
begin
API.Get_Tex_Parameter_Float (Target.Kind, Enums.Textures.Priority, Ret);
Raise_Exception_On_OpenGL_Error;
return Priority (Ret);
end Texture_Priority;
procedure Toggle_Compare_X_To_Texture (Target : Texture_Target;
Enabled : Boolean) is
Value : Enums.Textures.Compare_Kind;
begin
if Enabled then
Value := Enums.Textures.Compare_R_To_Texture;
else
Value := Enums.Textures.None;
end if;
API.Tex_Parameter_Comp_Mode (Target.Kind, Enums.Textures.Compare_Mode,
Value);
Raise_Exception_On_OpenGL_Error;
end Toggle_Compare_X_To_Texture;
function Compare_X_To_Texture_Enabled (Target : Texture_Target)
return Boolean is
use type Enums.Textures.Compare_Kind;
Value : Enums.Textures.Compare_Kind;
begin
API.Get_Tex_Parameter_Comp_Mode (Target.Kind, Enums.Textures.Compare_Mode,
Value);
Raise_Exception_On_OpenGL_Error;
return Value = Enums.Textures.Compare_R_To_Texture;
end Compare_X_To_Texture_Enabled;
procedure Set_Compare_Function (Target : Texture_Target;
Func : Compare_Function) is
begin
API.Tex_Parameter_Comp_Func (Target.Kind, Enums.Textures.Compare_Func,
Func);
Raise_Exception_On_OpenGL_Error;
end Set_Compare_Function;
function Current_Compare_Function (Target : Texture_Target)
return Compare_Function is
Value : Compare_Function;
begin
API.Get_Tex_Parameter_Comp_Func (Target.Kind, Enums.Textures.Compare_Func,
Value);
Raise_Exception_On_OpenGL_Error;
return Value;
end Current_Compare_Function;
procedure Set_Depth_Texture_Mode (Target : Texture_Target;
Mode : Depth_Mode) is
begin
API.Tex_Parameter_Depth_Mode (Target.Kind, Enums.Textures.Depth, Mode);
Raise_Exception_On_OpenGL_Error;
end Set_Depth_Texture_Mode;
function Depth_Texture_Mode (Target : Texture_Target) return Depth_Mode is
Value : Depth_Mode;
begin
API.Get_Tex_Parameter_Depth_Mode (Target.Kind, Enums.Textures.Depth,
Value);
Raise_Exception_On_OpenGL_Error;
return Value;
end Depth_Texture_Mode;
procedure Toggle_Mipmap_Autoupdate (Target : Texture_Target;
Enabled : Boolean) is
begin
API.Tex_Parameter_Bool (Target.Kind, Enums.Textures.Generate_Mipmap,
Low_Level.Bool (Enabled));
Raise_Exception_On_OpenGL_Error;
end Toggle_Mipmap_Autoupdate;
function Mipmap_Autoupdate_Enabled (Target : Texture_Target)
return Boolean is
Value : Low_Level.Bool;
begin
API.Get_Tex_Parameter_Bool (Target.Kind, Enums.Textures.Generate_Mipmap,
Value);
Raise_Exception_On_OpenGL_Error;
return Boolean (Value);
end Mipmap_Autoupdate_Enabled;
procedure Generate_Mipmap (Target : Texture_Target) is
begin
API.Generate_Mipmap (Target.Kind);
Raise_Exception_On_OpenGL_Error;
end Generate_Mipmap;
function Raw_Type (Target : Texture_Target)
return Low_Level.Enums.Texture_Kind is
begin
return Target.Kind;
end Raw_Type;
procedure Set_Active_Unit (Unit : Texture_Unit) is
package Texture_Indexing is new Enums.Indexes
(Enums.Textures.Texture_Unit_Start_Rep,
Enums.Getter.Max_Combined_Texture_Image_Units);
begin
API.Active_Texture (Texture_Indexing.Representation (Unit));
Raise_Exception_On_OpenGL_Error;
end Set_Active_Unit;
function Active_Unit return Texture_Unit is
package Texture_Indexing is new Enums.Indexes
(Enums.Textures.Texture_Unit_Start_Rep,
Enums.Getter.Max_Combined_Texture_Image_Units);
Raw_Unit : aliased Int := Enums.Textures.Texture_Unit_Start_Rep;
begin
API.Get_Integer (Enums.Getter.Active_Texture, Raw_Unit'Access);
return Texture_Indexing.Value (Raw_Unit);
end Active_Unit;
function Texture_Unit_Count return Natural is
Count : aliased Int;
begin
API.Get_Integer (Enums.Getter.Max_Combined_Texture_Image_Units,
Count'Access);
return Natural (Count);
end Texture_Unit_Count;
function Format_For_Loading_Empty_Texture
(Internal_Format : Pixels.Internal_Format) return Pixels.Data_Format is
use GL.Pixels;
begin
case Internal_Format is
when Depth_Component | Depth_Component16 | Depth_Component24 |
Depth_Component32 => return Depth_Component;
when others => return Red;
end case;
end Format_For_Loading_Empty_Texture;
end GL.Objects.Textures;
|
libsrc/gfx/portable/point.asm | Frodevan/z88dk | 640 | 101743 | <filename>libsrc/gfx/portable/point.asm<gh_stars>100-1000
SECTION code_graphics
PUBLIC point
PUBLIC _point
PUBLIC point_callee
PUBLIC _point_callee
PUBLIC asm_point
EXTERN pointxy
; int point(int x, int y) __smallc;
point:
_point:
ld hl,sp+2
ld e,(hl) ;y
ld hl,sp+4
ld d,(hl) ;x
ex de,hl
jr asm_point
point_callee:
_point_callee:
pop bc ;return
pop hl ;y
pop de
ld h,e ;x
push bc ;return address
asm_point:
call pointxy
ld hl,1
ret nz ;pixel set
dec hl
ret
|
data/maps/objects/UndergroundPathNorthSouth.asm | opiter09/ASM-Machina | 1 | 170428 | <filename>data/maps/objects/UndergroundPathNorthSouth.asm
UndergroundPathNorthSouth_Object:
db $1 ; border block
def_warps
warp 5, 4, 2, UNDERGROUND_PATH_ROUTE_5
warp 2, 41, 2, UNDERGROUND_PATH_ROUTE_6
def_signs
def_objects
def_warps_to UNDERGROUND_PATH_NORTH_SOUTH
|
src/are.ads | stcarrez/resource-embedder | 7 | 23457 | <filename>src/are.ads
-----------------------------------------------------------------------
-- are -- Advanced Resource Embedder
-- Copyright (C) 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 Ada.Strings.Unbounded;
private with Ada.Finalization;
private with Ada.Streams;
private with Ada.Strings.Maps;
private with Ada.Containers.Indefinite_Ordered_Maps;
private with Ada.Containers.Indefinite_Vectors;
private with Ada.Directories;
private with Ada.Calendar;
private with Ada.Command_Line;
private with GNAT.Strings;
private with GNAT.Regpat;
private with Util.Strings.Vectors;
package Are is
function "-" (Message : in String) return String is (Message);
type Context_Type is tagged limited private;
type Resource_Type is tagged limited private;
type Resource_Access is access all Resource_Type;
type Resource_List is limited private;
private
subtype UString is Ada.Strings.Unbounded.Unbounded_String;
subtype Character_Set is Ada.Strings.Maps.Character_Set;
type Stream_Element_Access is access all Ada.Streams.Stream_Element_Array;
type File_Format is (FORMAT_RAW, FORMAT_GZIP);
-- The information about a file being embedded.
type File_Info is record
Content : Stream_Element_Access;
Length : Ada.Directories.File_Size;
Modtime : Ada.Calendar.Time;
Format : File_Format := FORMAT_RAW;
Line_Count : Natural := 0;
end record;
-- An ordered map of files being embedded.
package File_Maps is
new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => String,
Element_Type => File_Info,
"<" => "<",
"=" => "=");
type Format_Type is (R_BINARY, R_STRING, R_LINES);
type Line_Filter_Type (Size : GNAT.Regpat.Program_Size;
Replace_Length : Natural) is
record
Pattern : GNAT.Regpat.Pattern_Matcher (Size);
Replace : String (1 .. Replace_Length);
end record;
package Filter_Vectors is
new Ada.Containers.Indefinite_Vectors (Index_Type => Positive,
Element_Type => Line_Filter_Type);
-- A resource is composed of a set of files.
type Resource_Type is limited new Ada.Finalization.Limited_Controlled with record
Next : Resource_Access;
Name : UString;
Format : Format_Type := R_BINARY;
Files : File_Maps.Map;
Separators : Character_Set := Ada.Strings.Maps.Null_Set;
Filters : Filter_Vectors.Vector;
Type_Name : UString;
Content_Type_Name : UString;
Function_Name : UString;
Member_Content_Name : UString;
Member_Length_Name : UString;
Member_Modtime_Name : UString;
Member_Format_Name : UString;
end record;
-- Get the name of type and struct/record members for the generator:
-- - get the value from the resource library definition,
-- - otherwise use the global context,
-- - otherwise use the pre-defined value.
function Get_Type_Name (Resource : in Resource_Type;
Context : in Context_Type'Class;
Default : in String) return String;
function Get_Content_Type_Name (Resource : in Resource_Type;
Context : in Context_Type'Class;
Default : in String) return String;
function Get_Function_Name (Resource : in Resource_Type;
Context : in Context_Type'Class;
Default : in String) return String;
function Get_Member_Content_Name (Resource : in Resource_Type;
Context : in Context_Type'Class;
Default : in String) return String;
function Get_Member_Length_Name (Resource : in Resource_Type;
Context : in Context_Type'Class;
Default : in String) return String;
function Get_Member_Modtime_Name (Resource : in Resource_Type;
Context : in Context_Type'Class;
Default : in String) return String;
function Get_Member_Format_Name (Resource : in Resource_Type;
Context : in Context_Type'Class;
Default : in String) return String;
-- Release the resources.
overriding
procedure Finalize (Context : in out Resource_Type);
-- Load and add the file in the resource library.
procedure Add_File (Resource : in out Resource_Type;
Name : in String;
Path : in String;
Override : in Boolean := False) with
Pre => Name'Length > 0 and Path'Length > 0,
Post => Resource.Files.Contains (Name);
-- Load and add the file in the resource library.
procedure Add_File (Resource : in out Resource_Type;
Name : in String;
Path : in String;
Modtime : in Ada.Calendar.Time;
Override : in Boolean := False) with
Pre => Name'Length > 0 and Path'Length > 0,
Post => Resource.Files.Contains (Name);
-- Add a line filter that will replace contents matching the pattern
-- by the replacement string.
procedure Add_Line_Filter (Resource : in out Resource_Type;
Pattern : in String;
Replacement : in String);
-- Convert the file content to a list of string lines.
procedure Convert_To_Lines (Resource : in Resource_Type;
File : in File_Info;
Lines : in out Util.Strings.Vectors.Vector);
-- Collect the list of files names for the resource (list is sorted).
procedure Collect_Names (Resource : in Resource_Type;
Ignore_Case : in Boolean;
Names : in out Util.Strings.Vectors.Vector);
-- List of resources.
type Resource_List is limited record
Head : Resource_Access;
end record;
-- Create a new resource with the given name.
procedure Create_Resource (List : in out Resource_List;
Name : in String;
Resource : out Resource_Access) with
Pre => Name'Length > 0,
Post => Resource /= null;
-- Get the number of resources in the list.
function Length (List : in Resource_List) return Natural;
-- The context holding and describing information to embed.
type Context_Type is limited new Ada.Finalization.Limited_Controlled with record
Status : Ada.Command_Line.Exit_Status := Ada.Command_Line.Success;
Resources : Resource_List;
Verbose : aliased Boolean := False;
Debug : aliased Boolean := False;
Version : aliased Boolean := False;
Ignore_Case : aliased Boolean := False;
Name_Index : aliased Boolean := False;
Declare_Var : aliased Boolean := False;
No_Type_Declaration : aliased Boolean := False;
List_Content : aliased Boolean := False;
Keep_Temporary : aliased Boolean := False;
Rule_File : aliased GNAT.Strings.String_Access;
Language : aliased GNAT.Strings.String_Access;
Output : aliased GNAT.Strings.String_Access;
Tmp_Dir : aliased GNAT.Strings.String_Access;
Type_Name : aliased GNAT.Strings.String_Access;
Function_Name : aliased GNAT.Strings.String_Access;
Member_Content_Name : aliased GNAT.Strings.String_Access;
Member_Length_Name : aliased GNAT.Strings.String_Access;
Member_Modtime_Name : aliased GNAT.Strings.String_Access;
Member_Format_Name : aliased GNAT.Strings.String_Access;
Resource_Name : aliased GNAT.Strings.String_Access;
Fileset_Pattern : aliased GNAT.Strings.String_Access;
Var_Prefix : aliased GNAT.Strings.String_Access;
end record;
-- Release the context information.
overriding
procedure Finalize (Context : in out Context_Type);
-- Report an error and set the exit status accordingly
procedure Error (Context : in out Context_Type;
Message : in String;
Arg1 : in String;
Arg2 : in String := "");
procedure Error (Context : in out Context_Type;
Message : in String;
Arg1 : in UString;
Arg2 : in String := "");
-- Get a path for the resource generation directory.
function Get_Generation_Path (Context : in Context_Type;
Name : in String) return String;
-- Get the path to write a file taking into account the output directory.
function Get_Output_Path (Context : in Context_Type;
Name : in String) return String;
-- Configure the logs.
procedure Configure_Logs (Debug : in Boolean;
Verbose : in Boolean);
end Are;
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnarl/a-astaco.adb | djamal2727/Main-Bearing-Analytical-Model | 0 | 13391 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . A S Y N C H R O N O U S _ T A S K _ C O N T R O L --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-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. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is a dummy body, which will not normally be compiled when used with
-- standard versions of GNAT, which do not support this package. See comments
-- in spec for further details.
package body Ada.Asynchronous_Task_Control is
--------------
-- Continue --
--------------
procedure Continue (T : Ada.Task_Identification.Task_Id) is
begin
null;
end Continue;
----------
-- Hold --
----------
procedure Hold (T : Ada.Task_Identification.Task_Id) is
begin
raise Program_Error;
end Hold;
-------------
-- Is_Held --
-------------
function Is_Held (T : Ada.Task_Identification.Task_Id) return Boolean is
begin
return False;
end Is_Held;
end Ada.Asynchronous_Task_Control;
|
testsuite/tests-parser_data.ads | reznikmm/increment | 5 | 23018 | -- Copyright (c) 2015-2017 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with League.String_Vectors;
with Incr.Documents;
with Incr.Nodes;
with Incr.Parsers.Incremental;
package Tests.Parser_Data is
package P renames Incr.Parsers.Incremental.Parser_Data_Providers;
type Provider (Document : Incr.Documents.Document_Access)
is new P.Parser_Data_Provider and P.Node_Factory with private;
overriding function Actions
(Self : Provider) return P.Action_Table_Access;
overriding function States
(Self : Provider) return P.State_Table_Access;
overriding function Part_Counts
(Self : Provider) return P.Parts_Count_Table_Access;
overriding function Kind_Image
(Self : Provider;
Kind : Incr.Nodes.Node_Kind) return Wide_Wide_String;
overriding procedure Create_Node
(Self : aliased in out Provider;
Prod : Incr.Parsers.Incremental.
Parser_Data_Providers.Production_Index;
Children : Incr.Nodes.Node_Array;
Node : out Incr.Nodes.Node_Access;
Kind : out Incr.Nodes.Node_Kind);
type Node_Kind_Array is array (P.Production_Index range <>) of
Incr.Nodes.Node_Kind;
private
package Constructors is
function Create
(Document : Incr.Documents.Document_Access;
NT : Node_Kind_Array;
Parts : P.Parts_Count_Table;
Names : League.String_Vectors.Universal_String_Vector;
Max_State : P.Parser_State;
Max_Term : Incr.Nodes.Token_Kind) return Provider;
end Constructors;
type Node_Kind_Array_Access is access all Node_Kind_Array;
type Action_Table_Access is access P.Action_Table;
type State_Table_Access is access P.State_Table;
type Parts_Count_Table_Access is access P.Parts_Count_Table;
type Provider
(Document : Incr.Documents.Document_Access)
is new P.Parser_Data_Provider and P.Node_Factory with record
Max_Term : Incr.Nodes.Token_Kind;
Max_NT : Incr.Nodes.Node_Kind;
Names : League.String_Vectors.Universal_String_Vector;
Actions : Action_Table_Access;
States : State_Table_Access;
NT : Node_Kind_Array_Access;
Parts : Parts_Count_Table_Access;
end record;
end Tests.Parser_Data;
|
test/Fail/Issue4784a.agda | KDr2/agda | 0 | 4390 | <reponame>KDr2/agda<gh_stars>0
{-# OPTIONS --cubical-compatible #-}
postulate
A : Set
B : A → Set
T = (@0 x : A) → B x
|
base/mvdm/dos/v86/dev/hbios/debug.asm | npocmaka/Windows-Server-2003 | 17 | 25950 | <gh_stars>10-100
code SEGMENT Public byte 'CODE'
ASSUME Cs:code, Ds:code
buffer DB 6 DUP (?)
_DebugChar PROC Near
;
; AL < Character To Be Shown
;
push ax
push dx
mov ah, 1
mov dx, 0
int 14h
pop dx
pop ax
ret
_DebugChar ENDP
_DebugString PROC Near
;
; BX < Offset of String To Be Shown (Null Terminate)
;
push ax
push bx
push ds
mov ax, cs
mov ds, ax
@@:
mov al, [bx]
inc bx
or al, al
jz @f
call _DebugChar
jmp @b
@@:
pop ds
pop bx
pop ax
ret
_DebugString ENDP
NumHex PROC Near
;
; AL(0..3) < Hex Value
; AL > ASCII Code
;
and al, 0Fh
cmp al, 0Ah
jb @f
add al, 'A'-'0'-10
@@:
add al, '0'
ret
NumHex ENDP
NumByte PROC Near
;
; AL < Byte Value
; AX > Two ASCII Codes for Byte Value
;
push dx
mov dl, al
call NumHex
mov dh, al
mov al, dl
shr al, 1
shr al, 1
shr al, 1
shr al, 1
call NumHex
mov dl, al
mov ax, dx
pop dx
ret
NumByte ENDP
_DebugNumber PROC Near
;
; AX < Word Value To Be Shown
;
push ax
push bx
push dx
push bp
push ds
mov bx, cs
mov ds, bx
lea bx, buffer
mov Byte Ptr [bx], 32
mov dx, ax
mov al, dh
call NumByte
mov [bx+1], ax
mov al, dl
call NumByte
mov [bx+3], ax
lea bx, buffer
call _DebugString
pop ds
pop bp
pop dx
pop bx
pop ax
ret
_DebugNumber ENDP
PUBLIC _DebugChar, _DebugString, _DebugNumber
code ENDS
END
|
Boolean/Lemmas.agda | Smaug123/agdaproofs | 4 | 5229 | <reponame>Smaug123/agdaproofs
{-# OPTIONS --safe --warning=error --without-K #-}
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import LogicalFormulae
open import Boolean.Definition
module Boolean.Lemmas where
notNot : (x : Bool) → not (not x) ≡ x
notNot BoolTrue = refl
notNot BoolFalse = refl
notXor : (x y : Bool) → not (xor x y) ≡ xor (not x) y
notXor BoolTrue BoolTrue = refl
notXor BoolTrue BoolFalse = refl
notXor BoolFalse BoolTrue = refl
notXor BoolFalse BoolFalse = refl
|
src/skill-iterators-type_order.adb | skill-lang/adaCommon | 0 | 3525 | <gh_stars>0
-- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ iterator over types --
-- |___/_|\_\_|_|____| by: <NAME> --
-- --
pragma Ada_2012;
with Skill.Internal.Parts;
package body Skill.Iterators.Type_Order is
procedure Init (This : access Iterator'Class; First : Skill.Types.Pools.Pool)
is
T : Skill.Types.Pools.Pool;
begin
This.Ts.Init(First);
while This.Ts.Has_Next loop
T := This.Ts.Next;
if T.Static_Size > 0 then
This.Data.Init(T);
return;
end if;
end loop;
-- initialize with empty
This.Data.Init(First);
end Init;
function Next
(This : access Iterator'Class) return Annotation
is
Rval : Annotation := This.Data.Next;
T : Skill.Types.Pools.Pool;
begin
if not This.Data.Has_Next then
while This.Ts.Has_Next loop
T := This.Ts.Next;
if T.Static_Size > 0 then
This.Data.Init(T);
return Rval;
end if;
end loop;
end if;
return Rval;
end Next;
end Skill.Iterators.Type_Order;
|
examples/asm/arith.asm | erazemk/sicsim | 0 | 28533 | <gh_stars>0
. program
arith START 0
. vsota
LDA x
ADD y
STA sum
. razlika
LDA x
SUB y
STA diff
. zmnozek
LDA x
MUL y
STA prod
. kvocient
LDA x
DIV y
STA quot
. modulo
modulo LDA x
COMP y
JGT raz
STA mod
J halt
raz SUB y
STA x
J modulo
halt J halt
. podatki
x WORD 10
y WORD 3
sum RESW 1
diff RESW 1
prod RESW 1
quot RESW 1
mod RESW 1
|
iod/con2/donwl.asm | olifink/smsqe | 0 | 2788 | <reponame>olifink/smsqe
; Do a new line V2.00 1998 <NAME>
;
; This routine is called when a pending newline is activated, by
; changing the character size, sending more characters, activating
; the cursor or reading its position. The pending newline flag is
; set when there is no more room for characters on the current line,
; or a line feed character is printed. It is cleared by this
; routine, or by a whole area clear, or a cursor positioning call.
;
; Registers:
; Entry Exit
; A0 pointer to cdb preserved
;
section con
;
include 'dev8_keys_con'
;
xref cn_scral
;
xdef cn_dopnl
xdef cn_donl
;
nlreg reg d0-d7/a0/a1
cn_dopnl
moveq #0,d0
tst.b sd_nlsta(a0) ; is there a pending newline?
bne.s cn_donl ; yes
rts ; no
;
cn_donl
movem.l nlreg,-(sp)
tst.b sd_sflag(a0) ; possible?
beq.s cnn_do ; ... yes
blt.s cnn_exit ; ... no, never
move.w sd_yinc(a0),d1 ; new bottom edge of cursor...
move.w sd_ypos(a0),d0 ; for cursor outside window
add.w d1,d0
move.w d0,sd_ypos(a0) ; move down
bmi.s cnn_slst ; outside top of window
add.w d1,d0
cmp.w sd_ysize(a0),d0
bgt.s cnn_slst
clr.b sd_sflag(a0) ; in window now
bra.s cnn_slst
cnn_do
move.w sd_yinc(a0),d1 ; new bottom edge of cursor...
move.w d1,d0
add.w d0,d0
add.w sd_ypos(a0),d0 ; ...would be this
cmp.w sd_ysize(a0),d0 ; ...past bottom of active area
bgt.s cnn_scrl ; it is past, scroll instead
add.w d1,sd_ypos(a0) ; move down
bra.s cnn_slst ; and set to start of line
;
cnn_scrl
neg.w d1 ; move upwards
jsr cn_scral(pc) ; scroll whole area
;
cnn_slst
clr.w sd_xpos(a0) ; set cursor to left hand edge
clr.b sd_nlsta(a0) ; no pending newline now
cnn_exit
movem.l (sp)+,nlreg
cnn_exns
rts ; and exit
;
end
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_686.asm | ljhsiun2/medusa | 9 | 88815 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xb9c3, %rsi
lea addresses_WT_ht+0xd603, %rdi
nop
nop
sub %r10, %r10
mov $10, %rcx
rep movsb
nop
nop
nop
nop
nop
lfence
lea addresses_WC_ht+0xd132, %rsi
lea addresses_D_ht+0xe78f, %rdi
nop
nop
sub $41508, %r15
mov $76, %rcx
rep movsb
nop
nop
nop
xor %r10, %r10
lea addresses_WT_ht+0xa7, %rsi
lea addresses_normal_ht+0x4c53, %rdi
nop
nop
sub $61383, %rax
mov $94, %rcx
rep movsw
nop
nop
nop
nop
sub $48107, %rax
lea addresses_A_ht+0xb403, %rsi
lea addresses_UC_ht+0x15293, %rdi
nop
nop
nop
dec %r11
mov $78, %rcx
rep movsl
inc %r10
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r8
push %r9
push %rdx
push %rsi
// Store
lea addresses_WC+0x17343, %rdx
nop
nop
nop
nop
nop
cmp %rsi, %rsi
movw $0x5152, (%rdx)
nop
cmp %r13, %r13
// Store
lea addresses_PSE+0x19b43, %r13
nop
nop
nop
and %r8, %r8
mov $0x5152535455565758, %r11
movq %r11, %xmm4
vmovups %ymm4, (%r13)
nop
add %r9, %r9
// Store
lea addresses_US+0xc343, %r13
nop
nop
add $16947, %r9
movw $0x5152, (%r13)
sub %r9, %r9
// Faulty Load
lea addresses_PSE+0x19b43, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
cmp $18430, %r15
mov (%rsi), %edx
lea oracles, %r9
and $0xff, %rdx
shlq $12, %rdx
mov (%r9,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %r9
pop %r8
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WC', 'AVXalign': True, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_US', 'AVXalign': False, 'size': 2}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}}
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
WangShuang_book/p244test.asm | SmirnovKol/Learning_x86_assembly_language | 1 | 98013 | assume cs:code
code segment
start: mov ax, 5000
mov bh, 2
div bh
mov ax, 4c00h
int 21h
code ends
end start
|
Cubical/Data/SumFin/Properties.agda | howsiyu/cubical | 0 | 16279 | <reponame>howsiyu/cubical<gh_stars>0
{-# OPTIONS --safe #-}
module Cubical.Data.SumFin.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv renaming (_∙ₑ_ to _⋆_)
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Function
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Univalence
open import Cubical.Data.Empty as ⊥
open import Cubical.Data.Unit
open import Cubical.Data.Bool
open import Cubical.Data.Nat
open import Cubical.Data.Nat.Order
import Cubical.Data.Fin as Fin
import Cubical.Data.Fin.LehmerCode as LehmerCode
open import Cubical.Data.SumFin.Base as SumFin
open import Cubical.Data.Sum
open import Cubical.Data.Sigma
open import Cubical.HITs.PropositionalTruncation as Prop
open import Cubical.Relation.Nullary
private
variable
ℓ : Level
k : ℕ
SumFin→Fin : Fin k → Fin.Fin k
SumFin→Fin = SumFin.elim (λ {k} _ → Fin.Fin k) Fin.fzero Fin.fsuc
Fin→SumFin : Fin.Fin k → Fin k
Fin→SumFin = Fin.elim (λ {k} _ → Fin k) fzero fsuc
Fin→SumFin-fsuc : (fk : Fin.Fin k) → Fin→SumFin (Fin.fsuc fk) ≡ fsuc (Fin→SumFin fk)
Fin→SumFin-fsuc = Fin.elim-fsuc (λ {k} _ → Fin k) fzero fsuc
SumFin→Fin→SumFin : (fk : Fin k) → Fin→SumFin (SumFin→Fin fk) ≡ fk
SumFin→Fin→SumFin = SumFin.elim (λ fk → Fin→SumFin (SumFin→Fin fk) ≡ fk)
refl λ {k} {fk} eq →
Fin→SumFin (Fin.fsuc (SumFin→Fin fk)) ≡⟨ Fin→SumFin-fsuc (SumFin→Fin fk) ⟩
fsuc (Fin→SumFin (SumFin→Fin fk)) ≡⟨ cong fsuc eq ⟩
fsuc fk ∎
Fin→SumFin→Fin : (fk : Fin.Fin k) → SumFin→Fin (Fin→SumFin fk) ≡ fk
Fin→SumFin→Fin = Fin.elim (λ fk → SumFin→Fin (Fin→SumFin fk) ≡ fk)
refl λ {k} {fk} eq →
SumFin→Fin (Fin→SumFin (Fin.fsuc fk)) ≡⟨ cong SumFin→Fin (Fin→SumFin-fsuc fk) ⟩
Fin.fsuc (SumFin→Fin (Fin→SumFin fk)) ≡⟨ cong Fin.fsuc eq ⟩
Fin.fsuc fk ∎
SumFin≃Fin : ∀ k → Fin k ≃ Fin.Fin k
SumFin≃Fin _ =
isoToEquiv (iso SumFin→Fin Fin→SumFin Fin→SumFin→Fin SumFin→Fin→SumFin)
SumFin≡Fin : ∀ k → Fin k ≡ Fin.Fin k
SumFin≡Fin k = ua (SumFin≃Fin k)
enum : (n : ℕ)(p : n < k) → Fin k
enum n p = Fin→SumFin (n , p)
enumElim : (P : Fin k → Type ℓ) → ((n : ℕ)(p : n < k) → P (enum _ p)) → (i : Fin k) → P i
enumElim P f i = subst P (SumFin→Fin→SumFin i) (f (SumFin→Fin i .fst) (SumFin→Fin i .snd))
-- Closure properties of SumFin under type constructors
SumFin⊎≃ : (m n : ℕ) → (Fin m ⊎ Fin n) ≃ (Fin (m + n))
SumFin⊎≃ 0 n = ⊎-swap-≃ ⋆ ⊎-⊥-≃
SumFin⊎≃ (suc m) n = ⊎-assoc-≃ ⋆ ⊎-equiv (idEquiv ⊤) (SumFin⊎≃ m n)
SumFinΣ≃ : (n : ℕ)(f : Fin n → ℕ) → (Σ (Fin n) (λ x → Fin (f x))) ≃ (Fin (totalSum f))
SumFinΣ≃ 0 f = ΣEmpty _
SumFinΣ≃ (suc n) f =
Σ⊎≃
⋆ ⊎-equiv (ΣUnit (λ tt → Fin (f (inl tt)))) (SumFinΣ≃ n (λ x → f (inr x)))
⋆ SumFin⊎≃ (f (inl tt)) (totalSum (λ x → f (inr x)))
SumFin×≃ : (m n : ℕ) → (Fin m × Fin n) ≃ (Fin (m · n))
SumFin×≃ m n = SumFinΣ≃ m (λ _ → n) ⋆ pathToEquiv (λ i → Fin (totalSumConst {m = m} n i))
SumFinΠ≃ : (n : ℕ)(f : Fin n → ℕ) → ((x : Fin n) → Fin (f x)) ≃ (Fin (totalProd f))
SumFinΠ≃ 0 _ = isContr→≃Unit (isContrΠ⊥) ⋆ invEquiv (⊎-⊥-≃)
SumFinΠ≃ (suc n) f =
Π⊎≃
⋆ Σ-cong-equiv (ΠUnit (λ tt → Fin (f (inl tt)))) (λ _ → SumFinΠ≃ n (λ x → f (inr x)))
⋆ SumFin×≃ (f (inl tt)) (totalProd (λ x → f (inr x)))
isNotZero : ℕ → ℕ
isNotZero 0 = 0
isNotZero (suc n) = 1
SumFin∥∥≃ : (n : ℕ) → ∥ Fin n ∥ ≃ Fin (isNotZero n)
SumFin∥∥≃ 0 = propTruncIdempotent≃ (isProp⊥)
SumFin∥∥≃ (suc n) =
isContr→≃Unit (inhProp→isContr ∣ inl tt ∣ isPropPropTrunc)
⋆ isContr→≃Unit (isContrUnit) ⋆ invEquiv (⊎-⊥-≃)
ℕ→Bool : ℕ → Bool
ℕ→Bool 0 = false
ℕ→Bool (suc n) = true
SumFin∥∥DecProp : (n : ℕ) → ∥ Fin n ∥ ≃ Bool→Type (ℕ→Bool n)
SumFin∥∥DecProp 0 = uninhabEquiv (Prop.rec isProp⊥ ⊥.rec) ⊥.rec
SumFin∥∥DecProp (suc n) = isContr→≃Unit (inhProp→isContr ∣ inl tt ∣ isPropPropTrunc)
-- negation of SumFin
SumFin¬ : (n : ℕ) → (¬ Fin n) ≃ Bool→Type (isZero n)
SumFin¬ 0 = isContr→≃Unit isContr⊥→A
SumFin¬ (suc n) = uninhabEquiv (λ f → f fzero) ⊥.rec
-- SumFin 1 is equivalent to unit
Fin1≃Unit : Fin 1 ≃ Unit
Fin1≃Unit = ⊎-⊥-≃
isContrSumFin1 : isContr (Fin 1)
isContrSumFin1 = isOfHLevelRespectEquiv 0 (invEquiv Fin1≃Unit) isContrUnit
-- SumFin 2 is equivalent to Bool
SumFin2≃Bool : Fin 2 ≃ Bool
SumFin2≃Bool = ⊎-equiv (idEquiv _) ⊎-⊥-≃ ⋆ isoToEquiv Iso-⊤⊎⊤-Bool
-- decidable predicate over SumFin
SumFinℙ≃ : (n : ℕ) → (Fin n → Bool) ≃ Fin (2 ^ n)
SumFinℙ≃ 0 = isContr→≃Unit (isContrΠ⊥) ⋆ invEquiv (⊎-⊥-≃)
SumFinℙ≃ (suc n) =
Π⊎≃
⋆ Σ-cong-equiv (UnitToType≃ Bool ⋆ invEquiv SumFin2≃Bool) (λ _ → SumFinℙ≃ n)
⋆ SumFin×≃ 2 (2 ^ n)
-- decidable subsets of SumFin
Bool→ℕ : Bool → ℕ
Bool→ℕ true = 1
Bool→ℕ false = 0
trueCount : {n : ℕ}(f : Fin n → Bool) → ℕ
trueCount {n = 0} _ = 0
trueCount {n = suc n} f = Bool→ℕ (f (inl tt)) + (trueCount (f ∘ inr))
SumFinDec⊎≃ : (n : ℕ)(t : Bool) → (Bool→Type t ⊎ Fin n) ≃ (Fin (Bool→ℕ t + n))
SumFinDec⊎≃ _ true = idEquiv _
SumFinDec⊎≃ _ false = ⊎-swap-≃ ⋆ ⊎-⊥-≃
SumFinSub≃ : (n : ℕ)(f : Fin n → Bool) → Σ _ (Bool→Type ∘ f) ≃ Fin (trueCount f)
SumFinSub≃ 0 _ = ΣEmpty _
SumFinSub≃ (suc n) f =
Σ⊎≃
⋆ ⊎-equiv (ΣUnit (Bool→Type ∘ f ∘ inl)) (SumFinSub≃ n (f ∘ inr))
⋆ SumFinDec⊎≃ _ (f (inl tt))
-- decidable quantifier
trueForSome : (n : ℕ)(f : Fin n → Bool) → Bool
trueForSome 0 _ = false
trueForSome (suc n) f = f (inl tt) or trueForSome n (f ∘ inr)
trueForAll : (n : ℕ)(f : Fin n → Bool) → Bool
trueForAll 0 _ = true
trueForAll (suc n) f = f (inl tt) and trueForAll n (f ∘ inr)
SumFin∃→ : (n : ℕ)(f : Fin n → Bool) → Σ _ (Bool→Type ∘ f) → Bool→Type (trueForSome n f)
SumFin∃→ 0 _ = ΣEmpty _ .fst
SumFin∃→ (suc n) f =
Bool→Type⊎' _ _
∘ map-⊎ (ΣUnit (Bool→Type ∘ f ∘ inl) .fst) (SumFin∃→ n (f ∘ inr))
∘ Σ⊎≃ .fst
SumFin∃← : (n : ℕ)(f : Fin n → Bool) → Bool→Type (trueForSome n f) → Σ _ (Bool→Type ∘ f)
SumFin∃← 0 _ = ⊥.rec
SumFin∃← (suc n) f =
invEq Σ⊎≃
∘ map-⊎ (invEq (ΣUnit (Bool→Type ∘ f ∘ inl))) (SumFin∃← n (f ∘ inr))
∘ Bool→Type⊎ _ _
SumFin∃≃ : (n : ℕ)(f : Fin n → Bool) → ∥ Σ (Fin n) (Bool→Type ∘ f) ∥ ≃ Bool→Type (trueForSome n f)
SumFin∃≃ n f =
propBiimpl→Equiv isPropPropTrunc isPropBool→Type
(Prop.rec isPropBool→Type (SumFin∃→ n f))
(∣_∣ ∘ SumFin∃← n f)
SumFin∀≃ : (n : ℕ)(f : Fin n → Bool) → ((x : Fin n) → Bool→Type (f x)) ≃ Bool→Type (trueForAll n f)
SumFin∀≃ 0 _ = isContr→≃Unit (isContrΠ⊥)
SumFin∀≃ (suc n) f =
Π⊎≃
⋆ Σ-cong-equiv (ΠUnit (Bool→Type ∘ f ∘ inl)) (λ _ → SumFin∀≃ n (f ∘ inr))
⋆ Bool→Type×≃ _ _
-- internal equality
SumFin≡ : (n : ℕ) → (a b : Fin n) → Bool
SumFin≡ 0 _ _ = true
SumFin≡ (suc n) (inl tt) (inl tt) = true
SumFin≡ (suc n) (inl tt) (inr y) = false
SumFin≡ (suc n) (inr x) (inl tt) = false
SumFin≡ (suc n) (inr x) (inr y) = SumFin≡ n x y
isSetSumFin : (n : ℕ)→ isSet (Fin n)
isSetSumFin 0 = isProp→isSet isProp⊥
isSetSumFin (suc n) = isSet⊎ (isProp→isSet isPropUnit) (isSetSumFin n)
SumFin≡≃ : (n : ℕ) → (a b : Fin n) → (a ≡ b) ≃ Bool→Type (SumFin≡ n a b)
SumFin≡≃ 0 _ _ = isContr→≃Unit (isProp→isContrPath isProp⊥ _ _)
SumFin≡≃ (suc n) (inl tt) (inl tt) = isContr→≃Unit (inhProp→isContr refl (isSetSumFin _ _ _))
SumFin≡≃ (suc n) (inl tt) (inr y) = invEquiv (⊎Path.Cover≃Path _ _) ⋆ uninhabEquiv ⊥.rec* ⊥.rec
SumFin≡≃ (suc n) (inr x) (inl tt) = invEquiv (⊎Path.Cover≃Path _ _) ⋆ uninhabEquiv ⊥.rec* ⊥.rec
SumFin≡≃ (suc n) (inr x) (inr y) = invEquiv (_ , isEmbedding-inr x y) ⋆ SumFin≡≃ n x y
-- propositional truncation of Fin
-- decidability of Fin
DecFin : (n : ℕ) → Dec (Fin n)
DecFin 0 = no (idfun _)
DecFin (suc n) = yes fzero
-- propositional truncation of Fin
Dec∥Fin∥ : (n : ℕ) → Dec ∥ Fin n ∥
Dec∥Fin∥ n = Dec∥∥ (DecFin n)
-- some properties about cardinality
fzero≠fone : {n : ℕ} → ¬ (fzero ≡ fsuc fzero)
fzero≠fone {n = n} = SumFin≡≃ (suc (suc n)) fzero (fsuc fzero) .fst
Fin>0→isInhab : (n : ℕ) → 0 < n → Fin n
Fin>0→isInhab 0 p = ⊥.rec (¬-<-zero p)
Fin>0→isInhab (suc n) p = fzero
Fin>1→hasNonEqualTerm : (n : ℕ) → 1 < n → Σ[ i ∈ Fin n ] Σ[ j ∈ Fin n ] ¬ i ≡ j
Fin>1→hasNonEqualTerm 0 p = ⊥.rec (snotz (≤0→≡0 p))
Fin>1→hasNonEqualTerm 1 p = ⊥.rec (snotz (≤0→≡0 (pred-≤-pred p)))
Fin>1→hasNonEqualTerm (suc (suc n)) _ = fzero , fsuc fzero , fzero≠fone
isEmpty→Fin≡0 : (n : ℕ) → ¬ Fin n → 0 ≡ n
isEmpty→Fin≡0 0 _ = refl
isEmpty→Fin≡0 (suc n) p = ⊥.rec (p fzero)
isInhab→Fin>0 : (n : ℕ) → Fin n → 0 < n
isInhab→Fin>0 0 i = ⊥.rec i
isInhab→Fin>0 (suc n) _ = suc-≤-suc zero-≤
hasNonEqualTerm→Fin>1 : (n : ℕ) → (i j : Fin n) → ¬ i ≡ j → 1 < n
hasNonEqualTerm→Fin>1 0 i _ _ = ⊥.rec i
hasNonEqualTerm→Fin>1 1 i j p = ⊥.rec (p (isContr→isProp isContrSumFin1 i j))
hasNonEqualTerm→Fin>1 (suc (suc n)) _ _ _ = suc-≤-suc (suc-≤-suc zero-≤)
Fin≤1→isProp : (n : ℕ) → n ≤ 1 → isProp (Fin n)
Fin≤1→isProp 0 _ = isProp⊥
Fin≤1→isProp 1 _ = isContr→isProp isContrSumFin1
Fin≤1→isProp (suc (suc n)) p = ⊥.rec (¬-<-zero (pred-≤-pred p))
isProp→Fin≤1 : (n : ℕ) → isProp (Fin n) → n ≤ 1
isProp→Fin≤1 0 _ = ≤-solver 0 1
isProp→Fin≤1 1 _ = ≤-solver 1 1
isProp→Fin≤1 (suc (suc n)) p = ⊥.rec (fzero≠fone (p fzero (fsuc fzero)))
-- automorphisms of SumFin
SumFin≃≃ : (n : ℕ) → (Fin n ≃ Fin n) ≃ Fin (LehmerCode.factorial n)
SumFin≃≃ _ =
equivComp (SumFin≃Fin _) (SumFin≃Fin _)
⋆ LehmerCode.lehmerEquiv
⋆ LehmerCode.lehmerFinEquiv
⋆ invEquiv (SumFin≃Fin _)
|
bios/csstuff/joy.asm | arbruijn/d1dos | 2 | 94300 | <reponame>arbruijn/d1dos
;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
;
; $Source: f:/miner/source/bios/rcs/joy.asm $
; $Revision: 1.16 $
; $Author: john $
; $Date: 1995/03/30 11:03:30 $
;
; Contains routines for joystick interface.
;
; $Log: joy.asm $
; Revision 1.16 1995/03/30 11:03:30 john
; Made -JoyBios read buttons using BIOS.
;
; Revision 1.15 1995/02/14 11:39:36 john
; Added polled/bios joystick readers..
;
; Revision 1.14 1995/01/29 18:36:00 john
; Made timer count in mode 2 instead of mode 3.
;
; Revision 1.13 1994/12/28 15:32:21 john
; Added code to read joystick axis not all at one time.
;
; Revision 1.12 1994/12/27 15:44:59 john
; Made the joystick timeout be at 1/100th of a second,
; regardless of CPU speed.
;
; Revision 1.11 1994/11/15 12:04:40 john
; Cleaned up timer code a bit... took out unused functions
; like timer_get_milliseconds, etc.
;
; Revision 1.10 1994/07/01 10:55:54 john
; Fixed some bugs... added support for 4 axis.
;
; Revision 1.9 1994/06/30 20:36:54 john
; Revamped joystick code.
;
; Revision 1.8 1994/04/22 12:52:06 john
.386
_DATA SEGMENT BYTE PUBLIC USE32 'DATA'
rcsid db "$Id: joy.asm 1.16 1995/03/30 11:03:30 john Exp $"
LastTick dd 0
TotalTicks dd 0
PUBLIC _joy_bogus_reading
PUBLIC _joy_retries
_joy_bogus_reading dd 0
_joy_retries dd 0
RetryCount dd 0
_DATA ENDS
DGROUP GROUP _DATA
_TEXT SEGMENT BYTE PUBLIC USE32 'CODE'
ASSUME ds:_DATA
ASSUME cs:_TEXT
JOY_PORT EQU 0201h
TDATA EQU 40h
TCOMMAND EQU 43h
joy_get_timer:
xor al, al ; Latch timer 0 command
out TCOMMAND, al ; Latch timer
in al, TDATA ; Read lo byte
mov ah, al
in al, TDATA ; Read hi byte
xchg ah, al
and eax, 0ffffh
ret
PUBLIC joy_read_stick_friendly_
joy_read_stick_friendly_:
; ebx = read mask
; edi = pointer to event buffer
; ecx = timeout value
; returns in eax the number of events
mov RetryCount, 0
mov _joy_bogus_reading, 0
joy_read_stick_friendly_retry:
inc RetryCount
cmp RetryCount, 3
jbe @f
mov _joy_bogus_reading, 1
inc _joy_retries
mov eax, 0
ret
@@:
push ecx
push ebx
push edi
and ebx, 01111b ; Make sure we only check the right values
; number of events we found will be in bh, so this also clears it to zero.
mov dx, JOY_PORT
cli ; disable interrupts while reading time...
call joy_get_timer ; Returns counter in EAX
sti ; enable interrupts after reading time...
mov LastTick, eax
waitforstable_f: in al, dx
and al, bl
jz ready_f ; Wait for the port in question to be done reading...
cli ; disable interrupts while reading time...
call joy_get_timer ; Returns counter in EAX
sti ; enable interrupts after reading time...
xchg eax, LastTick
cmp eax, LastTick
jb @f
sub eax, LastTick
@@: ; Higher...
add TotalTicks, eax
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae ready_f
jmp waitforstable_f
ready_f:
cli
mov al, 0ffh
out dx, al ; Start joystick a readin'
call joy_get_timer ; Returns counter in EAX
mov LastTick, eax
mov TotalTicks, 0
mov [edi], eax ; Store initial count
add edi, 4
again_f: in al, dx ; Read Joystick port
not al
and al, bl ; Mask off channels we don't want to read
jnz flip_f ; See if any of the channels flipped
; none flipped -- check any interrupts...
mov al, 0Ah
out 20h, al
in al, 20h ; Get interrupts pending
cmp al, 0
je NoInts
; Need to do an interrupt
sti
nop ; let the interrupt go on...
cli
; See if any axis turned
in al, dx
not al
and al, bl
jz NoInts
; At this point, an interrupt occured, making one or more
; of the axis values bogus. So, we will restart this process...
pop edi
pop ebx
pop ecx
jmp joy_read_stick_friendly_retry
NoInts:
call joy_get_timer ; Returns counter in EAX
xchg eax, LastTick
cmp eax, LastTick
jb @f
sub eax, LastTick
@@: ; Higher...
add TotalTicks, eax
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae timed_out_f
jmp again_f
flip_f: and eax, 01111b ; Only care about axis values
mov [edi], eax ; Record what channel(s) flipped
add edi, 4
xor bl, al ; Unmark the channels that just tripped
call joy_get_timer ; Returns counter in EAX
mov [edi], eax ; Record the time this channel flipped
add edi, 4
inc bh ; Increment number of events
cmp bl, 0
jne again_f ; If there are more channels to read, keep looping
timed_out_f:
sti
movzx eax, bh ; Return number of events
pop edi
pop ebx
pop ecx
ret
PUBLIC joy_read_stick_asm_
joy_read_stick_asm_:
; ebx = read mask
; edi = pointer to event buffer
; ecx = timeout value
; returns in eax the number of events
mov _joy_bogus_reading, 0
and ebx, 01111b ; Make sure we only check the right values
; number of events we found will be in bh, so this also clears it to zero.
mov dx, JOY_PORT
cli ; disable interrupts while reading time...
call joy_get_timer ; Returns counter in EAX
sti ; enable interrupts after reading time...
mov LastTick, eax
waitforstable: in al, dx
and al, bl
jz ready ; Wait for the port in question to be done reading...
cli ; disable interrupts while reading time...
call joy_get_timer ; Returns counter in EAX
sti ; enable interrupts after reading time...
xchg eax, LastTick
cmp eax, LastTick
jb @f
sub eax, LastTick
@@: ; Higher...
add TotalTicks, eax
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae ready
jmp waitforstable
ready:
cli
mov al, 0ffh
out dx, al ; Start joystick a readin'
call joy_get_timer ; Returns counter in EAX
mov LastTick, eax
mov TotalTicks, 0
mov [edi], eax ; Store initial count
add edi, 4
again: in al, dx ; Read Joystick port
not al
and al, bl ; Mask off channels we don't want to read
jnz flip ; See if any of the channels flipped
call joy_get_timer ; Returns counter in EAX
xchg eax, LastTick
cmp eax, LastTick
jb @f
sub eax, LastTick
@@: ; Higher...
add TotalTicks, eax
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae timedout
jmp again
flip: and eax, 01111b ; Only care about axis values
mov [edi], eax ; Record what channel(s) flipped
add edi, 4
xor bl, al ; Unmark the channels that just tripped
call joy_get_timer ; Returns counter in EAX
mov [edi], eax ; Record the time this channel flipped
add edi, 4
inc bh ; Increment number of events
cmp bl, 0
jne again ; If there are more channels to read, keep looping
timedout:
movzx eax, bh ; Return number of events
sti
ret
PUBLIC joy_read_stick_polled_
joy_read_stick_polled_:
; ebx = read mask
; edi = pointer to event buffer
; ecx = timeout value
; returns in eax the number of events
mov _joy_bogus_reading, 0
and ebx, 01111b ; Make sure we only check the right values
; number of events we found will be in bh, so this also clears it to zero.
mov dx, JOY_PORT
mov TotalTicks, 0
waitforstable1: in al, dx
and al, bl
jz ready1 ; Wait for the port in question to be done reading...
inc TotalTicks
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae ready1
jmp waitforstable1
ready1:
cli
mov al, 0ffh
out dx, al ; Start joystick a readin'
mov TotalTicks, 0
mov dword ptr [edi], 0 ; Store initial count
add edi, 4
again1: in al, dx ; Read Joystick port
not al
and al, bl ; Mask off channels we don't want to read
jnz flip1 ; See if any of the channels flipped
inc TotalTicks
cmp TotalTicks, ecx ; Timeout at 1/200'th of a second
jae timedout1
jmp again1
flip1: and eax, 01111b ; Only care about axis values
mov [edi], eax ; Record what channel(s) flipped
add edi, 4
xor bl, al ; Unmark the channels that just tripped
mov eax, TotalTicks
mov [edi], eax ; Record the time this channel flipped
add edi, 4
inc bh ; Increment number of events
cmp bl, 0
jne again1 ; If there are more channels to read, keep looping
timedout1:
movzx eax, bh ; Return number of events
sti
ret
PUBLIC joy_read_stick_bios_
joy_read_stick_bios_:
; ebx = read mask
; edi = pointer to event buffer
; ecx = timeout value
; returns in eax the number of events
mov _joy_bogus_reading, 0
pusha
mov dword ptr [edi], 0
mov eax, 08400h
mov edx, 1
cli
int 15h
sti
mov dword ptr [edi+4], 1 ; Axis 1
and eax, 0ffffh
mov [edi+8], eax ; Axis 1 value
mov dword ptr [edi+12], 2 ; Axis 2
and ebx, 0ffffh
mov [edi+16], ebx ; Axis 2 value
mov dword ptr [edi+20], 4 ; Axis 3
and ecx, 0ffffh
mov [edi+24], ecx ; Axis 3 value
mov dword ptr [edi+28], 8 ; Axis 3
and edx, 0ffffh
mov [edi+32], edx ; Axis 3 value
popa
mov eax, 4 ; 4 events
ret
PUBLIC joy_read_buttons_bios_
joy_read_buttons_bios_:
; returns in eax the button settings
push ebx
push ecx
push edx
mov eax, 08400h
mov edx, 0 ; Read switches
int 15h
pop edx
pop ecx
pop ebx
shr eax, 4
not eax
and eax, 01111b
ret
_TEXT ENDS
END
|
agda-stdlib/src/Relation/Binary/Reasoning/Base/Single.agda | DreamLinuxer/popl21-artifact | 5 | 15036 | <reponame>DreamLinuxer/popl21-artifact<filename>agda-stdlib/src/Relation/Binary/Reasoning/Base/Single.agda
------------------------------------------------------------------------
-- The Agda standard library
--
-- The basic code for equational reasoning with a single relation
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary
module Relation.Binary.Reasoning.Base.Single
{a ℓ} {A : Set a} (_∼_ : Rel A ℓ)
(refl : Reflexive _∼_) (trans : Transitive _∼_)
where
------------------------------------------------------------------------
-- Reasoning combinators
-- Re-export combinators from partial reasoning
open import Relation.Binary.Reasoning.Base.Partial _∼_ trans public
hiding (_∎⟨_⟩)
-- Redefine the terminating combinator now that we have reflexivity
infix 3 _∎
_∎ : ∀ x → x IsRelatedTo x
x ∎ = relTo refl
|
src/hypro/parser/antlr4-flowstar/Setting.g4 | hypro/hypro | 22 | 5870 | /*
* Setting.g4
*
* @author <NAME>
* @date 27.6.2017
*
* A grammar for AnTLR to generate a parser to parse the settings of Flow*.
*/
grammar Setting;
import Formula;
//////// Parser Rules
setting : 'setting' '{' (fixedsteps | time | remainder | identity | qrprecond | plotsetting | fixedorders | adaptiveorders | cutoff | precision | filename | maxjumps | print)* '}' ;
//setting : 'setting' '{' (fixedsteps | time | identity | plotsetting | fixedorders | precision | filename | maxjumps | print)* '}' ;
//// Important Parser Rules
fixedsteps : 'fixed steps' NUMBER ;
time : 'time' NUMBER ;
plotsetting : 'gnuplot octagon' VARIABLE ((',' VARIABLE)+)? ;
filename : 'output' VARIABLE ;
maxjumps : 'max jumps' NUMBER ;
print : 'print' VARIABLE ;
//// Unimportant Parser Rules
remainder : 'remainder estimation' EXPONENTIAL ;
identity : 'identity precondition' ;
qrprecond : 'QR precondition' ;
fixedorders : 'fixed orders' NUMBER ;
adaptiveorders : 'adaptive orders' '{' 'min' NUMBER ',' 'max' NUMBER '}' ;
cutoff : 'cutoff' EXPONENTIAL ;
precision : 'precision' NUMBER ;
//////// Lexer Rules
EXPONENTIAL : MINUS? NUMBER 'e' MINUS? NUMBER ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.