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
sanity3.asm
MahtabEK/OS---XV6
0
105200
<filename>sanity3.asm _sanity3: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "types.h" #include "stat.h" #include "user.h" int main(){ 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 51 push %ecx e: 83 ec 14 sub $0x14,%esp int pid; printf(1,"Father pid is %d" ,getpid()); 11: e8 8a 03 00 00 call 3a0 <getpid> 16: 83 ec 04 sub $0x4,%esp 19: 50 push %eax 1a: 68 68 08 00 00 push $0x868 1f: 6a 01 push $0x1 21: e8 89 04 00 00 call 4af <printf> 26: 83 c4 10 add $0x10,%esp sleep(10000); 29: 83 ec 0c sub $0xc,%esp 2c: 68 10 27 00 00 push $0x2710 31: e8 7a 03 00 00 call 3b0 <sleep> 36: 83 c4 10 add $0x10,%esp printf(1,"Father is awake"); 39: 83 ec 08 sub $0x8,%esp 3c: 68 79 08 00 00 push $0x879 41: 6a 01 push $0x1 43: e8 67 04 00 00 call 4af <printf> 48: 83 c4 10 add $0x10,%esp pid = fork(); 4b: e8 c8 02 00 00 call 318 <fork> 50: 89 45 ec mov %eax,-0x14(%ebp) if(pid != 0 ){ //father 53: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 57: 74 2d je 86 <main+0x86> for(int i=0; i<50; i++){ 59: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 60: eb 1c jmp 7e <main+0x7e> printf(1,"Process %d is printing for the %d time\n" , getpid() , i); 62: e8 39 03 00 00 call 3a0 <getpid> 67: ff 75 f4 pushl -0xc(%ebp) 6a: 50 push %eax 6b: 68 8c 08 00 00 push $0x88c 70: 6a 01 push $0x1 72: e8 38 04 00 00 call 4af <printf> 77: 83 c4 10 add $0x10,%esp printf(1,"Father pid is %d" ,getpid()); sleep(10000); printf(1,"Father is awake"); pid = fork(); if(pid != 0 ){ //father for(int i=0; i<50; i++){ 7a: 83 45 f4 01 addl $0x1,-0xc(%ebp) 7e: 83 7d f4 31 cmpl $0x31,-0xc(%ebp) 82: 7e de jle 62 <main+0x62> 84: eb 36 jmp bc <main+0xbc> printf(1,"Process %d is printing for the %d time\n" , getpid() , i); } } else if(pid == 0 ){ //child 86: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 8a: 75 30 jne bc <main+0xbc> for(int i=0; i<50; i++){ 8c: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 93: eb 1c jmp b1 <main+0xb1> printf(1,"Process %d is printing for the %d time\n" , getpid() , i); 95: e8 06 03 00 00 call 3a0 <getpid> 9a: ff 75 f0 pushl -0x10(%ebp) 9d: 50 push %eax 9e: 68 8c 08 00 00 push $0x88c a3: 6a 01 push $0x1 a5: e8 05 04 00 00 call 4af <printf> aa: 83 c4 10 add $0x10,%esp } } else if(pid == 0 ){ //child for(int i=0; i<50; i++){ ad: 83 45 f0 01 addl $0x1,-0x10(%ebp) b1: 83 7d f0 31 cmpl $0x31,-0x10(%ebp) b5: 7e de jle 95 <main+0x95> printf(1,"Process %d is printing for the %d time\n" , getpid() , i); } exit(); b7: e8 64 02 00 00 call 320 <exit> } return 0; bc: b8 00 00 00 00 mov $0x0,%eax } c1: 8b 4d fc mov -0x4(%ebp),%ecx c4: c9 leave c5: 8d 61 fc lea -0x4(%ecx),%esp c8: c3 ret 000000c9 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { c9: 55 push %ebp ca: 89 e5 mov %esp,%ebp cc: 57 push %edi cd: 53 push %ebx asm volatile("cld; rep stosb" : ce: 8b 4d 08 mov 0x8(%ebp),%ecx d1: 8b 55 10 mov 0x10(%ebp),%edx d4: 8b 45 0c mov 0xc(%ebp),%eax d7: 89 cb mov %ecx,%ebx d9: 89 df mov %ebx,%edi db: 89 d1 mov %edx,%ecx dd: fc cld de: f3 aa rep stos %al,%es:(%edi) e0: 89 ca mov %ecx,%edx e2: 89 fb mov %edi,%ebx e4: 89 5d 08 mov %ebx,0x8(%ebp) e7: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } ea: 90 nop eb: 5b pop %ebx ec: 5f pop %edi ed: 5d pop %ebp ee: c3 ret 000000ef <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { ef: 55 push %ebp f0: 89 e5 mov %esp,%ebp f2: 83 ec 10 sub $0x10,%esp char *os; os = s; f5: 8b 45 08 mov 0x8(%ebp),%eax f8: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) fb: 90 nop fc: 8b 45 08 mov 0x8(%ebp),%eax ff: 8d 50 01 lea 0x1(%eax),%edx 102: 89 55 08 mov %edx,0x8(%ebp) 105: 8b 55 0c mov 0xc(%ebp),%edx 108: 8d 4a 01 lea 0x1(%edx),%ecx 10b: 89 4d 0c mov %ecx,0xc(%ebp) 10e: 0f b6 12 movzbl (%edx),%edx 111: 88 10 mov %dl,(%eax) 113: 0f b6 00 movzbl (%eax),%eax 116: 84 c0 test %al,%al 118: 75 e2 jne fc <strcpy+0xd> ; return os; 11a: 8b 45 fc mov -0x4(%ebp),%eax } 11d: c9 leave 11e: c3 ret 0000011f <strcmp>: int strcmp(const char *p, const char *q) { 11f: 55 push %ebp 120: 89 e5 mov %esp,%ebp while(*p && *p == *q) 122: eb 08 jmp 12c <strcmp+0xd> p++, q++; 124: 83 45 08 01 addl $0x1,0x8(%ebp) 128: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 12c: 8b 45 08 mov 0x8(%ebp),%eax 12f: 0f b6 00 movzbl (%eax),%eax 132: 84 c0 test %al,%al 134: 74 10 je 146 <strcmp+0x27> 136: 8b 45 08 mov 0x8(%ebp),%eax 139: 0f b6 10 movzbl (%eax),%edx 13c: 8b 45 0c mov 0xc(%ebp),%eax 13f: 0f b6 00 movzbl (%eax),%eax 142: 38 c2 cmp %al,%dl 144: 74 de je 124 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 146: 8b 45 08 mov 0x8(%ebp),%eax 149: 0f b6 00 movzbl (%eax),%eax 14c: 0f b6 d0 movzbl %al,%edx 14f: 8b 45 0c mov 0xc(%ebp),%eax 152: 0f b6 00 movzbl (%eax),%eax 155: 0f b6 c0 movzbl %al,%eax 158: 29 c2 sub %eax,%edx 15a: 89 d0 mov %edx,%eax } 15c: 5d pop %ebp 15d: c3 ret 0000015e <strlen>: uint strlen(char *s) { 15e: 55 push %ebp 15f: 89 e5 mov %esp,%ebp 161: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 164: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 16b: eb 04 jmp 171 <strlen+0x13> 16d: 83 45 fc 01 addl $0x1,-0x4(%ebp) 171: 8b 55 fc mov -0x4(%ebp),%edx 174: 8b 45 08 mov 0x8(%ebp),%eax 177: 01 d0 add %edx,%eax 179: 0f b6 00 movzbl (%eax),%eax 17c: 84 c0 test %al,%al 17e: 75 ed jne 16d <strlen+0xf> ; return n; 180: 8b 45 fc mov -0x4(%ebp),%eax } 183: c9 leave 184: c3 ret 00000185 <memset>: void* memset(void *dst, int c, uint n) { 185: 55 push %ebp 186: 89 e5 mov %esp,%ebp stosb(dst, c, n); 188: 8b 45 10 mov 0x10(%ebp),%eax 18b: 50 push %eax 18c: ff 75 0c pushl 0xc(%ebp) 18f: ff 75 08 pushl 0x8(%ebp) 192: e8 32 ff ff ff call c9 <stosb> 197: 83 c4 0c add $0xc,%esp return dst; 19a: 8b 45 08 mov 0x8(%ebp),%eax } 19d: c9 leave 19e: c3 ret 0000019f <strchr>: char* strchr(const char *s, char c) { 19f: 55 push %ebp 1a0: 89 e5 mov %esp,%ebp 1a2: 83 ec 04 sub $0x4,%esp 1a5: 8b 45 0c mov 0xc(%ebp),%eax 1a8: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 1ab: eb 14 jmp 1c1 <strchr+0x22> if(*s == c) 1ad: 8b 45 08 mov 0x8(%ebp),%eax 1b0: 0f b6 00 movzbl (%eax),%eax 1b3: 3a 45 fc cmp -0x4(%ebp),%al 1b6: 75 05 jne 1bd <strchr+0x1e> return (char*)s; 1b8: 8b 45 08 mov 0x8(%ebp),%eax 1bb: eb 13 jmp 1d0 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 1bd: 83 45 08 01 addl $0x1,0x8(%ebp) 1c1: 8b 45 08 mov 0x8(%ebp),%eax 1c4: 0f b6 00 movzbl (%eax),%eax 1c7: 84 c0 test %al,%al 1c9: 75 e2 jne 1ad <strchr+0xe> if(*s == c) return (char*)s; return 0; 1cb: b8 00 00 00 00 mov $0x0,%eax } 1d0: c9 leave 1d1: c3 ret 000001d2 <gets>: char* gets(char *buf, int max) { 1d2: 55 push %ebp 1d3: 89 e5 mov %esp,%ebp 1d5: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 1d8: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 1df: eb 42 jmp 223 <gets+0x51> cc = read(0, &c, 1); 1e1: 83 ec 04 sub $0x4,%esp 1e4: 6a 01 push $0x1 1e6: 8d 45 ef lea -0x11(%ebp),%eax 1e9: 50 push %eax 1ea: 6a 00 push $0x0 1ec: e8 47 01 00 00 call 338 <read> 1f1: 83 c4 10 add $0x10,%esp 1f4: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 1f7: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1fb: 7e 33 jle 230 <gets+0x5e> break; buf[i++] = c; 1fd: 8b 45 f4 mov -0xc(%ebp),%eax 200: 8d 50 01 lea 0x1(%eax),%edx 203: 89 55 f4 mov %edx,-0xc(%ebp) 206: 89 c2 mov %eax,%edx 208: 8b 45 08 mov 0x8(%ebp),%eax 20b: 01 c2 add %eax,%edx 20d: 0f b6 45 ef movzbl -0x11(%ebp),%eax 211: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 213: 0f b6 45 ef movzbl -0x11(%ebp),%eax 217: 3c 0a cmp $0xa,%al 219: 74 16 je 231 <gets+0x5f> 21b: 0f b6 45 ef movzbl -0x11(%ebp),%eax 21f: 3c 0d cmp $0xd,%al 221: 74 0e je 231 <gets+0x5f> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 223: 8b 45 f4 mov -0xc(%ebp),%eax 226: 83 c0 01 add $0x1,%eax 229: 3b 45 0c cmp 0xc(%ebp),%eax 22c: 7c b3 jl 1e1 <gets+0xf> 22e: eb 01 jmp 231 <gets+0x5f> cc = read(0, &c, 1); if(cc < 1) break; 230: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 231: 8b 55 f4 mov -0xc(%ebp),%edx 234: 8b 45 08 mov 0x8(%ebp),%eax 237: 01 d0 add %edx,%eax 239: c6 00 00 movb $0x0,(%eax) return buf; 23c: 8b 45 08 mov 0x8(%ebp),%eax } 23f: c9 leave 240: c3 ret 00000241 <stat>: int stat(char *n, struct stat *st) { 241: 55 push %ebp 242: 89 e5 mov %esp,%ebp 244: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 247: 83 ec 08 sub $0x8,%esp 24a: 6a 00 push $0x0 24c: ff 75 08 pushl 0x8(%ebp) 24f: e8 0c 01 00 00 call 360 <open> 254: 83 c4 10 add $0x10,%esp 257: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 25a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 25e: 79 07 jns 267 <stat+0x26> return -1; 260: b8 ff ff ff ff mov $0xffffffff,%eax 265: eb 25 jmp 28c <stat+0x4b> r = fstat(fd, st); 267: 83 ec 08 sub $0x8,%esp 26a: ff 75 0c pushl 0xc(%ebp) 26d: ff 75 f4 pushl -0xc(%ebp) 270: e8 03 01 00 00 call 378 <fstat> 275: 83 c4 10 add $0x10,%esp 278: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 27b: 83 ec 0c sub $0xc,%esp 27e: ff 75 f4 pushl -0xc(%ebp) 281: e8 c2 00 00 00 call 348 <close> 286: 83 c4 10 add $0x10,%esp return r; 289: 8b 45 f0 mov -0x10(%ebp),%eax } 28c: c9 leave 28d: c3 ret 0000028e <atoi>: int atoi(const char *s) { 28e: 55 push %ebp 28f: 89 e5 mov %esp,%ebp 291: 83 ec 10 sub $0x10,%esp int n; n = 0; 294: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 29b: eb 25 jmp 2c2 <atoi+0x34> n = n*10 + *s++ - '0'; 29d: 8b 55 fc mov -0x4(%ebp),%edx 2a0: 89 d0 mov %edx,%eax 2a2: c1 e0 02 shl $0x2,%eax 2a5: 01 d0 add %edx,%eax 2a7: 01 c0 add %eax,%eax 2a9: 89 c1 mov %eax,%ecx 2ab: 8b 45 08 mov 0x8(%ebp),%eax 2ae: 8d 50 01 lea 0x1(%eax),%edx 2b1: 89 55 08 mov %edx,0x8(%ebp) 2b4: 0f b6 00 movzbl (%eax),%eax 2b7: 0f be c0 movsbl %al,%eax 2ba: 01 c8 add %ecx,%eax 2bc: 83 e8 30 sub $0x30,%eax 2bf: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 2c2: 8b 45 08 mov 0x8(%ebp),%eax 2c5: 0f b6 00 movzbl (%eax),%eax 2c8: 3c 2f cmp $0x2f,%al 2ca: 7e 0a jle 2d6 <atoi+0x48> 2cc: 8b 45 08 mov 0x8(%ebp),%eax 2cf: 0f b6 00 movzbl (%eax),%eax 2d2: 3c 39 cmp $0x39,%al 2d4: 7e c7 jle 29d <atoi+0xf> n = n*10 + *s++ - '0'; return n; 2d6: 8b 45 fc mov -0x4(%ebp),%eax } 2d9: c9 leave 2da: c3 ret 000002db <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 2db: 55 push %ebp 2dc: 89 e5 mov %esp,%ebp 2de: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 2e1: 8b 45 08 mov 0x8(%ebp),%eax 2e4: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 2e7: 8b 45 0c mov 0xc(%ebp),%eax 2ea: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 2ed: eb 17 jmp 306 <memmove+0x2b> *dst++ = *src++; 2ef: 8b 45 fc mov -0x4(%ebp),%eax 2f2: 8d 50 01 lea 0x1(%eax),%edx 2f5: 89 55 fc mov %edx,-0x4(%ebp) 2f8: 8b 55 f8 mov -0x8(%ebp),%edx 2fb: 8d 4a 01 lea 0x1(%edx),%ecx 2fe: 89 4d f8 mov %ecx,-0x8(%ebp) 301: 0f b6 12 movzbl (%edx),%edx 304: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 306: 8b 45 10 mov 0x10(%ebp),%eax 309: 8d 50 ff lea -0x1(%eax),%edx 30c: 89 55 10 mov %edx,0x10(%ebp) 30f: 85 c0 test %eax,%eax 311: 7f dc jg 2ef <memmove+0x14> *dst++ = *src++; return vdst; 313: 8b 45 08 mov 0x8(%ebp),%eax } 316: c9 leave 317: c3 ret 00000318 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 318: b8 01 00 00 00 mov $0x1,%eax 31d: cd 40 int $0x40 31f: c3 ret 00000320 <exit>: SYSCALL(exit) 320: b8 02 00 00 00 mov $0x2,%eax 325: cd 40 int $0x40 327: c3 ret 00000328 <wait>: SYSCALL(wait) 328: b8 03 00 00 00 mov $0x3,%eax 32d: cd 40 int $0x40 32f: c3 ret 00000330 <pipe>: SYSCALL(pipe) 330: b8 04 00 00 00 mov $0x4,%eax 335: cd 40 int $0x40 337: c3 ret 00000338 <read>: SYSCALL(read) 338: b8 05 00 00 00 mov $0x5,%eax 33d: cd 40 int $0x40 33f: c3 ret 00000340 <write>: SYSCALL(write) 340: b8 10 00 00 00 mov $0x10,%eax 345: cd 40 int $0x40 347: c3 ret 00000348 <close>: SYSCALL(close) 348: b8 15 00 00 00 mov $0x15,%eax 34d: cd 40 int $0x40 34f: c3 ret 00000350 <kill>: SYSCALL(kill) 350: b8 06 00 00 00 mov $0x6,%eax 355: cd 40 int $0x40 357: c3 ret 00000358 <exec>: SYSCALL(exec) 358: b8 07 00 00 00 mov $0x7,%eax 35d: cd 40 int $0x40 35f: c3 ret 00000360 <open>: SYSCALL(open) 360: b8 0f 00 00 00 mov $0xf,%eax 365: cd 40 int $0x40 367: c3 ret 00000368 <mknod>: SYSCALL(mknod) 368: b8 11 00 00 00 mov $0x11,%eax 36d: cd 40 int $0x40 36f: c3 ret 00000370 <unlink>: SYSCALL(unlink) 370: b8 12 00 00 00 mov $0x12,%eax 375: cd 40 int $0x40 377: c3 ret 00000378 <fstat>: SYSCALL(fstat) 378: b8 08 00 00 00 mov $0x8,%eax 37d: cd 40 int $0x40 37f: c3 ret 00000380 <link>: SYSCALL(link) 380: b8 13 00 00 00 mov $0x13,%eax 385: cd 40 int $0x40 387: c3 ret 00000388 <mkdir>: SYSCALL(mkdir) 388: b8 14 00 00 00 mov $0x14,%eax 38d: cd 40 int $0x40 38f: c3 ret 00000390 <chdir>: SYSCALL(chdir) 390: b8 09 00 00 00 mov $0x9,%eax 395: cd 40 int $0x40 397: c3 ret 00000398 <dup>: SYSCALL(dup) 398: b8 0a 00 00 00 mov $0xa,%eax 39d: cd 40 int $0x40 39f: c3 ret 000003a0 <getpid>: SYSCALL(getpid) 3a0: b8 0b 00 00 00 mov $0xb,%eax 3a5: cd 40 int $0x40 3a7: c3 ret 000003a8 <sbrk>: SYSCALL(sbrk) 3a8: b8 0c 00 00 00 mov $0xc,%eax 3ad: cd 40 int $0x40 3af: c3 ret 000003b0 <sleep>: SYSCALL(sleep) 3b0: b8 0d 00 00 00 mov $0xd,%eax 3b5: cd 40 int $0x40 3b7: c3 ret 000003b8 <uptime>: SYSCALL(uptime) 3b8: b8 0e 00 00 00 mov $0xe,%eax 3bd: cd 40 int $0x40 3bf: c3 ret 000003c0 <getppid>: SYSCALL(getppid) 3c0: b8 16 00 00 00 mov $0x16,%eax 3c5: cd 40 int $0x40 3c7: c3 ret 000003c8 <wait2>: SYSCALL(wait2) 3c8: b8 18 00 00 00 mov $0x18,%eax 3cd: cd 40 int $0x40 3cf: c3 ret 000003d0 <nice>: SYSCALL(nice) 3d0: b8 17 00 00 00 mov $0x17,%eax 3d5: cd 40 int $0x40 3d7: c3 ret 000003d8 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 3d8: 55 push %ebp 3d9: 89 e5 mov %esp,%ebp 3db: 83 ec 18 sub $0x18,%esp 3de: 8b 45 0c mov 0xc(%ebp),%eax 3e1: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 3e4: 83 ec 04 sub $0x4,%esp 3e7: 6a 01 push $0x1 3e9: 8d 45 f4 lea -0xc(%ebp),%eax 3ec: 50 push %eax 3ed: ff 75 08 pushl 0x8(%ebp) 3f0: e8 4b ff ff ff call 340 <write> 3f5: 83 c4 10 add $0x10,%esp } 3f8: 90 nop 3f9: c9 leave 3fa: c3 ret 000003fb <printint>: static void printint(int fd, int xx, int base, int sgn) { 3fb: 55 push %ebp 3fc: 89 e5 mov %esp,%ebp 3fe: 53 push %ebx 3ff: 83 ec 24 sub $0x24,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 402: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 409: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 40d: 74 17 je 426 <printint+0x2b> 40f: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 413: 79 11 jns 426 <printint+0x2b> neg = 1; 415: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 41c: 8b 45 0c mov 0xc(%ebp),%eax 41f: f7 d8 neg %eax 421: 89 45 ec mov %eax,-0x14(%ebp) 424: eb 06 jmp 42c <printint+0x31> } else { x = xx; 426: 8b 45 0c mov 0xc(%ebp),%eax 429: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 42c: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 433: 8b 4d f4 mov -0xc(%ebp),%ecx 436: 8d 41 01 lea 0x1(%ecx),%eax 439: 89 45 f4 mov %eax,-0xc(%ebp) 43c: 8b 5d 10 mov 0x10(%ebp),%ebx 43f: 8b 45 ec mov -0x14(%ebp),%eax 442: ba 00 00 00 00 mov $0x0,%edx 447: f7 f3 div %ebx 449: 89 d0 mov %edx,%eax 44b: 0f b6 80 0c 0b 00 00 movzbl 0xb0c(%eax),%eax 452: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 456: 8b 5d 10 mov 0x10(%ebp),%ebx 459: 8b 45 ec mov -0x14(%ebp),%eax 45c: ba 00 00 00 00 mov $0x0,%edx 461: f7 f3 div %ebx 463: 89 45 ec mov %eax,-0x14(%ebp) 466: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 46a: 75 c7 jne 433 <printint+0x38> if(neg) 46c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 470: 74 2d je 49f <printint+0xa4> buf[i++] = '-'; 472: 8b 45 f4 mov -0xc(%ebp),%eax 475: 8d 50 01 lea 0x1(%eax),%edx 478: 89 55 f4 mov %edx,-0xc(%ebp) 47b: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 480: eb 1d jmp 49f <printint+0xa4> putc(fd, buf[i]); 482: 8d 55 dc lea -0x24(%ebp),%edx 485: 8b 45 f4 mov -0xc(%ebp),%eax 488: 01 d0 add %edx,%eax 48a: 0f b6 00 movzbl (%eax),%eax 48d: 0f be c0 movsbl %al,%eax 490: 83 ec 08 sub $0x8,%esp 493: 50 push %eax 494: ff 75 08 pushl 0x8(%ebp) 497: e8 3c ff ff ff call 3d8 <putc> 49c: 83 c4 10 add $0x10,%esp buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 49f: 83 6d f4 01 subl $0x1,-0xc(%ebp) 4a3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 4a7: 79 d9 jns 482 <printint+0x87> putc(fd, buf[i]); } 4a9: 90 nop 4aa: 8b 5d fc mov -0x4(%ebp),%ebx 4ad: c9 leave 4ae: c3 ret 000004af <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 4af: 55 push %ebp 4b0: 89 e5 mov %esp,%ebp 4b2: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 4b5: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 4bc: 8d 45 0c lea 0xc(%ebp),%eax 4bf: 83 c0 04 add $0x4,%eax 4c2: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 4c5: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 4cc: e9 59 01 00 00 jmp 62a <printf+0x17b> c = fmt[i] & 0xff; 4d1: 8b 55 0c mov 0xc(%ebp),%edx 4d4: 8b 45 f0 mov -0x10(%ebp),%eax 4d7: 01 d0 add %edx,%eax 4d9: 0f b6 00 movzbl (%eax),%eax 4dc: 0f be c0 movsbl %al,%eax 4df: 25 ff 00 00 00 and $0xff,%eax 4e4: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 4e7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 4eb: 75 2c jne 519 <printf+0x6a> if(c == '%'){ 4ed: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 4f1: 75 0c jne 4ff <printf+0x50> state = '%'; 4f3: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 4fa: e9 27 01 00 00 jmp 626 <printf+0x177> } else { putc(fd, c); 4ff: 8b 45 e4 mov -0x1c(%ebp),%eax 502: 0f be c0 movsbl %al,%eax 505: 83 ec 08 sub $0x8,%esp 508: 50 push %eax 509: ff 75 08 pushl 0x8(%ebp) 50c: e8 c7 fe ff ff call 3d8 <putc> 511: 83 c4 10 add $0x10,%esp 514: e9 0d 01 00 00 jmp 626 <printf+0x177> } } else if(state == '%'){ 519: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 51d: 0f 85 03 01 00 00 jne 626 <printf+0x177> if(c == 'd'){ 523: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 527: 75 1e jne 547 <printf+0x98> printint(fd, *ap, 10, 1); 529: 8b 45 e8 mov -0x18(%ebp),%eax 52c: 8b 00 mov (%eax),%eax 52e: 6a 01 push $0x1 530: 6a 0a push $0xa 532: 50 push %eax 533: ff 75 08 pushl 0x8(%ebp) 536: e8 c0 fe ff ff call 3fb <printint> 53b: 83 c4 10 add $0x10,%esp ap++; 53e: 83 45 e8 04 addl $0x4,-0x18(%ebp) 542: e9 d8 00 00 00 jmp 61f <printf+0x170> } else if(c == 'x' || c == 'p'){ 547: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 54b: 74 06 je 553 <printf+0xa4> 54d: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 551: 75 1e jne 571 <printf+0xc2> printint(fd, *ap, 16, 0); 553: 8b 45 e8 mov -0x18(%ebp),%eax 556: 8b 00 mov (%eax),%eax 558: 6a 00 push $0x0 55a: 6a 10 push $0x10 55c: 50 push %eax 55d: ff 75 08 pushl 0x8(%ebp) 560: e8 96 fe ff ff call 3fb <printint> 565: 83 c4 10 add $0x10,%esp ap++; 568: 83 45 e8 04 addl $0x4,-0x18(%ebp) 56c: e9 ae 00 00 00 jmp 61f <printf+0x170> } else if(c == 's'){ 571: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 575: 75 43 jne 5ba <printf+0x10b> s = (char*)*ap; 577: 8b 45 e8 mov -0x18(%ebp),%eax 57a: 8b 00 mov (%eax),%eax 57c: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 57f: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 583: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 587: 75 25 jne 5ae <printf+0xff> s = "(null)"; 589: c7 45 f4 b4 08 00 00 movl $0x8b4,-0xc(%ebp) while(*s != 0){ 590: eb 1c jmp 5ae <printf+0xff> putc(fd, *s); 592: 8b 45 f4 mov -0xc(%ebp),%eax 595: 0f b6 00 movzbl (%eax),%eax 598: 0f be c0 movsbl %al,%eax 59b: 83 ec 08 sub $0x8,%esp 59e: 50 push %eax 59f: ff 75 08 pushl 0x8(%ebp) 5a2: e8 31 fe ff ff call 3d8 <putc> 5a7: 83 c4 10 add $0x10,%esp s++; 5aa: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 5ae: 8b 45 f4 mov -0xc(%ebp),%eax 5b1: 0f b6 00 movzbl (%eax),%eax 5b4: 84 c0 test %al,%al 5b6: 75 da jne 592 <printf+0xe3> 5b8: eb 65 jmp 61f <printf+0x170> putc(fd, *s); s++; } } else if(c == 'c'){ 5ba: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 5be: 75 1d jne 5dd <printf+0x12e> putc(fd, *ap); 5c0: 8b 45 e8 mov -0x18(%ebp),%eax 5c3: 8b 00 mov (%eax),%eax 5c5: 0f be c0 movsbl %al,%eax 5c8: 83 ec 08 sub $0x8,%esp 5cb: 50 push %eax 5cc: ff 75 08 pushl 0x8(%ebp) 5cf: e8 04 fe ff ff call 3d8 <putc> 5d4: 83 c4 10 add $0x10,%esp ap++; 5d7: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5db: eb 42 jmp 61f <printf+0x170> } else if(c == '%'){ 5dd: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 5e1: 75 17 jne 5fa <printf+0x14b> putc(fd, c); 5e3: 8b 45 e4 mov -0x1c(%ebp),%eax 5e6: 0f be c0 movsbl %al,%eax 5e9: 83 ec 08 sub $0x8,%esp 5ec: 50 push %eax 5ed: ff 75 08 pushl 0x8(%ebp) 5f0: e8 e3 fd ff ff call 3d8 <putc> 5f5: 83 c4 10 add $0x10,%esp 5f8: eb 25 jmp 61f <printf+0x170> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 5fa: 83 ec 08 sub $0x8,%esp 5fd: 6a 25 push $0x25 5ff: ff 75 08 pushl 0x8(%ebp) 602: e8 d1 fd ff ff call 3d8 <putc> 607: 83 c4 10 add $0x10,%esp putc(fd, c); 60a: 8b 45 e4 mov -0x1c(%ebp),%eax 60d: 0f be c0 movsbl %al,%eax 610: 83 ec 08 sub $0x8,%esp 613: 50 push %eax 614: ff 75 08 pushl 0x8(%ebp) 617: e8 bc fd ff ff call 3d8 <putc> 61c: 83 c4 10 add $0x10,%esp } state = 0; 61f: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 626: 83 45 f0 01 addl $0x1,-0x10(%ebp) 62a: 8b 55 0c mov 0xc(%ebp),%edx 62d: 8b 45 f0 mov -0x10(%ebp),%eax 630: 01 d0 add %edx,%eax 632: 0f b6 00 movzbl (%eax),%eax 635: 84 c0 test %al,%al 637: 0f 85 94 fe ff ff jne 4d1 <printf+0x22> putc(fd, c); } state = 0; } } } 63d: 90 nop 63e: c9 leave 63f: c3 ret 00000640 <free>: static Header base; static Header *freep; void free(void *ap) { 640: 55 push %ebp 641: 89 e5 mov %esp,%ebp 643: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 646: 8b 45 08 mov 0x8(%ebp),%eax 649: 83 e8 08 sub $0x8,%eax 64c: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 64f: a1 28 0b 00 00 mov 0xb28,%eax 654: 89 45 fc mov %eax,-0x4(%ebp) 657: eb 24 jmp 67d <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 659: 8b 45 fc mov -0x4(%ebp),%eax 65c: 8b 00 mov (%eax),%eax 65e: 3b 45 fc cmp -0x4(%ebp),%eax 661: 77 12 ja 675 <free+0x35> 663: 8b 45 f8 mov -0x8(%ebp),%eax 666: 3b 45 fc cmp -0x4(%ebp),%eax 669: 77 24 ja 68f <free+0x4f> 66b: 8b 45 fc mov -0x4(%ebp),%eax 66e: 8b 00 mov (%eax),%eax 670: 3b 45 f8 cmp -0x8(%ebp),%eax 673: 77 1a ja 68f <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) 675: 8b 45 fc mov -0x4(%ebp),%eax 678: 8b 00 mov (%eax),%eax 67a: 89 45 fc mov %eax,-0x4(%ebp) 67d: 8b 45 f8 mov -0x8(%ebp),%eax 680: 3b 45 fc cmp -0x4(%ebp),%eax 683: 76 d4 jbe 659 <free+0x19> 685: 8b 45 fc mov -0x4(%ebp),%eax 688: 8b 00 mov (%eax),%eax 68a: 3b 45 f8 cmp -0x8(%ebp),%eax 68d: 76 ca jbe 659 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 68f: 8b 45 f8 mov -0x8(%ebp),%eax 692: 8b 40 04 mov 0x4(%eax),%eax 695: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 69c: 8b 45 f8 mov -0x8(%ebp),%eax 69f: 01 c2 add %eax,%edx 6a1: 8b 45 fc mov -0x4(%ebp),%eax 6a4: 8b 00 mov (%eax),%eax 6a6: 39 c2 cmp %eax,%edx 6a8: 75 24 jne 6ce <free+0x8e> bp->s.size += p->s.ptr->s.size; 6aa: 8b 45 f8 mov -0x8(%ebp),%eax 6ad: 8b 50 04 mov 0x4(%eax),%edx 6b0: 8b 45 fc mov -0x4(%ebp),%eax 6b3: 8b 00 mov (%eax),%eax 6b5: 8b 40 04 mov 0x4(%eax),%eax 6b8: 01 c2 add %eax,%edx 6ba: 8b 45 f8 mov -0x8(%ebp),%eax 6bd: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 6c0: 8b 45 fc mov -0x4(%ebp),%eax 6c3: 8b 00 mov (%eax),%eax 6c5: 8b 10 mov (%eax),%edx 6c7: 8b 45 f8 mov -0x8(%ebp),%eax 6ca: 89 10 mov %edx,(%eax) 6cc: eb 0a jmp 6d8 <free+0x98> } else bp->s.ptr = p->s.ptr; 6ce: 8b 45 fc mov -0x4(%ebp),%eax 6d1: 8b 10 mov (%eax),%edx 6d3: 8b 45 f8 mov -0x8(%ebp),%eax 6d6: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 6d8: 8b 45 fc mov -0x4(%ebp),%eax 6db: 8b 40 04 mov 0x4(%eax),%eax 6de: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 6e5: 8b 45 fc mov -0x4(%ebp),%eax 6e8: 01 d0 add %edx,%eax 6ea: 3b 45 f8 cmp -0x8(%ebp),%eax 6ed: 75 20 jne 70f <free+0xcf> p->s.size += bp->s.size; 6ef: 8b 45 fc mov -0x4(%ebp),%eax 6f2: 8b 50 04 mov 0x4(%eax),%edx 6f5: 8b 45 f8 mov -0x8(%ebp),%eax 6f8: 8b 40 04 mov 0x4(%eax),%eax 6fb: 01 c2 add %eax,%edx 6fd: 8b 45 fc mov -0x4(%ebp),%eax 700: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 703: 8b 45 f8 mov -0x8(%ebp),%eax 706: 8b 10 mov (%eax),%edx 708: 8b 45 fc mov -0x4(%ebp),%eax 70b: 89 10 mov %edx,(%eax) 70d: eb 08 jmp 717 <free+0xd7> } else p->s.ptr = bp; 70f: 8b 45 fc mov -0x4(%ebp),%eax 712: 8b 55 f8 mov -0x8(%ebp),%edx 715: 89 10 mov %edx,(%eax) freep = p; 717: 8b 45 fc mov -0x4(%ebp),%eax 71a: a3 28 0b 00 00 mov %eax,0xb28 } 71f: 90 nop 720: c9 leave 721: c3 ret 00000722 <morecore>: static Header* morecore(uint nu) { 722: 55 push %ebp 723: 89 e5 mov %esp,%ebp 725: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 728: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 72f: 77 07 ja 738 <morecore+0x16> nu = 4096; 731: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 738: 8b 45 08 mov 0x8(%ebp),%eax 73b: c1 e0 03 shl $0x3,%eax 73e: 83 ec 0c sub $0xc,%esp 741: 50 push %eax 742: e8 61 fc ff ff call 3a8 <sbrk> 747: 83 c4 10 add $0x10,%esp 74a: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 74d: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 751: 75 07 jne 75a <morecore+0x38> return 0; 753: b8 00 00 00 00 mov $0x0,%eax 758: eb 26 jmp 780 <morecore+0x5e> hp = (Header*)p; 75a: 8b 45 f4 mov -0xc(%ebp),%eax 75d: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 760: 8b 45 f0 mov -0x10(%ebp),%eax 763: 8b 55 08 mov 0x8(%ebp),%edx 766: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 769: 8b 45 f0 mov -0x10(%ebp),%eax 76c: 83 c0 08 add $0x8,%eax 76f: 83 ec 0c sub $0xc,%esp 772: 50 push %eax 773: e8 c8 fe ff ff call 640 <free> 778: 83 c4 10 add $0x10,%esp return freep; 77b: a1 28 0b 00 00 mov 0xb28,%eax } 780: c9 leave 781: c3 ret 00000782 <malloc>: void* malloc(uint nbytes) { 782: 55 push %ebp 783: 89 e5 mov %esp,%ebp 785: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 788: 8b 45 08 mov 0x8(%ebp),%eax 78b: 83 c0 07 add $0x7,%eax 78e: c1 e8 03 shr $0x3,%eax 791: 83 c0 01 add $0x1,%eax 794: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 797: a1 28 0b 00 00 mov 0xb28,%eax 79c: 89 45 f0 mov %eax,-0x10(%ebp) 79f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 7a3: 75 23 jne 7c8 <malloc+0x46> base.s.ptr = freep = prevp = &base; 7a5: c7 45 f0 20 0b 00 00 movl $0xb20,-0x10(%ebp) 7ac: 8b 45 f0 mov -0x10(%ebp),%eax 7af: a3 28 0b 00 00 mov %eax,0xb28 7b4: a1 28 0b 00 00 mov 0xb28,%eax 7b9: a3 20 0b 00 00 mov %eax,0xb20 base.s.size = 0; 7be: c7 05 24 0b 00 00 00 movl $0x0,0xb24 7c5: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7c8: 8b 45 f0 mov -0x10(%ebp),%eax 7cb: 8b 00 mov (%eax),%eax 7cd: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 7d0: 8b 45 f4 mov -0xc(%ebp),%eax 7d3: 8b 40 04 mov 0x4(%eax),%eax 7d6: 3b 45 ec cmp -0x14(%ebp),%eax 7d9: 72 4d jb 828 <malloc+0xa6> if(p->s.size == nunits) 7db: 8b 45 f4 mov -0xc(%ebp),%eax 7de: 8b 40 04 mov 0x4(%eax),%eax 7e1: 3b 45 ec cmp -0x14(%ebp),%eax 7e4: 75 0c jne 7f2 <malloc+0x70> prevp->s.ptr = p->s.ptr; 7e6: 8b 45 f4 mov -0xc(%ebp),%eax 7e9: 8b 10 mov (%eax),%edx 7eb: 8b 45 f0 mov -0x10(%ebp),%eax 7ee: 89 10 mov %edx,(%eax) 7f0: eb 26 jmp 818 <malloc+0x96> else { p->s.size -= nunits; 7f2: 8b 45 f4 mov -0xc(%ebp),%eax 7f5: 8b 40 04 mov 0x4(%eax),%eax 7f8: 2b 45 ec sub -0x14(%ebp),%eax 7fb: 89 c2 mov %eax,%edx 7fd: 8b 45 f4 mov -0xc(%ebp),%eax 800: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 803: 8b 45 f4 mov -0xc(%ebp),%eax 806: 8b 40 04 mov 0x4(%eax),%eax 809: c1 e0 03 shl $0x3,%eax 80c: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 80f: 8b 45 f4 mov -0xc(%ebp),%eax 812: 8b 55 ec mov -0x14(%ebp),%edx 815: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 818: 8b 45 f0 mov -0x10(%ebp),%eax 81b: a3 28 0b 00 00 mov %eax,0xb28 return (void*)(p + 1); 820: 8b 45 f4 mov -0xc(%ebp),%eax 823: 83 c0 08 add $0x8,%eax 826: eb 3b jmp 863 <malloc+0xe1> } if(p == freep) 828: a1 28 0b 00 00 mov 0xb28,%eax 82d: 39 45 f4 cmp %eax,-0xc(%ebp) 830: 75 1e jne 850 <malloc+0xce> if((p = morecore(nunits)) == 0) 832: 83 ec 0c sub $0xc,%esp 835: ff 75 ec pushl -0x14(%ebp) 838: e8 e5 fe ff ff call 722 <morecore> 83d: 83 c4 10 add $0x10,%esp 840: 89 45 f4 mov %eax,-0xc(%ebp) 843: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 847: 75 07 jne 850 <malloc+0xce> return 0; 849: b8 00 00 00 00 mov $0x0,%eax 84e: eb 13 jmp 863 <malloc+0xe1> 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){ 850: 8b 45 f4 mov -0xc(%ebp),%eax 853: 89 45 f0 mov %eax,-0x10(%ebp) 856: 8b 45 f4 mov -0xc(%ebp),%eax 859: 8b 00 mov (%eax),%eax 85b: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 85e: e9 6d ff ff ff jmp 7d0 <malloc+0x4e> } 863: c9 leave 864: c3 ret
P6/P6Judger - 100 testpoints/testpoint/testpoint47.asm
flyinglandlord/BUAA-CO-2021
5
95774
<gh_stars>1-10 ori $1, $0, 1 ori $2, $0, 4 ori $3, $0, 11 ori $4, $0, 9 sw $3, 0($0) sw $4, 4($0) sw $3, 8($0) sw $2, 12($0) sw $1, 16($0) sw $1, 20($0) sw $1, 24($0) sw $1, 28($0) sw $4, 32($0) sw $4, 36($0) sw $1, 40($0) sw $1, 44($0) sw $2, 48($0) sw $1, 52($0) sw $3, 56($0) sw $4, 60($0) sw $2, 64($0) sw $4, 68($0) sw $4, 72($0) sw $3, 76($0) sw $3, 80($0) sw $2, 84($0) sw $3, 88($0) sw $4, 92($0) sw $4, 96($0) sw $2, 100($0) sw $1, 104($0) sw $4, 108($0) sw $2, 112($0) sw $1, 116($0) sw $1, 120($0) sw $2, 124($0) sb $2, 0($2) divu $2, $2 lhu $3, 0($2) lh $2, 0($2) TAG1: beq $2, $2, TAG2 mfhi $3 andi $4, $3, 4 or $1, $4, $3 TAG2: bltz $1, TAG3 and $3, $1, $1 andi $2, $1, 6 lbu $1, 0($1) TAG3: mult $1, $1 sub $1, $1, $1 sw $1, 0($1) sb $1, 0($1) TAG4: srlv $3, $1, $1 bgez $3, TAG5 mflo $1 mthi $1 TAG5: bltz $1, TAG6 lbu $4, 0($1) sllv $1, $4, $4 multu $1, $1 TAG6: beq $1, $1, TAG7 sh $1, 0($1) div $1, $1 lbu $1, 0($1) TAG7: multu $1, $1 lui $3, 8 sltu $3, $1, $3 lbu $4, 0($3) TAG8: lbu $3, 0($4) sllv $2, $3, $3 addu $1, $2, $2 mfhi $4 TAG9: lbu $4, 0($4) lh $4, 0($4) srlv $1, $4, $4 lh $4, 0($4) TAG10: multu $4, $4 lui $1, 14 lui $2, 6 mthi $1 TAG11: bgez $2, TAG12 mflo $4 beq $4, $4, TAG12 divu $2, $2 TAG12: mflo $2 mflo $4 sb $4, 0($4) lui $1, 11 TAG13: lui $1, 7 lui $4, 13 or $2, $1, $1 mfhi $2 TAG14: blez $2, TAG15 sll $0, $0, 0 sltiu $1, $2, 14 slt $3, $2, $3 TAG15: beq $3, $3, TAG16 sh $3, 0($3) lui $1, 1 sh $3, 0($3) TAG16: nor $1, $1, $1 srav $2, $1, $1 lui $4, 0 bne $1, $2, TAG17 TAG17: sh $4, 0($4) multu $4, $4 mult $4, $4 lb $4, 0($4) TAG18: lb $4, 0($4) lui $2, 12 lui $4, 1 beq $2, $2, TAG19 TAG19: mfhi $1 beq $4, $1, TAG20 subu $4, $4, $4 lw $1, 0($1) TAG20: sw $1, 0($1) mtlo $1 mthi $1 mthi $1 TAG21: lhu $2, 0($1) mflo $2 blez $2, TAG22 lui $1, 7 TAG22: mflo $2 mult $2, $2 sh $1, 0($2) addi $3, $2, 2 TAG23: bgez $3, TAG24 addiu $4, $3, 13 mflo $2 divu $4, $2 TAG24: lui $3, 13 bltz $3, TAG25 sw $2, 0($2) ori $2, $2, 13 TAG25: addiu $1, $2, 10 bltz $2, TAG26 sltiu $4, $2, 10 lb $1, 0($1) TAG26: mult $1, $1 mult $1, $1 sllv $1, $1, $1 lui $4, 5 TAG27: sll $0, $0, 0 divu $4, $4 mfhi $2 mthi $4 TAG28: lb $2, 0($2) slt $4, $2, $2 sb $2, 0($2) mtlo $4 TAG29: mfhi $1 divu $1, $1 mfhi $3 multu $3, $3 TAG30: mthi $3 srl $2, $3, 5 mthi $2 blez $3, TAG31 TAG31: lb $4, 0($2) mfhi $4 multu $4, $2 mfhi $3 TAG32: bne $3, $3, TAG33 lh $2, 0($3) sra $1, $2, 10 bltz $3, TAG33 TAG33: multu $1, $1 mult $1, $1 bgez $1, TAG34 mthi $1 TAG34: mfhi $1 blez $1, TAG35 lui $3, 1 lui $2, 3 TAG35: lui $4, 15 mult $2, $2 mult $2, $2 lui $2, 3 TAG36: lui $2, 13 lui $3, 0 lui $3, 3 sll $0, $0, 0 TAG37: mfhi $1 lui $1, 7 mthi $3 sltiu $2, $1, 4 TAG38: bne $2, $2, TAG39 mtlo $2 mfhi $3 sll $0, $0, 0 TAG39: lui $3, 2 sllv $2, $3, $4 mthi $4 srl $1, $2, 2 TAG40: sll $0, $0, 0 mult $4, $1 sll $0, $0, 0 srl $2, $4, 11 TAG41: mult $2, $2 mult $2, $2 lh $3, -480($2) mflo $4 TAG42: addiu $1, $4, 8 sll $0, $0, 0 sll $0, $0, 0 and $4, $1, $1 TAG43: mult $4, $4 srl $2, $4, 12 bltz $2, TAG44 mfhi $2 TAG44: sll $4, $2, 8 mthi $4 lbu $3, 0($2) sb $3, -3072($4) TAG45: bltz $3, TAG46 mfhi $2 mult $3, $2 mtlo $3 TAG46: mfhi $4 lui $1, 12 mtlo $4 bne $2, $1, TAG47 TAG47: srlv $1, $1, $1 lui $3, 0 mfhi $2 lui $3, 8 TAG48: sll $0, $0, 0 mflo $2 sll $0, $0, 0 srav $1, $3, $3 TAG49: srlv $4, $1, $1 andi $3, $4, 5 sll $0, $0, 0 beq $1, $1, TAG50 TAG50: sw $3, 0($3) lhu $3, 0($3) xor $3, $3, $3 mflo $3 TAG51: sh $3, 0($3) add $3, $3, $3 lw $4, 0($3) add $2, $3, $3 TAG52: mfhi $3 srav $4, $3, $2 xori $3, $2, 11 lui $1, 3 TAG53: bne $1, $1, TAG54 sll $0, $0, 0 sll $0, $0, 0 mult $1, $4 TAG54: mflo $1 mtlo $1 sb $1, 0($4) lui $2, 10 TAG55: mult $2, $2 sll $0, $0, 0 mflo $3 xori $3, $3, 3 TAG56: bltz $3, TAG57 subu $3, $3, $3 lui $4, 6 divu $3, $4 TAG57: mthi $4 srl $3, $4, 14 lui $1, 6 beq $4, $4, TAG58 TAG58: sll $2, $1, 9 mtlo $2 blez $1, TAG59 div $2, $1 TAG59: mthi $2 or $4, $2, $2 srlv $3, $2, $4 bne $2, $2, TAG60 TAG60: lui $2, 14 bne $2, $3, TAG61 mfhi $4 div $2, $3 TAG61: sll $0, $0, 0 sll $0, $0, 0 mfhi $4 mflo $1 TAG62: sw $1, -512($1) ori $2, $1, 15 blez $1, TAG63 sltiu $2, $1, 5 TAG63: sllv $1, $2, $2 add $4, $2, $2 lui $3, 10 lui $1, 6 TAG64: mtlo $1 mflo $3 lui $3, 5 addiu $1, $3, 8 TAG65: lui $2, 0 mflo $1 mthi $2 sll $0, $0, 0 TAG66: mthi $3 srl $4, $3, 1 addiu $4, $3, 12 lui $1, 14 TAG67: bne $1, $1, TAG68 mflo $4 lui $4, 4 div $4, $1 TAG68: mfhi $3 sll $0, $0, 0 lui $4, 1 bltz $3, TAG69 TAG69: lui $3, 8 sll $0, $0, 0 sll $0, $0, 0 lui $2, 14 TAG70: nor $1, $2, $2 sll $0, $0, 0 mtlo $2 mflo $3 TAG71: sll $0, $0, 0 slt $1, $3, $3 divu $1, $3 slti $2, $3, 0 TAG72: blez $2, TAG73 multu $2, $2 div $2, $2 sll $2, $2, 14 TAG73: sra $1, $2, 0 sb $1, 0($2) sw $2, 0($1) mthi $1 TAG74: blez $1, TAG75 lhu $3, 0($1) mfhi $1 lb $2, 0($1) TAG75: lb $2, 0($2) lui $3, 4 lui $1, 14 bgtz $3, TAG76 TAG76: lui $2, 13 addu $4, $1, $1 lui $3, 2 or $3, $3, $4 TAG77: sll $0, $0, 0 sll $0, $0, 0 addu $2, $4, $4 sll $0, $0, 0 TAG78: blez $2, TAG79 mtlo $2 addiu $4, $2, 12 lui $2, 6 TAG79: beq $2, $2, TAG80 mtlo $2 blez $2, TAG80 sb $2, 0($2) TAG80: mult $2, $2 mtlo $2 sll $0, $0, 0 sltiu $3, $2, 15 TAG81: mflo $2 sll $2, $3, 5 xor $4, $2, $2 sw $3, 0($4) TAG82: lui $2, 5 ori $1, $2, 15 mfhi $2 sll $0, $0, 0 TAG83: mtlo $4 mtlo $4 lh $3, 0($4) mthi $4 TAG84: beq $3, $3, TAG85 mflo $4 beq $4, $4, TAG85 addi $1, $3, 12 TAG85: addiu $2, $1, 3 sll $0, $0, 0 bgez $2, TAG86 mtlo $2 TAG86: div $2, $2 xori $4, $2, 2 mflo $3 mfhi $3 TAG87: bgez $3, TAG88 sw $3, 0($3) divu $3, $3 or $1, $3, $3 TAG88: mtlo $1 srl $2, $1, 8 lui $3, 14 bgez $3, TAG89 TAG89: div $3, $3 addu $2, $3, $3 sll $0, $0, 0 mtlo $2 TAG90: mtlo $2 sll $0, $0, 0 sra $3, $2, 9 sll $0, $0, 0 TAG91: div $3, $3 mthi $3 bne $3, $3, TAG92 sw $3, -3584($3) TAG92: mult $3, $3 nor $1, $3, $3 lb $3, 3585($1) mtlo $1 TAG93: blez $3, TAG94 sltu $3, $3, $3 sb $3, 0($3) divu $3, $3 TAG94: lb $1, 0($3) bltz $3, TAG95 lui $2, 10 mfhi $2 TAG95: mtlo $2 blez $2, TAG96 sll $3, $2, 6 sb $2, 0($3) TAG96: mthi $3 bgtz $3, TAG97 mult $3, $3 mfhi $1 TAG97: addu $2, $1, $1 bgtz $2, TAG98 sllv $3, $2, $1 bgtz $3, TAG98 TAG98: mtlo $3 mfhi $1 mtlo $3 blez $3, TAG99 TAG99: addiu $2, $1, 8 mthi $1 sb $2, 0($1) mtlo $1 TAG100: lui $1, 13 mflo $1 lui $2, 10 sll $0, $0, 0 TAG101: sll $0, $0, 0 andi $4, $2, 6 lb $3, 0($4) mfhi $3 TAG102: slti $3, $3, 5 div $3, $3 slt $3, $3, $3 bgtz $3, TAG103 TAG103: mflo $3 sb $3, 0($3) bltz $3, TAG104 mfhi $1 TAG104: sb $1, 0($1) xori $2, $1, 1 mflo $1 sb $1, 0($1) TAG105: mflo $3 sb $1, 0($3) multu $3, $1 bgez $1, TAG106 TAG106: mtlo $3 xor $1, $3, $3 lb $2, 0($1) sh $1, 0($2) TAG107: lui $1, 10 mult $1, $2 bne $1, $1, TAG108 multu $1, $2 TAG108: divu $1, $1 subu $2, $1, $1 lui $1, 1 mflo $1 TAG109: mtlo $1 bne $1, $1, TAG110 sllv $3, $1, $1 lbu $2, 0($1) TAG110: mult $2, $2 bltz $2, TAG111 mult $2, $2 blez $2, TAG111 TAG111: lhu $4, 0($2) multu $4, $4 srl $4, $2, 9 multu $4, $2 TAG112: addiu $4, $4, 7 beq $4, $4, TAG113 sb $4, 0($4) lui $2, 6 TAG113: mfhi $2 slti $3, $2, 9 lui $4, 12 blez $4, TAG114 TAG114: slti $3, $4, 11 mflo $3 mthi $3 div $3, $4 TAG115: lh $2, 0($3) sh $2, 0($3) nor $1, $2, $3 beq $2, $3, TAG116 TAG116: lui $2, 11 lw $3, 1($1) sb $3, 1($1) bgez $1, TAG117 TAG117: nor $3, $3, $3 mult $3, $3 mthi $3 lui $1, 8 TAG118: sll $1, $1, 11 bne $1, $1, TAG119 sll $0, $0, 0 lui $4, 2 TAG119: sll $0, $0, 0 mtlo $4 blez $4, TAG120 mflo $3 TAG120: sll $0, $0, 0 andi $3, $2, 0 blez $3, TAG121 srlv $4, $2, $3 TAG121: lui $1, 2 mtlo $4 sll $0, $0, 0 sltiu $2, $4, 2 TAG122: multu $2, $2 mflo $3 xori $4, $3, 15 lw $3, 0($2) TAG123: mtlo $3 bltz $3, TAG124 multu $3, $3 lui $4, 7 TAG124: sll $0, $0, 0 lui $1, 1 mflo $4 mfhi $4 TAG125: mtlo $4 mflo $3 srav $2, $3, $3 bne $2, $2, TAG126 TAG126: lw $3, 0($2) multu $2, $3 xori $4, $3, 15 slt $1, $2, $4 TAG127: lui $1, 14 bltz $1, TAG128 sll $0, $0, 0 sll $0, $0, 0 TAG128: bne $1, $1, TAG129 sll $0, $0, 0 and $3, $3, $1 sw $3, 0($3) TAG129: mult $3, $3 mtlo $3 sb $3, 0($3) bgtz $3, TAG130 TAG130: sllv $3, $3, $3 lh $1, 0($3) multu $3, $3 andi $1, $3, 11 TAG131: multu $1, $1 bne $1, $1, TAG132 lui $3, 2 sra $1, $1, 2 TAG132: lui $1, 12 mfhi $3 srav $2, $3, $1 blez $2, TAG133 TAG133: mult $2, $2 lui $3, 3 bgtz $2, TAG134 sh $2, 0($2) TAG134: sll $0, $0, 0 sll $0, $0, 0 beq $3, $3, TAG135 sll $3, $3, 2 TAG135: addiu $1, $3, 11 mfhi $4 sw $3, 0($4) bgez $3, TAG136 TAG136: sh $4, 0($4) lui $4, 3 lui $2, 12 beq $2, $4, TAG137 TAG137: sll $0, $0, 0 div $4, $4 mthi $2 sll $0, $0, 0 TAG138: beq $4, $4, TAG139 mtlo $4 mflo $4 div $4, $4 TAG139: beq $4, $4, TAG140 mthi $4 div $4, $4 lui $2, 7 TAG140: addiu $2, $2, 1 lui $4, 6 sll $0, $0, 0 blez $2, TAG141 TAG141: sllv $4, $2, $2 or $3, $4, $4 sll $0, $0, 0 srl $1, $2, 2 TAG142: subu $3, $1, $1 div $3, $1 sll $0, $0, 0 sltu $2, $3, $1 TAG143: div $2, $2 blez $2, TAG144 mthi $2 andi $3, $2, 9 TAG144: sllv $3, $3, $3 mthi $3 lui $4, 2 lbu $3, 0($3) TAG145: lui $3, 2 mult $3, $3 bne $3, $3, TAG146 sltiu $3, $3, 2 TAG146: lhu $4, 0($3) sb $3, 0($4) srlv $1, $4, $3 mfhi $2 TAG147: srl $1, $2, 9 mflo $4 lui $3, 15 sb $3, 0($2) TAG148: lui $4, 5 addu $3, $3, $3 mtlo $4 bgez $4, TAG149 TAG149: andi $1, $3, 3 bne $1, $3, TAG150 lui $3, 4 bgez $3, TAG150 TAG150: lui $1, 11 andi $3, $3, 12 bgez $3, TAG151 subu $2, $3, $1 TAG151: blez $2, TAG152 sll $0, $0, 0 beq $2, $2, TAG152 mthi $2 TAG152: sll $0, $0, 0 lui $1, 14 bgez $2, TAG153 xori $4, $1, 3 TAG153: bltz $4, TAG154 mthi $4 mtlo $4 srl $1, $4, 11 TAG154: div $1, $1 bne $1, $1, TAG155 lui $3, 14 sll $0, $0, 0 TAG155: lui $2, 15 mfhi $3 divu $2, $2 lhu $4, 0($3) TAG156: bltz $4, TAG157 sh $4, 0($4) mtlo $4 lui $1, 12 TAG157: div $1, $1 slti $3, $1, 1 mfhi $4 mtlo $1 TAG158: sllv $3, $4, $4 beq $3, $4, TAG159 mult $4, $4 andi $4, $3, 8 TAG159: mflo $4 lhu $2, 0($4) sw $2, 0($4) sb $4, 0($4) TAG160: sh $2, 0($2) sw $2, 0($2) srav $1, $2, $2 beq $2, $1, TAG161 TAG161: multu $1, $1 mthi $1 multu $1, $1 sll $4, $1, 14 TAG162: sb $4, 0($4) bne $4, $4, TAG163 mfhi $1 beq $1, $4, TAG163 TAG163: lui $3, 13 sll $0, $0, 0 multu $3, $4 sll $0, $0, 0 TAG164: bgtz $4, TAG165 slt $2, $4, $4 sb $2, 0($4) lb $1, 0($2) TAG165: sh $1, 0($1) lw $4, 0($1) ori $2, $1, 13 lhu $4, 0($1) TAG166: mfhi $3 lui $4, 6 div $3, $4 sll $0, $0, 0 TAG167: bne $3, $3, TAG168 mflo $3 mfhi $1 andi $3, $3, 13 TAG168: sw $3, 0($3) lui $3, 5 sll $0, $0, 0 multu $3, $3 TAG169: sltiu $4, $1, 2 mflo $4 sw $4, 0($4) mfhi $4 TAG170: mtlo $4 beq $4, $4, TAG171 subu $3, $4, $4 mfhi $3 TAG171: mthi $3 sra $2, $3, 14 bltz $2, TAG172 sw $3, 0($2) TAG172: sw $2, 0($2) lw $2, 0($2) srav $3, $2, $2 sh $3, 0($2) TAG173: bne $3, $3, TAG174 lui $4, 0 bne $3, $3, TAG174 xori $1, $3, 15 TAG174: sb $1, 0($1) srav $2, $1, $1 lb $4, 0($2) lui $2, 13 TAG175: sll $0, $0, 0 sll $0, $0, 0 lbu $4, 0($3) mflo $3 TAG176: beq $3, $3, TAG177 mtlo $3 beq $3, $3, TAG177 mult $3, $3 TAG177: mfhi $1 sh $1, 0($1) lui $1, 5 mult $3, $1 TAG178: mult $1, $1 beq $1, $1, TAG179 sll $0, $0, 0 addu $2, $1, $1 TAG179: mtlo $2 mflo $3 sll $0, $0, 0 sll $0, $0, 0 TAG180: sll $2, $3, 2 divu $3, $3 sllv $3, $2, $3 sll $0, $0, 0 TAG181: bne $4, $4, TAG182 mthi $4 mtlo $4 beq $4, $4, TAG182 TAG182: add $4, $4, $4 xor $4, $4, $4 bgtz $4, TAG183 mfhi $2 TAG183: sb $2, 0($2) sltiu $2, $2, 12 slt $4, $2, $2 sltu $3, $4, $2 TAG184: bgtz $3, TAG185 lui $1, 10 lui $1, 4 sh $1, 0($3) TAG185: addu $1, $1, $1 subu $3, $1, $1 bgtz $1, TAG186 mfhi $2 TAG186: mult $2, $2 bne $2, $2, TAG187 sllv $3, $2, $2 ori $3, $2, 9 TAG187: mult $3, $3 lb $3, 0($3) addiu $2, $3, 5 mfhi $3 TAG188: mflo $4 slt $3, $4, $4 lbu $4, 0($4) sh $4, 0($3) TAG189: nor $1, $4, $4 mflo $3 mfhi $1 sb $1, 0($1) TAG190: mult $1, $1 addu $1, $1, $1 sra $2, $1, 15 bne $2, $1, TAG191 TAG191: multu $2, $2 mfhi $3 mtlo $3 mfhi $2 TAG192: mflo $2 multu $2, $2 sw $2, 0($2) lui $4, 9 TAG193: andi $1, $4, 10 sll $0, $0, 0 sll $0, $0, 0 bne $1, $2, TAG194 TAG194: sltiu $4, $2, 3 sb $2, 0($4) subu $3, $4, $4 sw $2, 0($2) TAG195: multu $3, $3 xori $3, $3, 6 multu $3, $3 beq $3, $3, TAG196 TAG196: multu $3, $3 xori $4, $3, 2 addu $3, $3, $3 bltz $3, TAG197 TAG197: xori $3, $3, 3 mflo $3 blez $3, TAG198 divu $3, $3 TAG198: blez $3, TAG199 lhu $4, 0($3) sb $3, 0($4) sw $4, 0($3) TAG199: mtlo $4 subu $2, $4, $4 sllv $2, $2, $4 xor $4, $4, $4 TAG200: mfhi $2 bgez $4, TAG201 mult $4, $4 beq $2, $2, TAG201 TAG201: sw $2, 0($2) lui $3, 14 addiu $4, $3, 4 ori $3, $2, 1 TAG202: bltz $3, TAG203 lui $3, 3 beq $3, $3, TAG203 mflo $4 TAG203: lbu $3, 0($4) lui $2, 2 mfhi $4 xori $3, $4, 1 TAG204: lbu $3, 0($3) lui $1, 8 bltz $3, TAG205 lhu $4, 0($3) TAG205: bgez $4, TAG206 mtlo $4 mflo $3 sub $4, $4, $3 TAG206: beq $4, $4, TAG207 sltu $3, $4, $4 mthi $3 beq $3, $3, TAG207 TAG207: multu $3, $3 mflo $3 sw $3, 0($3) lbu $2, 0($3) TAG208: lhu $2, 0($2) lh $1, 0($2) lhu $4, 0($2) bne $1, $2, TAG209 TAG209: mflo $4 mult $4, $4 blez $4, TAG210 lw $1, 0($4) TAG210: beq $1, $1, TAG211 ori $4, $1, 15 sh $1, 0($4) bltz $1, TAG211 TAG211: sb $4, 0($4) lui $3, 1 mthi $4 sll $0, $0, 0 TAG212: mfhi $4 sb $4, 0($4) sll $0, $0, 0 sll $0, $0, 0 TAG213: mflo $1 mult $4, $1 bltz $4, TAG214 sb $4, 0($1) TAG214: bgtz $1, TAG215 lhu $3, 0($1) bltz $3, TAG215 lbu $1, 0($1) TAG215: blez $1, TAG216 sb $1, 0($1) bgez $1, TAG216 lui $1, 8 TAG216: and $2, $1, $1 mtlo $1 bne $2, $2, TAG217 mthi $1 TAG217: bgez $2, TAG218 subu $1, $2, $2 sra $2, $1, 3 lui $3, 5 TAG218: mflo $2 lui $3, 14 sll $0, $0, 0 bne $3, $3, TAG219 TAG219: sllv $2, $3, $3 sll $0, $0, 0 sll $0, $0, 0 lui $2, 4 TAG220: mthi $2 bgez $2, TAG221 sll $0, $0, 0 mfhi $1 TAG221: slt $1, $1, $1 sb $1, 0($1) sub $4, $1, $1 sltu $4, $4, $4 TAG222: ori $2, $4, 15 lui $4, 1 lui $4, 14 bltz $2, TAG223 TAG223: mtlo $4 beq $4, $4, TAG224 subu $2, $4, $4 blez $4, TAG224 TAG224: addiu $2, $2, 12 mflo $3 bgez $2, TAG225 srav $1, $3, $2 TAG225: srl $1, $1, 9 mflo $2 addu $3, $2, $1 multu $1, $1 TAG226: bgez $3, TAG227 mtlo $3 sb $3, 0($3) lui $1, 2 TAG227: mtlo $1 mflo $4 mflo $2 lbu $1, 0($1) TAG228: bne $1, $1, TAG229 lw $2, 0($1) sh $2, 0($1) lhu $4, 0($1) TAG229: lh $3, 0($4) xori $3, $3, 14 mtlo $4 bltz $3, TAG230 TAG230: sb $3, 0($3) bgtz $3, TAG231 subu $2, $3, $3 multu $3, $2 TAG231: lui $2, 14 mult $2, $2 sll $0, $0, 0 sll $0, $0, 0 TAG232: sh $4, 0($4) slt $1, $4, $4 mflo $3 mflo $2 TAG233: beq $2, $2, TAG234 xori $4, $2, 0 bltz $4, TAG234 lui $4, 7 TAG234: sh $4, 0($4) mflo $4 lb $4, 0($4) sltu $1, $4, $4 TAG235: lbu $4, 0($1) sra $2, $1, 14 multu $1, $2 mtlo $2 TAG236: mfhi $3 multu $2, $2 bltz $3, TAG237 mflo $3 TAG237: mtlo $3 sllv $4, $3, $3 slt $1, $3, $3 and $1, $4, $3 TAG238: bgtz $1, TAG239 sh $1, 0($1) sw $1, 0($1) sltiu $3, $1, 3 TAG239: bne $3, $3, TAG240 srl $2, $3, 0 lui $2, 12 bltz $2, TAG240 TAG240: xori $1, $2, 3 mthi $1 divu $2, $2 sll $0, $0, 0 TAG241: bne $1, $1, TAG242 addu $3, $1, $1 beq $1, $3, TAG242 sll $0, $0, 0 TAG242: blez $3, TAG243 div $3, $3 sll $0, $0, 0 sll $0, $0, 0 TAG243: and $2, $2, $2 and $4, $2, $2 divu $4, $4 beq $2, $2, TAG244 TAG244: lui $3, 1 sll $0, $0, 0 sll $0, $0, 0 divu $3, $3 TAG245: lui $4, 7 divu $4, $4 mtlo $3 mflo $4 TAG246: andi $1, $4, 7 mtlo $1 blez $4, TAG247 mtlo $4 TAG247: sh $1, 0($1) lw $3, 0($1) bgtz $3, TAG248 mtlo $3 TAG248: bgez $3, TAG249 lui $1, 10 sltu $4, $3, $1 mfhi $2 TAG249: lui $2, 8 div $2, $2 mtlo $2 bgez $2, TAG250 TAG250: mthi $2 beq $2, $2, TAG251 mfhi $2 div $2, $2 TAG251: blez $2, TAG252 lui $2, 9 mflo $3 sra $2, $2, 14 TAG252: sb $2, 0($2) mflo $1 sra $3, $1, 15 divu $3, $3 TAG253: div $3, $3 sll $3, $3, 12 mthi $3 srav $3, $3, $3 TAG254: lui $4, 7 srlv $1, $4, $3 beq $1, $3, TAG255 lui $1, 10 TAG255: mflo $4 mtlo $1 blez $1, TAG256 lb $3, 0($4) TAG256: sb $3, 0($3) beq $3, $3, TAG257 srl $3, $3, 8 xori $4, $3, 7 TAG257: bne $4, $4, TAG258 srl $2, $4, 0 sb $4, 0($2) sb $4, 0($4) TAG258: lb $2, 0($2) bgtz $2, TAG259 lui $4, 4 sw $2, 0($4) TAG259: mult $4, $4 mflo $3 beq $4, $4, TAG260 mthi $3 TAG260: sw $3, 0($3) sh $3, 0($3) blez $3, TAG261 and $2, $3, $3 TAG261: lui $4, 12 andi $4, $2, 13 lw $1, 0($4) mult $4, $2 TAG262: and $2, $1, $1 bne $1, $2, TAG263 multu $2, $1 lui $3, 10 TAG263: sll $0, $0, 0 mthi $3 srlv $2, $3, $3 mflo $3 TAG264: sllv $1, $3, $3 mfhi $4 sb $3, 0($3) lui $3, 3 TAG265: blez $3, TAG266 multu $3, $3 xor $1, $3, $3 beq $3, $3, TAG266 TAG266: lui $4, 6 lbu $2, 0($1) mtlo $1 lui $4, 11 TAG267: mthi $4 bgtz $4, TAG268 mult $4, $4 divu $4, $4 TAG268: sltiu $3, $4, 4 lbu $4, 0($3) mtlo $3 addu $3, $4, $3 TAG269: mthi $3 slti $4, $3, 1 bne $4, $3, TAG270 addi $3, $3, 8 TAG270: sb $3, 0($3) mtlo $3 bgez $3, TAG271 mfhi $4 TAG271: bgtz $4, TAG272 or $1, $4, $4 mthi $4 mult $1, $1 TAG272: mthi $1 subu $1, $1, $1 sub $4, $1, $1 multu $1, $1 TAG273: lui $2, 6 mfhi $4 mfhi $2 mfhi $4 TAG274: blez $4, TAG275 slt $2, $4, $4 mtlo $2 bgtz $2, TAG275 TAG275: mult $2, $2 addu $1, $2, $2 mtlo $2 sb $1, 0($2) TAG276: lui $2, 0 bgtz $1, TAG277 lw $2, 0($2) bltz $2, TAG277 TAG277: sb $2, 0($2) sltu $4, $2, $2 mflo $3 lui $4, 1 TAG278: sll $0, $0, 0 sll $3, $4, 4 mflo $4 add $2, $4, $4 TAG279: mfhi $3 add $2, $3, $3 subu $1, $2, $3 bne $3, $2, TAG280 TAG280: mult $1, $1 sltiu $3, $1, 1 sb $1, 0($3) slt $2, $1, $1 TAG281: mflo $4 sub $2, $2, $4 beq $2, $2, TAG282 lui $3, 0 TAG282: sra $1, $3, 13 xori $3, $3, 4 sh $3, 0($3) lui $2, 0 TAG283: lui $2, 11 addu $4, $2, $2 sll $0, $0, 0 slti $2, $2, 1 TAG284: lui $4, 10 srl $1, $4, 6 sh $2, -10240($1) mfhi $3 TAG285: lhu $2, 0($3) multu $3, $2 bgtz $3, TAG286 lw $2, 0($3) TAG286: lui $1, 11 sb $2, 0($2) lui $1, 11 beq $1, $2, TAG287 TAG287: lui $3, 12 mtlo $1 div $3, $1 sll $0, $0, 0 TAG288: lui $4, 12 lui $4, 11 mthi $3 lui $4, 8 TAG289: mtlo $4 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG290: ori $4, $1, 11 and $3, $4, $1 slt $4, $4, $1 lui $2, 0 TAG291: sh $2, 0($2) bne $2, $2, TAG292 sw $2, 0($2) lui $1, 15 TAG292: mult $1, $1 mflo $3 mfhi $4 mtlo $1 TAG293: lui $1, 15 addiu $4, $1, 1 addiu $2, $4, 9 bne $4, $4, TAG294 TAG294: mtlo $2 sll $0, $0, 0 srl $4, $2, 7 mflo $1 TAG295: xor $2, $1, $1 mfhi $2 lui $1, 7 lui $1, 0 TAG296: mfhi $2 bne $2, $2, TAG297 sltu $3, $2, $1 mfhi $2 TAG297: multu $2, $2 divu $2, $2 sw $2, -225($2) bne $2, $2, TAG298 TAG298: sll $0, $0, 0 lh $4, -7680($4) lhu $1, -225($4) lhu $3, -225($4) TAG299: blez $3, TAG300 mfhi $1 lui $1, 1 blez $1, TAG300 TAG300: srav $2, $1, $1 lui $1, 12 lui $2, 3 mflo $1 TAG301: lui $1, 1 lui $3, 4 beq $3, $1, TAG302 sltiu $1, $3, 1 TAG302: lh $3, 0($1) blez $3, TAG303 sh $1, -225($3) lui $4, 15 TAG303: mult $4, $4 mflo $4 mfhi $3 mflo $4 TAG304: sltiu $1, $4, 11 lbu $4, 0($4) sh $4, 0($4) beq $4, $4, TAG305 TAG305: mthi $4 bgtz $4, TAG306 sw $4, 0($4) or $3, $4, $4 TAG306: mfhi $4 lui $2, 15 mthi $4 beq $2, $4, TAG307 TAG307: srav $4, $2, $2 srav $2, $2, $2 sll $0, $0, 0 sltu $1, $2, $2 TAG308: sltiu $2, $1, 12 lbu $2, 0($2) blez $2, TAG309 mflo $2 TAG309: sltu $4, $2, $2 blez $4, TAG310 multu $4, $4 mthi $4 TAG310: lw $2, 0($4) mtlo $2 lui $4, 2 mult $4, $2 TAG311: mfhi $3 sll $0, $0, 0 beq $3, $3, TAG312 mflo $3 TAG312: bgez $3, TAG313 lw $4, 0($3) lhu $1, 0($3) mtlo $4 TAG313: lui $1, 7 bgez $1, TAG314 sll $0, $0, 0 bne $1, $4, TAG314 TAG314: lw $2, 0($4) beq $4, $4, TAG315 sb $4, 0($2) bltz $4, TAG315 TAG315: mflo $2 mflo $4 and $3, $2, $4 bne $3, $3, TAG316 TAG316: lb $1, 0($3) lh $2, 0($3) bgez $2, TAG317 lw $2, 0($3) TAG317: multu $2, $2 lui $4, 1 lui $2, 12 divu $2, $4 TAG318: bgez $2, TAG319 mthi $2 xori $2, $2, 12 mthi $2 TAG319: mult $2, $2 bltz $2, TAG320 lui $3, 5 sll $0, $0, 0 TAG320: divu $2, $2 sra $4, $2, 15 lb $4, 0($4) lui $3, 11 TAG321: addu $3, $3, $3 sll $0, $0, 0 mult $3, $3 mthi $3 TAG322: lui $3, 6 beq $3, $3, TAG323 sll $0, $0, 0 sb $3, 0($3) TAG323: multu $4, $4 mtlo $4 lui $1, 12 sb $4, 0($4) TAG324: bne $1, $1, TAG325 slti $2, $1, 3 divu $1, $1 sw $1, 0($2) TAG325: lbu $3, 0($2) sh $2, 0($3) mult $3, $2 and $1, $2, $3 TAG326: xori $1, $1, 9 xor $2, $1, $1 sw $1, 0($2) xori $3, $1, 14 TAG327: mult $3, $3 mfhi $3 mthi $3 lui $1, 8 TAG328: mtlo $1 multu $1, $1 lui $1, 15 srlv $4, $1, $1 TAG329: mfhi $2 div $2, $2 blez $4, TAG330 slti $1, $2, 2 TAG330: beq $1, $1, TAG331 mfhi $1 andi $4, $1, 8 lui $1, 8 TAG331: multu $1, $1 sw $1, 0($1) lui $4, 2 bgtz $1, TAG332 TAG332: sll $0, $0, 0 lui $4, 9 bgez $4, TAG333 lhu $2, 0($2) TAG333: beq $2, $2, TAG334 sw $2, 0($2) mthi $2 srav $2, $2, $2 TAG334: sll $3, $2, 6 mthi $2 addu $1, $3, $3 mthi $3 TAG335: srl $2, $1, 7 blez $2, TAG336 srlv $4, $2, $1 sh $4, 0($2) TAG336: sw $4, 0($4) srav $2, $4, $4 mult $2, $2 bltz $2, TAG337 TAG337: mult $2, $2 sllv $2, $2, $2 lbu $1, 0($2) beq $1, $1, TAG338 TAG338: sw $1, 0($1) lui $3, 10 beq $3, $3, TAG339 addiu $1, $3, 1 TAG339: sll $0, $0, 0 subu $4, $1, $1 mfhi $4 lui $4, 4 TAG340: bgez $4, TAG341 sll $0, $0, 0 lh $4, 0($4) lui $2, 5 TAG341: slt $3, $2, $2 multu $3, $3 bne $3, $2, TAG342 lui $2, 0 TAG342: mflo $1 lw $1, 0($2) blez $1, TAG343 multu $1, $1 TAG343: mthi $1 slt $3, $1, $1 bltz $3, TAG344 multu $3, $1 TAG344: multu $3, $3 xori $3, $3, 4 mflo $2 blez $3, TAG345 TAG345: lh $2, 0($2) mfhi $2 beq $2, $2, TAG346 andi $3, $2, 9 TAG346: mtlo $3 nor $4, $3, $3 mflo $3 mult $4, $3 TAG347: slt $2, $3, $3 bne $2, $2, TAG348 sb $2, 0($2) lh $1, 0($3) TAG348: lb $1, 0($1) mthi $1 mthi $1 lh $3, 0($1) TAG349: blez $3, TAG350 sb $3, 0($3) bne $3, $3, TAG350 mflo $3 TAG350: mtlo $3 mtlo $3 sw $3, 0($3) mfhi $2 TAG351: sh $2, 0($2) srl $3, $2, 0 ori $1, $2, 11 lhu $2, 0($3) TAG352: blez $2, TAG353 mthi $2 bltz $2, TAG353 sb $2, 0($2) TAG353: ori $1, $2, 0 lui $3, 7 mflo $2 slti $1, $3, 14 TAG354: lui $1, 10 mtlo $1 slti $2, $1, 5 mfhi $1 TAG355: ori $2, $1, 15 or $3, $2, $1 lbu $1, 0($3) lui $4, 15 TAG356: sltu $1, $4, $4 sll $0, $0, 0 lw $3, 0($1) slti $1, $4, 14 TAG357: sb $1, 0($1) mfhi $4 sw $4, 0($1) beq $4, $1, TAG358 TAG358: mfhi $2 lb $2, 0($4) lui $1, 12 lui $4, 7 TAG359: slt $2, $4, $4 mflo $2 mfhi $4 mthi $4 TAG360: bne $4, $4, TAG361 lb $2, 0($4) and $1, $4, $2 sll $2, $4, 8 TAG361: mfhi $2 blez $2, TAG362 mtlo $2 multu $2, $2 TAG362: sra $1, $2, 8 lui $2, 15 sra $1, $1, 11 sll $0, $0, 0 TAG363: srlv $3, $1, $1 mfhi $4 mthi $4 lui $3, 4 TAG364: bltz $3, TAG365 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG365: addiu $2, $3, 13 lui $2, 2 sltu $2, $3, $2 bgez $3, TAG366 TAG366: mult $2, $2 beq $2, $2, TAG367 lui $2, 12 bltz $2, TAG367 TAG367: sll $0, $0, 0 mfhi $4 mthi $2 mult $2, $4 TAG368: sh $4, 0($4) bgez $4, TAG369 sh $4, 0($4) sltu $2, $4, $4 TAG369: mflo $4 lui $4, 6 slt $1, $4, $4 sll $0, $0, 0 TAG370: sb $1, 0($1) blez $1, TAG371 andi $2, $1, 14 lui $3, 2 TAG371: sll $0, $0, 0 lui $3, 11 beq $4, $3, TAG372 lui $1, 0 TAG372: subu $3, $1, $1 sb $3, 0($3) sb $3, 0($1) slt $4, $3, $3 TAG373: lui $4, 11 mthi $4 lui $2, 7 blez $4, TAG374 TAG374: slt $3, $2, $2 mthi $3 mtlo $2 mult $3, $2 TAG375: and $1, $3, $3 bgez $1, TAG376 ori $2, $1, 5 sw $3, 0($2) TAG376: mfhi $1 mthi $2 bne $1, $2, TAG377 mtlo $2 TAG377: sh $1, 0($1) srlv $4, $1, $1 sb $1, 0($1) sltu $4, $4, $4 TAG378: multu $4, $4 lhu $2, 0($4) mthi $2 srlv $2, $4, $4 TAG379: lh $4, 0($2) mthi $2 blez $2, TAG380 sub $3, $2, $4 TAG380: bne $3, $3, TAG381 andi $2, $3, 4 lui $1, 1 sh $1, 0($2) TAG381: blez $1, TAG382 mthi $1 ori $1, $1, 7 beq $1, $1, TAG382 TAG382: mflo $3 multu $1, $3 mflo $3 ori $3, $3, 4 TAG383: bgtz $3, TAG384 and $4, $3, $3 lb $1, 0($3) bne $3, $4, TAG384 TAG384: lui $1, 13 mtlo $1 mtlo $1 mflo $4 TAG385: bgtz $4, TAG386 lui $3, 10 bgez $3, TAG386 lb $1, 0($3) TAG386: mfhi $1 mtlo $1 multu $1, $1 bgez $1, TAG387 TAG387: lbu $4, 0($1) mflo $4 lui $3, 7 multu $4, $3 TAG388: slti $2, $3, 5 srl $1, $2, 8 sb $2, 0($1) mthi $1 TAG389: mflo $2 sb $1, 0($1) sb $2, 0($1) bne $2, $2, TAG390 TAG390: mflo $2 sw $2, 0($2) or $2, $2, $2 mflo $1 TAG391: bgez $1, TAG392 sllv $4, $1, $1 bgtz $1, TAG392 mtlo $4 TAG392: bne $4, $4, TAG393 mtlo $4 bgez $4, TAG393 sub $2, $4, $4 TAG393: lhu $2, 0($2) lui $4, 1 bne $2, $2, TAG394 xor $2, $4, $2 TAG394: addiu $2, $2, 8 lui $2, 7 blez $2, TAG395 mthi $2 TAG395: sll $3, $2, 7 sllv $2, $2, $3 nor $1, $2, $2 sll $0, $0, 0 TAG396: ori $4, $3, 11 lui $4, 9 bne $4, $4, TAG397 addu $3, $3, $4 TAG397: subu $4, $3, $3 srlv $4, $3, $4 bltz $4, TAG398 mthi $3 TAG398: bltz $4, TAG399 mfhi $1 addiu $4, $1, 10 blez $1, TAG399 TAG399: nor $3, $4, $4 mtlo $4 bgtz $3, TAG400 sll $0, $0, 0 TAG400: sll $0, $0, 0 mflo $4 beq $4, $3, TAG401 mflo $3 TAG401: bne $3, $3, TAG402 mfhi $4 mult $3, $3 slt $1, $3, $4 TAG402: sra $4, $1, 12 sll $3, $1, 0 subu $1, $4, $1 lui $2, 0 TAG403: mult $2, $2 addu $4, $2, $2 mfhi $1 blez $1, TAG404 TAG404: lui $1, 11 bgtz $1, TAG405 sllv $3, $1, $1 lhu $3, 0($1) TAG405: lui $1, 1 divu $1, $3 srav $4, $3, $3 mthi $4 TAG406: addu $1, $4, $4 beq $4, $1, TAG407 addiu $1, $1, 13 sll $0, $0, 0 TAG407: sll $0, $0, 0 lui $4, 2 mthi $1 srav $1, $4, $4 TAG408: bne $1, $1, TAG409 subu $3, $1, $1 mult $1, $3 bne $1, $1, TAG409 TAG409: mflo $3 sb $3, 0($3) nor $4, $3, $3 lw $4, 0($3) TAG410: mflo $1 mult $1, $4 mult $1, $1 lhu $4, 0($4) TAG411: sw $4, 0($4) bgtz $4, TAG412 addi $2, $4, 5 and $3, $4, $2 TAG412: beq $3, $3, TAG413 xori $4, $3, 3 bgtz $4, TAG413 xori $2, $4, 5 TAG413: mflo $3 beq $2, $2, TAG414 mtlo $2 sw $3, 0($3) TAG414: mflo $2 lbu $3, 0($2) sltu $1, $3, $3 mfhi $2 TAG415: mflo $2 multu $2, $2 lb $2, 0($2) lui $3, 12 TAG416: sll $0, $0, 0 bne $2, $2, TAG417 sra $1, $2, 11 divu $3, $3 TAG417: lui $2, 12 sll $0, $0, 0 and $1, $2, $1 or $2, $2, $2 TAG418: lui $4, 0 sll $1, $4, 5 bne $4, $4, TAG419 mflo $3 TAG419: lui $1, 2 mtlo $3 sra $1, $3, 10 bgtz $3, TAG420 TAG420: mult $1, $1 sra $3, $1, 3 mtlo $1 lh $4, 0($3) TAG421: lb $1, 0($4) nor $3, $4, $4 addiu $2, $1, 6 sh $3, 0($4) TAG422: mfhi $4 mfhi $3 lhu $1, 0($3) lhu $1, 0($2) TAG423: lw $2, 0($1) nor $2, $2, $2 bgtz $1, TAG424 multu $2, $1 TAG424: div $2, $2 mfhi $1 sh $2, 0($1) srl $3, $1, 3 TAG425: mthi $3 mult $3, $3 blez $3, TAG426 mfhi $3 TAG426: mflo $1 mfhi $1 lui $2, 13 mfhi $2 TAG427: mflo $4 sh $4, 0($2) mthi $2 sw $4, 0($2) TAG428: ori $3, $4, 5 sh $4, 0($4) blez $3, TAG429 divu $4, $3 TAG429: slt $2, $3, $3 lui $2, 10 subu $3, $2, $2 mult $2, $3 TAG430: mfhi $4 multu $3, $4 mult $4, $3 mfhi $2 TAG431: srav $4, $2, $2 addi $1, $2, 1 addi $1, $4, 6 mflo $3 TAG432: mflo $4 nor $4, $4, $4 lb $4, 1($4) beq $4, $4, TAG433 TAG433: mfhi $4 mult $4, $4 beq $4, $4, TAG434 or $2, $4, $4 TAG434: lui $4, 0 multu $2, $4 beq $2, $4, TAG435 lui $4, 11 TAG435: sll $0, $0, 0 lui $1, 13 divu $1, $1 sll $0, $0, 0 TAG436: sll $0, $0, 0 mtlo $1 sll $0, $0, 0 xori $3, $1, 5 TAG437: sll $1, $3, 13 blez $3, TAG438 xori $1, $1, 14 sll $0, $0, 0 TAG438: bgtz $1, TAG439 subu $3, $1, $1 bltz $3, TAG439 sb $1, 0($3) TAG439: bgez $3, TAG440 mfhi $1 lhu $4, 0($3) lui $2, 0 TAG440: xori $3, $2, 3 sh $2, 0($2) mult $3, $2 lw $3, 0($2) TAG441: sltiu $2, $3, 15 bgez $3, TAG442 multu $2, $2 div $2, $3 TAG442: mult $2, $2 lui $2, 0 lbu $2, 0($2) lui $1, 8 TAG443: divu $1, $1 mflo $1 lbu $1, 0($1) xor $2, $1, $1 TAG444: bgtz $2, TAG445 mthi $2 lw $1, 0($2) sw $2, 0($2) TAG445: bgez $1, TAG446 mtlo $1 mthi $1 sb $1, 0($1) TAG446: xori $1, $1, 6 blez $1, TAG447 lhu $3, 0($1) bgtz $3, TAG447 TAG447: nor $2, $3, $3 mthi $2 lb $4, 1($2) mthi $4 TAG448: lui $3, 12 sll $0, $0, 0 lui $2, 12 bgtz $3, TAG449 TAG449: lui $2, 2 sll $0, $0, 0 beq $2, $2, TAG450 div $2, $2 TAG450: sll $0, $0, 0 addiu $3, $2, 14 mthi $2 sll $0, $0, 0 TAG451: subu $4, $1, $1 mtlo $1 sll $1, $4, 3 addi $1, $4, 8 TAG452: bgez $1, TAG453 xori $3, $1, 4 lh $4, 0($1) lb $2, 0($3) TAG453: lui $4, 1 srl $4, $4, 15 sllv $2, $2, $2 bne $4, $2, TAG454 TAG454: addu $1, $2, $2 mtlo $2 lui $3, 13 sll $0, $0, 0 TAG455: mthi $3 sll $0, $0, 0 lui $1, 2 sll $0, $0, 0 TAG456: sll $0, $0, 0 slt $4, $1, $1 srlv $2, $4, $1 bltz $1, TAG457 TAG457: mfhi $3 sb $3, 0($2) mfhi $2 mfhi $4 TAG458: and $2, $4, $4 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG459: lui $1, 13 beq $1, $1, TAG460 mult $3, $3 mtlo $3 TAG460: sll $0, $0, 0 sra $3, $2, 1 mflo $1 lui $1, 5 TAG461: beq $1, $1, TAG462 mfhi $4 sllv $4, $1, $4 mthi $1 TAG462: addu $2, $4, $4 mthi $4 xori $2, $4, 4 xori $3, $2, 3 TAG463: sll $0, $0, 0 multu $3, $2 bgtz $2, TAG464 srav $3, $3, $3 TAG464: slt $3, $3, $3 bltz $3, TAG465 nor $4, $3, $3 beq $3, $3, TAG465 TAG465: mfhi $3 xori $3, $3, 13 lb $2, 0($3) mtlo $3 TAG466: lui $2, 13 sll $0, $0, 0 sll $0, $0, 0 multu $2, $2 TAG467: mtlo $4 sltiu $3, $4, 2 mfhi $4 sll $2, $3, 4 TAG468: multu $2, $2 mflo $1 lui $4, 15 andi $3, $4, 11 TAG469: subu $4, $3, $3 mflo $4 xor $3, $4, $4 sw $4, 0($3) TAG470: blez $3, TAG471 subu $4, $3, $3 bgez $4, TAG471 mfhi $1 TAG471: sltiu $3, $1, 8 mult $3, $1 bgez $3, TAG472 mult $1, $1 TAG472: sb $3, 0($3) sltu $4, $3, $3 sb $4, 0($3) sw $3, 0($4) TAG473: lb $1, 0($4) mtlo $4 lui $4, 10 bne $4, $4, TAG474 TAG474: andi $2, $4, 5 multu $4, $2 mult $2, $4 beq $4, $4, TAG475 TAG475: sb $2, 0($2) bgez $2, TAG476 lw $3, 0($2) mfhi $4 TAG476: slt $1, $4, $4 sll $3, $4, 4 sll $0, $0, 0 mfhi $4 TAG477: bne $4, $4, TAG478 mtlo $4 lui $1, 12 lui $4, 2 TAG478: sll $0, $0, 0 xor $4, $4, $4 lui $1, 5 sll $0, $0, 0 TAG479: mtlo $1 mflo $3 bgez $1, TAG480 sltu $3, $3, $1 TAG480: bne $3, $3, TAG481 lbu $4, 0($3) mthi $3 blez $4, TAG481 TAG481: multu $4, $4 sh $4, 0($4) mfhi $3 mflo $3 TAG482: sllv $4, $3, $3 srlv $2, $3, $3 addiu $4, $3, 12 beq $4, $2, TAG483 TAG483: mthi $4 mflo $1 mtlo $1 mult $4, $1 TAG484: bne $1, $1, TAG485 addi $2, $1, 5 beq $1, $2, TAG485 lui $2, 8 TAG485: sll $0, $0, 0 bne $2, $2, TAG486 sll $0, $0, 0 sll $0, $0, 0 TAG486: mult $2, $2 sra $2, $2, 1 mthi $2 multu $2, $2 TAG487: bne $2, $2, TAG488 sll $0, $0, 0 mfhi $4 bgtz $2, TAG488 TAG488: mfhi $1 lh $1, 0($4) multu $1, $1 div $1, $1 TAG489: mfhi $4 lb $2, 0($4) andi $4, $4, 15 sllv $3, $2, $1 TAG490: slti $1, $3, 11 sra $4, $3, 9 mflo $3 lui $1, 9 TAG491: div $1, $1 srl $2, $1, 8 andi $3, $2, 7 lui $4, 13 TAG492: bne $4, $4, TAG493 addiu $2, $4, 15 lui $1, 10 divu $4, $4 TAG493: srl $3, $1, 14 blez $3, TAG494 div $3, $3 lui $3, 7 TAG494: mflo $1 mult $1, $3 nor $4, $3, $1 addu $1, $3, $3 TAG495: sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 lui $4, 13 TAG496: mflo $1 mthi $1 sll $0, $0, 0 sll $0, $0, 0 TAG497: subu $3, $2, $2 lh $3, 0($3) mult $2, $3 mtlo $2 TAG498: mflo $3 bgez $3, TAG499 lui $3, 4 lbu $1, 0($3) TAG499: bgez $1, TAG500 subu $3, $1, $1 andi $3, $1, 5 lui $4, 12 TAG500: slt $3, $4, $4 lui $4, 10 sll $2, $4, 13 sll $0, $0, 0 TAG501: div $4, $4 srlv $4, $4, $4 sll $0, $0, 0 lui $1, 12 TAG502: sra $3, $1, 5 sll $4, $1, 13 sb $1, -24576($3) sll $0, $0, 0 TAG503: sll $0, $0, 0 addiu $4, $3, 2 beq $3, $3, TAG504 sh $3, -24576($3) TAG504: lui $3, 11 bne $4, $3, TAG505 div $4, $4 sb $3, 0($3) TAG505: beq $3, $3, TAG506 sll $0, $0, 0 mtlo $4 sw $3, 0($4) TAG506: bne $4, $4, TAG507 mthi $4 bltz $4, TAG507 divu $4, $4 TAG507: subu $4, $4, $4 lui $4, 7 sll $0, $0, 0 bne $4, $4, TAG508 TAG508: mthi $2 and $2, $2, $2 or $3, $2, $2 sll $0, $0, 0 TAG509: sll $0, $0, 0 mfhi $2 mfhi $3 multu $3, $3 TAG510: mtlo $3 sra $3, $3, 8 bgtz $3, TAG511 lui $4, 9 TAG511: bltz $4, TAG512 divu $4, $4 sra $4, $4, 13 and $3, $4, $4 TAG512: mthi $3 lw $3, 0($3) lui $1, 8 bgez $1, TAG513 TAG513: mtlo $1 mthi $1 xori $2, $1, 14 sll $0, $0, 0 TAG514: lui $2, 5 sll $0, $0, 0 mthi $2 addiu $4, $2, 10 TAG515: sll $0, $0, 0 sll $0, $0, 0 mthi $1 bne $1, $4, TAG516 TAG516: lui $1, 14 lui $3, 3 multu $2, $2 sll $0, $0, 0 TAG517: mfhi $1 lui $1, 15 xor $3, $1, $3 mfhi $1 TAG518: mult $1, $1 lui $4, 0 xori $4, $4, 3 beq $1, $4, TAG519 TAG519: mflo $2 sw $4, -625($2) lui $2, 1 bgez $2, TAG520 TAG520: sll $0, $0, 0 mflo $3 mflo $4 lui $2, 1 TAG521: addu $4, $2, $2 sll $0, $0, 0 bne $3, $2, TAG522 mfhi $2 TAG522: multu $2, $2 mult $2, $2 mult $2, $2 srl $3, $2, 4 TAG523: mult $3, $3 lh $2, 0($3) slt $1, $2, $3 lb $4, 0($1) TAG524: sb $4, 0($4) addiu $1, $4, 7 srl $1, $1, 12 mult $1, $1 TAG525: sw $1, 0($1) lb $1, 0($1) bltz $1, TAG526 multu $1, $1 TAG526: sb $1, 0($1) sh $1, 0($1) mult $1, $1 bgez $1, TAG527 TAG527: andi $1, $1, 8 bgez $1, TAG528 sub $3, $1, $1 div $1, $3 TAG528: mtlo $3 lui $2, 9 bgtz $3, TAG529 mthi $3 TAG529: lui $4, 6 div $4, $4 mflo $4 div $4, $2 TAG530: mflo $2 mflo $4 beq $2, $2, TAG531 lui $4, 2 TAG531: mtlo $4 beq $4, $4, TAG532 sll $0, $0, 0 mtlo $4 TAG532: mthi $4 sltiu $3, $4, 7 mtlo $4 mflo $2 TAG533: sll $0, $0, 0 ori $1, $3, 8 bgtz $1, TAG534 lb $4, 0($1) TAG534: sh $4, 0($4) xori $4, $4, 13 lui $1, 5 mfhi $1 TAG535: sll $0, $0, 0 mfhi $4 mflo $4 sltiu $3, $1, 0 TAG536: beq $3, $3, TAG537 mthi $3 beq $3, $3, TAG537 sub $2, $3, $3 TAG537: slt $4, $2, $2 sll $0, $0, 0 mfhi $4 mthi $4 TAG538: mflo $2 mult $2, $4 lui $1, 14 mflo $1 TAG539: mfhi $3 sra $3, $3, 12 bgtz $3, TAG540 mult $1, $3 TAG540: lh $3, 0($3) lw $4, 0($3) mult $3, $4 lhu $4, 0($3) TAG541: lb $1, 0($4) bne $4, $4, TAG542 multu $1, $1 lui $1, 15 TAG542: multu $1, $1 bne $1, $1, TAG543 mflo $2 sh $1, 0($2) TAG543: addiu $4, $2, 9 bne $4, $2, TAG544 lhu $4, 0($2) lhu $4, 0($4) TAG544: xori $1, $4, 7 bltz $4, TAG545 lbu $4, 0($1) beq $4, $4, TAG545 TAG545: lhu $4, 0($4) srlv $2, $4, $4 mflo $3 xor $2, $4, $3 TAG546: mult $2, $2 bltz $2, TAG547 lui $2, 8 sll $0, $0, 0 TAG547: mtlo $2 lui $4, 9 bne $2, $2, TAG548 multu $2, $4 TAG548: multu $4, $4 beq $4, $4, TAG549 addiu $3, $4, 14 bne $4, $3, TAG549 TAG549: mtlo $3 subu $3, $3, $3 beq $3, $3, TAG550 andi $3, $3, 12 TAG550: bltz $3, TAG551 lb $2, 0($3) beq $3, $2, TAG551 lhu $1, 0($2) TAG551: lh $4, 0($1) bne $4, $4, TAG552 sw $4, 0($4) bltz $1, TAG552 TAG552: mtlo $4 sra $1, $4, 3 bne $4, $1, TAG553 mthi $1 TAG553: sub $1, $1, $1 lui $1, 13 divu $1, $1 sll $0, $0, 0 TAG554: mtlo $1 mfhi $4 bne $1, $4, TAG555 mflo $4 TAG555: sll $0, $0, 0 srlv $3, $1, $1 div $3, $3 mflo $2 TAG556: sb $2, 0($2) divu $2, $2 subu $1, $2, $2 lbu $4, 0($2) TAG557: sb $4, 0($4) mthi $4 multu $4, $4 slti $1, $4, 15 TAG558: sb $1, 0($1) bltz $1, TAG559 mflo $1 beq $1, $1, TAG559 TAG559: sb $1, 0($1) lb $4, 0($1) lui $1, 5 srav $2, $4, $1 TAG560: bne $2, $2, TAG561 sb $2, 0($2) lui $4, 2 blez $2, TAG561 TAG561: addiu $4, $4, 15 slt $2, $4, $4 lb $3, 0($2) bgtz $4, TAG562 TAG562: multu $3, $3 lui $2, 12 sh $3, 0($3) bgtz $2, TAG563 TAG563: andi $4, $2, 14 mflo $4 multu $4, $4 mult $4, $4 TAG564: lui $2, 14 beq $2, $4, TAG565 mflo $4 mflo $1 TAG565: addi $3, $1, 7 lui $1, 1 mtlo $1 bne $1, $1, TAG566 TAG566: and $2, $1, $1 mult $1, $2 bgez $1, TAG567 lui $3, 7 TAG567: multu $3, $3 sll $0, $0, 0 sltu $3, $2, $2 bne $3, $3, TAG568 TAG568: mthi $3 bne $3, $3, TAG569 mthi $3 bne $3, $3, TAG569 TAG569: mult $3, $3 sb $3, 0($3) mflo $2 mfhi $4 TAG570: addu $1, $4, $4 mthi $1 addu $3, $4, $4 srav $1, $3, $3 TAG571: mthi $1 beq $1, $1, TAG572 lui $1, 12 subu $3, $1, $1 TAG572: sb $3, 0($3) lui $1, 4 blez $3, TAG573 sltiu $4, $3, 11 TAG573: srav $1, $4, $4 andi $4, $4, 14 sltiu $4, $4, 14 bne $4, $4, TAG574 TAG574: addiu $1, $4, 10 andi $1, $1, 6 mtlo $4 lh $1, 0($1) TAG575: sll $1, $1, 12 mult $1, $1 mult $1, $1 bltz $1, TAG576 TAG576: mult $1, $1 beq $1, $1, TAG577 multu $1, $1 sra $1, $1, 10 TAG577: addiu $3, $1, 13 sltu $2, $3, $1 mthi $1 sh $2, 0($1) TAG578: mtlo $2 bgtz $2, TAG579 add $1, $2, $2 bne $1, $2, TAG579 TAG579: mult $1, $1 lhu $1, 0($1) lui $1, 5 multu $1, $1 TAG580: mfhi $2 mflo $2 lui $2, 6 sll $0, $0, 0 TAG581: sll $0, $0, 0 sll $0, $0, 0 sb $3, 0($3) xori $3, $3, 14 TAG582: sra $2, $3, 5 bne $2, $3, TAG583 mult $3, $3 bgez $3, TAG583 TAG583: lhu $1, 0($2) lui $3, 11 lui $2, 11 blez $2, TAG584 TAG584: lui $2, 11 sltu $3, $2, $2 bgtz $2, TAG585 add $2, $3, $2 TAG585: multu $2, $2 sll $0, $0, 0 sw $2, 0($1) bgtz $1, TAG586 TAG586: mflo $4 mthi $1 addi $1, $4, 0 bne $1, $4, TAG587 TAG587: sh $1, 0($1) multu $1, $1 lui $3, 10 mflo $1 TAG588: lui $1, 7 mfhi $3 sll $0, $0, 0 addu $4, $3, $1 TAG589: sll $0, $0, 0 mult $4, $4 lui $3, 1 beq $3, $4, TAG590 TAG590: divu $3, $3 lui $2, 3 mult $3, $2 beq $3, $3, TAG591 TAG591: div $2, $2 lui $3, 8 mflo $1 mtlo $3 TAG592: xor $3, $1, $1 mthi $3 lw $3, 0($3) sll $0, $0, 0 TAG593: addiu $4, $4, 3 bne $4, $4, TAG594 div $4, $4 lui $4, 9 TAG594: sll $0, $0, 0 sll $0, $0, 0 bgtz $4, TAG595 mult $4, $4 TAG595: sll $0, $0, 0 beq $4, $4, TAG596 mthi $4 sltu $2, $4, $4 TAG596: bltz $2, TAG597 sll $0, $0, 0 divu $3, $3 andi $1, $3, 0 TAG597: slti $2, $1, 6 sb $1, 0($1) srlv $4, $2, $1 divu $2, $4 TAG598: mflo $1 mflo $1 blez $1, TAG599 lui $3, 15 TAG599: divu $3, $3 mtlo $3 sltiu $1, $3, 15 mfhi $1 TAG600: mfhi $3 xor $1, $3, $1 srl $4, $1, 7 sll $3, $1, 2 TAG601: bne $3, $3, TAG602 subu $4, $3, $3 mfhi $3 bne $3, $3, TAG602 TAG602: slti $3, $3, 5 mfhi $4 lbu $4, 0($3) mtlo $3 TAG603: lui $4, 12 mthi $4 sltu $2, $4, $4 addiu $1, $4, 11 TAG604: mfhi $3 mtlo $1 blez $3, TAG605 and $3, $3, $3 TAG605: sll $0, $0, 0 sll $0, $0, 0 beq $3, $3, TAG606 lui $1, 1 TAG606: sll $0, $0, 0 mtlo $1 sll $0, $0, 0 bgtz $1, TAG607 TAG607: lhu $2, 0($2) beq $2, $2, TAG608 slt $4, $2, $2 blez $2, TAG608 TAG608: srlv $3, $4, $4 lb $3, 0($4) sw $3, 0($3) sltiu $2, $3, 15 TAG609: srl $2, $2, 9 srl $2, $2, 6 lh $3, 0($2) lhu $3, 0($2) TAG610: mflo $3 sll $0, $0, 0 beq $3, $3, TAG611 sll $0, $0, 0 TAG611: andi $1, $4, 0 addi $1, $1, 14 lui $2, 7 sll $0, $0, 0 TAG612: div $3, $3 sll $0, $0, 0 mthi $3 mflo $2 TAG613: lb $1, 0($2) mthi $1 srl $2, $2, 0 bgez $2, TAG614 TAG614: mthi $2 beq $2, $2, TAG615 addiu $4, $2, 0 lui $4, 5 TAG615: lbu $2, 0($4) lui $1, 5 sll $0, $0, 0 divu $4, $1 TAG616: lui $4, 3 bgez $4, TAG617 srl $4, $4, 12 mthi $4 TAG617: sb $4, 0($4) mtlo $4 multu $4, $4 mtlo $4 TAG618: lh $3, 0($4) blez $3, TAG619 addiu $3, $3, 9 div $3, $3 TAG619: bne $3, $3, TAG620 sb $3, 0($3) srav $2, $3, $3 mthi $2 TAG620: multu $2, $2 multu $2, $2 slti $4, $2, 2 multu $2, $2 TAG621: bgez $4, TAG622 lui $2, 6 mfhi $4 mflo $4 TAG622: sb $4, 0($4) addu $4, $4, $4 sb $4, 0($4) divu $4, $4 TAG623: multu $4, $4 sh $4, 0($4) sh $4, 0($4) srav $1, $4, $4 TAG624: mflo $1 multu $1, $1 addiu $2, $1, 12 mflo $1 TAG625: srav $2, $1, $1 multu $2, $2 bne $1, $2, TAG626 mtlo $1 TAG626: sb $2, 0($2) addi $2, $2, 8 lui $4, 13 sra $4, $2, 3 TAG627: lb $2, 0($4) addu $2, $4, $2 lh $4, 0($2) sh $4, 0($2) TAG628: sh $4, 0($4) bltz $4, TAG629 mflo $4 lbu $3, 0($4) TAG629: andi $4, $3, 14 lb $4, 0($3) sb $3, 0($4) mflo $3 TAG630: bgez $3, TAG631 divu $3, $3 mfhi $2 mfhi $3 TAG631: blez $3, TAG632 multu $3, $3 ori $4, $3, 4 lbu $3, 0($3) TAG632: beq $3, $3, TAG633 lui $1, 5 mflo $3 bne $3, $1, TAG633 TAG633: lui $4, 2 lui $4, 13 beq $4, $4, TAG634 lb $3, 0($3) TAG634: div $3, $3 lui $4, 9 sll $0, $0, 0 blez $3, TAG635 TAG635: multu $4, $4 srl $2, $4, 9 lui $3, 11 bltz $4, TAG636 TAG636: lui $2, 10 addiu $3, $3, 14 multu $3, $2 subu $4, $3, $3 TAG637: bltz $4, TAG638 sw $4, 0($4) addiu $1, $4, 6 mflo $1 TAG638: beq $1, $1, TAG639 sltiu $1, $1, 0 sh $1, 0($1) sh $1, 0($1) TAG639: mult $1, $1 sw $1, 0($1) lui $1, 4 slti $1, $1, 11 TAG640: bne $1, $1, TAG641 sw $1, 0($1) lbu $1, 0($1) beq $1, $1, TAG641 TAG641: lhu $2, 0($1) bltz $1, TAG642 mthi $2 and $4, $2, $1 TAG642: lb $1, 0($4) mfhi $3 lbu $3, 0($3) blez $3, TAG643 TAG643: mtlo $3 lw $1, 0($3) sltiu $3, $3, 4 div $3, $3 TAG644: divu $3, $3 bne $3, $3, TAG645 lui $4, 0 mtlo $3 TAG645: lui $2, 5 lui $4, 11 mthi $4 mthi $4 TAG646: div $4, $4 mult $4, $4 mthi $4 lui $1, 1 TAG647: subu $3, $1, $1 nor $2, $3, $3 nor $4, $1, $3 sll $0, $0, 0 TAG648: mfhi $1 lui $3, 2 subu $1, $4, $1 srl $2, $1, 14 TAG649: sll $0, $0, 0 lui $1, 7 sll $0, $0, 0 addiu $2, $2, 15 TAG650: blez $2, TAG651 sll $0, $0, 0 mthi $2 mthi $2 TAG651: nor $1, $2, $2 mfhi $3 bgez $2, TAG652 sra $2, $1, 9 TAG652: addu $3, $2, $2 bltz $3, TAG653 lbu $3, 512($2) beq $2, $3, TAG653 TAG653: lhu $3, 0($3) mfhi $2 subu $3, $3, $2 bne $3, $3, TAG654 TAG654: mtlo $3 sll $0, $0, 0 slti $1, $2, 1 mult $2, $2 TAG655: mflo $3 mtlo $3 bgez $1, TAG656 lui $1, 9 TAG656: mtlo $1 mfhi $4 blez $4, TAG657 lb $4, 0($4) TAG657: mult $4, $4 div $4, $4 mthi $4 mtlo $4 TAG658: sra $3, $4, 13 ori $4, $3, 10 bgez $4, TAG659 mthi $4 TAG659: mflo $2 srlv $3, $4, $2 div $3, $4 mult $4, $3 TAG660: andi $2, $3, 7 xori $2, $3, 0 mfhi $3 bltz $2, TAG661 TAG661: lbu $4, 0($3) sb $3, 0($4) sub $2, $4, $3 blez $3, TAG662 TAG662: lw $1, 0($2) mult $1, $2 and $1, $2, $1 beq $1, $1, TAG663 TAG663: xor $2, $1, $1 mflo $4 lui $4, 7 mult $4, $1 TAG664: sltiu $1, $4, 1 beq $1, $1, TAG665 subu $3, $1, $4 sb $3, 0($3) TAG665: lui $4, 1 sll $0, $0, 0 sll $0, $0, 0 mthi $1 TAG666: sb $1, 0($1) lui $3, 2 lh $2, 0($1) lw $1, 0($1) TAG667: bgez $1, TAG668 sw $1, 0($1) mtlo $1 bne $1, $1, TAG668 TAG668: mthi $1 mflo $4 multu $1, $4 mthi $1 TAG669: mtlo $4 sw $4, 0($4) sw $4, 0($4) mtlo $4 TAG670: xori $1, $4, 12 sra $4, $4, 11 lui $3, 9 sllv $2, $4, $4 TAG671: mult $2, $2 lh $2, 0($2) xori $4, $2, 15 lui $3, 10 TAG672: beq $3, $3, TAG673 mtlo $3 beq $3, $3, TAG673 mfhi $4 TAG673: mtlo $4 multu $4, $4 bne $4, $4, TAG674 divu $4, $4 TAG674: sra $2, $4, 4 lw $2, 0($2) sb $2, 0($2) lui $1, 6 TAG675: beq $1, $1, TAG676 lui $1, 1 lhu $3, 0($1) mtlo $1 TAG676: sll $0, $0, 0 beq $3, $3, TAG677 sll $0, $0, 0 lui $2, 0 TAG677: slt $3, $2, $2 bgtz $3, TAG678 mult $3, $3 bgtz $3, TAG678 TAG678: lui $3, 7 sll $0, $0, 0 mfhi $4 mfhi $3 TAG679: lui $1, 9 blez $1, TAG680 mflo $4 mtlo $3 TAG680: blez $4, TAG681 sw $4, 0($4) lui $2, 2 mthi $4 TAG681: blez $2, TAG682 lui $1, 9 mtlo $2 lui $4, 10 TAG682: mult $4, $4 mflo $4 mult $4, $4 xor $2, $4, $4 TAG683: lh $2, 0($2) bgez $2, TAG684 lui $2, 11 lbu $4, 0($2) TAG684: mthi $4 sub $1, $4, $4 nor $4, $4, $4 subu $4, $1, $4 TAG685: lui $1, 14 bgez $1, TAG686 mtlo $1 addiu $4, $4, 14 TAG686: bltz $4, TAG687 sll $2, $4, 1 bgtz $4, TAG687 sltu $1, $2, $4 TAG687: mult $1, $1 sra $1, $1, 5 lb $3, 0($1) mtlo $3 TAG688: lbu $3, 0($3) mfhi $1 addi $3, $3, 12 mfhi $1 TAG689: srl $2, $1, 9 sb $2, 0($1) sll $3, $2, 9 lui $1, 12 TAG690: mtlo $1 addu $2, $1, $1 and $3, $1, $1 sll $0, $0, 0 TAG691: lb $2, 0($4) mflo $2 mtlo $2 sll $0, $0, 0 TAG692: beq $2, $2, TAG693 mflo $3 slt $2, $3, $2 sra $4, $2, 10 TAG693: multu $4, $4 sb $4, 0($4) divu $4, $4 lui $3, 15 TAG694: mtlo $3 lui $2, 5 blez $2, TAG695 lui $4, 13 TAG695: sll $0, $0, 0 bne $2, $2, TAG696 sll $0, $0, 0 mfhi $2 TAG696: srav $2, $2, $2 addiu $3, $2, 0 mult $2, $3 lhu $3, 0($2) TAG697: divu $3, $3 addiu $2, $3, 6 lh $4, -256($3) div $4, $4 TAG698: sll $0, $0, 0 blez $4, TAG699 subu $4, $4, $4 add $1, $4, $4 TAG699: subu $2, $1, $1 mfhi $3 sra $2, $3, 10 sh $2, 0($1) TAG700: sltu $1, $2, $2 multu $1, $1 lb $1, 0($2) sw $2, 0($1) TAG701: lui $3, 4 xor $1, $3, $3 bne $1, $3, TAG702 lui $3, 6 TAG702: sltiu $3, $3, 0 mult $3, $3 ori $4, $3, 7 sltu $3, $3, $3 TAG703: bne $3, $3, TAG704 lbu $4, 0($3) sw $4, 0($4) mthi $3 TAG704: addi $4, $4, 7 divu $4, $4 subu $4, $4, $4 bgez $4, TAG705 TAG705: add $2, $4, $4 multu $2, $4 addu $2, $2, $2 mflo $2 TAG706: slt $2, $2, $2 mtlo $2 multu $2, $2 lb $1, 0($2) TAG707: lbu $2, 0($1) sh $1, 0($2) slti $2, $2, 2 lbu $4, 0($2) TAG708: beq $4, $4, TAG709 sb $4, 0($4) lui $3, 9 beq $3, $4, TAG709 TAG709: xori $3, $3, 7 bne $3, $3, TAG710 lui $2, 13 bgtz $2, TAG710 TAG710: mflo $1 sw $2, 0($1) lui $2, 14 bltz $2, TAG711 TAG711: sll $0, $0, 0 sll $0, $0, 0 sb $1, 0($1) lui $4, 5 TAG712: mtlo $4 bltz $4, TAG713 mfhi $2 lb $4, 0($2) TAG713: mtlo $4 mthi $4 addi $1, $4, 0 mult $1, $4 TAG714: lbu $3, 0($1) addi $2, $3, 4 andi $1, $2, 15 mthi $1 TAG715: lhu $2, 0($1) lui $3, 0 bne $3, $2, TAG716 mult $1, $3 TAG716: mfhi $4 lui $3, 2 sltiu $3, $3, 4 sb $3, 0($4) TAG717: ori $2, $3, 9 mfhi $4 beq $2, $2, TAG718 xor $2, $4, $2 TAG718: mflo $4 xori $4, $4, 2 mfhi $4 bgez $4, TAG719 TAG719: lui $1, 15 and $4, $1, $1 sll $0, $0, 0 blez $4, TAG720 TAG720: mtlo $4 bltz $4, TAG721 ori $1, $4, 14 srl $1, $1, 7 TAG721: sll $0, $0, 0 lui $2, 3 divu $1, $1 lb $2, -7680($1) TAG722: mtlo $2 bne $2, $2, TAG723 mthi $2 beq $2, $2, TAG723 TAG723: mfhi $1 bne $1, $2, TAG724 mult $2, $1 bne $1, $2, TAG724 TAG724: sltu $4, $1, $1 sb $4, 0($4) mtlo $4 sw $4, 0($4) TAG725: lui $2, 14 sll $0, $0, 0 sra $3, $4, 3 multu $4, $3 TAG726: mfhi $3 xori $3, $3, 9 mthi $3 bgez $3, TAG727 TAG727: multu $3, $3 lb $4, 0($3) multu $3, $4 blez $3, TAG728 TAG728: srl $4, $4, 5 lui $4, 14 mult $4, $4 mfhi $1 TAG729: sw $1, -196($1) mflo $2 addiu $2, $2, 0 lbu $2, -196($1) TAG730: bne $2, $2, TAG731 mtlo $2 beq $2, $2, TAG731 mtlo $2 TAG731: subu $3, $2, $2 sll $3, $2, 9 bgtz $2, TAG732 mthi $2 TAG732: sll $0, $0, 0 bgtz $3, TAG733 mfhi $4 mfhi $2 TAG733: mflo $2 divu $2, $2 sllv $3, $2, $2 lui $2, 14 TAG734: addiu $3, $2, 3 multu $3, $2 sltu $2, $3, $3 srlv $1, $2, $3 TAG735: mthi $1 mthi $1 slti $1, $1, 11 bgez $1, TAG736 TAG736: lui $4, 12 lbu $3, 0($1) bgtz $3, TAG737 mthi $3 TAG737: bltz $3, TAG738 multu $3, $3 sb $3, 0($3) lui $3, 8 TAG738: sll $0, $0, 0 mfhi $2 mflo $4 multu $2, $3 TAG739: mflo $2 mflo $3 lhu $1, 0($3) sltiu $3, $3, 11 TAG740: mthi $3 mfhi $3 sb $3, 0($3) bne $3, $3, TAG741 TAG741: lbu $4, 0($3) sb $3, 0($3) mflo $1 or $1, $1, $1 TAG742: lui $4, 5 lui $4, 10 mfhi $3 bgez $3, TAG743 TAG743: lui $4, 11 sll $0, $0, 0 sll $0, $0, 0 sb $3, 0($3) TAG744: bne $3, $3, TAG745 xori $2, $3, 4 ori $1, $3, 7 mflo $3 TAG745: sb $3, 0($3) lhu $4, 0($3) sh $4, -256($4) mult $3, $4 TAG746: bltz $4, TAG747 lui $2, 12 mfhi $3 bne $3, $3, TAG747 TAG747: sllv $3, $3, $3 lui $2, 12 lbu $1, 0($3) bltz $3, TAG748 TAG748: subu $2, $1, $1 sw $1, 0($1) beq $1, $1, TAG749 mult $2, $2 TAG749: sh $2, 0($2) mthi $2 addu $1, $2, $2 mfhi $1 TAG750: nop nop test_end: beq $0, $0, test_end nop
test/asm/use-label-outside-section.asm
michealccc/rgbds
522
246919
lab: PRINTLN lab-lab
FormalAnalyzer/models/apps/OpeningDoorTogglesSwitch.als
Mohannadcse/IoTCOM_BehavioralRuleExtractor
0
4573
module app_OpeningDoorTogglesSwitch open IoTBottomUp as base open cap_runIn open cap_now open cap_contactSensor open cap_switch one sig app_OpeningDoorTogglesSwitch extends IoTApp { contact1 : one cap_contactSensor, switch1 : one cap_switch, state : one cap_state, } { rules = r //capabilities = contact1 + switch1 + state } one sig cap_state extends cap_runIn {} { attributes = cap_state_attr + cap_runIn_attr } abstract sig cap_state_attr extends Attribute {} abstract sig r extends Rule {} one sig r0 extends r {}{ triggers = r0_trig conditions = r0_cond commands = r0_comm } abstract sig r0_trig extends Trigger {} one sig r0_trig0 extends r0_trig {} { capabilities = app_OpeningDoorTogglesSwitch.contact1 attribute = cap_contactSensor_attr_contact value = cap_contactSensor_attr_contact_val_open } abstract sig r0_cond extends Condition {} abstract sig r0_comm extends Command {} one sig r0_comm0 extends r0_comm {} { capability = app_OpeningDoorTogglesSwitch.switch1 attribute = cap_switch_attr_switch value = cap_switch_attr_switch_val_on } one sig r1 extends r {}{ no triggers conditions = r1_cond commands = r1_comm } abstract sig r1_cond extends Condition {} one sig r1_cond0 extends r1_cond {} { capabilities = app_OpeningDoorTogglesSwitch.state attribute = cap_runIn_attr_runIn value = cap_runIn_attr_runIn_val_on } abstract sig r1_comm extends Command {} one sig r1_comm0 extends r1_comm {} { capability = app_OpeningDoorTogglesSwitch.switch1 attribute = cap_switch_attr_switch value = cap_switch_attr_switch_val_off } one sig r2 extends r {}{ triggers = r2_trig conditions = r2_cond commands = r2_comm } abstract sig r2_trig extends Trigger {} one sig r2_trig0 extends r2_trig {} { capabilities = app_OpeningDoorTogglesSwitch.contact1 attribute = cap_contactSensor_attr_contact value = cap_contactSensor_attr_contact_val_open } abstract sig r2_cond extends Condition {} abstract sig r2_comm extends Command {} one sig r2_comm0 extends r2_comm {} { capability = app_OpeningDoorTogglesSwitch.state attribute = cap_runIn_attr_runIn value = cap_runIn_attr_runIn_val_on }
wasm/part0902/main.asm
Bigsby/slae
0
26731
.386 .model flat, stdcall option casemap :none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\masm32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib .data FirstMessage db "First Message", 13, 10, 0 SecondMessage db "Second Message", 13, 10, 0 counter1 DWORD 0 counter2 DWORD 0 .code start: mov counter1, 10 .while ( counter1 > 0 ) invoke StdOut, addr FirstMessage dec counter1 .break .if ( counter1 == 4 ) .endw mov counter2, 5 .repeat invoke StdOut, addr SecondMessage dec counter2 .until ( counter2 == 0 ) invoke ExitProcess, 0 end start
scripts/itunes-switch-airplay.applescript
davenquinn/shell-config
0
2696
on run argv tell application "System Events" if application process "iTunes" exists then set currentDate to current date set currentHour to (currentDate's hours) tell application "iTunes" if (currentHour > 8 and currentHour < 23) then log "Switching airplay" try set selectedAirplayDevice to (get some AirPlay device whose name is (item 1 of argv)) on error set selectedAirplayDevice to (get some AirPlay device whose kind is computer) log "Switching to computer" end try else set selectedAirplayDevice to (get some AirPlay device whose kind is computer) log "Switching to computer" end if set current AirPlay devices to {selectedAirplayDevice} end tell end if end tell end run
examples/3rd-party/Mancala/mancala.asm
brickpool/hp35s
3
24779
; https://brianddk.github.io/prog/mancala/mancala.asm ; [rights] Copyright <NAME>. (brianddk) 2016 https://github.com/brianddk ; [license] Licensed under Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0 ; [repo] https://github.com/brianddk/brianddk.github.io/blob/master/prog/mancala/mancala.asm ; ; Mancala game written for the hp 41s scientific calculator. ; ; Version: 0.1 (commit c790ba6 + 1) ; ; Rules: https://en.wikipedia.org/wiki/Kalah aka Kalah(6,4) ; ; Build: ; txt2raw.pl - by <NAME>, a TXT to opcode compiler ; http://thomasokken.com/free42/txt2raw/txt2raw.html ; build.sh - (by me) a bunch of `sed` to make LBL, XEQ, GTO, I, J easier. ; https://github.com/brianddk/brianddk.github.io/blob/master/prog/mancala/build.sh ; ; Oddities: ; This program is designed for the hp 35s which is why the notation is so very odd. ; I decided to test in on Free42s since it would be easier to debug. Porting back ; to hp 35s should be fairly straight forward in this form. I will eventually write ; the offset calculator since the hp 35s has anonymous XEQ/GTO that I want to use. ; I also went through great pains to not consume many program LBLs or variables. ; That is why 'MANCA' is the only named label / variable. In the 35s, the named ; labels / variables will be prog 'M' and variables 'I', 'J' ; ; Bugs: ; - Display is base 10, so more than 9 beans in a pit is a problem. ; - When a player empties all thier pits the game is supposed to end... it doesn't. ; ; Layout ; ; R00 - P2 'Home' pit ; R01 - P1 pit #1 ; R02 - P1 pit #2 ; R03 - P1 pit #3 ; R04 - P1 pit #4 ; R05 - P1 pit #5 ; R06 - P1 pit #6 ; R07 - P1 'Home' pit ; R08 - P2 pit #6 ; R09 - P2 pit #5 ; R10 - P2 pit #4 ; R11 - P2 pit #3 ; R12 - P2 pit #2 ; R13 - P2 pit #1 ; R14 - P1 Display Vector ; R15 - P2 Display Vector ; R16 - Virtual 'I' register ; R17 - Vertual 'J' register ; FLAG1 - Player 1 turn flag ; FLAG2 - Player 2 turn flag ; FLAG3 - Winner found flag ; FLAG4 - Bad 'pick' choice flag ; ; Game board (to imagine) ; ; R00-R13 R12 R11-R10 R09 R08 ; R01 R02 R03-R04 R05 R06-R07 ; ; Game Display ; ; x: Z,DCB,A98.P2 ; y: Z,123,456.P1 ; ; Where, ; 'Z,' - Ignore the 'millionth' place, its a place holder, nothing more ; 'P1' - The score for Player 1 (in the X vector) ; 'P2' - The score for Player 2 (in the Y vector) ; '1|D' - # of beans in 'pit #1' for P1 and P2 ; '2|C' - # of beans in 'pit #2' for P1 and P2 ; '3|B' - # of beans in 'pit #3' for P1 and P2 ; '4|A' - # of beans in 'pit #4' for P1 and P2 ; '5|9' - # of beans in 'pit #5' for P1 and P2 ; '6|8' - # of beans in 'pit #6' for P1 and P2 ; ; Indicators ; 'GRAD' - Player1's turn when 'GRAD' is displayed ; 'RAD' - Player2's turn when 'RAD' is displayed LBL "MANCA" ;Main Mancala program XEQ [INIT] ; Init the game registers LBL [MAIN] ; Main game loop XEQ [CHECK-WINNER] ; Check for a winner FS? 3 ; Flag3 = Winner Found! GTO [DONE] ; Finished when a winner is found LBL [REDISPLAY] ; Come here if we pick bad XEQ [DISPLAY] ; Display the game board XEQ [PICK] ; Pick a move FS? 4 ; Invalid move? GTO [REDISPLAY] ; .. Redisplay XEQ [MOVE] ; Move the beans XEQ [SWITCH] ; Swithch players GTO [MAIN] ; Loop for next move LBL [DONE] ; This is where we finish XEQ [CLEANUP] ; Cleanup we are done RTN ; ; .Init registers LBL [INIT] ; Init the game registers CF 1 ; Clear our flag regs CF 2 CF 3 CF 4 13 ; For i in 13..1 STO I ; i 4 ; st-x = 4 LBL [INIT-LOOP] STO (I) ; 4->(i) DSE I ; DSE i GTO [INIT-LOOP] 0 ; i now equals zero STO (I) ; 0->(i), i = 0 7 STO I X<>Y STO (I) ; 0->(i), i = 7 SF 1 ; P1'S Turn GRAD ; 42s Only, P1 indicator RTN ; ; This routine will check for ; Check for winner ; .. the winner by looking at LBL [CHECK-WINNER] ; .. the 'home pits' #35s SF 10 ; For 35s prompting CF 3 ; Clear winner found flag 0 ; i = P1-home STO J ; j = P2-home 7 ; Compare P1-home to 24 STO I ; .. if it is .gte. then won! RCL (I) ; p1-home,7,0 24 ; 24,p1h,7,0 X<=Y? GTO [P1-WINNER] RCL (J) ; p2h,24,p1h,7 X<>Y ; 24,p2h,p1h,7 X<=Y? GTO [P2-WINNER] GTO [WINNER-RTN] LBL [P1-WINNER] "PLAYER 1 WON" GTO [WINNER-DONE] LBL [P2-WINNER] "PLAYER 2 WON" LBL [WINNER-DONE] SF 3 ; Set winner found flag #41c PROMPT ; The 42s uses prompt command #42s PROMPT ; The 42s uses prompt command LBL [WINNER-RTN] ; .. But the 35s uses Flag 10 #35s CF 10 ; Restore (35s) default RTN ; ; Display the board LBL [DISPLAY] 1.006 STO I ; i 14 STO J ; "$(j)" == "$(14)" 1000000 STO (J) ; (j)=1,000,000 LBL [P1-BOARD] ; 1m,14,1.. ;STOP 10 ; WARN Base 10 for now 6 ; 6,10,1m,14 RCL I ; i,6,10,1m IP - ; 6-ip,10,1m,1m Y^X ; 10^(6-ip(i)),1m,1m,1m RCL (I) ; Ri,10^6-i,1m,1m x ; 10^(6-ip(i)) * $(i) STO+ (J) ; @(j) += i^(6-ip(i)) + $(i) ISG I ; loop GTO [P1-BOARD] 15 STO J ; j = P2-vector 2000000 STO (J) 13.007 STO I LBL [P2-BOARD] ;STOP 10 ; WARN Base 10 for now RCL I ; i,10,13.,2m IP 8 ; 8,i,10,13. - ; i-8,10,13.,13. Y^X ; 10^(i-8),13.,13. RCL (I) ; Ri, 10^..,13,13 x ; * ; Ri*10^..13,13,13 STO+ (J) DSE I GTO [P2-BOARD] 7 ; Now we get the score and tack STO I ;.. it to the end of the number 0 ;.. as the FP STO J ; i = p1-home, j=p2-home 0.01 ; .01,0,7 RCL (J) ; R0,.01,0,7 x ; R0%,0,7,7 0.01 ; .01,R0%,0,7 RCL (I) ; R7,.01,R0%,0 x ; R7%,R0%,0,0 14 ; .. st-y = p2-score/100 STO I 15 STO J ; i = p1 vector, j=p2-vector Rv ; st-x = p1-score/100 Rv ; .. st-y = p2-score/100 STO+ (I) X<>Y STO+ (J) RCL (J) ; P2 RCL (I) ; P1 #41c FS? 2 #41c X<>Y FIX 2 STOP RTN ; ; Pick a pit to move LBL [PICK] CF 4 IP ; INT 1 X<>Y X<Y? SF 4 6 X<>Y X>Y? SF 4 FS? 4 GTO [PICK-DONE] STO I ; i=PICK FS? 1 GTO [CHECK-PICK] 14 X<>Y - STO I ; i LBL [CHECK-PICK] RCL (I) ; (i) X=0? SF 4 LBL [PICK-DONE] RCL I ; i RTN ; ; Move beans from selected pit LBL [MOVE] 0 X<> (I) ; (i)= 0 (MOVE BEANS OUT) STO J ; j=VALUE PREVIOUSLY IN (i) LBL [MOVE-LOOP] ; INCI SUBROUTINE-INLINE 1 RCL I ; i++ (MOVE REGISTER FORWARD) + 14 MOD STO I ; i=(i+1)MOD(14) FS? 1 ; P1? XEQ [SKIP0] ; SKIP0 IF P1 FS? 2 XEQ [SKIP7] ; SKIP7 IF P2 ; INCI END-SUBROUTINE-INLINE 1 STO+ (I) ; (i)=(i)+1 DSE J ; j-- GTO [MOVE-LOOP] 1 RCL (I) X=Y? XEQ [WIN-BEANS] RTN ; ; SKIP0 LBL [SKIP0] X=0? ISG I CF 0 ; NOP RTN ; ; SKIP7 LBL [SKIP7] 7 X<>Y X=Y? ISG I CF 0 ; NOP RTN ; ; WIN-BEANS LBL [WIN-BEANS] ;STOP RCL I X=0? RTN 7 X=Y? RTN FS? 1 GTO [P1-WINBEANS] FS? 2 GTO [P2-WINBEANS] RTN LBL [P1-WINBEANS] STO J X<Y? ; 7 < I ? RTN GTO [DONE-WINBEANS] LBL [P2-WINBEANS] 0 STO J Rv X>Y? RTN LBL [DONE-WINBEANS] CLX X<> (I) STO+ (J) CLX 14 X<>Y - STO I 0 X<> (I) STO+ (J) RTN ; ; Switch to other players turn LBL [SWITCH] 7 RCL I ; i contains the final register of move X=Y? ; if i=7, landed in a bank, free move RTN X=0? ; if i=0, landed in a bank, free move RTN FS? 1 GTO [SWITCHTO-P2] CF 2 SF 1 GRAD GTO [SWITCH-DONE] LBL [SWITCHTO-P2] CF 1 SF 2 RAD LBL [SWITCH-DONE] RTN ; ; Clean up after game LBL [CLEANUP] CF 1 CF 2 CF 3 CF 4 FIX 4 DEG RTN END
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/array27_pkg.ads
best08618/asylo
7
11476
package Array27_Pkg is subtype Outer_Type is String (1 .. 8); subtype Inner_Type is String (1 .. 3); function F return Inner_Type; end Array27_Pkg;
m7/vocabulary/vocabulary.asm
paulscottrobson/aquarius-chess
1
168372
<filename>m7/vocabulary/vocabulary.asm<gh_stars>1-10 ; -------------------------------------- ; < ; -------------------------------------- word_1000: call CompileCallFollowing ld a,h ; check if signs different. xor d add a,a ; CS if different jr nc,__less_samesign ld a,d ; different. set CS to sign of B add a,a ; if set (negative) B must be < A as A is +ve jr __less_returnc __less_samesign: push de ; save DE ex de,hl ; -1 if B < A sbc hl,de ; calculate B - A , hencs CS if < (Carry clear by add a,a) pop de ; restore DE __less_returnc: ld a,0 ; A 0 sbc a,0 ; A $FF if CS. ld l,a ; put in HL ld h,a ret ; -------------------------------------- ; = ; -------------------------------------- word_1001: call CompileCallFollowing ld a,h ; H = H ^ D xor d ld h,a ld a,l ; A = (L ^ E) | (H ^ D) xor e or h ; if A == 0 they are the same. ld hl,$0000 ; return 0 if different ret nz dec hl ; return -1 ret ; -------------------------------------- ; - ; -------------------------------------- word_1002: call CompileCallFollowing push de ; save DE ex de,hl ; HL = B, DE = A xor a ; clear carry sbc hl,de ; calculate B-A pop de ; restore DE ret ; -------------------------------------- ; + ; -------------------------------------- word_1003: call CopyFollowing .db endcopy_1003 - $ - 1 add hl,de endcopy_1003: ; -------------------------------------- ; AND ; -------------------------------------- word_1004: call CompileCallFollowing ld a,h and d ld h,a ld a,l and e ld l,a ret ; -------------------------------------- ; OR ; -------------------------------------- word_1005: call CompileCallFollowing ld a,h or d ld h,a ld a,l or e ld l,a ret ; -------------------------------------- ; XOR ; -------------------------------------- word_1006: call CompileCallFollowing ld a,h xor d ld h,a ld a,l xor e ld l,a ret ; -------------------------------------- ; / ; -------------------------------------- word_1007: call CompileCallFollowing push de call DIVDivideMod16 ex de,hl pop de ret ; -------------------------------------- ; MOD ; -------------------------------------- word_1008: call CompileCallFollowing push de call DIVDivideMod16 pop de ret ; -------------------------------------- ; ! ; -------------------------------------- word_1009: call CopyFollowing .db endcopy_1009 - $ - 1 ld (hl),e inc hl ld (hl),d dec hl endcopy_1009: ; -------------------------------------- ; @ ; -------------------------------------- word_1010: call CopyFollowing .db endcopy_1010 - $ - 1 ld a,(hl) inc hl ld h,(hl) ld l,a endcopy_1010: ; -------------------------------------- ; +! ; -------------------------------------- word_1011: call CompileCallFollowing ld a,(hl) add a,e ld (hl),a inc hl ld a,(hl) adc a,d ld (hl),a dec hl ret ; -------------------------------------- ; C! ; -------------------------------------- word_1012: call CopyFollowing .db endcopy_1012 - $ - 1 ld (hl),e endcopy_1012: ; -------------------------------------- ; C@ ; -------------------------------------- word_1013: call CopyFollowing .db endcopy_1013 - $ - 1 ld l,(hl) ld h,0 endcopy_1013: ; -------------------------------------- ; P@ ; -------------------------------------- word_1014: call CompileCallFollowing push bc ld b,h ld c,l in l,(c) ld h,0 pop bc ret ; -------------------------------------- ; P! ; -------------------------------------- word_1015: call CompileCallFollowing push bc push hl ld a,e ld b,h ld c,l out (c),a pop hl pop bc ret ; -------------------------------------- ; , ; -------------------------------------- word_1016: call CompileCallFollowing jp CompileWord ; -------------------------------------- ; ; ; -------------------------------------- word_1017: ld a,$C9 ; compile a RET call CompileByte ; TODO: Check close to $E000, so we can skip the ROM header. ret ; -------------------------------------- ; C, ; -------------------------------------- word_1018: call CompileCallFollowing ld a,l jp CompileByte ; -------------------------------------- ; COPY ; -------------------------------------- word_1019: call CompileCallFollowing ld a,b ; exit if C = 0 or c ret z push bc ; BC count push de ; DE target push hl ; HL source xor a ; Clear C sbc hl,de ; check overlap ? jr nc,__copy_gt_count ; if source after target add hl,de ; undo subtract add hl,bc ; add count to HL + DE ex de,hl add hl,bc ex de,hl dec de ; dec them, so now at the last byte to copy dec hl lddr ; do it backwards jr __copy_exit __copy_gt_count: add hl,de ; undo subtract ldir ; do the copy __copy_exit: pop hl ; restore registers pop de pop bc ret ; -------------------------------------- ; FILL ; -------------------------------------- word_1020: call CompileCallFollowing ld a,b ; exit if C = 0 or c ret z push bc ; BC count push de ; DE target, L byte __fill_loop: ld a,l ; copy a byte ld (de),a inc de ; bump pointer dec bc ; dec counter and loop ld a,b or c jr nz,__fill_loop pop de ; restore pop bc ret ; -------------------------------------- ; HALT ; -------------------------------------- word_1021: call CompileCallFollowing __halt_loop: di halt jr __halt_loop ; -------------------------------------- ; BREAK ; -------------------------------------- word_1022: call CopyFollowing .db endcopy_1022 - $ - 1 db $76 endcopy_1022: ; -------------------------------------- ; * ; -------------------------------------- word_1023: call CompileCallFollowing jp MULTMultiply16 ; -------------------------------------- ; SWAP ; -------------------------------------- word_1024: call CopyFollowing .db endcopy_1024 - $ - 1 ex de,hl endcopy_1024: ; -------------------------------------- ; A>B ; -------------------------------------- word_1025: call CopyFollowing .db endcopy_1025 - $ - 1 ld d,h ld e,l endcopy_1025: ; -------------------------------------- ; A>C ; -------------------------------------- word_1026: call CopyFollowing .db endcopy_1026 - $ - 1 ld b,h ld c,l endcopy_1026: ; -------------------------------------- ; B>A ; -------------------------------------- word_1027: call CopyFollowing .db endcopy_1027 - $ - 1 ld h,d ld l,e endcopy_1027: ; -------------------------------------- ; B>C ; -------------------------------------- word_1028: call CopyFollowing .db endcopy_1028 - $ - 1 ld b,d ld c,e endcopy_1028: ; -------------------------------------- ; C>A ; -------------------------------------- word_1029: call CopyFollowing .db endcopy_1029 - $ - 1 ld h,b ld l,c endcopy_1029: ; -------------------------------------- ; C>B ; -------------------------------------- word_1030: call CopyFollowing .db endcopy_1030 - $ - 1 ld d,b ld e,c endcopy_1030: ; -------------------------------------- ; PUSH ; -------------------------------------- word_1031: call CopyFollowing .db endcopy_1031 - $ - 1 push hl endcopy_1031: ; -------------------------------------- ; POP ; -------------------------------------- word_1032: call CopyFollowing .db endcopy_1032 - $ - 1 ex de,hl pop hl endcopy_1032: ; -------------------------------------- ; A>R ; -------------------------------------- word_1033: call CopyFollowing .db endcopy_1033 - $ - 1 push hl endcopy_1033: ; -------------------------------------- ; R>A ; -------------------------------------- word_1034: call CopyFollowing .db endcopy_1034 - $ - 1 pop hl endcopy_1034: ; -------------------------------------- ; B>R ; -------------------------------------- word_1035: call CopyFollowing .db endcopy_1035 - $ - 1 push de endcopy_1035: ; -------------------------------------- ; R>B ; -------------------------------------- word_1036: call CopyFollowing .db endcopy_1036 - $ - 1 pop de endcopy_1036: ; -------------------------------------- ; C>R ; -------------------------------------- word_1037: call CopyFollowing .db endcopy_1037 - $ - 1 push bc endcopy_1037: ; -------------------------------------- ; R>C ; -------------------------------------- word_1038: call CopyFollowing .db endcopy_1038 - $ - 1 pop bc endcopy_1038: ; -------------------------------------- ; AB>R ; -------------------------------------- word_1039: call CopyFollowing .db endcopy_1039 - $ - 1 push de push hl endcopy_1039: ; -------------------------------------- ; R>AB ; -------------------------------------- word_1040: call CopyFollowing .db endcopy_1040 - $ - 1 pop hl pop de endcopy_1040: ; -------------------------------------- ; ABC>R ; -------------------------------------- word_1041: call CopyFollowing .db endcopy_1041 - $ - 1 push bc push de push hl endcopy_1041: ; -------------------------------------- ; R>ABC ; -------------------------------------- word_1042: call CopyFollowing .db endcopy_1042 - $ - 1 pop hl pop de pop bc endcopy_1042: ; -------------------------------------- ; H ; -------------------------------------- word_1043: call CopyFollowing .db endcopy_1043 - $ - 1 ex de,hl ld hl,CodeNextFree endcopy_1043: ; -------------------------------------- ; $SYSTEM ; -------------------------------------- word_1044: call CopyFollowing .db endcopy_1044 - $ - 1 ex de,hl ld hl,InformationBlock endcopy_1044: ; -------------------------------------- ; $DICTIONARY ; -------------------------------------- word_1045: call CopyFollowing .db endcopy_1045 - $ - 1 ex de,hl ld hl,(DictionaryBase) endcopy_1045: ; -------------------------------------- ; WARM.START ; -------------------------------------- word_1046: call CompileCallFollowing jp WarmStart ; -------------------------------------- ; REPORT.ERROR ; -------------------------------------- word_1047: call CompileCallFollowing jp Interface ; -------------------------------------- ; $COMPILER ; -------------------------------------- word_1048: call CompileCallFollowing jp CompileStream ; -------------------------------------- ; CONSTANT ; -------------------------------------- word_1049: ld hl,(CodeNextFree) ; fix up definition to remove call address. dec hl dec hl ld (CodeNextFree),hl ; keeping the CALL opcode. ; ld hl,ConstantHandler ; make it CALL ConstantHandler call CompileWord ld hl,(RegA) ; and put the word in after. call CompileWord ret ; -------------------------------------- ; VARIABLE ; -------------------------------------- word_1050: ld hl,(CodeNextFree) ; fix up definition to remove call address. dec hl dec hl ld (CodeNextFree),hl ; keeping the CALL opcode. ; ld hl,VariableHandler ; make it CALL VariableHandler call CompileWord ld hl,$0000 ; initialise to zero. call CompileWord ret ; -------------------------------------- ; DATA ; -------------------------------------- word_1051: ld hl,(CodeNextFree) ; fix up definition to remove call address. dec hl dec hl ld (CodeNextFree),hl ; keeping the CALL opcode. ; ld hl,VariableHandler ; make it CALL VariableHandler call CompileWord ret ; -------------------------------------- ; ARRAY ; -------------------------------------- word_1052: ld hl,(CodeNextFree) ; fix up definition to remove call address. dec hl dec hl ld (CodeNextFree),hl ; keeping the CALL opcode. ; ld hl,VariableHandler ; make it CALL VariableHandler call CompileWord ld hl,(RegA) ; initialise to zero. _MakeArray: ld a,h or l ret z dec hl xor a call CompileByte jr _MakeArray ret ; -------------------------------------- ; ADDRESS.OF ; -------------------------------------- word_1053: push de push hl ld hl,(CodeNextFree) ; get previous code address dec hl ld d,(hl) dec hl ld e,(hl) dec hl ld (CodeNextFree),hl ; we've removed the word, address is in DE ex de,hl call CompileLoadConstant pop hl pop de ret ; -------------------------------------- ; !! ; -------------------------------------- word_1054: ld hl,(CodeNextFree) ; we save one byte. dec hl ld (CodeNextFree),hl ; ld b,(hl) dec hl ld c,(hl) ld (hl),b dec hl ld (hl),c dec hl ld (hl),$22 ret ; -------------------------------------- ; @@ ; -------------------------------------- word_1055: ld hl,(CodeNextFree) ; we save one byte. ; dec hl dec hl dec hl ld (hl),$2A ret ; -------------------------------------- ; --- ; -------------------------------------- word_1056: call CopyFollowing .db endcopy_1056 - $ - 1 dec hl dec hl endcopy_1056: ; -------------------------------------- ; -- ; -------------------------------------- word_1057: call CopyFollowing .db endcopy_1057 - $ - 1 dec hl endcopy_1057: ; -------------------------------------- ; ++ ; -------------------------------------- word_1058: call CopyFollowing .db endcopy_1058 - $ - 1 inc hl endcopy_1058: ; -------------------------------------- ; +++ ; -------------------------------------- word_1059: call CopyFollowing .db endcopy_1059 - $ - 1 inc hl inc hl endcopy_1059: ; -------------------------------------- ; 0- ; -------------------------------------- word_1060: call CompileCallFollowing __negate: ld a,h cpl ld h,a ld a,l cpl ld l,a inc hl ret ; -------------------------------------- ; 0< ; -------------------------------------- word_1061: call CompileCallFollowing bit 7,h ld hl,$0000 ret z dec hl ret ; -------------------------------------- ; 0= ; -------------------------------------- word_1062: call CompileCallFollowing ld a,h or l ld hl,$0000 ret nz dec hl ret ; -------------------------------------- ; 2* ; -------------------------------------- word_1063: call CopyFollowing .db endcopy_1063 - $ - 1 add hl,hl endcopy_1063: ; -------------------------------------- ; 4* ; -------------------------------------- word_1064: call CopyFollowing .db endcopy_1064 - $ - 1 add hl,hl add hl,hl endcopy_1064: ; -------------------------------------- ; 8* ; -------------------------------------- word_1065: call CopyFollowing .db endcopy_1065 - $ - 1 add hl,hl add hl,hl add hl,hl endcopy_1065: ; -------------------------------------- ; 16* ; -------------------------------------- word_1066: call CopyFollowing .db endcopy_1066 - $ - 1 add hl,hl add hl,hl add hl,hl add hl,hl endcopy_1066: ; -------------------------------------- ; 2/ ; -------------------------------------- word_1067: call CopyFollowing .db endcopy_1067 - $ - 1 sra h rr l endcopy_1067: ; -------------------------------------- ; 4/ ; -------------------------------------- word_1068: call CopyFollowing .db endcopy_1068 - $ - 1 sra h rr l sra h rr l endcopy_1068: ; -------------------------------------- ; ABS ; -------------------------------------- word_1069: call CompileCallFollowing bit 7,h ret z jp __negate ; -------------------------------------- ; BSWAP ; -------------------------------------- word_1070: call CopyFollowing .db endcopy_1070 - $ - 1 ld a,l ld l,h ld h,a endcopy_1070: ; -------------------------------------- ; NOT ; -------------------------------------- word_1071: call CompileCallFollowing ld a,h cpl ld h,a ld a,l cpl ld l,a ret ; -------------------------------------- ; STRLEN ; -------------------------------------- word_1072: call CompileCallFollowing push de ex de,hl ld hl,0 _SLNLoop: ld a,(de) or a jr z,_SLNExit inc de inc hl jr _SLNLoop _SLNExit: pop de ret ; -------------------------------------- ; RANDOM ; -------------------------------------- word_1073: call CompileCallFollowing ex de,hl push bc ld hl,(seed1) ld b,h ld c,l add hl,hl add hl,hl inc l add hl,bc ld (seed1),hl ld hl,(seed2) add hl,hl sbc a,a and %00101101 xor l ld l,a ld (seed2),hl add hl,bc pop bc ret ; -------------------------------------- ; IM.DRAW ; -------------------------------------- word_1074: call CompileCallFollowing push bc push de push hl ld h,e ld l,l ld e,c ld d,b ld bc,$0000 call ImageDraw pop hl pop de pop bc ret ; -------------------------------------- ; IM.COLOUR ; -------------------------------------- word_1075: call CompileCallFollowing ld a,l ld (imageDefaultColour),a ret ; -------------------------------------- ; SG.DRAW ; -------------------------------------- word_1076: call CompileCallFollowing push bc push de push hl ld c,(hl) ; count in BC inc hl ld b,(hl) inc hl _SGDLoop: call CopySpriteData call DrawOneSprite inc hl inc hl dec bc ld a,b or c jr nz,_SGDLoop pop hl pop de pop bc ret ; -------------------------------------- ; SG.ERASE ; -------------------------------------- word_1077: call CompileCallFollowing push bc push de push hl ld a,(imageDefaultColour) push af ; save sprite default colour xor a ; zero it, just in case we are restoring $00. ld (imageDefaultColour),a ld c,(hl) ; count in BC inc hl ld b,(hl) dec hl add hl,bc ; advance to last. add hl,bc _SEDLoop: call EraseOneSprite dec hl dec hl dec bc ld a,b or c jr nz,_SEDLoop pop af ; restore default colour ld (imageDefaultColour),a pop hl pop de pop bc ret DIVDivideMod16: push bc ld b,d ; DE ld c,e ex de,hl ld hl,0 ld a,b ld b,8 Div16_Loop1: rla adc hl,hl sbc hl,de jr nc,Div16_NoAdd1 add hl,de Div16_NoAdd1: djnz Div16_Loop1 rla cpl ld b,a ld a,c ld c,b ld b,8 Div16_Loop2: rla adc hl,hl sbc hl,de jr nc,Div16_NoAdd2 add hl,de Div16_NoAdd2: djnz Div16_Loop2 rla cpl ld d,c ld e,a pop bc ret MULTMultiply16: push bc push de ld b,h ; get multipliers in DE/BC ld c,l ld hl,0 ; zero total __Core__Mult_Loop: bit 0,c ; lsb of shifter is non-zero jr z,__Core__Mult_Shift add hl,de ; add adder to total __Core__Mult_Shift: srl b ; shift BC right. rr c ex de,hl ; shift DE left add hl,hl ex de,hl ld a,b ; loop back if BC is nonzero or c jr nz,__Core__Mult_Loop pop de pop bc ret ConstantHandler: ld a,0xEB ; compile ex de,hl call CompileByte ld a,0x21 ; compile ld hl, call CompileByte pop hl ; address of word to compile ld a,(hl) inc hl ld h,(hl) ld l,a call CompileWord ; compile that word. ret VariableHandler: ld a,0xEB ; compile ex de,hl call CompileByte ld a,0x21 ; compile ld hl, call CompileByte pop hl ; address of word to compile call CompileWord ; compile that word. ret FixAccessCodeWrite: ld a,0x2A ; LD HL,(xxxx) jr nc,_FACIsRead ; use Carry to decide what to update ld a,0x22 _FACIsRead: ; ld hl,(CodeNextFree) ; we save one byte. dec hl ld (CodeNextFree),hl ; ld b,(hl) dec hl ld c,(hl) ld (hl),b dec hl ld (hl),c dec hl ld (hl),a ret ImageDraw: ld a,l ; check in range 0..39 0..23 cp 24 ret nc ld a,h cp 40 ret nc call IDCalculatePos ; calculate position on screen -> HL ld a,(de) ; get X,Y size into A inc de ; advance into graphic data ld (bc),a ; write size out to save, so it's a graphic inc bc ; in its own right. ; ; Draw one line A is size, HL screen pos, DE gfx data, BC store. ; _IDOuter: push af ; save height counter. push hl ; save screen position, start of line and $0F ; make A a horizontal counter, e.g. 0..15 jr z,_IDDoneBoth ; width zero, nothing to do. _IDInner: ; ; Save/Copy one byte, go through this twice, once for colour RAM $3000-$33FF and once ; for char RAM $3400-$37FF ; push af ; save A ld a,(hl) ; get and save old value ld (bc),a inc bc ld a,(de) ; copy out new value or a ; zero ? jr nz,_IDNotDefault ; can't be default bit 2,h ; in char RAM, can't be default jr z,_IDNotDefault ld a,(imageDefaultColour) ; load default colour _IDNotDefault: ld (hl),a inc de pop af ; restore A bit 2,h ; are we in $34xx e.g. have just written to colour RAM jr nz,_IDDoneBoth ; if so we've done both. set 2,h ; otherwise do the colour RAM copy jr _IDInner ; ; Done one character, now advance one right. ; _IDDoneBoth: res 2,h ; back to character RAM. inc hl ; next character to the right dec a ; done the lot jr nz,_IDInner ; no, go back. pop hl ; restore start of line ld a,l ; go down one line add a,40 ld l,a jr nc,_IDNoCarry inc h _IDNoCarry: pop af ; restore line counter sub a,$10 ; decrement the upper nibble of the counter cp a,$10 ; until upper nibble is $00 jr nc,_IDOuter ret IDCalculatePos: push de ld a,h ; save X in A ld h,0 ; HL = Y add hl,hl ; HL = Y x 8 add hl,hl add hl,hl ld e,l ; DE = Y x 8 ld d,h add hl,hl ; HL = Y x 32 add hl,hl add hl,de ; HL = Y x 40 ld e,a ; DE = X ld d,0 add hl,de ; HL = X + Y x 40 ld de,$3028 ; now a screen position add hl,de pop de ret CopySpriteData: push bc push de push hl ld a,(hl) ; point to sprite in HL and DE inc hl ld h,(hl) ld l,a ld e,l ld d,h ld bc,6 ; HL points to the values, DE to the update values. add hl,bc ex de,hl ; HL is the update values, DE the target values. ld b,3 ; update potentially three values _CSDLoop: ld a,(hl) ; check HL points to $FFFF inc hl and (hl) inc a ; zero if was $FF jr z,_CSDNext dec hl ; HL/DE are first byte ld a,(hl) ld (de),a ld (hl),$FF inc de ; second byte inc hl ld a,(hl) ld (de),a ld (hl),$FF dec de ; fix so both increments +2 _CSDNext: inc de inc de inc hl djnz _CSDLoop pop hl pop de pop bc ret DrawOneSprite: push bc push de push hl ld a,(hl) ; point to sprite in HL and BC inc hl ld h,(hl) ld l,a ld bc,12 ; point to storage space HL add hl,bc ld b,h ; storage space in BC. ld c,l dec hl ; graphic address in DE. ld d,(hl) dec hl ld e,(hl) ld a,d ; if $FFFF do and e inc a jr z,_DOSExit dec hl ; Y in A dec hl ld a,(hl) dec hl ; X in L dec hl ld h,(hl) ld l,a ; HL = (X,Y) call ImageDraw ; draw the image copying the background _DOSExit: pop hl pop de pop bc ret EraseOneSprite: push bc push de push hl ld a,(hl) ; point to sprite in HL and DE inc hl ld h,(hl) ld l,a ld bc,12 ; point to storage space. add hl,bc ld d,h ; storage space in DE, drawing fom here ld e,l ld bc,$0000 ; copy data to ROM. dec hl ; if graphic is $FFFF do nothing. ld a,(hl) dec hl and (hl) inc a jr z,_EOSExit dec hl ; Y in A dec hl ld a,(hl) dec hl ; X in L dec hl ld h,(hl) ld l,a ; HL = (X,Y) call ImageDraw ; draw the image copying the background _EOSExit: pop hl pop de pop bc ret
endterm_mysolution/grade3.adb
jamalakhaligova/ADA
0
16525
with Ada.Text_IO,Ada.Calendar, Ada.Numerics.Discrete_Random; use Ada.Text_IO; procedure Grade3 is type Barr is array (Natural range <>,Natural range <>) of Boolean; protected Organism is entry Move(X,Y : Natural; is_infected : out Boolean); function inArea(x,y:Natural) return Boolean; procedure Init; private X, Y : Natural; is_infected : Boolean; a : Barr(2..10,2..10); end Organism; task type Virus(varx,vary: Natural; dx,dy: Integer); task body Virus is act_x,act_y : Natural; dis_x,dis_y : Integer; got_virus : Boolean := False; procedure spread(varx,vary : Natural; dx,dy : Integer) is begin loop act_x := act_x + dis_x; act_y := act_y + dis_y; exit when Organism.inArea(act_x,act_y); end loop; end spread; begin act_x := varx; act_y := vary; dis_x := dx; dis_y := dy; while not got_virus loop Organism.Move(act_x,act_y,got_virus); spread(act_x,act_y,dis_x,dis_y); delay 2.0; end loop; end Virus; protected body Organism is entry Move(X,Y : Natural;is_infected : out Boolean) when True is begin if(a(X,Y)=True) then is_infected := True; Put_Line("virus is infected at "& X'Image &","& Y'Image); else Put_Line("virus is at "& X'Image &","& Y'Image); end if; end Move; procedure Init is cnt : Natural := 0; begin for i in 2..10 loop for j in 2..10 loop if (i=j)then a(i,j) := True; elsif (i mod j =0) then a(i,j) := True; else a(i,j) := False; end if; end loop; end loop; end Init; function inArea(x,y : Natural) return Boolean is begin if (x>=2 and then x<=10 and then y>=2 and then y<=10) then return True; else return False; end if; end inArea; end Organism; type Virusptr is access Virus; f,t,s : Virusptr; begin Organism.Init; f := new Virus(2,7,1,0); t := new Virus(2,3,1,1); s := new Virus(10,2,-1,1); end Grade3;
Library/Math/Float/floatConvert.asm
steakknife/pcgeos
504
245054
<reponame>steakknife/pcgeos<filename>Library/Math/Float/floatConvert.asm COMMENT @----------------------------------------------------------------------- Copyright (c) Geoworks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: floatConvert.asm AUTHOR: Cheng, 1/91 ROUTINES: Name Description ---- ----------- FloatAsciiToFloat - Global FloatAsciiToInteger FloatAsciiToFraction NextDigit ConvertDigit NextNonSpaceChar NextChar UngetChar REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial revision witt 10/93 DBCS-ized character getting and putting. DESCRIPTION: $Id: floatConvert.asm,v 1.1 97/04/05 01:22:57 newdeal Exp $ -------------------------------------------------------------------------------@ COMMENT @----------------------------------------------------------------------- FUNCTION: FloatAsciiToFloat (originally STRM->FP#) DESCRIPTION: Given a parsed string, convert it into a floating point number. CALLED BY: GLOBAL () PASS: al - FloatAsciiToFloatFlags FAF_PUSH_RESULT - place result onto the fp stack FAF_STORE_NUMBER - store result into the location given by es:di cx - number of characters in the string that the routine should concern itself with ds:si - string in this format: "[+-] dddd.dddd [Ee] [+-] dddd" Notes: ------ * The string is assumed to be legal because duplicating the error checking that is done in the parser seems unnecessary. * There can be at most a single decimal point. * Spaces and thousands seperators are ignored. RETURN: carry clear if successful carry set if error DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: convert pre-exponent portion into a float keep track of the number of digits after the decimal convert the exponent modify the exponent based on the number of digits after the decimal incorporate the exponent into the float store the result KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ FAF_stackFrame struct resultFlag FloatAsciiToFloatFlags ; how the resulting number should be stored sourceAddr fptr.char ; address of string resultAddr fptr.char ; result to be placed here if so specified numChars byte ; number of characters in the string numCharsRead byte ; number of characters processed negNum byte ; boolean - number is negative negExp byte ; boolean - number has a negative exponent SBCS< thousandsSep char ; char - the thousands seperator > DBCS< thousandsSep wchar ; wchar - the thousands seperator > SBCS< decimalSep char ; char - the decimal seperator > DBCS< decimalSep wchar ; wchar - the decimal seperator > errorFlag byte ; boolean - error encountered errorType word ; unused right now FAF_stackFrame ends COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FloatAsciiToFloatInternal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: internal call to FloatAsciiToFloat CALLED BY: GLOBAL see header directly above for details exported for coprocessor libriaries REVISION HISTORY: Name Date Description ---- ---- ----------- jimmy 10/29/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ global FloatAsciiToFloatInternal:far FloatAsciiToFloatInternal proc far call FloatAsciiToFloat ret FloatAsciiToFloatInternal endp FloatAsciiToFloat proc far uses ax,bx,cx,dx,ds,di,si FAF_local local FAF_stackFrame .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the passed float point string is valid ; EC < push bx > EC < mov bx, ds EC < call ECAssertValidFarPointerXIP > EC < pop bx > endif EC< push ax > EC< test al, not (mask FAF_PUSH_RESULT or mask FAF_STORE_NUMBER) > EC< ERROR_NZ FLOAT_BAD_FLAGS > EC< test al, mask FAF_PUSH_RESULT > EC< je ok > EC< test al, mask FAF_STORE_NUMBER > EC< ERROR_NZ FLOAT_BAD_FLAGS > EC< ok: > EC< pop ax > ;----------------------------------------------------------------------- ; initialize vars and such mov FAF_local.resultFlag, al mov FAF_local.numChars, cl mov FAF_local.sourceAddr.offset, si mov FAF_local.sourceAddr.segment, ds mov FAF_local.resultAddr.offset, di mov FAF_local.resultAddr.segment, es clr ax mov FAF_local.numCharsRead, al mov FAF_local.negNum, al mov FAF_local.negExp, al mov FAF_local.errorFlag, al mov FAF_local.errorType, ax ; ; get local chars ; ; DR_LOCAL_GET_NUMERIC_FORMAT call FloatGetDecimalSeperator SBCS< mov FAF_local.decimalSep, al > DBCS< mov FAF_local.decimalSep, ax > call FloatGetThousandsSeperator SBCS< mov FAF_local.thousandsSep, al > DBCS< mov FAF_local.thousandsSep, ax > ;----------------------------------------------------------------------- ; start conversion call FloatEnter ; ds <- fp stack seg call NextNonSpaceChar ; al <- char LocalCmpChar ax, '+' je convertInt LocalCmpChar ax, '-' je negNumber call UngetChar jmp short convertInt negNumber: dec FAF_local.negNum convertInt: call FloatAsciiToInteger ; al <- non-numeric ASCII char LocalCmpChar ax, FAF_local.decimalSep jne fractionProcessed call FloatAsciiToFraction ; al <- non-numeric ASCII char push ax ; save it call FloatAdd pop ax fractionProcessed: ; ; al = non-numeric ASCII char ; LocalCmpChar ax, 'E' je processExp LocalCmpChar ax, 'e' je processExp LocalIsNull ax je doneConvert ; we're done errorFound: dec FAF_local.errorFlag ; note error jmp short doneConvert ; store what results we have ;----------------------------------------------------------------------- ; deal with exponent here processExp: ; ; check for sign ; call NextDigit ; al <- digit jc processSign ; branch if non-digit call UngetChar jmp short convertExp processSign: LocalCmpChar ax, '+' je convertExp LocalCmpChar ax, '-' jne errorFound dec FAF_local.negExp convertExp: call FloatAsciiToInteger tst al je terminationOK dec FAF_local.errorFlag ; note error found terminationOK: ; ; ( fp: mantissa exponent ) ; call FloatFloatToDword ; dx:ax <- exponent ;----------------------------------------------------------------------- ; limit checks... tst dx js expIsNegative ; branch if negative jne posExpError ; if <>0, out of range for sure cmp ax, DECIMAL_EXPONENT_UPPER_LIMIT jle doneLimitChecks posExpError: mov ax, DECIMAL_EXPONENT_UPPER_LIMIT ; force upper limit jmp short expError expIsNegative: cmp dx, 0ffffh ; out of range if <>0ffffh jne negExpError cmp ax, DECIMAL_EXPONENT_LOWER_LIMIT jge doneLimitChecks ; error if limit exceeded negExpError: mov ax, DECIMAL_EXPONENT_LOWER_LIMIT ; force lower limit expError: dec FAF_local.errorFlag ; note error found doneLimitChecks: ; end limit checks ;----------------------------------------------------------------------- call Float10ToTheX ; push 10^ax onto the fp stack cmp FAF_local.negExp, 0 je posExp call FloatDivide jmp short doneConvert posExp: call FloatMultiply ;----------------------------------------------------------------------- ; we're done doneConvert: ; ; negate if negative number ; cmp FAF_local.negNum, 0 je storeResult call FloatNegate storeResult: ; ; store the result ; mov al, FAF_local.resultFlag test al, mask FAF_PUSH_RESULT jnz done ; result already on stack test al, mask FAF_STORE_NUMBER jz done ; for now... les di, FAF_local.resultAddr call FloatPopNumber done: cmp FAF_local.errorFlag, 0 clc je exit stc exit: call FloatOpDone .leave ret FloatAsciiToFloat endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatAsciiToInteger DESCRIPTION: Converts the ASCII string into an integer. ( fp: -- X) Thousands seperators are ignored. CALLED BY: INTERNAL (FloatAsciiToFloat) PASS: FAF_stackFrame RETURN: al/ax - ASCII character that stopped the conversion cx - number of digits converted stack frame vars updated integer on fp stack DESTROYED: ax,dx REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ FloatAsciiToInteger proc near FAF_local local FAF_stackFrame .enter inherit near call Float0 ; initialize number clr cx ; init count of digits nextDigit: call NextDigit ; al <- digit jc checkDone ; branch if non-digit ; ; process digit ; inc cx ; inc count clr ah push ax ; save digit call FloatMultiply10 ; destroys ax,cx,dx pop ax ; retrieve digit call FloatWordToFloat ; destroys ax,cx,dx,di call FloatAdd jmp short nextDigit checkDone: LocalCmpChar ax, FAF_local.thousandsSep je nextDigit ; ignore .leave ret FloatAsciiToInteger endp COMMENT @----------------------------------------------------------------------- FUNCTION: FloatAsciiToFraction DESCRIPTION: Converts the ASCII decimal string into a fraction. ( fp: -- X) CALLED BY: INTERNAL (FloatAsciiToFloat) PASS: FAF_stackFrame RETURN: al/ax - ASCII character that stopped the conversion cx - number of digits converted stack frame vars updated fraction on fp stack DESTROYED: ax,dx REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ FloatAsciiToFraction proc near uses bx,di .enter call Float0 ; initialize number clr cx ; init count nextDigit: call NextDigit ; al <- digit jc startConversion inc cx ; inc count clr ah push ax ; save digit jmp short nextDigit startConversion: ; cx = num digits found jcxz done mov bx, cx ; save num digits mov di, ax ; save non-numeric ASCII char convLoop: call Float10 call FloatDivide pop ax call FloatWordToFloat call FloatAdd loop convLoop call Float10 call FloatDivide mov cx, bx ; retrieve num digits mov ax, di ; retrieve non-numeric ASCII char done: .leave ret FloatAsciiToFraction endp COMMENT @----------------------------------------------------------------------- FUNCTION: NextDigit DESCRIPTION: Retrieves the next numeric char and converts it into a number if possible. CALLED BY: INTERNAL (FloatAsciiToFloat) PASS: nothing RETURN: carry clear if successful al - number (not ASCII) carry set otherwise DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ NextDigit proc near call NextNonSpaceChar ; al <- ASCII char jc exit call ConvertDigit ; transform char to number exit: ret NextDigit endp COMMENT @----------------------------------------------------------------------- FUNCTION: ConvertDigit DESCRIPTION: Converts an ASCII numeral into a number if possible. CALLED BY: INTERNAL (FloatAsciiToFloat, NextDigit) PASS: al/ax - ASCII/Unicode char RETURN: carry clear if char is numberic 0 <= al <= 9 carry set otherwise DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ ConvertDigit proc near LocalCmpChar ax, '0' ; check bounds jl error LocalCmpChar ax, '9' jg error sub al, '0' ; convert clc ; signal success ret error: stc ; signal failure ret ConvertDigit endp COMMENT @----------------------------------------------------------------------- FUNCTION: NextNonSpaceChar DESCRIPTION: Return the next non-whiespace character from the string. CALLED BY: INTERNAL (FloatAsciiToFloat, NextDigit) PASS: nothing RETURN: C clear if successful al - ASCII char C set if ds:[si] = NULL DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ NextNonSpaceChar proc near space: call NextChar jc exit ; exit with failure if unsuccessful ; get the next character if the current one is a white space char if DBCS_PCGEOS call LocalIsSpace jnz space else LocalCmpChar ax, C_LINEFEED je space LocalCmpChar ax, C_ENTER je space LocalCmpChar ax, C_TAB je space LocalCmpChar ax, C_SPACE je space endif clc ; signal success exit: ret NextNonSpaceChar endp COMMENT @----------------------------------------------------------------------- FUNCTION: NextChar DESCRIPTION: Return the next character from the string. A check is made to see that the string length that was given is not exceeded. The routine returns C set if a null is encountered, or if the length limit is hit. CALLED BY: INTERNAL (NextNonSpaceChar) PASS: stack frame RETURN: al/ax - ds:[si] (SBCS/DBCS) C set if al = NULL si <- si + 1 DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version witt 10/93 DBCS-ized character getting.. -------------------------------------------------------------------------------@ NextChar proc near uses ds,si FAF_local local FAF_stackFrame .enter inherit near mov al, FAF_local.numChars ; num chars in string cmp al, FAF_local.numCharsRead jbe error ; error if all have been processed inc FAF_local.numCharsRead lds si, FAF_local.sourceAddr LocalGetChar ax, dssi LocalNextChar FAF_local.sourceAddr LocalIsNull ax ; null term? jnz done ; branch if not, C = 0 error: clr ax stc ; set C if null term done: .leave ret NextChar endp COMMENT @----------------------------------------------------------------------- FUNCTION: UngetChar DESCRIPTION: CALLED BY: INTERNAL () PASS: al - char to 'unget' RETURN: DESTROYED: REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 1/91 Initial version -------------------------------------------------------------------------------@ UngetChar proc near FAF_local local FAF_stackFrame .enter inherit near ; NOTE! : Changed the code below so that an *INTEGER*, ; not byte, decrement is performed to solve mysterious ; float/parse errors if a numeric string just happened ; to end of a 256-byte boundary. -Don 5/16/00 ;;; LocalPrevChar FAF_local.sourceAddr.offset LocalPrevChar FAF_local.sourceAddr dec FAF_local.numCharsRead .leave ret UngetChar endp
Univalence/Obsolete/FinVec.agda
JacquesCarette/pi-dual
14
11164
{-# OPTIONS --without-K #-} -- This should really be called FinSet. From nlab: -- FinSet is the category of finite sets and all functions between -- them: the full subcategory of Set on finite sets. It is easy (and -- thus common) to make FinSet skeletal; there is one object for each -- natural number n (including n=0), and a morphism from m to n is an -- m-tuple (f0,…,fm−1) of numbers satisfying 0≤fi<n. This amounts to -- identifying n with the set {0,…,n−1}. (Sometimes {1,…,n} is used -- instead.) This is exactly what we do below -- Definition of the Operations on permutations, based on the Vector representation -- There are 2 sets of definitions here: -- 1. pure Vector, in which the contents are arbitrary sets -- 2. specialized to Fin contents. -- Some notes: -- - There are operations (such as sequential composition) which 'lift' more -- awkwardly. -- - To avoid a proliferation of bad names, we use sub-modules -- Cauchy representation Vec (Fin m) n without checks that m=n or -- checks of uniqueness and completeness has a commutative semiring -- structure (modulo a postulate about sym). This is the main building -- block of ConcretePermutation module FinVec where open import Data.Nat using (ℕ; _+_; _*_) open import Data.Vec renaming (map to mapV; _++_ to _++V_; concat to concatV) open import Data.Fin using (Fin; inject+; raise; zero; suc) open import Function using (_∘_; id; _$_) open import Data.Sum using (_⊎_; inj₁; inj₂; [_,_]′) renaming (map to map⊎) open import Data.Product using (_×_; _,′_; proj₁; proj₂) open import Equiv open import TypeEquiv using (swap₊; swap⋆) import TypeEquiv as TE open import FinEquiv using (module Plus; module Times; module PlusTimes) open import Proofs using ( -- VectorLemmas _!!_; concat-map; map-map-map; lookup-map; map-∘ ) import Level open import Algebra open import Algebra.Structures open import Relation.Binary.Core open import Relation.Binary.PropositionalEquality using (subst; sym; trans; cong₂) open import Groupoid ------------------------------------------------------------------------------ -- Pure vector operations -- Does not involve Fin at all. -- Note: not exported! private module V where _⊎v_ : ∀ {m n} {A B : Set} → Vec A m → Vec B n → Vec (A ⊎ B) (m + n) α ⊎v β = tabulate (inj₁ ∘ _!!_ α) ++V tabulate (inj₂ ∘ _!!_ β) swap+ : {m n : ℕ} {A B : Set} → Vec (A ⊎ B) (m + n) → Vec (B ⊎ A) (m + n) swap+ v = tabulate (swap₊ ∘ _!!_ v) _×v_ : ∀ {m n} {A B : Set} → Vec A m → Vec B n → Vec (A × B) (m * n) α ×v β = α >>= (λ b → mapV (_,′_ b) β) 0v : {A : Set} → Vec A 0 0v = [] ------------------------------------------------------------------------------ -- Elementary permutations, Fin version -- Cauchy Representation Vec (Fin m) n without checks of uniqueness -- and completeness -- We need to define (at least) 0, 1, +, *, ∘, swap+, swap* module F where open import Data.Nat.Properties.Simple using (+-right-identity) open import Data.Vec.Properties using (lookup-allFin; tabulate∘lookup; lookup∘tabulate; tabulate-∘; lookup-++-inject+) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; cong; cong₂; subst; module ≡-Reasoning) open ≡-Reasoning open import Equiv using (_∼_) open import Proofs using (congD!; -- FinNatLemmas inject+0≡uniti+; -- FiniteFunctions finext; -- VectorLemmas lookupassoc; map-++-commute; tabulate-split; left!!; right!!; lookup-++-raise; unSplit; tab++[]≡tab∘̂unite+ ) open V -- convenient abbreviations FinVec : ℕ → ℕ → Set FinVec m n = Vec (Fin m) n private fwd : {m n : ℕ} → (Fin m ⊎ Fin n) → Fin (m + n) fwd = proj₁ Plus.fwd-iso bwd : {m n : ℕ} → Fin (m + n) → (Fin m ⊎ Fin n) bwd = Equiv.qinv.g (proj₂ Plus.fwd-iso) bwd∘fwd~id : {m n : ℕ} → bwd {m} {n} ∘ fwd ∼ id bwd∘fwd~id = Equiv.qinv.β (proj₂ Plus.fwd-iso) -- make all the definitions abstract. Note that the type isn't, -- otherwise we could not do anything at all with it! abstract -- principal component of the identity permutation 1C : {n : ℕ} → FinVec n n 1C {n} = allFin n -- corresponds to ⊥ ≃ (⊥ × A) and other impossibilities -- but don't use it, as it is abstract and will confuse external proofs! 0C : FinVec 0 0 0C = 1C {0} -- Sequential composition _∘̂_ : {n₀ n₁ n₂ : ℕ} → Vec (Fin n₁) n₀ → Vec (Fin n₂) n₁ → Vec (Fin n₂) n₀ π₁ ∘̂ π₂ = tabulate (_!!_ π₂ ∘ _!!_ π₁) -- swap the first m elements with the last n elements -- [ v₀ , v₁ , v₂ , ... , vm-1 , vm , vm₊₁ , ... , vm+n-1 ] -- ==> -- [ vm , vm₊₁ , ... , vm+n-1 , v₀ , v₁ , v₂ , ... , vm-1 ] swap+cauchy : (m n : ℕ) → FinVec (n + m) (m + n) swap+cauchy m n = tabulate (Plus.swapper m n) -- Parallel additive composition -- conceptually, what we want is _⊎c'_ : ∀ {m₁ n₁ m₂ n₂} → FinVec m₁ m₂ → FinVec n₁ n₂ → FinVec (m₁ + n₁) (m₂ + n₂) _⊎c'_ α β = mapV fwd (α ⊎v β) -- but the above is tedious to work with. Instead, inline a bit to get _⊎c_ : ∀ {m₁ n₁ m₂ n₂} → FinVec m₁ m₂ → FinVec n₁ n₂ → FinVec (m₁ + n₁) (m₂ + n₂) _⊎c_ {m₁} α β = tabulate (fwd ∘ inj₁ ∘ _!!_ α) ++V tabulate (fwd {m₁} ∘ inj₂ ∘ _!!_ β) -- see ⊎c≡⊎c' lemma below _⊎fv_ : ∀ {m₁ n₁ m₂ n₂} → FinVec m₁ m₂ → FinVec n₁ n₂ → FinVec (m₁ + n₁) (m₂ + n₂) _⊎fv_ {m₁} α β = tabulate (λ j → fwd (map⊎ (_!!_ α) (_!!_ β) (bwd j))) ⊎-equiv : ∀ {m₁ n₁ m₂ n₂} → (α : FinVec m₁ m₂) → (β : FinVec n₁ n₂) → α ⊎c β ≡ α ⊎fv β ⊎-equiv {m₁} {n₁} {m₂} {n₂} α β = let mm s = map⊎ (_!!_ α) (_!!_ β) s in let g = fwd ∘ mm ∘ bwd in begin ( tabulate (λ j → fwd (inj₁ (α !! j))) ++V tabulate (λ j → fwd {m₁} (inj₂ (β !! j))) ≡⟨ refl ⟩ -- map⊎ evaluates on inj₁/inj₂ tabulate (fwd ∘ mm ∘ inj₁) ++V tabulate (fwd ∘ mm ∘ inj₂) ≡⟨ cong₂ _++V_ (finext (λ i → cong (fwd ∘ mm) (sym (bwd∘fwd~id (inj₁ i))))) (finext (λ i → cong (fwd ∘ mm) (sym (bwd∘fwd~id (inj₂ i))))) ⟩ tabulate {m₂} (g ∘ fwd ∘ inj₁) ++V tabulate {n₂} (g ∘ fwd {m₂} ∘ inj₂) ≡⟨ sym (tabulate-split {m₂} {n₂} {f = g}) ⟩ tabulate g ∎) where open ≡-Reasoning -- Tensor multiplicative composition -- Transpositions in α correspond to swapping entire rows -- Transpositions in β correspond to swapping entire columns _×c_ : ∀ {m₁ n₁ m₂ n₂} → FinVec m₁ m₂ → FinVec n₁ n₂ → FinVec (m₁ * n₁) (m₂ * n₂) α ×c β = mapV Times.fwd (α ×v β) -- swap⋆ -- -- This is essentially the classical problem of in-place matrix transpose: -- "http://en.wikipedia.org/wiki/In-place_matrix_transposition" -- Given m and n, the desired permutation in Cauchy representation is: -- P(i) = m*n-1 if i=m*n-1 -- = m*i mod m*n-1 otherwise -- transposeIndex : {m n : ℕ} → Fin m × Fin n → Fin (n * m) -- transposeIndex = Times.fwd ∘ swap -- inject≤ (fromℕ (toℕ d * m + toℕ b)) (i*n+k≤m*n d b) swap⋆cauchy : (m n : ℕ) → FinVec (n * m) (m * n) swap⋆cauchy m n = tabulate (Times.swapper m n) -- mapV transposeIndex (V.tcomp 1C 1C) ------------------------------------------------------------------------------------------- -- Things which are the foundations of other permutations, but coming -- from properties, rather than being operators unite+ : {m : ℕ} → FinVec m (0 + m) unite+ {m} = tabulate (proj₁ (Plus.unite+ {m})) uniti+ : {m : ℕ} → FinVec (0 + m) m uniti+ {m} = tabulate (proj₁ (Plus.uniti+ {m})) unite+r : {m : ℕ} → FinVec m (m + 0) unite+r {m} = tabulate (proj₁ (Plus.unite+r {m})) uniti+r : {m : ℕ} → FinVec (m + 0) m uniti+r {m} = tabulate (proj₁ (Plus.uniti+r {m})) assocl+ : {m n o : ℕ} → FinVec ((m + n) + o) (m + (n + o)) assocl+ {m} {n} {o} = tabulate (proj₁ (Plus.assocl+ {m} {n} {o})) assocr+ : {m n o : ℕ} → FinVec (m + (n + o)) (m + n + o) assocr+ {m} {n} {o} = tabulate (proj₁ (Plus.assocr+ {m} {n} {o})) unite* : {m : ℕ} → FinVec m (1 * m) unite* {m} = tabulate (proj₁ (Times.unite* {m})) uniti* : {m : ℕ} → FinVec (1 * m) m uniti* {m} = tabulate (proj₁ (Times.uniti* {m})) unite*r : {m : ℕ} → FinVec m (m * 1) unite*r {m} = tabulate (proj₁ (Times.unite*r {m})) uniti*r : {m : ℕ} → FinVec (m * 1) m uniti*r {m} = tabulate (proj₁ (Times.uniti*r {m})) assocl* : {m n o : ℕ} → FinVec ((m * n) * o) (m * (n * o)) assocl* {m} {n} {o} = tabulate (proj₁ (Times.assocl* {m} {n} {o})) assocr* : {m n o : ℕ} → FinVec (m * (n * o)) (m * n * o) assocr* {m} {n} {o} = tabulate (proj₁ (Times.assocr* {m} {n} {o})) dist*+ : ∀ {m n o} → FinVec (m * o + n * o) ((m + n) * o) dist*+ {m} {n} {o} = tabulate (proj₁ (PlusTimes.dist {m} {n} {o})) factor*+ : ∀ {m n o} → FinVec ((m + n) * o) (m * o + n * o) factor*+ {m} {n} {o} = tabulate (proj₁ (PlusTimes.factor {m} {n} {o})) distl*+ : ∀ {m n o} → FinVec (m * n + m * o) (m * (n + o)) distl*+ {m} {n} {o} = tabulate (proj₁ (PlusTimes.distl {m} {n} {o})) factorl*+ : ∀ {m n o} → FinVec (m * (n + o)) (m * n + m * o) factorl*+ {m} {n} {o} = tabulate (proj₁ (PlusTimes.factorl {m} {n} {o})) right-zero*l : ∀ {m} → FinVec 0 (m * 0) right-zero*l {m} = tabulate (proj₁ (Times.distzr {m})) right-zero*r : ∀ {m} → FinVec (m * 0) 0 right-zero*r {m} = tabulate (proj₁ (Times.factorzr {m})) ------------------------------------------------------------------------------------------- -- Below here, we start with properties -- Useful stuff infix 4 _∼p_ _∼p_ : {n m : ℕ} (p₁ p₂ : Vec (Fin m) n) → Set _∼p_ {n} p₁ p₂ = (i : Fin n) → p₁ !! i ≡ p₂ !! i ∼p⇒≡ : {n : ℕ} {p₁ p₂ : Vec (Fin n) n} → (p₁ ∼p p₂) → p₁ ≡ p₂ ∼p⇒≡ {n} {p₁} {p₂} eqv = begin ( p₁ ≡⟨ sym (tabulate∘lookup p₁) ⟩ tabulate (_!!_ p₁) ≡⟨ finext eqv ⟩ tabulate (_!!_ p₂) ≡⟨ tabulate∘lookup p₂ ⟩ p₂ ∎) where open ≡-Reasoning -- note the flip! ∘̂⇒∘ : {m n o : ℕ} → (f : Fin m → Fin n) → (g : Fin n → Fin o) → tabulate f ∘̂ tabulate g ∼p tabulate (g ∘ f) ∘̂⇒∘ f g i = begin ( (tabulate f ∘̂ tabulate g) !! i ≡⟨ lookup∘tabulate _ i ⟩ (tabulate g) !! (tabulate f !! i) ≡⟨ lookup∘tabulate _ (tabulate f !! i) ⟩ g (tabulate f !! i) ≡⟨ cong g (lookup∘tabulate f i) ⟩ g (f i) ≡⟨ sym (lookup∘tabulate (g ∘ f) i) ⟩ tabulate (g ∘ f) !! i ∎) where open ≡-Reasoning -- this is just tabulate∘lookup, but it hides the details; should this be -- called 'join' or 'flatten' ? cauchyext : {m n : ℕ} (π : FinVec m n) → tabulate (_!!_ π) ≡ π cauchyext π = tabulate∘lookup π -- we could go through ~p, but this works better in practice ~⇒≡ : {m n : ℕ} {f : Fin m → Fin n} {g : Fin n → Fin m} → (f ∘ g ∼ id) → (tabulate g ∘̂ tabulate f ≡ 1C) ~⇒≡ {f = f} {g} β = ∼p⇒≡ (λ i → trans (∘̂⇒∘ g f i) (cong (λ x → x !! i) (finext β))) -- make a permutation from something lower level, directly -- ~⇒≡ {m} {n = m} {o = m} (p∘!p≡id {p = Plus.unite+ {m}}) -- properties of sequential composition ∘̂-assoc : {m₁ m₂ m₃ m₄ : ℕ} → (a : Vec (Fin m₂) m₁) (b : Vec (Fin m₃) m₂) (c : Vec (Fin m₄) m₃) → a ∘̂ (b ∘̂ c) ≡ (a ∘̂ b) ∘̂ c ∘̂-assoc a b c = finext (lookupassoc a b c) ∘̂-rid : {m n : ℕ} → (π : Vec (Fin m) n) → π ∘̂ 1C ≡ π ∘̂-rid π = trans (finext (λ i → lookup-allFin (π !! i))) (cauchyext π) ∘̂-lid : {m n : ℕ} → (π : Vec (Fin m) n) → 1C ∘̂ π ≡ π ∘̂-lid π = trans (finext (λ i → cong (_!!_ π) (lookup-allFin i))) (cauchyext π) !!⇒∘̂ : {n₁ n₂ n₃ : ℕ} → (π₁ : Vec (Fin n₁) n₂) → (π₂ : Vec (Fin n₂) n₃) → (i : Fin n₃) → π₁ !! (π₂ !! i) ≡ (π₂ ∘̂ π₁) !! i !!⇒∘̂ π₁ π₂ i = begin ( π₁ !! (π₂ !! i) ≡⟨ sym (lookup∘tabulate (λ j → (π₁ !! (π₂ !! j))) i) ⟩ tabulate (λ i → π₁ !! (π₂ !! i)) !! i ≡⟨ refl ⟩ (π₂ ∘̂ π₁) !! i ∎) where open ≡-Reasoning -- properties of sequential composition 0C∘̂0C≡0C : 1C {0} ∘̂ 1C {0} ≡ 1C {0} 0C∘̂0C≡0C = refl -- properties of parallel composition -- trivial ones first 1C₀⊎x≡x : ∀ {m n} {x : FinVec m n} → 1C {0} ⊎c x ≡ x 1C₀⊎x≡x {x = x} = cauchyext x unite+∘[0⊎x]≡x∘unite+ : ∀ {m n} {x : FinVec m n} → unite+ ∘̂ (1C {0} ⊎c x) ≡ x ∘̂ unite+ unite+∘[0⊎x]≡x∘unite+ {m} {n} {x} = finext pf where pf : (i : Fin n) → (0C ⊎c x) !! (unite+ !! i) ≡ unite+ !! (x !! i) pf i = begin ( tabulate (λ y → x !! y) !! (tabulate id !! i) ≡⟨ cong (λ j → tabulate (λ y → x !! y) !! j) (lookup∘tabulate id i) ⟩ tabulate (λ y → x !! y) !! i ≡⟨ lookup∘tabulate (_!!_ x) i ⟩ x !! i ≡⟨ sym (lookup∘tabulate id (x !! i)) ⟩ tabulate id !! (x !! i) ∎) uniti+∘x≡[0⊎x]∘uniti+ : ∀ {m n} {x : FinVec m n} → uniti+ ∘̂ x ≡ (1C {0} ⊎c x) ∘̂ uniti+ uniti+∘x≡[0⊎x]∘uniti+ {m} {n} {x} = finext pf where pf : (i : Fin n) → x !! (uniti+ !! i) ≡ uniti+ !! ((0C ⊎c x) !! i) pf i = begin ( x !! (tabulate id !! i) ≡⟨ cong (_!!_ x) (lookup∘tabulate id i) ⟩ x !! i ≡⟨ sym (lookup∘tabulate (λ y → x !! y) i) ⟩ tabulate (λ y → x !! y) !! i ≡⟨ sym (lookup∘tabulate id _) ⟩ tabulate id !! (tabulate (λ y → x !! y) !! i) ∎) {- x⊎1C₀≡x : ∀ {m n} {x : FinVec m n} → x ⊎c (1C {0}) ≡ ? x⊎1C₀≡x {m} {n} {x = x} = let e = proj₁ (Plus.unite+) in let i = proj₁ (Plus.uniti+) in let eq = sym (+-right-identity m) in begin ( tabulate (λ j → inject+ 0 (x !! j)) ++V [] ≡⟨ cong (λ x → x ++V []) (finext (λ j → inject+0≡uniti+ (x !! j) eq)) ⟩ tabulate (λ j → i (x !! j)) ++V [] ≡⟨ tab++[]≡tab∘̂unite+ (λ j → i (x !! j)) (+-right-identity n) ⟩ tabulate (λ j → i (x !! e j)) ≡⟨ finext (λ j → sym (lookup∘tabulate (λ k → i (x !! k)) (e j))) ⟩ tabulate (λ j → tabulate (λ k → i (x !! k)) !! (e j)) ≡⟨ finext (λ j → cong₂ _!!_ (finext (λ k → sym (lookup∘tabulate i (x !! k)))) (sym (lookup∘tabulate e j))) ⟩ tabulate (λ j → (tabulate (λ k → tabulate i !! (x !! k))) !! ((tabulate e) !! j)) ∎) where open ≡-Reasoning -} 1C⊎1C≡1C : ∀ {m n} → 1C {m} ⊎c 1C {n} ≡ 1C 1C⊎1C≡1C {m} {n} = begin ( tabulate {m} (inject+ n ∘ _!!_ 1C) ++V tabulate {n} (raise m ∘ _!!_ 1C) ≡⟨ cong₂ (_++V_ {m = m}) (finext (λ i → cong (inject+ n) (lookup-allFin i))) (finext (λ i → cong (raise m) (lookup-allFin i))) ⟩ tabulate {m} (inject+ n) ++V tabulate {n} (raise m) ≡⟨ unSplit {m} id ⟩ tabulate {m + n} id ∎) where open ≡-Reasoning 1C!!i≡i : ∀ {m} {i : Fin m} → 1C {m} !! i ≡ i 1C!!i≡i = lookup∘tabulate id _ unite+∘̂uniti+~id : ∀ {m} → (unite+ {m}) ∘̂ uniti+ ≡ 1C {m} unite+∘̂uniti+~id {m} = ~⇒≡ {m} {n = m} (p∘!p≡id {p = Plus.unite+ {m}}) uniti+∘̂unite+~id : ∀ {m} → (uniti+ {m}) ∘̂ unite+ ≡ 1C {m} uniti+∘̂unite+~id {m} = ~⇒≡ {m} {n = m} (p∘!p≡id {p = Plus.uniti+}) unite+r∘̂uniti+r~id : ∀ {m} → (unite+r {m}) ∘̂ uniti+r ≡ 1C {m + 0} unite+r∘̂uniti+r~id {m} = ~⇒≡ {m} (p∘!p≡id {p = Plus.unite+r {m}}) uniti+r∘̂unite+r~id : ∀ {m} → (uniti+r {m}) ∘̂ unite+r ≡ 1C {m} uniti+r∘̂unite+r~id {m} = ~⇒≡ (p∘!p≡id {p = Plus.uniti+r}) assocl+∘̂assocr+~id : ∀ {m n o} → assocl+ {m} {n} {o} ∘̂ assocr+ {m} ≡ 1C assocl+∘̂assocr+~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = Plus.assocl+ {m}}) assocr+∘̂assocl+~id : ∀ {m n o} → assocr+ {m} {n} {o} ∘̂ assocl+ {m} ≡ 1C assocr+∘̂assocl+~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = Plus.assocr+ {m}}) swap+-inv : ∀ {m n} → swap+cauchy m n ∘̂ swap+cauchy n m ≡ 1C swap+-inv {m} {n} = ~⇒≡ (Plus.swap-inv m n) idˡ⊕ : ∀ {m n} {x : FinVec m n} → uniti+ ∘̂ (1C {0} ⊎c x) ≡ x ∘̂ uniti+ idˡ⊕ {m} {n} {x} = finext pf where open ≡-Reasoning pf : (i : Fin n) → (1C {0} ⊎c x) !! (uniti+ !! i) ≡ (uniti+ !! (x !! i)) pf i = begin ( tabulate (λ y → x !! y) !! (tabulate id !! i) ≡⟨ cong (_!!_ (tabulate λ y → x !! y)) (lookup∘tabulate id i) ⟩ (tabulate (λ y → x !! y)) !! i ≡⟨ lookup∘tabulate (λ y → x !! y) i ⟩ x !! i ≡⟨ sym (lookup∘tabulate id (x !! i)) ⟩ tabulate id !! (x !! i) ∎) [,]-commute : {A B C D E : Set} → {f : A → C} → {g : B → C} → {h : C → D} → ∀ x → h ([ f , g ]′ x) ≡ [ (h ∘ f) , (h ∘ g) ]′ x [,]-commute (inj₁ x) = refl [,]-commute (inj₂ y) = refl {- assocl-commute : ∀ {m₁ m₂ m₃ n₁ n₂ n₃} {a : FinVec m₁ n₁} {b : FinVec m₂ n₂} {c : FinVec m₃ n₃} → assocl+ {n₁} ∘̂ ((a ⊎c b) ⊎c c) ≡ (a ⊎c (b ⊎c c)) ∘̂ assocl+ {m₁} assocl-commute {m₁} {m₂} {m₃} {n₁} {n₂} {n₃} {a} {b} {c} = begin ( assocl+ {n₁} ∘̂ ((a ⊎c b) ⊎c c) ≡⟨ cong (λ x → assocl+ {n₁} ∘̂ x) (trans (⊎-equiv (a ⊎c b) c) (cong (λ x → x ⊎fv c) (⊎-equiv a b))) ⟩ assocl+ {n₁} ∘̂ ((a ⊎fv b) ⊎fv c) ≡⟨ refl ⟩ tabulate (λ i → ((a ⊎fv b) ⊎fv c) !! (assocl+ {n₁} !! i)) ≡⟨ finext pf₁ ⟩ tabulate (λ i → assocl+ {m₁} !! ((a ⊎fv (b ⊎fv c)) !! i) ) ≡⟨ refl ⟩ (a ⊎fv (b ⊎fv c)) ∘̂ assocl+ {m₁} ≡⟨ cong (λ x → x ∘̂ assocl+ {m₁}) (sym (trans (cong (λ x → a ⊎c x) (⊎-equiv b c)) (⊎-equiv a (b ⊎fv c)))) ⟩ (a ⊎c (b ⊎c c)) ∘̂ assocl+ {m₁} ∎) where pf₁ : ∀ i → ((a ⊎fv b) ⊎fv c) !! (assocl+ {n₁} !! i) ≡ assocl+ {m₁} !! ((a ⊎fv (b ⊎fv c)) !! i) pf₁ i = let assoc1 k = proj₁ (Plus.assocl+ {n₁}) k in let assoc2 k = proj₁ (Plus.assocl+ {m₁} {m₂}) k in let abc!! = (_!!_ ((a ⊎fv b) ⊎fv c)) in let a!! = (_!!_ a) in let b!! = (_!!_ b) in let c!! = (_!!_ c) in let ab!! = (_!!_ (a ⊎fv b)) in let bc!! = (_!!_ (b ⊎fv c)) in let iso4 = ((sym≃ (Plus.fwd-iso {n₁})) ● ((path⊎ id≃ (sym≃ Plus.fwd-iso)) ● (TE.assocl₊equiv ● (path⊎ Plus.fwd-iso id≃)))) in let iso3 = (sym≃ (Plus.fwd-iso {n₁})) ● ((path⊎ id≃ (sym≃ Plus.fwd-iso)) ● (TE.assocl₊equiv)) in let iso4b = (path⊎ id≃ (sym≃ Plus.fwd-iso) ● ((TE.assocl₊equiv ● path⊎ Plus.fwd-iso id≃) ● Plus.fwd-iso)) in begin ( ((a ⊎fv b) ⊎fv c) !! (assocl+ {n₁} !! i) ≡⟨ cong abc!! (lookup∘tabulate _ i) ⟩ abc!! (assoc1 i) ≡⟨ lookup∘tabulate _ (assoc1 i) ⟩ fwd (map⊎ ab!! c!! (bwd (assoc1 i))) ≡⟨ cong (fwd ∘ map⊎ ab!! c!!) (bwd∘fwd~id (iso4 ⋆ i)) ⟩ fwd (map⊎ ab!! c!! (iso4 ⋆ i)) ≡⟨ cong fwd (merge-[,] {h = fwd} {i = id} (iso3 ⋆ i)) ⟩ fwd (map⊎ (ab!! ∘ fwd) c!! (iso3 ⋆ i)) ≡⟨ {!!} ⟩ iso4b ⋆ (map⊎ a!! bc!! (bwd i)) ≡⟨ sym (cong (λ x → iso4b ⋆ x) (bwd∘fwd~id (map⊎ a!! bc!! (bwd i)))) ⟩ assoc2 (fwd (map⊎ a!! bc!! (bwd i))) ≡⟨ sym (cong assoc2 (lookup∘tabulate _ i)) ⟩ assoc2 ((a ⊎fv (b ⊎fv c)) !! i) ≡⟨ sym (lookup∘tabulate assoc2 _) ⟩ assocl+ {m₁} !! ((a ⊎fv (b ⊎fv c)) !! i) ∎) -} -- properties of multiplicative composition unite*∘̂uniti*~id : ∀ {m} → (unite* {m}) ∘̂ uniti* ≡ 1C {1 * m} unite*∘̂uniti*~id {m} = ~⇒≡ {m} {n = 1 * m} (p∘!p≡id {p = Times.unite* {m}}) uniti*∘̂unite*~id : ∀ {m} → (uniti* {m}) ∘̂ unite* ≡ 1C {m} uniti*∘̂unite*~id {m} = ~⇒≡ {1 * m} {n = m} (p∘!p≡id {p = Times.uniti* {m}}) unite*r∘̂uniti*r~id : ∀ {m} → (unite*r {m}) ∘̂ uniti*r ≡ 1C {m * 1} unite*r∘̂uniti*r~id {m} = ~⇒≡ {m} {n = m * 1} (p∘!p≡id {p = Times.unite*r {m}}) uniti*r∘̂unite*r~id : ∀ {m} → (uniti*r {m}) ∘̂ unite*r ≡ 1C {m} uniti*r∘̂unite*r~id {m} = ~⇒≡ {m * 1} {n = m} (p∘!p≡id {p = Times.uniti*r {m}}) assocl*∘̂assocr*~id : ∀ {m n o} → assocl* {m} {n} {o} ∘̂ assocr* {m} ≡ 1C assocl*∘̂assocr*~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = Times.assocl* {m}}) assocr*∘̂assocl*~id : ∀ {m n o} → assocr* {m} {n} {o} ∘̂ assocl* {m} ≡ 1C assocr*∘̂assocl*~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = Times.assocr* {m}}) dist*+∘̂factor*+~id : ∀ {m n o} → dist*+ {m} {n} {o} ∘̂ factor*+ {m} ≡ 1C dist*+∘̂factor*+~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = PlusTimes.dist {m}}) factor*+∘̂dist*+~id : ∀ {m n o} → factor*+ {m} {n} {o} ∘̂ dist*+ {m} ≡ 1C factor*+∘̂dist*+~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = PlusTimes.factor {m}}) distl*+∘̂factorl*+~id : ∀ {m n o} → distl*+ {m} {n} {o} ∘̂ factorl*+ {m} ≡ 1C distl*+∘̂factorl*+~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = PlusTimes.distl {m}}) factorl*+∘̂distl*+~id : ∀ {m n o} → factorl*+ {m} {n} {o} ∘̂ distl*+ {m} ≡ 1C factorl*+∘̂distl*+~id {m} {_} {o} = ~⇒≡ (p∘!p≡id {p = PlusTimes.factorl {m}}) right-zero*l∘̂right-zero*r~id : ∀ {m} → right-zero*l {m} ∘̂ right-zero*r {m} ≡ 1C {m * 0} right-zero*l∘̂right-zero*r~id {m} = ~⇒≡ {f = proj₁ (Times.factorzr {m})} (p∘!p≡id {p = Times.distzr {m}}) right-zero*r∘̂right-zero*l~id : ∀ {m} → right-zero*r {m} ∘̂ right-zero*l {m} ≡ 1C right-zero*r∘̂right-zero*l~id {m} = ~⇒≡ { f = proj₁ (Times.factorz {m})} (p∘!p≡id {p = Times.distz {m}}) private left⊎⊎!! : ∀ {m₁ m₂ m₃ m₄ n₁ n₂} → (p₁ : FinVec m₁ n₁) → (p₂ : FinVec m₂ n₂) → (p₃ : FinVec m₃ m₁) → (p₄ : FinVec m₄ m₂) → (i : Fin n₁) → (p₃ ⊎c p₄) !! ( (p₁ ⊎c p₂) !! inject+ n₂ i ) ≡ inject+ m₄ ( (p₁ ∘̂ p₃) !! i) left⊎⊎!! {m₁} {m₂} {_} {m₄} {_} {n₂} p₁ p₂ p₃ p₄ i = let pp = p₃ ⊎c p₄ in let qq = p₁ ⊎c p₂ in begin ( pp !! (qq !! inject+ n₂ i) ≡⟨ cong (_!!_ pp) (lookup-++-inject+ (tabulate (inject+ m₂ ∘ _!!_ p₁)) (tabulate (raise m₁ ∘ _!!_ p₂)) i) ⟩ pp !! (tabulate (inject+ m₂ ∘ _!!_ p₁ ) !! i) ≡⟨ cong (_!!_ pp) (lookup∘tabulate _ i) ⟩ pp !! (inject+ m₂ (p₁ !! i)) ≡⟨ left!! (p₁ !! i) (inject+ m₄ ∘ (_!!_ p₃)) ⟩ inject+ m₄ (p₃ !! (p₁ !! i)) ≡⟨ cong (inject+ m₄) (sym (lookup∘tabulate _ i)) ⟩ inject+ m₄ ((p₁ ∘̂ p₃) !! i) ∎ ) right⊎⊎!! : ∀ {m₁ m₂ m₃ m₄ n₁ n₂} → (p₁ : FinVec m₁ n₁) → (p₂ : FinVec m₂ n₂) → (p₃ : FinVec m₃ m₁) → (p₄ : FinVec m₄ m₂) → (i : Fin n₂) → (p₃ ⊎c p₄) !! ( (p₁ ⊎c p₂) !! raise n₁ i ) ≡ raise m₃ ( (p₂ ∘̂ p₄) !! i) right⊎⊎!! {m₁} {m₂} {m₃} {_} {n₁} {_} p₁ p₂ p₃ p₄ i = let pp = p₃ ⊎c p₄ in let qq = p₁ ⊎c p₂ in begin ( pp !! (qq !! raise n₁ i) ≡⟨ cong (_!!_ pp) (lookup-++-raise (tabulate (inject+ m₂ ∘ _!!_ p₁)) (tabulate (raise m₁ ∘ _!!_ p₂)) i) ⟩ pp !! (tabulate (raise m₁ ∘ _!!_ p₂) !! i) ≡⟨ cong (_!!_ pp) (lookup∘tabulate _ i) ⟩ pp !! raise m₁ (p₂ !! i) ≡⟨ right!! {m₁} (p₂ !! i) (raise m₃ ∘ (_!!_ p₄)) ⟩ raise m₃ (p₄ !! (p₂ !! i)) ≡⟨ cong (raise m₃) (sym (lookup∘tabulate _ i)) ⟩ raise m₃ ((p₂ ∘̂ p₄) !! i) ∎ ) ⊎c-distrib : ∀ {m₁ m₂ m₃ m₄ n₁ n₂} → {p₁ : FinVec m₁ n₁} → {p₂ : FinVec m₂ n₂} → {p₃ : FinVec m₃ m₁} → {p₄ : FinVec m₄ m₂} → (p₁ ⊎c p₂) ∘̂ (p₃ ⊎c p₄) ≡ (p₁ ∘̂ p₃) ⊎c (p₂ ∘̂ p₄) ⊎c-distrib {m₁} {m₂} {m₃} {m₄} {n₁} {n₂} {p₁} {p₂} {p₃} {p₄} = let p₃₄ = p₃ ⊎c p₄ in let p₁₂ = p₁ ⊎c p₂ in let lhs = λ i → p₃₄ !! (p₁₂ !! i) in begin ( tabulate lhs ≡⟨ tabulate-split {n₁} {n₂} ⟩ tabulate {n₁} (lhs ∘ inject+ n₂) ++V tabulate {n₂} (lhs ∘ raise n₁) ≡⟨ cong₂ _++V_ (finext (left⊎⊎!! p₁ _ _ _)) (finext (right⊎⊎!! p₁ _ _ _)) ⟩ tabulate {n₁} (λ i → inject+ m₄ ((p₁ ∘̂ p₃) !! i)) ++V tabulate {n₂} (λ i → raise m₃ ((p₂ ∘̂ p₄) !! i)) ≡⟨ refl ⟩ (p₁ ∘̂ p₃) ⊎c (p₂ ∘̂ p₄) ∎) ------------------------------------------------------------------------------ -- properties of ×c private concat!! : {A : Set} {m n : ℕ} → (a : Fin m) → (b : Fin n) → (xss : Vec (Vec A n) m) → concatV xss !! (Times.fwd (a ,′ b)) ≡ (xss !! a) !! b concat!! zero b (xs ∷ xss) = lookup-++-inject+ xs (concatV xss) b concat!! (suc a) b (xs ∷ xss) = trans (lookup-++-raise xs (concatV xss) (Times.fwd (a ,′ b))) (concat!! a b xss) ×c-equiv : {m₁ m₂ n₁ n₂ : ℕ} (p₁ : FinVec m₁ n₁) (p₂ : FinVec m₂ n₂) → (p₁ ×c p₂) ≡ concatV (mapV (λ y → mapV Times.fwd (mapV (λ x → y ,′ x) p₂)) p₁) ×c-equiv p₁ p₂ = let zss = mapV (λ b → mapV (λ x → b ,′ x) p₂) p₁ in begin ( (p₁ ×c p₂) ≡⟨ refl ⟩ mapV Times.fwd (concatV zss) ≡⟨ sym (concat-map zss Times.fwd) ⟩ concatV (mapV (mapV Times.fwd) zss) ≡⟨ cong concatV (map-map-map Times.fwd (λ b → mapV (λ x → b ,′ x) p₂) p₁) ⟩ concatV (mapV (λ y → mapV Times.fwd (mapV (λ x → y ,′ x) p₂)) p₁) ∎) lookup-2d : {A : Set} (m n : ℕ) → (k : Fin (m * n)) → {f : Fin m × Fin n → A} → concatV (tabulate {m} (λ i → tabulate {n} (λ j → f (i ,′ j)))) !! k ≡ f (Times.bwd k) lookup-2d m n k {f} = let lhs = concatV (tabulate {m} (λ i → tabulate {n} (λ j → f (i ,′ j)))) in let a = proj₁ (Times.bwd {m} {n} k) in let b = proj₂ (Times.bwd {m} {n} k) in begin ( lhs !! k ≡⟨ cong (_!!_ lhs) (sym (Times.fwd∘bwd~id {m} k)) ⟩ lhs !! (Times.fwd (a ,′ b)) ≡⟨ concat!! a b _ ⟩ (tabulate {m} (λ i → tabulate {n} (λ j → f (i ,′ j))) !! a) !! b ≡⟨ cong (λ x → x !! b) (lookup∘tabulate _ a) ⟩ tabulate {n} (λ j → f (a ,′ j)) !! b ≡⟨ lookup∘tabulate _ b ⟩ f (a ,′ b) ≡⟨ refl ⟩ f (Times.bwd k) ∎) ×c!! : {m₁ m₂ n₁ n₂ : ℕ} (p₁ : FinVec m₁ n₁) (p₂ : FinVec m₂ n₂) (k : Fin (n₁ * n₂)) → (p₁ ×c p₂) !! k ≡ Times.fwd (p₁ !! proj₁ (Times.bwd k) ,′ p₂ !! proj₂ (Times.bwd {n₁} k)) ×c!! {n₁ = n₁} p₁ p₂ k = let a = proj₁ (Times.bwd {n₁} k) in let b = proj₂ (Times.bwd {n₁} k) in begin ( (p₁ ×c p₂) !! k ≡⟨ cong₂ _!!_ (×c-equiv p₁ p₂) (sym (Times.fwd∘bwd~id {n₁} k)) ⟩ concatV (mapV (λ y → mapV Times.fwd (mapV (λ x → y ,′ x) p₂)) p₁) !! Times.fwd (a ,′ b) ≡⟨ concat!! a b _ ⟩ ((mapV (λ y → mapV Times.fwd (mapV (λ x → y ,′ x) p₂)) p₁) !! a) !! b ≡⟨ cong (λ x → x !! b) (lookup-map a _ p₁) ⟩ mapV Times.fwd (mapV (λ x → p₁ !! a ,′ x) p₂) !! b ≡⟨ cong (λ x → x !! b) (sym (map-∘ Times.fwd _ p₂)) ⟩ mapV (Times.fwd ∘ (λ x → p₁ !! a ,′ x)) p₂ !! b ≡⟨ lookup-map b _ p₂ ⟩ Times.fwd (p₁ !! a ,′ p₂ !! b) ∎) ×c-distrib : ∀ {m₁ m₂ m₃ m₄ n₁ n₂} → {p₁ : FinVec m₁ n₁} → {p₂ : FinVec m₂ n₂} → {p₃ : FinVec m₃ m₁} → {p₄ : FinVec m₄ m₂} → (p₁ ×c p₂) ∘̂ (p₃ ×c p₄) ≡ (p₁ ∘̂ p₃) ×c (p₂ ∘̂ p₄) ×c-distrib {m₁} {m₂} {m₃} {m₄} {n₁} {n₂} {p₁} {p₂} {p₃} {p₄} = let p₃₄ = p₃ ×c p₄ in let p₁₂ = p₁ ×c p₂ in let p₂₄ = p₂ ∘̂ p₄ in let p₁₃ = p₁ ∘̂ p₃ in let lhs = λ i → p₃₄ !! (p₁₂ !! i) in let zss = mapV (λ b → mapV (λ x → b ,′ x) (p₂ ∘̂ p₄)) (p₁ ∘̂ p₃) in begin ( tabulate {n₁ * n₂} (λ i → p₃₄ !! (p₁₂ !! i)) ≡⟨ finext (λ j → cong (_!!_ p₃₄) (×c!! p₁ p₂ j)) ⟩ tabulate {n₁ * n₂} (λ i → p₃₄ !! Times.fwd (p₁ !! proj₁ (Times.bwd i) ,′ p₂ !! proj₂ (Times.bwd i))) ≡⟨ finext (λ j → ×c!! p₃ p₄ _) ⟩ tabulate (λ i → let k = Times.fwd (p₁ !! proj₁ (Times.bwd i) ,′ p₂ !! proj₂ (Times.bwd i)) in Times.fwd (p₃ !! proj₁ (Times.bwd k) ,′ p₄ !! proj₂ (Times.bwd k))) ≡⟨ finext (λ i → cong₂ (λ x y → Times.fwd (p₃ !! proj₁ x ,′ p₄ !! proj₂ y)) (Times.bwd∘fwd~id {m₁} {m₂} (p₁ !! proj₁ (Times.bwd i) ,′ _)) (Times.bwd∘fwd~id (_ ,′ p₂ !! proj₂ (Times.bwd i)))) ⟩ tabulate (λ i → Times.fwd (p₃ !! (p₁ !! proj₁ (Times.bwd i)) ,′ (p₄ !! (p₂ !! proj₂ (Times.bwd i))))) ≡⟨ finext (λ k → sym (lookup-2d n₁ n₂ k)) ⟩ tabulate (λ k → concatV (tabulate {n₁} (λ z → tabulate {n₂} (λ w → Times.fwd ((p₃ !! (p₁ !! z)) ,′ (p₄ !! (p₂ !! w)))))) !! k) ≡⟨ tabulate∘lookup _ ⟩ concatV (tabulate {n₁} (λ z → tabulate {n₂} (λ w → Times.fwd ((p₃ !! (p₁ !! z)) ,′ (p₄ !! (p₂ !! w)))))) ≡⟨ cong concatV (finext (λ i → tabulate-∘ Times.fwd (λ w → ((p₃ !! (p₁ !! i)) ,′ (p₄ !! (p₂ !! w)))) )) ⟩ concatV (tabulate (λ z → mapV Times.fwd (tabulate (λ w → (p₃ !! (p₁ !! z)) ,′ (p₄ !! (p₂ !! w)))))) ≡⟨ cong concatV (finext (λ i → cong (mapV Times.fwd) (tabulate-∘ (λ x → (p₃ !! (p₁ !! i)) ,′ x) (_!!_ p₄ ∘ _!!_ p₂)))) ⟩ concatV (tabulate (λ z → mapV Times.fwd (mapV (λ x → (p₃ !! (p₁ !! z)) ,′ x) p₂₄))) ≡⟨ cong concatV (tabulate-∘ _ (_!!_ p₃ ∘ _!!_ p₁)) ⟩ concatV (mapV (λ y → mapV Times.fwd (mapV (λ x → y ,′ x) p₂₄)) p₁₃) ≡⟨ sym (×c-equiv p₁₃ p₂₄) ⟩ (p₁ ∘̂ p₃) ×c (p₂ ∘̂ p₄) ∎) -- there might be a simpler proofs of this using tablate∘lookup right -- at the start. 1C×1C≡1C : ∀ {m n} → (1C {m} ×c 1C {n}) ≡ 1C {m * n} 1C×1C≡1C {m} {n} = begin ( 1C {m} ×c 1C ≡⟨ ×c-equiv 1C 1C ⟩ concatV (mapV (λ y → mapV Times.fwd (mapV (_,′_ y) (1C {n}))) (1C {m})) ≡⟨ cong (concatV {n = m}) (sym (tabulate-∘ _ id)) ⟩ concatV {n = m} (tabulate (λ y → mapV Times.fwd (mapV (_,′_ y) (1C {n})))) ≡⟨ cong (concatV {n = m}) (finext (λ y → sym (map-∘ Times.fwd (λ x → y ,′ x) 1C))) ⟩ concatV (tabulate {n = m} (λ y → mapV (Times.fwd ∘ (_,′_ y)) (1C {n}))) ≡⟨ cong (concatV {m = n} {m}) (finext (λ y → sym (tabulate-∘ (Times.fwd ∘ (_,′_ y)) id))) ⟩ concatV (tabulate {n = m} (λ a → tabulate {n = n} (λ b → Times.fwd (a ,′ b)))) ≡⟨ sym (tabulate∘lookup _) ⟩ tabulate (λ k → concatV (tabulate {n = m} (λ a → tabulate {n = n} (λ b → Times.fwd (a ,′ b)))) !! k) ≡⟨ finext (λ k → lookup-2d m n k) ⟩ tabulate (λ k → Times.fwd {m} {n} (Times.bwd k)) ≡⟨ finext (Times.fwd∘bwd~id {m} {n}) ⟩ 1C {m * n} ∎ ) swap*-inv : ∀ {m n} → swap⋆cauchy m n ∘̂ swap⋆cauchy n m ≡ 1C swap*-inv {m} {n} = ~⇒≡ (Times.swap-inv m n) ------------------------ -- A few "reveal" functions, to let us peek into the representation reveal1C : ∀ {m} → allFin m ≡ 1C reveal1C = refl reveal0C : [] ≡ 1C {0} reveal0C = refl reveal⊎c : ∀ {m₁ n₁ m₂ n₂} → {α : FinVec m₁ m₂} → {β : FinVec n₁ n₂} → α ⊎c β ≡ tabulate (fwd ∘ inj₁ ∘ _!!_ α) ++V tabulate (fwd {m₁} ∘ inj₂ ∘ _!!_ β) reveal⊎c = refl ------------------------------------------------------------------------------ -- Commutative semiring structure open F _cauchy≃_ : (m n : ℕ) → Set m cauchy≃ n = FinVec m n id-iso : {m : ℕ} → FinVec m m id-iso = 1C private postulate sym-iso : {m n : ℕ} → FinVec m n → FinVec n m trans-iso : {m n o : ℕ} → FinVec m n → FinVec n o → FinVec m o trans-iso c₁ c₂ = c₂ ∘̂ c₁ cauchy≃IsEquiv : IsEquivalence {Level.zero} {Level.zero} {ℕ} _cauchy≃_ cauchy≃IsEquiv = record { refl = id-iso ; sym = sym-iso ; trans = trans-iso } cauchyPlusIsSG : IsSemigroup {Level.zero} {Level.zero} {ℕ} _cauchy≃_ _+_ cauchyPlusIsSG = record { isEquivalence = cauchy≃IsEquiv ; assoc = λ m n o → assocl+ {m} {n} {o} ; ∙-cong = _⊎c_ } cauchyTimesIsSG : IsSemigroup {Level.zero} {Level.zero} {ℕ} _cauchy≃_ _*_ cauchyTimesIsSG = record { isEquivalence = cauchy≃IsEquiv ; assoc = λ m n o → assocl* {m} {n} {o} ; ∙-cong = _×c_ } cauchyPlusIsCM : IsCommutativeMonoid _cauchy≃_ _+_ 0 cauchyPlusIsCM = record { isSemigroup = cauchyPlusIsSG ; identityˡ = λ m → 1C ; comm = λ m n → swap+cauchy n m } cauchyTimesIsCM : IsCommutativeMonoid _cauchy≃_ _*_ 1 cauchyTimesIsCM = record { isSemigroup = cauchyTimesIsSG ; identityˡ = λ m → uniti* {m} ; comm = λ m n → swap⋆cauchy n m } cauchyIsCSR : IsCommutativeSemiring _cauchy≃_ _+_ _*_ 0 1 cauchyIsCSR = record { +-isCommutativeMonoid = cauchyPlusIsCM ; *-isCommutativeMonoid = cauchyTimesIsCM ; distribʳ = λ o m n → factor*+ {m} {n} {o} ; zeroˡ = λ m → 0C } cauchyCSR : CommutativeSemiring Level.zero Level.zero cauchyCSR = record { Carrier = ℕ ; _≈_ = _cauchy≃_ ; _+_ = _+_ ; _*_ = _*_ ; 0# = 0 ; 1# = 1 ; isCommutativeSemiring = cauchyIsCSR } ------------------------------------------------------------------------------ -- Groupoid structure private postulate linv : {m n : ℕ} (c : FinVec m n) → (sym-iso c) ∘̂ c ≡ 1C postulate rinv : {m n : ℕ} (c : FinVec m n) → c ∘̂ (sym-iso c) ≡ 1C G : 1Groupoid G = record { set = ℕ ; _↝_ = _cauchy≃_ ; _≈_ = _≡_ ; id = id-iso ; _∘_ = λ c₁ c₂ → trans-iso c₂ c₁ ; _⁻¹ = sym-iso ; lneutr = ∘̂-lid ; rneutr = ∘̂-rid ; assoc = λ c₁ c₂ c₃ → sym (∘̂-assoc c₁ c₂ c₃) ; equiv = record { refl = refl ; sym = sym ; trans = trans } ; linv = linv ; rinv = rinv ; ∘-resp-≈ = cong₂ _∘̂_ } {-- -- Move to its own spot later merge-[,] : {A B C D E : Set} → {h : A → C} → {i : B → D} → {f : C → E} → {g : D → E} → (x : A ⊎ B) → [ f , g ]′ ( map⊎ h i x ) ≡ [ (f ∘ h) , (g ∘ i) ]′ x merge-[,] (inj₁ x) = refl merge-[,] (inj₂ y) = refl --}
resources/scripts/api/bgptools.ads
kopfjager007/Amass
0
10989
<reponame>kopfjager007/Amass -- Copyright © by <NAME> 2022. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. -- SPDX-License-Identifier: Apache-2.0 local json = require("json") name = "BGPTools" type = "misc" local bgptoolsWhoisAddress = "" -- bgptoolsWhoisURL is the URL for the BGP.Tools whois server. local bgptoolsWhoisURL = "bgp.tools" -- bgptoolsTableFile is the path to the file containing ASN prefixes. local bgptoolsTableFile = "" function start() set_rate_limit(1) end function asn(ctx, addr, asn) if (bgptoolsWhoisAddress == "" and not get_whois_addr(ctx)) then return end -- Check if the table file containing ASN prefixes needs to be acquired if (bgptoolsTableFile == "" and need_table_file(ctx) and not get_table_file(ctx)) then return end local result if (asn == 0) then if (addr == "") then return end result = origin(ctx, addr) if (result == nil) then return end local cidrs = netblocks(ctx, result.asn) if (cidrs == nil or #cidrs == 0) then return end result['netblocks'] = cidrs else local cidrs = netblocks(ctx, asn) if (cidrs == nil or #cidrs == 0) then return end if (addr == "") then local parts = split(cidrs[1], "/") if (#parts < 2) then return end addr = parts[1] end result = origin(ctx, addr) if (result == nil) then return end result['netblocks'] = cidrs end table.insert(result['netblocks'], result['prefix']) new_asn(ctx, result) end function origin(ctx, addr) local conn, err = socket.connect(ctx, bgptoolsWhoisAddress, 43, "tcp") if (err ~= nil and err ~= "") then log(ctx, "failed to connect to the whois server: " .. err) return nil end _, err = conn:send("begin\n" .. addr .. "\nend") if (err ~= nil and err ~= "") then log(ctx, "failed to send the whois server request: " .. err) conn:close() return nil end local data data, err = conn:recv_all() conn:close() if (err ~= nil and err ~= "") then log(ctx, "failed to read the whois server response: " .. err) return nil end local fields = split(data, "|") return { ['addr']=addr, ['asn']=tonumber(trim_space(fields[1])), ['prefix']=trim_space(fields[3]), ['cc']=trim_space(fields[4]), ['registry']=trim_space(fields[5]), ['desc']=trim_space(fields[7]), } end function netblocks(ctx, asn) local prefixes = io.open(bgptoolsTableFile, "r") local netblocks = {} for line in prefixes:lines() do local j = json.decode(line) if (j ~= nil and j['ASN'] ~= nil and j['ASN'] == asn) then table.insert(netblocks, j['CIDR']) end end prefixes:close() return netblocks end function need_table_file(ctx) bgptoolsTableFile = output_dir(ctx) .. "/bgptools.jsonl" local modified = mtime(bgptoolsTableFile) if (modified == 0) then return true end hoursfrom = os.difftime(os.time(), modified) / (60 * 60) wholehours = math.floor(hoursfrom) if (wholehours > 5) then return true end return false end function get_table_file(ctx) local resp, err = request(ctx, {['url']="https://bgp.tools/table.jsonl"}) if (err ~= nil and err ~= "") then log(ctx, "failed to obtain the table.jsonl file: " .. err) return false end local prefixes = io.open(bgptoolsTableFile, "w") if (prefixes == nil) then log(ctx, "failed to write the table.jsonl file") return false end prefixes:write(resp) prefixes:close() return true end function split(str, delim) local result = {} local pattern = "[^%" .. delim .. "]+" local matches = find(str, pattern) if (matches == nil or #matches == 0) then return result end for _, match in pairs(matches) do table.insert(result, match) end return result end function get_whois_addr(ctx) local resp, err = resolve(ctx, bgptoolsWhoisURL, "A", false) if ((err ~= nil and err ~= "") or #resp == 0) then log(ctx, "failed to resolve the whois server address: " .. err) return false end bgptoolsWhoisAddress = resp[1].rrdata return true end function trim_space(s) if (s == nil) then return "" end return s:match( "^%s*(.-)%s*$" ) end
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_5083_1049.asm
ljhsiun2/medusa
9
102000
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r14 push %rsi lea addresses_D_ht+0x1712d, %rsi sub %r14, %r14 mov $0x6162636465666768, %r13 movq %r13, %xmm4 vmovups %ymm4, (%rsi) dec %r12 pop %rsi pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r15 push %r8 push %r9 push %rbx push %rcx // Load lea addresses_normal+0x1602d, %r8 nop nop nop nop nop cmp %rbx, %rbx movups (%r8), %xmm1 vpextrq $0, %xmm1, %r15 nop nop nop cmp %r14, %r14 // Load mov $0x71201c00000004f9, %r12 xor $21983, %rcx movntdqa (%r12), %xmm1 vpextrq $1, %xmm1, %r8 nop nop and %r9, %r9 // Store lea addresses_RW+0x1ad, %r8 sub $7010, %r14 movb $0x51, (%r8) nop nop nop nop and %rcx, %rcx // Store lea addresses_normal+0xb565, %r12 nop inc %r8 mov $0x5152535455565758, %rbx movq %rbx, %xmm1 vmovups %ymm1, (%r12) nop nop nop nop inc %rcx // Faulty Load lea addresses_RW+0x1ae2d, %r9 nop nop and $44974, %r15 mov (%r9), %r14w lea oracles, %rcx and $0xff, %r14 shlq $12, %r14 mov (%rcx,%r14,1), %r14 pop %rcx pop %rbx pop %r9 pop %r8 pop %r15 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_normal', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 2, 'NT': True, 'type': 'addresses_NC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_RW', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal', 'size': 32, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}} {'32': 5083} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
generated/natools-static_maps-s_expressions-templates-dates-t.adb
faelys/natools
0
30620
-- Generated at 2015-06-24 18:19:13 +0000 by Natools.Static_Hash_Maps -- from src/natools-s_expressions-templates-dates-maps.sx with Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds; with Natools.Static_Maps.S_Expressions.Templates.Dates.Zones; function Natools.Static_Maps.S_Expressions.Templates.Dates.T return Boolean is begin for I in Map_1_Keys'Range loop if Natools.Static_Maps.S_Expressions.Templates.Dates.Cmds.Hash (Map_1_Keys (I).all) /= I then return False; end if; end loop; for I in Map_2_Keys'Range loop if Natools.Static_Maps.S_Expressions.Templates.Dates.Zones.Hash (Map_2_Keys (I).all) /= I then return False; end if; end loop; return True; end Natools.Static_Maps.S_Expressions.Templates.Dates.T;
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_488.asm
ljhsiun2/medusa
9
160589
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x31a8, %rsi lea addresses_D_ht+0x166e8, %rdi clflush (%rsi) nop cmp %rbp, %rbp mov $22, %rcx rep movsw nop nop nop nop nop sub $9349, %rsi lea addresses_WC_ht+0x1b948, %rcx xor %rbx, %rbx mov (%rcx), %edi nop dec %rbx lea addresses_WT_ht+0xec8, %r15 nop nop and $25563, %rcx mov $0x6162636465666768, %rsi movq %rsi, (%r15) nop nop nop nop nop cmp %rsi, %rsi lea addresses_WT_ht+0x167a1, %rsi lea addresses_D_ht+0x6d94, %rdi nop nop nop nop dec %r9 mov $90, %rcx rep movsb nop nop nop add %r9, %r9 lea addresses_A_ht+0xc148, %rsi lea addresses_UC_ht+0x3368, %rdi clflush (%rsi) dec %r12 mov $96, %rcx rep movsb nop nop add %rdi, %rdi lea addresses_UC_ht+0x1dc48, %r12 nop nop nop nop nop xor $12813, %r9 movups (%r12), %xmm1 vpextrq $1, %xmm1, %r15 nop nop and %r15, %r15 lea addresses_normal_ht+0x6548, %rbx clflush (%rbx) nop nop nop inc %r12 mov $0x6162636465666768, %rcx movq %rcx, %xmm0 vmovups %ymm0, (%rbx) nop nop dec %rcx lea addresses_D_ht+0xf928, %rsi lea addresses_D_ht+0x10348, %rdi nop nop nop sub $45778, %r9 mov $46, %rcx rep movsl cmp %rcx, %rcx lea addresses_WC_ht+0x19508, %rbp nop nop inc %rcx mov (%rbp), %di nop nop nop and %rdi, %rdi lea addresses_WT_ht+0x3348, %rsi lea addresses_D_ht+0xf7d8, %rdi nop nop xor %r12, %r12 mov $90, %rcx rep movsb nop nop cmp $6797, %rbx lea addresses_UC_ht+0x1758, %r12 nop nop add $64639, %rsi mov $0x6162636465666768, %rcx movq %rcx, %xmm0 movups %xmm0, (%r12) nop nop nop sub %rbp, %rbp pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r8 push %r9 push %rbx push %rdi push %rsi // Faulty Load lea addresses_WC+0x1e548, %rsi nop nop xor %rdi, %rdi movb (%rsi), %bl lea oracles, %r9 and $0xff, %rbx shlq $12, %rbx mov (%r9,%rbx,1), %rbx pop %rsi pop %rdi pop %rbx pop %r9 pop %r8 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 2}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 9}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 4}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
programs/oeis/129/A129354.asm
jmorken/loda
1
80703
; A129354: Duplicate of A129628. ; 1,3,2,6,2,6,2,10,3,6,2,12,2,6,4,15,2,9,2,12,4,6,2,20,3,6,4,12,2,12,2,21,4,6,4,18,2,6,4,20,2,12,2,12,6,6,2,30,3,9,4,12,2,12,4,20,4,6,2,24,2,6,6,28,4,12,2,12,4 mov $27,$0 mov $29,2 lpb $29 clr $0,27 mov $0,$27 sub $29,1 add $0,$29 sub $0,1 lpb $0 mov $1,$0 sub $1,$0 add $1,$0 cal $1,75995 ; a(n) = Sum_{k=1..floor(n/2)} floor(n/k) for n >= 2, with a(1) = 1. sub $0,1 div $0,2 add $2,$1 lpe mov $1,$2 mov $30,$29 lpb $30 mov $28,$1 sub $30,1 lpe lpe lpb $27 mov $27,0 sub $28,$1 lpe mov $1,$28 add $1,1
src/base/f64_ilogb.asm
rainer-erdmann/libm64
0
164901
; ; FILENAME : f64_ilogb.asm ; ; DESCRIPTION : ; int ilogbd(double v) ; ; assembly module written for MASM/NASM ; ; AUTHOR : <NAME> ; ; Copyright 2016-2019 <NAME> ; ; License: see accompanying file license.txt ; ; CHANGES : ; ; REF NO VERSION DATE WHO DETAIL ; IFDEF @Version INCLUDE common.masm ELSE INCLUDE 'common.nasm' ENDIF IFDEF _M_X64 ; 64bit ; x64 - x64 - x64 - x64 - x64 - x64 - x64 - x64 - x64 - x64 - x64 .data .code ILOGB0 EQU 080000000h ILOGBNAN EQU 07fffffffh ; "int __cdecl ilogbd(double)" (?ilogbd@@YAHN@Z) ENTRY ilogbd, YAHN@Z movq rax, xmm0 shr rax, 52 and eax, 07ffh ; strip sign jz .xdz ; => DEN or ZERO cmp eax, 07feh ; in range? ja .xnani ; => INF or NAN sub eax, 03ffh ; extracted exp ret ; x is DEN or ZERO .xdz: movq rax, xmm0 add rax, rax ; clear sign jz .xz bsr rax, rax sub eax, 1023 + 52; ret .xz: mov eax, ILOGB0 ; ILOGB0 ret ; x is INF or NAN .xnani: mov eax, ILOGBNAN ; ILOGBNAN ret FUNC ENDP ELSE ; x86 .code ENTRY ilogbd, YAHN@Z mov eax, [esp+4+4] shr eax, 20 and eax, 07ffh ; strip sign sub eax, 1 cmp eax, 07fdh ; in range? ja .x_no sub eax, 03feh ; extracted exp ret ; x is ZERO, DEN or NAN/INF .x_no: jns .xnani ; x is INF or NAN ; x is DEN or ZERO .xdz: mov edx, [esp+4] ; recover x mov eax, [esp+4+4] add eax, eax ; clear sign or eax, edx jz .xz mov eax, [esp+4+4] btr eax, 31 bsr eax, eax jnz .hh bsr eax, [esp+4] sub eax, 1023 + 52 - 1; ret .hh: sub eax, 1023 + 20 - 1; ret .xz: mov eax, 080000000h ; ILOGB0 ret ; x is INF or NAN .xnani: mov eax, 07fffffffh ; ILOGBNAN ret ; "int __vectorcall ilogbd(double)" (?ilogbd@@YQHN@Z) ENTRY ilogbd, YQHN@Z ; 8.0 SAN ; ~7.0 HAS BMI pextrw eax, xmm0, 3 shr eax, 4 and eax, 07ffh ; strip sign ; mov ecx, (11 << 8) + 4 ; bextr eax, eax, ecx ; BMI1 sub eax, 1 cmp eax, 07fdh ; in range? ja .x_no sub eax, 03feh ; extracted exp ret ; x is ZERO, DEN or NAN/INF .x_no: jns .xnani ; x is INF or NAN ; x is DEN or ZERO .xdz: pxor xmm1, xmm1 comisd xmm0, xmm1 jz .xz movdqa xmm1, xmm0 psrlq xmm1, 32 movd eax, xmm1 btr eax, 31 bsr eax, eax jnz .hh movd eax, xmm0 bsr eax, eax sub eax, 1023 + 52 - 1; ret .hh: sub eax, 1023 + 20 - 1; ret .xz: mov eax, 080000000h ; ILOGB0 ret ; x is INF or NAN .xnani: mov eax, 07fffffffh ; ILOGBNAN ret FUNC ENDP ENDIF END
sources/local_message_passing.adb
HeisenbugLtd/msg_passing
0
22251
------------------------------------------------------------------------ -- Copyright (C) 2010-2020 by Heisenbug Ltd. (<EMAIL>) -- -- This work is free. You can redistribute it and/or modify it under -- the terms of the Do What The Fuck You Want To Public License, -- Version 2, as published by Sam Hocevar. See the LICENSE file for -- more details. ------------------------------------------------------------------------ pragma License (Unrestricted); ------------------------------------------------------------------------ -- Local_Message_Passing -- -- Generic package providing mailbox communication channels. -- -- All mailboxes instantiated from this package can be shared by name -- between different tasks without needing the specific package where -- the mailbox is located. -- ------------------------------------------------------------------------ with Ada.Real_Time; with System.Address_To_Access_Conversions; with System.Storage_Elements; use type Ada.Real_Time.Time; use type Ada.Real_Time.Time_Span; use type System.Storage_Elements.Storage_Count; package body Local_Message_Passing is package SSE renames System.Storage_Elements; -- Due to alignment rules, the size of the type and that of an -- object of that type may be different, so use the size of a -- (dummy) object instead of Message'Size for consistency checks. -- TODO: Use 'Object_Size instead. Dummy : Message; MESSAGE_OBJECT_LENGTH : constant SSE.Storage_Count := (Dummy'Size + System.Storage_Unit - 1) / System.Storage_Unit; --------------------------------------------------------------------- -- Conv -- -- To convert between a Mailbox and its Handle we simply convert the -- address into an access type. -- -- This avoids 'Unchecked_Access at the danger of creating dangling -- pointers if the scope of the mailbox is smaller than that of its -- pointer to it. --------------------------------------------------------------------- package Conv is new System.Address_To_Access_Conversions (Object => Mailbox); --------------------------------------------------------------------- -- Export_Mailbox -- -- Exports a mailbox by name for use by other processes. -- -- The name given to the mailbox is only significant up to the first -- 31 characters, and shall be unique in those. --------------------------------------------------------------------- procedure Export_Mailbox (Mbx : in out Mailbox; Name : in String); --------------------------------------------------------------------- -- Conditional_Receive --------------------------------------------------------------------- procedure Conditional_Receive (Mbx : in Handle; Msg : out Message; Success : out Boolean) is begin Mbx.all.Try_Get (Msg, Success); end Conditional_Receive; --------------------------------------------------------------------- -- Conditional_Send --------------------------------------------------------------------- procedure Conditional_Send (Mbx : in Handle; Msg : in Message; Success : out Boolean) is begin Mbx.all.Try_Put (Msg, Success); end Conditional_Send; --------------------------------------------------------------------- -- Export_Mailbox --------------------------------------------------------------------- procedure Export_Mailbox (Mbx : in out Mailbox; Name : in String) is begin Mailbox_Sharing.Add_Mailbox (Mbx'Address, Name, MESSAGE_OBJECT_LENGTH); end Export_Mailbox; --------------------------------------------------------------------- -- Import_Mailbox --------------------------------------------------------------------- procedure Import_Mailbox (Name : in String; Hnd : out Handle; Max_Wait : in Ada.Real_Time.Time_Span) is -- Convert the relative delay to an absolute one. Latest : constant Ada.Real_Time.Time := Ada.Real_Time.Clock + Max_Wait; begin Hnd := Handle (Conv.To_Pointer (Mailbox_Sharing.Find_Mailbox (Name, MESSAGE_OBJECT_LENGTH, Latest))); end Import_Mailbox; --------------------------------------------------------------------- -- Open_Mailbox --------------------------------------------------------------------- procedure Open_Mailbox (Mbx : in out Mailbox; Hnd : out Handle; Export_Name : in String := "") is begin Mbx.Clear; Hnd := Handle (Conv.To_Pointer (Mbx'Address)); if Export_Name /= "" then Export_Mailbox (Mbx, Export_Name); end if; end Open_Mailbox; --------------------------------------------------------------------- -- Receive --------------------------------------------------------------------- procedure Receive (Mbx : in Handle; Msg : out Message) is begin Mbx.all.Get (Msg); end Receive; --------------------------------------------------------------------- -- Send --------------------------------------------------------------------- procedure Send (Mbx : in Handle; Msg : in Message) is begin Mbx.all.Put (Msg); end Send; --------------------------------------------------------------------- -- Timed_Receive --------------------------------------------------------------------- procedure Timed_Receive (Mbx : in Handle; Msg : out Message; Latest : in Ada.Real_Time.Time; Success : out Boolean) is begin select Mbx.all.Get (Msg); Success := True; or delay until Latest; Success := False; end select; end Timed_Receive; --------------------------------------------------------------------- -- Timed_Receive --------------------------------------------------------------------- procedure Timed_Receive (Mbx : in Handle; Msg : out Message; Max_Wait : in Ada.Real_Time.Time_Span; Success : out Boolean) is begin Timed_Receive (Mbx, Msg, Ada.Real_Time.Clock + Max_Wait, Success); end Timed_Receive; --------------------------------------------------------------------- -- Timed_Send --------------------------------------------------------------------- procedure Timed_Send (Mbx : in Handle; Msg : in Message; Latest : in Ada.Real_Time.Time; Success : out Boolean) is begin select Mbx.all.Put (Msg); Success := True; or delay until Latest; Success := False; end select; end Timed_Send; --------------------------------------------------------------------- -- Timed_Send --------------------------------------------------------------------- procedure Timed_Send (Mbx : in Handle; Msg : in Message; Max_Wait : in Ada.Real_Time.Time_Span; Success : out Boolean) is begin Timed_Send (Mbx, Msg, Ada.Real_Time.Clock + Max_Wait, Success); end Timed_Send; --------------------------------------------------------------------- -- Mailbox --------------------------------------------------------------------- protected body Mailbox is ------------------------------------------------------------------ -- Mailbox.Clear ------------------------------------------------------------------ procedure Clear is begin -- Reset number of messages and indices. Num_Messages := 0; Oldest := Msg_Queue'First; Latest := Msg_Queue'First; end Clear; ------------------------------------------------------------------ -- Mailbox.Get ------------------------------------------------------------------ entry Get (Msg : out Message) when Num_Messages > 0 is begin -- Get oldest message from queue and advance index. Msg := Msg_Queue (Oldest); Oldest := (Oldest mod Size) + 1; -- Message has been retrieved now. Num_Messages := Num_Messages - 1; end Get; ------------------------------------------------------------------ -- Mailbox.Put ------------------------------------------------------------------ entry Put (Msg : in Message) when Num_Messages < Size is begin -- Put message into latest slot and advance index. Msg_Queue (Latest) := Msg; Latest := (Latest mod Size) + 1; -- One more message deposited. Num_Messages := Num_Messages + 1; end Put; ------------------------------------------------------------------ -- Mailbox.Try_Get ------------------------------------------------------------------ procedure Try_Get (Msg : out Message; Success : out Boolean) is begin Success := Num_Messages > 0; if Success then -- Get message from oldest slot and advance index. Msg := Msg_Queue (Oldest); Oldest := (Oldest mod Size) + 1; -- One message retrieved. Num_Messages := Num_Messages - 1; end if; end Try_Get; ------------------------------------------------------------------ -- Mailbox.Try_Put ------------------------------------------------------------------ procedure Try_Put (Msg : in Message; Success : out Boolean) is begin Success := Num_Messages < Size; if Success then -- Put message into latest slot and advance index. Msg_Queue (Latest) := Msg; Latest := (Latest mod Size) + 1; -- One more message deposited. Num_Messages := Num_Messages + 1; end if; end Try_Put; end Mailbox; end Local_Message_Passing;
spotify_prev.scpt
yantze/applescript-player-control
2
4222
tell application "Spotify" to previous track
programs/oeis/295/A295317.asm
neoneye/loda
22
101877
<filename>programs/oeis/295/A295317.asm ; A295317: Sum of the products of the smaller and larger parts of the partitions of n into two distinct parts with the smaller part odd. ; 0,0,2,3,4,5,18,22,26,30,64,73,82,91,156,172,188,204,310,335,360,385,542,578,614,650,868,917,966,1015,1304,1368,1432,1496,1866,1947,2028,2109,2570,2670,2770,2870,3432,3553,3674,3795,4468,4612,4756,4900,5694,5863,6032,6201,7126,7322,7518,7714,8780,9005,9230,9455,10672,10928,11184,11440,12818,13107,13396,13685,15234,15558,15882,16206,17936,18297,18658,19019,20940,21340,21740,22140,24262,24703,25144,25585,27918,28402,28886,29370,31924,32453,32982,33511,36296,36872,37448,38024,41050,41675 mov $2,$0 lpb $0 sub $0,1 add $1,$2 add $2,$0 trn $0,4 add $2,$0 add $0,1 lpe mov $0,$1
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_DrawUpdateStructIfVal_fastcall.asm
jpoikela/z88dk
640
29766
; sp1_DrawUpdateStructIfVal(struct sp1_update *u) SECTION code_clib SECTION code_temp_sp1 PUBLIC _sp1_DrawUpdateStructIfVal_fastcall EXTERN asm_sp1_DrawUpdateStructIfVal defc _sp1_DrawUpdateStructIfVal_fastcall = asm_sp1_DrawUpdateStructIfVal
kernel/cpu/mem.asm
Irchh/uefi-os
3
103224
<reponame>Irchh/uefi-os global read_cr3 global load_pml4t read_cr3: mov rax, cr3 ret load_pml4t: cli ;ret push rdi mov rdi, cr4 or rdi, 1<<5 mov cr4, rdi pop rdi mov cr3, rdi sti ret
electives/pw/lab/lista-2/ada/receiver.adb
jerry-sky/academic-notebook
4
10262
package body Receiver is task body ReceiverTask is receivedMessagesCount: Natural := 0; begin loop accept ReceiveMessage do receivedMessagesCount := Natural'Succ(receivedMessagesCount); end ReceiveMessage; if k = receivedMessagesCount then exit; end if; end loop; accept Ended do null; end Ended; end ReceiverTask; end Receiver;
src/regex-utilities-string_buffers.ads
skordal/ada-regex
2
13987
-- Ada regular expression library -- (c) <NAME> 2020 <<EMAIL>> -- Report bugs and issues on <https://github.com/skordal/ada-regex> private with Ada.Strings.Unbounded; package Regex.Utilities.String_Buffers is -- String buffer type: type String_Buffer is tagged limited private; -- Creates a string buffer: function Create (Input : in String) return String_Buffer; -- Gets the next character from a string buffer: function Get_Next (This : in out String_Buffer) return Character; -- Peeks at the next character in a string buffer: function Peek (This : in out String_Buffer) return Character; -- Discards the next character in a string buffer: procedure Discard_Next (This : in out String_Buffer); -- Checks whether the string buffer index is at the end: function At_End (This : in String_Buffer) return Boolean; -- Gets the current index in the string buffer: function Get_Index (This : in String_Buffer) return Natural; private type String_Buffer is tagged limited record Buffer : Ada.Strings.Unbounded.Unbounded_String; Index : Integer; end record; end Regex.Utilities.String_Buffers;
libsrc/_DEVELOPMENT/adt/p_forward_list_alt/z80/asm_p_forward_list_alt_push_back.asm
jpoikela/z88dk
640
170499
; =============================================================== ; Dec 2013 ; =============================================================== ; ; void p_forward_list_alt_push_back(p_forward_list_alt_t *list, void *item) ; ; Add item to the end of the list. ; ; =============================================================== SECTION code_clib SECTION code_adt_p_forward_list_alt PUBLIC asm_p_forward_list_alt_push_back EXTERN asm_p_forward_list_alt_insert_after asm_p_forward_list_alt_push_back: ; enter : bc = p_forward_list_alt_t *list ; de = void *item ; ; exit : bc = p_forward_list_alt_t *list ; hl = void *item ; ; uses : af, de, hl inc bc inc bc ld a,(bc) ld l,a inc bc ld a,(bc) ld h,a ; hl = list->tail dec bc dec bc dec bc ; bc = list jp asm_p_forward_list_alt_insert_after
programs/oeis/076/A076312.asm
karttu/loda
1
87457
<filename>programs/oeis/076/A076312.asm ; A076312: a(n) = floor(n/10) + 2*(n mod 10). ; 0,2,4,6,8,10,12,14,16,18,1,3,5,7,9,11,13,15,17,19,2,4,6,8,10,12,14,16,18,20,3,5,7,9,11,13,15,17,19,21,4,6,8,10,12,14,16,18,20,22,5,7,9,11,13,15,17,19,21,23,6,8,10,12,14,16,18,20,22,24,7,9,11,13,15,17,19,21,23,25,8,10,12,14,16,18,20,22,24,26,9,11,13,15,17,19,21,23,25,27,10,12,14,16,18,20,22,24,26,28,11,13,15,17,19,21,23,25,27,29,12,14,16,18,20,22,24,26,28,30,13,15,17,19,21,23,25,27,29,31,14,16,18,20,22,24,26,28,30,32,15,17,19,21,23,25,27,29,31,33,16,18,20,22,24,26,28,30,32,34,17,19,21,23,25,27,29,31,33,35,18,20,22,24,26,28,30,32,34,36,19,21,23,25,27,29,31,33,35,37,20,22,24,26,28,30,32,34,36,38,21,23,25,27,29,31,33,35,37,39,22,24,26,28,30,32,34,36,38,40,23,25,27,29,31,33,35,37,39,41,24,26,28,30,32,34,36,38,40,42 mov $1,$0 mod $0,10 mul $0,19 add $1,$0 div $1,10
Projetos/H-Assembler/Assembler/src/test/resources/testLeaw.nasm
RaphaelAzev/Z01-GrupoH-2-
2
176230
; Arquivo: testLeaw.nasm ; Curso: Elementos de Sistemas ; Criado por: <NAME> ; Data: 16/04/2017 leaw $0,%A leaw $1,%A leaw $2,%A leaw $R0,%A leaw $R1,%A leaw $R2,%A
programs/oeis/225/A225972.asm
jmorken/loda
1
174803
; A225972: The number of binary pattern classes in the (2,n)-rectangular grid with 3 '1's and (2n-3) '0's: two patterns are in same class if one of them can be obtained by a reflection or 180-degree rotation of the other. ; 0,0,1,6,14,32,55,94,140,208,285,390,506,656,819,1022,1240,1504,1785,2118,2470,2880,3311,3806,4324,4912,5525,6214,6930,7728,8555,9470,10416,11456,12529,13702,14910,16224,17575,19038,20540,22160,23821,25606,27434,29392,31395,33534,35720,38048,40425,42950,45526,48256,51039,53982,56980,60144,63365,66758,70210,73840,77531,81406,85344,89472,93665,98054,102510,107168,111895,116830,121836,127056,132349,137862,143450,149264,155155,161278,167480,173920,180441,187206,194054,201152,208335,215774,223300,231088,238965,247110,255346,263856,272459,281342,290320,299584,308945,318598,328350,338400,348551,359006,369564,380432,391405,402694,414090,425808,437635,449790,462056,474656,487369,500422,513590,527104,540735,554718,568820,583280,597861,612806,627874,643312,658875,674814,690880,707328,723905,740870,757966,775456,793079,811102,829260,847824,866525,885638,904890,924560,944371,964606,984984,1005792,1026745,1048134,1069670,1091648,1113775,1136350,1159076,1182256,1205589,1229382,1253330,1277744,1302315,1327358,1352560,1378240,1404081,1430406,1456894,1483872,1511015,1538654,1566460,1594768,1623245,1652230,1681386,1711056,1740899,1771262,1801800,1832864,1864105,1895878,1927830,1960320,1992991,2026206,2059604,2093552,2127685,2162374,2197250,2232688,2268315,2304510,2340896,2377856,2415009,2452742,2490670,2529184,2567895,2607198,2646700,2686800,2727101,2768006,2809114,2850832,2892755,2935294,2978040,3021408,3064985,3109190,3153606,3198656,3243919,3289822,3335940,3382704,3429685,3477318,3525170,3573680,3622411,3671806,3721424,3771712,3822225,3873414,3924830,3976928,4029255,4082270,4135516,4189456,4243629,4298502,4353610,4409424,4465475,4522238,4579240,4636960,4694921,4753606,4812534,4872192,4932095,4992734,5053620,5115248 mov $2,$0 lpb $2 lpb $4 add $1,$5 trn $4,2 lpe lpb $5 add $3,$0 add $4,$5 sub $1,$4 trn $5,$3 lpe add $4,$2 sub $2,1 add $4,2 add $5,$2 lpe
src/firmware-tests/Platform/Main/ResetDummies.asm
pete-restall/Cluck2Sesame-Prototype
1
160707
<filename>src/firmware-tests/Platform/Main/ResetDummies.asm #include "Platform.inc" radix decimal ResetDummies code global initialiseAfterPowerOnReset global initialiseAfterBrownOutReset global initialiseAfterMclrReset initialiseAfterPowerOnReset: return initialiseAfterBrownOutReset: return initialiseAfterMclrReset: return end
ada/src/afrl/cmasi/afrl-cmasi-enumerations.ads
joffreyhuguet/LmcpGen
0
30874
<reponame>joffreyhuguet/LmcpGen package afrl.cmasi.enumerations is type WavelengthBandEnum is (AllAny, EO, LWIR, SWIR, MWIR, Other); for WavelengthBandEnum use (AllAny => 0, EO => 1, LWIR => 2, SWIR => 3, MWIR => 4, Other => 5); type AltitudeTypeEnum is (AGL, MSL); for AltitudeTypeEnum use (AGL => 0, MSL => 1); type FOVOperationModeEnum is (Continuous, Discrete); for FOVOperationModeEnum use (Continuous => 0, Discrete => 1); type GimbalPointingModeEnum is (Unknown, AirVehicleRelativeAngle, AirVehicleRelativeSlewRate, LatLonSlaved, InertialRelativeSlewRate, Scan, Stowed); for GimbalPointingModeEnum use (Unknown => 0, AirVehicleRelativeAngle => 1, AirVehicleRelativeSlewRate => 2, LatLonSlaved => 3, InertialRelativeSlewRate => 4, Scan => 5, Stowed => 6); type CmasiEnum is (ABSTRACTGEOMETRY_ENUM, KEYVALUEPAIR_ENUM, LOCATION3D_ENUM, PAYLOADACTION_ENUM, PAYLOADCONFIGURATION_ENUM, PAYLOADSTATE_ENUM, VEHICLEACTION_ENUM, -- TASK, SEARCHTASK_ENUM, ABSTRACTZONE_ENUM, ENTITYCONFIGURATION_ENUM, FLIGHTPROFILE_ENUM, AIRVEHICLECONFIGURATION_ENUM, ENTITYSTATE_ENUM, AIRVEHICLESTATE_ENUM, WEDGE_ENUM, AREASEARCHTASK_ENUM, CAMERAACTION_ENUM, CAMERACONFIGURATION_ENUM, GIMBALLEDPAYLOADSTATE_ENUM, CAMERASTATE_ENUM, CIRCLE_ENUM, GIMBALANGLEACTION_ENUM, GIMBALCONFIGURATION_ENUM, GIMBALSCANACTION_ENUM, GIMBALSTAREACTION_ENUM, GIMBALSTATE_ENUM, GOTOWAYPOINTACTION_ENUM, KEEPINZONE_ENUM, KEEPOUTZONE_ENUM, LINESEARCHTASK_ENUM, NAVIGATIONACTION_ENUM, LOITERACTION_ENUM, LOITERTASK_ENUM, WAYPOINT_ENUM, MISSIONCOMMAND_ENUM, MUSTFLYTASK_ENUM, OPERATORSIGNAL_ENUM, OPERATINGREGION_ENUM, AUTOMATIONREQUEST_ENUM, POINTSEARCHTASK_ENUM, POLYGON_ENUM, RECTANGLE_ENUM, REMOVETASKS_ENUM, SERVICESTATUS_ENUM, SESSIONSTATUS_ENUM, VEHICLEACTIONCOMMAND_ENUM, VIDEOSTREAMACTION_ENUM, VIDEOSTREAMCONFIGURATION_ENUM, VIDEOSTREAMSTATE_ENUM, AUTOMATIONRESPONSE_ENUM, REMOVEZONES_ENUM, REMOVEENTITIES_ENUM, FLIGHTDIRECTORACTION_ENUM, WEATHERREPORT_ENUM, FOLLOWPATHCOMMAND_ENUM, PATHWAYPOINT_ENUM, STOPMOVEMENTACTION_ENUM, WAYPOINTTRANSFER_ENUM, PAYLOADSTOWACTION_ENUM ); for CmasiEnum use (ABSTRACTGEOMETRY_ENUM => 1, KEYVALUEPAIR_ENUM => 2, LOCATION3D_ENUM => 3, PAYLOADACTION_ENUM => 4, PAYLOADCONFIGURATION_ENUM => 5, PAYLOADSTATE_ENUM => 6, VEHICLEACTION_ENUM => 7, -- TASK => 8, SEARCHTASK_ENUM => 9, ABSTRACTZONE_ENUM => 10, ENTITYCONFIGURATION_ENUM => 11, FLIGHTPROFILE_ENUM => 12, AIRVEHICLECONFIGURATION_ENUM => 13, ENTITYSTATE_ENUM => 14, AIRVEHICLESTATE_ENUM => 15, WEDGE_ENUM => 16, AREASEARCHTASK_ENUM => 17, CAMERAACTION_ENUM => 18, CAMERACONFIGURATION_ENUM => 19, GIMBALLEDPAYLOADSTATE_ENUM => 20, CAMERASTATE_ENUM => 21, CIRCLE_ENUM => 22, GIMBALANGLEACTION_ENUM => 23, GIMBALCONFIGURATION_ENUM => 24, GIMBALSCANACTION_ENUM => 25, GIMBALSTAREACTION_ENUM => 26, GIMBALSTATE_ENUM => 27, GOTOWAYPOINTACTION_ENUM => 28, KEEPINZONE_ENUM => 29, KEEPOUTZONE_ENUM => 30, LINESEARCHTASK_ENUM => 31, NAVIGATIONACTION_ENUM => 32, LOITERACTION_ENUM => 33, LOITERTASK_ENUM => 34, WAYPOINT_ENUM => 35, MISSIONCOMMAND_ENUM => 36, MUSTFLYTASK_ENUM => 37, OPERATORSIGNAL_ENUM => 38, OPERATINGREGION_ENUM => 39, AUTOMATIONREQUEST_ENUM => 40, POINTSEARCHTASK_ENUM => 41, POLYGON_ENUM => 42, RECTANGLE_ENUM => 43, REMOVETASKS_ENUM => 44, SERVICESTATUS_ENUM => 45, SESSIONSTATUS_ENUM => 46, VEHICLEACTIONCOMMAND_ENUM => 47, VIDEOSTREAMACTION_ENUM => 48, VIDEOSTREAMCONFIGURATION_ENUM => 49, VIDEOSTREAMSTATE_ENUM => 50, AUTOMATIONRESPONSE_ENUM => 51, REMOVEZONES_ENUM => 52, REMOVEENTITIES_ENUM => 53, FLIGHTDIRECTORACTION_ENUM => 54, WEATHERREPORT_ENUM => 55, FOLLOWPATHCOMMAND_ENUM => 56, PATHWAYPOINT_ENUM => 57, STOPMOVEMENTACTION_ENUM => 58, WAYPOINTTRANSFER_ENUM => 59, PAYLOADSTOWACTION_ENUM => 60 ); end afrl.cmasi.enumerations;
src/commonAntlrTest/antlr/RewriterTest.g4
piacenti/dsl-maker
0
3247
grammar RewriterTest; main: ID+; ID: ~[ \t\r\n()'":]+;
src/flame.asm
Kannagi/Mega-Mario-TD
2
101869
dc.l $00000000 dc.l $00000003 dc.l $00000022 dc.l $00003020 dc.l $00023024 dc.l $00020044 dc.l $00040242 dc.l $00242442 dc.l $00244223 dc.l $02442231 dc.l $02422351 dc.l $04423151 dc.l $04423111 dc.l $00242311 dc.l $00242233 dc.l $00004422 dc.l $01000000 dc.l $33000000 dc.l $30020000 dc.l $20220000 dc.l $00200000 dc.l $00420000 dc.l $40420000 dc.l $44240200 dc.l $44344200 dc.l $23124400 dc.l $51132420 dc.l $51132420 dc.l $11132420 dc.l $11324200 dc.l $33244200 dc.l $22440000 dc.l $00000020 dc.l $00000020 dc.l $00000420 dc.l $00000420 dc.l $00004422 dc.l $00004422 dc.l $03024224 dc.l $02024234 dc.l $02442332 dc.l $34423313 dc.l $24423151 dc.l $44223151 dc.l $02423111 dc.l $02422331 dc.l $00242233 dc.l $00004422 dc.l $00000000 dc.l $00000000 dc.l $00200000 dc.l $00200000 dc.l $04420000 dc.l $42420030 dc.l $42420030 dc.l $43242020 dc.l $23224443 dc.l $31322442 dc.l $51332442 dc.l $51132444 dc.l $11132420 dc.l $13322420 dc.l $33224200 dc.l $22440000 palette_flame: dc.w $0ea0 dc.w $0eee dc.w $026e dc.w $02ae dc.w $000e dc.w $0222 ;palette size octet : 12 ,hexa $000c ;size octet : 448 ,hexa $01c0,tile : 7
examples/readint.asm
AlessandroFonseca/util.asm
1
97262
%include '../util.asm' section .text global _start _start: mov rdi, prompt call printstr call readint imul r14, rax, 2 mov rdi, msg2 call printstr mov rdi, r14 call printint call endl call exit section .data prompt: db 'Input a number: ', 0 msg2: db 'Twice: ', 0
test/Succeed/Issue1922.agda
cruhland/agda
1,989
2100
data Bool : Set where true false : Bool data Nat : Set where zero : Nat suc : Nat → Nat one : Nat one = suc zero two : Nat two = suc one data Fin : Nat → Set where zero : ∀{n} → Fin (suc n) suc : ∀{n} (i : Fin n) → Fin (suc n) --This part works as expected: s : ∀ n → (f : (k : Fin n) → Bool) → Fin (suc n) s n f = zero t1 : Fin two t1 = s one (λ { zero → true ; (suc ()) }) -- But Agda is not able to infer the 1 in this case: ttwo : Fin two ttwo = s _ (λ { zero → true ; (suc ()) }) -- Warning: -- _142 : Nat -- The problem gets worse when i add arguments to the ttwo function. This gives an error: t3 : Set → Fin two t3 A = s _ (λ { zero → true ; (suc ()) })
gfx/pokemon/ivysaur/anim.asm
Dev727/ancientplatinum
28
172539
frame 0, 06 frame 1, 08 frame 2, 20 frame 1, 06 endanim
pwnlib/shellcraft/templates/i386/linux/mprotect_all.asm
kristoff3r/pwntools
6
18442
<% from pwnlib.shellcraft import common %> <%page args="clear_ebx = True, fix_null = False"/> <%docstring>Calls mprotect(page, 4096, PROT_READ | PROT_WRITE | PROT_EXEC) for every page. It takes around 0.3 seconds on my box, but your milage may vary. Args: clear_ebx(bool): If this is set to False, then the shellcode will assume that ebx has already been zeroed. fix_null(bool): If this is set to True, then the NULL-page will also be mprotected at the cost of slightly larger shellcode </%docstring> <% label = common.label("mprotect_loop") %> %if clear_ebx: xor ebx, ebx %endif %if fix_null: xor ecx, ecx %endif ${label}: push PROT_READ | PROT_WRITE | PROT_EXEC pop edx push SYS_mprotect pop eax int 0x80 xor ecx, ecx mov ch, 0x10 add ebx, ecx jnz ${label}
test/bugs/fixed/DotPattern.agda
alhassy/agda
3
5525
<filename>test/bugs/fixed/DotPattern.agda module Bug where data A : Set where a : A h : A -> A h a = a data B : A -> Set where b : (x : A) -> B (h x) data _==_ : {x₁ x₂ : A} -> B x₁ -> B x₂ -> Set where eqb : {x : A} -> b x == b x -- The problem here is that we get the constraint h x = h x, which when x is a -- meta variable we don't solve. This constraint blocks the solution y := b x -- and so we don't see that y should be dotted. Either explicitly dotting y or -- binding x removes the problem. bad : {x : A}{y : B x} -> y == y -> A bad eqb = ? -- bad .{h x} .{b x} (eqb {x}) = ? -- works -- bad .{y = _} eqb = ? -- works -- bad (eqb {_}) = ? -- works -- The above example is solved by checking syntactic equality on blocked terms. -- This doesn't work below: infixl 70 _/_ infixl 50 _▻_ infix 40 _∋_ _⊢ _⇒_ _≛_ _≈∋_ mutual data Ctxt : Set where _▻_ : (Γ : Ctxt) -> Γ ⊢ -> Ctxt data _⊢ : (Γ : Ctxt) -> Set where ✶ : {Γ : Ctxt} -> Γ ⊢ data _⇒_ : Ctxt -> Ctxt -> Set where wk : {Γ : Ctxt} (σ : Γ ⊢) -> Γ ⇒ Γ ▻ σ data _∋_ : (Γ : Ctxt) -> Γ ⊢ -> Set where vz : {Γ : Ctxt} (τ : Γ ⊢) -> Γ ▻ τ ∋ τ / wk τ _/_ : {Γ Δ : Ctxt} -> Γ ⊢ -> Γ ⇒ Δ -> Δ ⊢ ✶ / ρ = ✶ data _≛_ : {Γ¹ Γ² : Ctxt} -> Γ¹ ⊢ -> Γ² ⊢ -> Set where data _≈∋_ : {Γ¹ Γ² : Ctxt} {τ¹ : Γ¹ ⊢} {τ² : Γ² ⊢} -> Γ¹ ∋ τ¹ -> Γ² ∋ τ² -> Set where vzCong : {Γ¹ : Ctxt} {τ¹ : Γ¹ ⊢} {Γ² : Ctxt} {τ² : Γ² ⊢} -> τ¹ ≛ τ² -> vz τ¹ ≈∋ vz τ² f : {Γ¹ : Ctxt} {σ¹ : Γ¹ ⊢} {v¹ : Γ¹ ∋ σ¹} {Γ² : Ctxt} {σ² : Γ² ⊢} {v² : Γ² ∋ σ²} {Γ³ : Ctxt} {σ³ : Γ³ ⊢} {v³ : Γ³ ∋ σ³} -> v¹ ≈∋ v² -> v² ≈∋ v³ -> v¹ ≈∋ v³ f (vzCong eqσ¹²) (vzCong eqσ²³) = ?
Task/Towers-of-Hanoi/AppleScript/towers-of-hanoi-2.applescript
LaudateCorpus1/RosettaCodeData
1
4264
-- hanoi :: Int -> (String, String, String) -> [(String, String)] on hanoi(n, {a, b, c}) if n > 0 then hanoi(n - 1, {a, c, b}) & {{a, b}} & hanoi(n - 1, {c, b, a}) else {} end if end hanoi -- TEST -- arrow :: (String, String) -> String on arrow(tuple) item 1 of tuple & " -> " & item 2 of tuple end arrow on run map(arrow, ¬ hanoi(3, {"left", "right", "mid"})) --> {"left -> right", "left -> mid", "right -> mid", "left -> right", -- "mid -> left", "mid -> right", "left -> right"} end run -- LIBRARY FUNCTIONS -- map :: (a -> b) -> [a] -> [b] on map(f, xs) tell mReturn(f) set lng to length of xs set lst to {} repeat with i from 1 to lng set end of lst to lambda(item i of xs, i, xs) end repeat return lst end tell end map -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: Handler -> Script on mReturn(f) if class of f is script then f else script property lambda : f end script end if end mReturn
programs/oeis/176/A176711.asm
karttu/loda
1
104452
; A176711: a(n) = 16n^4 + 64n^3 + 104n^2 + 80n + 21. ; 21,285,1365,4221,10197,21021,38805,66045,105621,160797,235221,332925,458325,616221,811797,1050621,1338645,1682205,2088021,2563197,3115221,3751965,4481685,5313021,6254997,7317021,8508885,9840765,11323221,12967197,14784021,16785405,18983445,21390621,24019797,26884221,29997525,33373725,37027221,40972797,45225621,49801245,54715605,59985021,65626197,71656221,78092565,84953085,92256021,100019997,108264021,117007485,126270165,136072221,146434197,157377021,168922005,181090845,193905621,207388797,221563221,236452125,252079125,268468221,285643797,303630621,322453845,342139005,362712021,384199197,406627221,430023165,454414485,479829021,506294997,533841021,562496085,592289565,623251221,655411197,688800021,723448605,759388245,796650621,835267797,875272221,916696725,959574525,1003939221,1049824797,1097265621,1146296445,1196952405,1249269021,1303282197,1359028221,1416543765,1475865885,1537032021,1600079997,1665048021,1731974685,1800898965,1871860221,1944898197,2020053021,2097365205,2176875645,2258625621,2342656797,2429011221,2517731325,2608859925,2702440221,2798515797,2897130621,2998329045,3102155805,3208656021,3317875197,3429859221,3544654365,3662307285,3782865021,3906374997,4032885021,4162443285,4295098365,4430899221,4569895197,4712136021,4857671805,5006553045,5158830621,5314555797,5473780221,5636555925,5802935325,5972971221,6146716797,6324225621,6505551645,6690749205,6879873021,7072978197,7270120221,7471354965,7676738685,7886328021,8100179997,8318352021,8540901885,8767887765,8999368221,9235402197,9476049021,9721368405,9971420445,10226265621,10485964797,10750579221,11020170525,11294800725,11574532221,11859427797,12149550621,12444964245,12745732605,13051920021,13363591197,13680811221,14003645565,14332160085,14666421021,15006494997,15352449021,15704350485,16062267165,16426267221,16796419197,17172792021,17555455005,17944477845,18339930621,18741883797,19150408221,19565575125,19987456125,20416123221,20851648797,21294105621,21743566845,22200106005,22663797021,23134714197,23612932221,24098526165,24591571485,25092144021,25600319997,26116176021,26639789085,27171236565,27710596221,28257946197,28813365021,29376931605,29948725245,30528825621,31117312797,31714267221,32319769725,32933901525,33556744221,34188379797,34828890621,35478359445,36136869405,36804504021,37481347197,38167483221,38862996765,39567972885,40282497021,41006654997,41740533021,42484217685,43237795965,44001355221,44774983197,45558768021,46352798205,47157162645,47971950621,48797251797,49633156221,50479754325,51337136925,52205395221,53084620797,53974905621,54876342045,55789022805,56713041021,57648490197,58595464221,59554057365,60524364285,61506480021,62500499997 add $0,1 pow $0,2 mul $0,8 mov $1,4 add $1,$0 mul $1,$0 sub $1,96 div $1,96 mul $1,24 add $1,21
test/interaction/Issue1842.agda
pthariensflame/agda
3
9533
<gh_stars>1-10 -- Issue #1842, __IMPOSSIBLE__ showed up in debug output {-# OPTIONS -v interaction.case:65 #-} -- KEEP data Bool : Set where true false : Bool test : Bool → Bool test x = {!x!} -- C-c C-c -- Splitting here with debug output turned on -- should not crash.
ffight/lcs/container/2E.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
80503
<reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data copyright zengfr site:http://github.com/zengfr/romhack 003A06 movem.l D0-D3, -(A6) 003A0A movem.l D0-D3, -(A6) 009ACA dbra D5, $9ac8 0517D4 move.b ($3e,A6), ($36,A6) 0522CE move.b ($36,A6), ($2e,A6) [container+38, container+3A] 0522D4 move.l ($a,A6), ($e,A6) 05245E move.b ($36,A6), ($2e,A6) [container+38, container+3A] 052464 move.l ($a,A6), ($e,A6) 05248C move.b ($3e,A6), ($36,A6) 0526DC move.b ($36,A6), ($2e,A6) [container+38, container+3A] 0526E2 move.l ($a,A6), ($e,A6) 05270A move.b ($3e,A6), ($36,A6) 052976 move.b ($36,A6), ($2e,A6) [container+38, container+3A] 05297C move.l ($a,A6), ($e,A6) 0529A4 move.b ($3e,A6), ($36,A6) 052D26 move.b ($36,A6), ($2e,A6) [container+38, container+3A] 052D2C move.l ($a,A6), ($e,A6) copyright zengfr site:http://github.com/zengfr/romhack
message/generation/swift-mt-generation/repository/SR2018/grammars/SwiftMtParser_MT566.g4
Yanick-Salzmann/message-converter-c
0
853
<reponame>Yanick-Salzmann/message-converter-c<filename>message/generation/swift-mt-generation/repository/SR2018/grammars/SwiftMtParser_MT566.g4<gh_stars>0 grammar SwiftMtParser_MT566; @lexer::header { #include "repository/ISwiftMtParser.h" #include "SwiftMtMessage.pb.h" #include <vector> #include <string> #include "BaseErrorListener.h" } @parser::header { #include "repository/ISwiftMtParser.h" #include "SwiftMtMessage.pb.h" #include <vector> #include <string> #include "BaseErrorListener.h" #include "SwiftMtParser_MT566Lexer.h" } @parser::members { public: typedef SwiftMtParser_MT566Lexer tLexer; typedef SwiftMtParser_MT566Parser tParser; private: std::vector<std::string> _errors; public: [[nodiscard]] const std::vector<std::string>& errors() const { return _errors; } private: class DefaultErrorListener : public antlr4::BaseErrorListener { private: std::vector<std::string>& _errors; public: explicit DefaultErrorListener(std::vector<std::string>& errors) : _errors(errors) { } void syntaxError(Recognizer *recognizer, antlr4::Token * offendingSymbol, size_t line, size_t charPositionInLine, const std::string &msg, std::exception_ptr e) override { _errors.push_back(msg); } }; DefaultErrorListener _error_listener { _errors }; public: class Helper : public ISwiftMtParser { public: bool parse_message(const std::string& message, std::vector<std::string>& errors, SwiftMtMessage& out_message) override { antlr4::ANTLRInputStream stream{message}; tLexer lexer{&stream}; antlr4::CommonTokenStream token_stream{&lexer}; tParser parser{&token_stream}; return parser.process(errors, out_message); } }; private: SwiftMtMessage _message_builder{}; bool process(std::vector<std::string>& errors, SwiftMtMessage& out_message) { _errors.clear(); removeErrorListeners(); addErrorListener(&_error_listener); _message_builder = SwiftMtMessage{}; message(); if(!_errors.empty()) { errors.insert(errors.end(), _errors.begin(), _errors.end()); return false; } out_message = _message_builder; return true; } public: [[nodiscard]] SwiftMtMessage parsed_message() const { return _message_builder; } } message : bh ah uh? mt tr? EOF; bh : TAG_BH bh_content RBRACE ; bh_content : ~(RBRACE)+ ; ah : TAG_AH ah_content RBRACE ; ah_content : ~( RBRACE )+ ; uh : TAG_UH sys_block RBRACE ; tr : TAG_TR sys_block RBRACE ; sys_block : sys_element+ ; sys_element : LBRACE sys_element_key COLON sys_element_content RBRACE ; sys_element_key : ~( COLON | RBRACE )+ ; sys_element_content : ~( RBRACE )+ ; mt returns [message::definition::swift::mt::MessageText elem] @after { _message_builder.mutable_msg_text()->MergeFrom($elem); } : TAG_MT seq_A seq_B seq_C? seq_D seq_E? MT_END; seq_A returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A"); } : fld_16R_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A.fld); } fld_20C_A+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_A.fld); } fld_23G_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_23G_A.fld); } fld_22F_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_A.fld); } fld_98a_A? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_A.fld); } seq_A1* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_A1.elem); } fld_16S_A { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A.fld); } ; seq_A1 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("A1"); } : fld_16R_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_A1.fld); } fld_22F_A1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_A1.fld); } fld_13a_A1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13a_A1.fld); } fld_20C_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_A1.fld); } fld_16S_A1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_A1.fld); } ; seq_B returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("B"); } : fld_16R_B { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_B.fld); } fld_95a_B? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_B.fld); } fld_97A_B { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_97A_B.fld); } fld_94a_B? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94a_B.fld); } fld_35B_B { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_35B_B.fld); } seq_B1? { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_B1.elem); } fld_93a_B+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_93a_B.fld); } fld_16S_B { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_B.fld); } ; seq_B1 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("B1"); } : fld_16R_B1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_B1.fld); } fld_94B_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94B_B1.fld); } fld_22F_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_B1.fld); } fld_12a_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_12a_B1.fld); } fld_11A_B1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_11A_B1.fld); } fld_98A_B1* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98A_B1.fld); } fld_92a_B1* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92a_B1.fld); } fld_36B_B1* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_36B_B1.fld); } fld_16S_B1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_B1.fld); } ; seq_C returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("C"); } : fld_16R_C { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_C.fld); } fld_98a_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_C.fld); } fld_69a_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_69a_C.fld); } fld_99A_C? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_99A_C.fld); } fld_92a_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92a_C.fld); } fld_90a_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_C.fld); } fld_36a_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_36a_C.fld); } fld_13a_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13a_C.fld); } fld_17B_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_17B_C.fld); } fld_22F_C* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_C.fld); } fld_16S_C { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_C.fld); } ; seq_D returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("D"); } : fld_16R_D { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_D.fld); } fld_13A_D { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_13A_D.fld); } fld_22a_D+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22a_D.fld); } fld_11A_D? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_11A_D.fld); } fld_98a_D* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_D.fld); } fld_69a_D* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_69a_D.fld); } fld_92a_D* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92a_D.fld); } fld_90a_D* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_D.fld); } fld_94B_D? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94B_D.fld); } seq_D1* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_D1.elem); } seq_D2* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_D2.elem); } fld_16S_D { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_D.fld); } ; seq_D1 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("D1"); } : fld_16R_D1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_D1.fld); } fld_22a_D1+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22a_D1.fld); } fld_35B_D1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_35B_D1.fld); } seq_D1a? { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_D1a.elem); } fld_36B_D1+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_36B_D1.fld); } fld_94a_D1* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94a_D1.fld); } fld_22F_D1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_D1.fld); } fld_11A_D1? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_11A_D1.fld); } fld_90a_D1* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_D1.fld); } fld_92a_D1* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92a_D1.fld); } fld_98a_D1+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_D1.fld); } seq_D1b* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_D1b.elem); } fld_16S_D1 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_D1.fld); } ; seq_D1a returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("D1a"); } : fld_16R_D1a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_D1a.fld); } fld_94B_D1a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94B_D1a.fld); } fld_22F_D1a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22F_D1a.fld); } fld_12a_D1a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_12a_D1a.fld); } fld_11A_D1a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_11A_D1a.fld); } fld_98A_D1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98A_D1a.fld); } fld_90a_D1a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_D1a.fld); } fld_92A_D1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92A_D1a.fld); } fld_36B_D1a* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_36B_D1a.fld); } fld_16S_D1a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_D1a.fld); } ; seq_D1b returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("D1b"); } : fld_16R_D1b { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_D1b.fld); } fld_95a_D1b+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_D1b.fld); } fld_97A_D1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_97A_D1b.fld); } fld_20C_D1b? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_D1b.fld); } fld_16S_D1b { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_D1b.fld); } ; seq_D2 returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("D2"); } : fld_16R_D2 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_D2.fld); } fld_22a_D2+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_22a_D2.fld); } fld_94C_D2? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_94C_D2.fld); } fld_97a_D2? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_97a_D2.fld); } seq_D2a* { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_D2a.elem); } fld_19B_D2+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_19B_D2.fld); } fld_98a_D2+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_D2.fld); } fld_92a_D2* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_92a_D2.fld); } fld_90a_D2* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_90a_D2.fld); } seq_D2b? { $elem.mutable_objects()->Add()->mutable_sequence()->MergeFrom($seq_D2b.elem); } fld_16S_D2 { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_D2.fld); } ; seq_D2a returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("D2a"); } : fld_16R_D2a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_D2a.fld); } fld_95a_D2a+ { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_D2a.fld); } fld_97a_D2a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_97a_D2a.fld); } fld_20C_D2a? { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_D2a.fld); } fld_16S_D2a { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_D2a.fld); } ; seq_D2b returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("D2b"); } : fld_16R_D2b { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_D2b.fld); } fld_20C_D2b { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_20C_D2b.fld); } fld_98a_D2b* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_98a_D2b.fld); } fld_16S_D2b { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_D2b.fld); } ; seq_E returns [message::definition::swift::mt::Sequence elem] @init { $elem.set_tag("E"); } : fld_16R_E { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16R_E.fld); } fld_70E_E* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_70E_E.fld); } fld_95a_E* { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_95a_E.fld); } fld_16S_E { $elem.mutable_objects()->Add()->mutable_field()->MergeFrom($fld_16S_E.fld); } ; fld_16R_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_20C_A returns [message::definition::swift::mt::Field fld] : fld_20C_A_C { $fld.MergeFrom($fld_20C_A_C.fld); } ; fld_23G_A returns [message::definition::swift::mt::Field fld] : fld_23G_A_G { $fld.MergeFrom($fld_23G_A_G.fld); } ; fld_22F_A returns [message::definition::swift::mt::Field fld] : fld_22F_A_F { $fld.MergeFrom($fld_22F_A_F.fld); } ; fld_98a_A returns [message::definition::swift::mt::Field fld] : fld_98a_A_A { $fld.MergeFrom($fld_98a_A_A.fld); } | fld_98a_A_C { $fld.MergeFrom($fld_98a_A_C.fld); } ; fld_16R_A1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_22F_A1 returns [message::definition::swift::mt::Field fld] : fld_22F_A1_F { $fld.MergeFrom($fld_22F_A1_F.fld); } ; fld_13a_A1 returns [message::definition::swift::mt::Field fld] : fld_13a_A1_A { $fld.MergeFrom($fld_13a_A1_A.fld); } | fld_13a_A1_B { $fld.MergeFrom($fld_13a_A1_B.fld); } ; fld_20C_A1 returns [message::definition::swift::mt::Field fld] : fld_20C_A1_C { $fld.MergeFrom($fld_20C_A1_C.fld); } ; fld_16S_A1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16S_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16R_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_95a_B returns [message::definition::swift::mt::Field fld] : fld_95a_B_P { $fld.MergeFrom($fld_95a_B_P.fld); } | fld_95a_B_R { $fld.MergeFrom($fld_95a_B_R.fld); } ; fld_97A_B returns [message::definition::swift::mt::Field fld] : fld_97A_B_A { $fld.MergeFrom($fld_97A_B_A.fld); } ; fld_94a_B returns [message::definition::swift::mt::Field fld] : fld_94a_B_B { $fld.MergeFrom($fld_94a_B_B.fld); } | fld_94a_B_C { $fld.MergeFrom($fld_94a_B_C.fld); } | fld_94a_B_F { $fld.MergeFrom($fld_94a_B_F.fld); } ; fld_35B_B returns [message::definition::swift::mt::Field fld] : fld_35B_B_B { $fld.MergeFrom($fld_35B_B_B.fld); } ; fld_16R_B1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_94B_B1 returns [message::definition::swift::mt::Field fld] : fld_94B_B1_B { $fld.MergeFrom($fld_94B_B1_B.fld); } ; fld_22F_B1 returns [message::definition::swift::mt::Field fld] : fld_22F_B1_F { $fld.MergeFrom($fld_22F_B1_F.fld); } ; fld_12a_B1 returns [message::definition::swift::mt::Field fld] : fld_12a_B1_A { $fld.MergeFrom($fld_12a_B1_A.fld); } | fld_12a_B1_C { $fld.MergeFrom($fld_12a_B1_C.fld); } ; fld_11A_B1 returns [message::definition::swift::mt::Field fld] : fld_11A_B1_A { $fld.MergeFrom($fld_11A_B1_A.fld); } ; fld_98A_B1 returns [message::definition::swift::mt::Field fld] : fld_98A_B1_A { $fld.MergeFrom($fld_98A_B1_A.fld); } ; fld_92a_B1 returns [message::definition::swift::mt::Field fld] : fld_92a_B1_A { $fld.MergeFrom($fld_92a_B1_A.fld); } | fld_92a_B1_D { $fld.MergeFrom($fld_92a_B1_D.fld); } ; fld_36B_B1 returns [message::definition::swift::mt::Field fld] : fld_36B_B1_B { $fld.MergeFrom($fld_36B_B1_B.fld); } ; fld_16S_B1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_93a_B returns [message::definition::swift::mt::Field fld] : fld_93a_B_B { $fld.MergeFrom($fld_93a_B_B.fld); } | fld_93a_B_C { $fld.MergeFrom($fld_93a_B_C.fld); } ; fld_16S_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16R_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_98a_C returns [message::definition::swift::mt::Field fld] : fld_98a_C_A { $fld.MergeFrom($fld_98a_C_A.fld); } | fld_98a_C_B { $fld.MergeFrom($fld_98a_C_B.fld); } | fld_98a_C_C { $fld.MergeFrom($fld_98a_C_C.fld); } | fld_98a_C_E { $fld.MergeFrom($fld_98a_C_E.fld); } ; fld_69a_C returns [message::definition::swift::mt::Field fld] : fld_69a_C_A { $fld.MergeFrom($fld_69a_C_A.fld); } | fld_69a_C_B { $fld.MergeFrom($fld_69a_C_B.fld); } | fld_69a_C_C { $fld.MergeFrom($fld_69a_C_C.fld); } | fld_69a_C_D { $fld.MergeFrom($fld_69a_C_D.fld); } | fld_69a_C_E { $fld.MergeFrom($fld_69a_C_E.fld); } | fld_69a_C_F { $fld.MergeFrom($fld_69a_C_F.fld); } ; fld_99A_C returns [message::definition::swift::mt::Field fld] : fld_99A_C_A { $fld.MergeFrom($fld_99A_C_A.fld); } ; fld_92a_C returns [message::definition::swift::mt::Field fld] : fld_92a_C_A { $fld.MergeFrom($fld_92a_C_A.fld); } | fld_92a_C_F { $fld.MergeFrom($fld_92a_C_F.fld); } | fld_92a_C_K { $fld.MergeFrom($fld_92a_C_K.fld); } | fld_92a_C_P { $fld.MergeFrom($fld_92a_C_P.fld); } ; fld_90a_C returns [message::definition::swift::mt::Field fld] : fld_90a_C_A { $fld.MergeFrom($fld_90a_C_A.fld); } | fld_90a_C_B { $fld.MergeFrom($fld_90a_C_B.fld); } | fld_90a_C_L { $fld.MergeFrom($fld_90a_C_L.fld); } ; fld_36a_C returns [message::definition::swift::mt::Field fld] : fld_36a_C_B { $fld.MergeFrom($fld_36a_C_B.fld); } | fld_36a_C_C { $fld.MergeFrom($fld_36a_C_C.fld); } ; fld_13a_C returns [message::definition::swift::mt::Field fld] : fld_13a_C_A { $fld.MergeFrom($fld_13a_C_A.fld); } | fld_13a_C_B { $fld.MergeFrom($fld_13a_C_B.fld); } ; fld_17B_C returns [message::definition::swift::mt::Field fld] : fld_17B_C_B { $fld.MergeFrom($fld_17B_C_B.fld); } ; fld_22F_C returns [message::definition::swift::mt::Field fld] : fld_22F_C_F { $fld.MergeFrom($fld_22F_C_F.fld); } ; fld_16S_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16R_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_13A_D returns [message::definition::swift::mt::Field fld] : fld_13A_D_A { $fld.MergeFrom($fld_13A_D_A.fld); } ; fld_22a_D returns [message::definition::swift::mt::Field fld] : fld_22a_D_F { $fld.MergeFrom($fld_22a_D_F.fld); } | fld_22a_D_H { $fld.MergeFrom($fld_22a_D_H.fld); } ; fld_11A_D returns [message::definition::swift::mt::Field fld] : fld_11A_D_A { $fld.MergeFrom($fld_11A_D_A.fld); } ; fld_98a_D returns [message::definition::swift::mt::Field fld] : fld_98a_D_A { $fld.MergeFrom($fld_98a_D_A.fld); } | fld_98a_D_B { $fld.MergeFrom($fld_98a_D_B.fld); } | fld_98a_D_C { $fld.MergeFrom($fld_98a_D_C.fld); } | fld_98a_D_E { $fld.MergeFrom($fld_98a_D_E.fld); } ; fld_69a_D returns [message::definition::swift::mt::Field fld] : fld_69a_D_A { $fld.MergeFrom($fld_69a_D_A.fld); } | fld_69a_D_B { $fld.MergeFrom($fld_69a_D_B.fld); } | fld_69a_D_C { $fld.MergeFrom($fld_69a_D_C.fld); } | fld_69a_D_D { $fld.MergeFrom($fld_69a_D_D.fld); } | fld_69a_D_E { $fld.MergeFrom($fld_69a_D_E.fld); } | fld_69a_D_F { $fld.MergeFrom($fld_69a_D_F.fld); } ; fld_92a_D returns [message::definition::swift::mt::Field fld] : fld_92a_D_A { $fld.MergeFrom($fld_92a_D_A.fld); } | fld_92a_D_F { $fld.MergeFrom($fld_92a_D_F.fld); } | fld_92a_D_H { $fld.MergeFrom($fld_92a_D_H.fld); } | fld_92a_D_J { $fld.MergeFrom($fld_92a_D_J.fld); } | fld_92a_D_R { $fld.MergeFrom($fld_92a_D_R.fld); } ; fld_90a_D returns [message::definition::swift::mt::Field fld] : fld_90a_D_A { $fld.MergeFrom($fld_90a_D_A.fld); } | fld_90a_D_B { $fld.MergeFrom($fld_90a_D_B.fld); } ; fld_94B_D returns [message::definition::swift::mt::Field fld] : fld_94B_D_B { $fld.MergeFrom($fld_94B_D_B.fld); } ; fld_16R_D1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_22a_D1 returns [message::definition::swift::mt::Field fld] : fld_22a_D1_F { $fld.MergeFrom($fld_22a_D1_F.fld); } | fld_22a_D1_H { $fld.MergeFrom($fld_22a_D1_H.fld); } ; fld_35B_D1 returns [message::definition::swift::mt::Field fld] : fld_35B_D1_B { $fld.MergeFrom($fld_35B_D1_B.fld); } ; fld_16R_D1a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_94B_D1a returns [message::definition::swift::mt::Field fld] : fld_94B_D1a_B { $fld.MergeFrom($fld_94B_D1a_B.fld); } ; fld_22F_D1a returns [message::definition::swift::mt::Field fld] : fld_22F_D1a_F { $fld.MergeFrom($fld_22F_D1a_F.fld); } ; fld_12a_D1a returns [message::definition::swift::mt::Field fld] : fld_12a_D1a_A { $fld.MergeFrom($fld_12a_D1a_A.fld); } | fld_12a_D1a_C { $fld.MergeFrom($fld_12a_D1a_C.fld); } ; fld_11A_D1a returns [message::definition::swift::mt::Field fld] : fld_11A_D1a_A { $fld.MergeFrom($fld_11A_D1a_A.fld); } ; fld_98A_D1a returns [message::definition::swift::mt::Field fld] : fld_98A_D1a_A { $fld.MergeFrom($fld_98A_D1a_A.fld); } ; fld_90a_D1a returns [message::definition::swift::mt::Field fld] : fld_90a_D1a_A { $fld.MergeFrom($fld_90a_D1a_A.fld); } | fld_90a_D1a_B { $fld.MergeFrom($fld_90a_D1a_B.fld); } ; fld_92A_D1a returns [message::definition::swift::mt::Field fld] : fld_92A_D1a_A { $fld.MergeFrom($fld_92A_D1a_A.fld); } ; fld_36B_D1a returns [message::definition::swift::mt::Field fld] : fld_36B_D1a_B { $fld.MergeFrom($fld_36B_D1a_B.fld); } ; fld_16S_D1a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_36B_D1 returns [message::definition::swift::mt::Field fld] : fld_36B_D1_B { $fld.MergeFrom($fld_36B_D1_B.fld); } ; fld_94a_D1 returns [message::definition::swift::mt::Field fld] : fld_94a_D1_B { $fld.MergeFrom($fld_94a_D1_B.fld); } | fld_94a_D1_C { $fld.MergeFrom($fld_94a_D1_C.fld); } | fld_94a_D1_F { $fld.MergeFrom($fld_94a_D1_F.fld); } ; fld_22F_D1 returns [message::definition::swift::mt::Field fld] : fld_22F_D1_F { $fld.MergeFrom($fld_22F_D1_F.fld); } ; fld_11A_D1 returns [message::definition::swift::mt::Field fld] : fld_11A_D1_A { $fld.MergeFrom($fld_11A_D1_A.fld); } ; fld_90a_D1 returns [message::definition::swift::mt::Field fld] : fld_90a_D1_A { $fld.MergeFrom($fld_90a_D1_A.fld); } | fld_90a_D1_B { $fld.MergeFrom($fld_90a_D1_B.fld); } | fld_90a_D1_F { $fld.MergeFrom($fld_90a_D1_F.fld); } | fld_90a_D1_J { $fld.MergeFrom($fld_90a_D1_J.fld); } | fld_90a_D1_K { $fld.MergeFrom($fld_90a_D1_K.fld); } | fld_90a_D1_L { $fld.MergeFrom($fld_90a_D1_L.fld); } ; fld_92a_D1 returns [message::definition::swift::mt::Field fld] : fld_92a_D1_A { $fld.MergeFrom($fld_92a_D1_A.fld); } | fld_92a_D1_D { $fld.MergeFrom($fld_92a_D1_D.fld); } | fld_92a_D1_F { $fld.MergeFrom($fld_92a_D1_F.fld); } | fld_92a_D1_L { $fld.MergeFrom($fld_92a_D1_L.fld); } | fld_92a_D1_M { $fld.MergeFrom($fld_92a_D1_M.fld); } | fld_92a_D1_N { $fld.MergeFrom($fld_92a_D1_N.fld); } ; fld_98a_D1 returns [message::definition::swift::mt::Field fld] : fld_98a_D1_A { $fld.MergeFrom($fld_98a_D1_A.fld); } | fld_98a_D1_B { $fld.MergeFrom($fld_98a_D1_B.fld); } | fld_98a_D1_C { $fld.MergeFrom($fld_98a_D1_C.fld); } | fld_98a_D1_E { $fld.MergeFrom($fld_98a_D1_E.fld); } ; fld_16R_D1b returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_95a_D1b returns [message::definition::swift::mt::Field fld] : fld_95a_D1b_C { $fld.MergeFrom($fld_95a_D1b_C.fld); } | fld_95a_D1b_P { $fld.MergeFrom($fld_95a_D1b_P.fld); } | fld_95a_D1b_Q { $fld.MergeFrom($fld_95a_D1b_Q.fld); } | fld_95a_D1b_R { $fld.MergeFrom($fld_95a_D1b_R.fld); } | fld_95a_D1b_S { $fld.MergeFrom($fld_95a_D1b_S.fld); } ; fld_97A_D1b returns [message::definition::swift::mt::Field fld] : fld_97A_D1b_A { $fld.MergeFrom($fld_97A_D1b_A.fld); } ; fld_20C_D1b returns [message::definition::swift::mt::Field fld] : fld_20C_D1b_C { $fld.MergeFrom($fld_20C_D1b_C.fld); } ; fld_16S_D1b returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16S_D1 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16R_D2 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_22a_D2 returns [message::definition::swift::mt::Field fld] : fld_22a_D2_F { $fld.MergeFrom($fld_22a_D2_F.fld); } | fld_22a_D2_H { $fld.MergeFrom($fld_22a_D2_H.fld); } ; fld_94C_D2 returns [message::definition::swift::mt::Field fld] : fld_94C_D2_C { $fld.MergeFrom($fld_94C_D2_C.fld); } ; fld_97a_D2 returns [message::definition::swift::mt::Field fld] : fld_97a_D2_A { $fld.MergeFrom($fld_97a_D2_A.fld); } | fld_97a_D2_E { $fld.MergeFrom($fld_97a_D2_E.fld); } ; fld_16R_D2a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_95a_D2a returns [message::definition::swift::mt::Field fld] : fld_95a_D2a_P { $fld.MergeFrom($fld_95a_D2a_P.fld); } | fld_95a_D2a_Q { $fld.MergeFrom($fld_95a_D2a_Q.fld); } | fld_95a_D2a_R { $fld.MergeFrom($fld_95a_D2a_R.fld); } | fld_95a_D2a_S { $fld.MergeFrom($fld_95a_D2a_S.fld); } ; fld_97a_D2a returns [message::definition::swift::mt::Field fld] : fld_97a_D2a_A { $fld.MergeFrom($fld_97a_D2a_A.fld); } | fld_97a_D2a_E { $fld.MergeFrom($fld_97a_D2a_E.fld); } ; fld_20C_D2a returns [message::definition::swift::mt::Field fld] : fld_20C_D2a_C { $fld.MergeFrom($fld_20C_D2a_C.fld); } ; fld_16S_D2a returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_19B_D2 returns [message::definition::swift::mt::Field fld] : fld_19B_D2_B { $fld.MergeFrom($fld_19B_D2_B.fld); } ; fld_98a_D2 returns [message::definition::swift::mt::Field fld] : fld_98a_D2_A { $fld.MergeFrom($fld_98a_D2_A.fld); } | fld_98a_D2_C { $fld.MergeFrom($fld_98a_D2_C.fld); } | fld_98a_D2_E { $fld.MergeFrom($fld_98a_D2_E.fld); } ; fld_92a_D2 returns [message::definition::swift::mt::Field fld] : fld_92a_D2_A { $fld.MergeFrom($fld_92a_D2_A.fld); } | fld_92a_D2_B { $fld.MergeFrom($fld_92a_D2_B.fld); } | fld_92a_D2_F { $fld.MergeFrom($fld_92a_D2_F.fld); } | fld_92a_D2_H { $fld.MergeFrom($fld_92a_D2_H.fld); } | fld_92a_D2_J { $fld.MergeFrom($fld_92a_D2_J.fld); } | fld_92a_D2_M { $fld.MergeFrom($fld_92a_D2_M.fld); } | fld_92a_D2_R { $fld.MergeFrom($fld_92a_D2_R.fld); } ; fld_90a_D2 returns [message::definition::swift::mt::Field fld] : fld_90a_D2_A { $fld.MergeFrom($fld_90a_D2_A.fld); } | fld_90a_D2_B { $fld.MergeFrom($fld_90a_D2_B.fld); } | fld_90a_D2_F { $fld.MergeFrom($fld_90a_D2_F.fld); } | fld_90a_D2_J { $fld.MergeFrom($fld_90a_D2_J.fld); } | fld_90a_D2_K { $fld.MergeFrom($fld_90a_D2_K.fld); } | fld_90a_D2_L { $fld.MergeFrom($fld_90a_D2_L.fld); } ; fld_16R_D2b returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_20C_D2b returns [message::definition::swift::mt::Field fld] : fld_20C_D2b_C { $fld.MergeFrom($fld_20C_D2b_C.fld); } ; fld_98a_D2b returns [message::definition::swift::mt::Field fld] : fld_98a_D2b_A { $fld.MergeFrom($fld_98a_D2b_A.fld); } | fld_98a_D2b_C { $fld.MergeFrom($fld_98a_D2b_C.fld); } ; fld_16S_D2b returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16S_D2 returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16S_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_16R_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16R"); } : START_OF_FIELD '16R:' ~(START_OF_FIELD)+; fld_70E_E returns [message::definition::swift::mt::Field fld] : fld_70E_E_E { $fld.MergeFrom($fld_70E_E_E.fld); } ; fld_95a_E returns [message::definition::swift::mt::Field fld] : fld_95a_E_P { $fld.MergeFrom($fld_95a_E_P.fld); } | fld_95a_E_Q { $fld.MergeFrom($fld_95a_E_Q.fld); } | fld_95a_E_R { $fld.MergeFrom($fld_95a_E_R.fld); } ; fld_16S_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("16S"); } : START_OF_FIELD '16S:' ~(START_OF_FIELD)+; fld_20C_A_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }: START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ; fld_23G_A_G returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("23G"); }: START_OF_FIELD '23G:' ~(START_OF_FIELD)+ ; fld_22F_A_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_98a_A_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_A_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_22F_A1_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_13a_A1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13A"); }: START_OF_FIELD '13A:' ~(START_OF_FIELD)+ ; fld_13a_A1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13B"); }: START_OF_FIELD '13B:' ~(START_OF_FIELD)+ ; fld_20C_A1_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }: START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ; fld_95a_B_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }: START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ; fld_95a_B_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }: START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ; fld_97A_B_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97A"); }: START_OF_FIELD '97A:' ~(START_OF_FIELD)+ ; fld_94a_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_94a_B_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94C"); }: START_OF_FIELD '94C:' ~(START_OF_FIELD)+ ; fld_94a_B_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94F"); }: START_OF_FIELD '94F:' ~(START_OF_FIELD)+ ; fld_35B_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("35B"); }: START_OF_FIELD '35B:' ~(START_OF_FIELD)+ ; fld_94B_B1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_22F_B1_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_12a_B1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("12A"); }: START_OF_FIELD '12A:' ~(START_OF_FIELD)+ ; fld_12a_B1_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("12C"); }: START_OF_FIELD '12C:' ~(START_OF_FIELD)+ ; fld_11A_B1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("11A"); }: START_OF_FIELD '11A:' ~(START_OF_FIELD)+ ; fld_98A_B1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_92a_B1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92A"); }: START_OF_FIELD '92A:' ~(START_OF_FIELD)+ ; fld_92a_B1_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92D"); }: START_OF_FIELD '92D:' ~(START_OF_FIELD)+ ; fld_36B_B1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("36B"); }: START_OF_FIELD '36B:' ~(START_OF_FIELD)+ ; fld_93a_B_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("93B"); }: START_OF_FIELD '93B:' ~(START_OF_FIELD)+ ; fld_93a_B_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("93C"); }: START_OF_FIELD '93C:' ~(START_OF_FIELD)+ ; fld_98a_C_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_C_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98B"); }: START_OF_FIELD '98B:' ~(START_OF_FIELD)+ ; fld_98a_C_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_98a_C_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98E"); }: START_OF_FIELD '98E:' ~(START_OF_FIELD)+ ; fld_69a_C_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69A"); }: START_OF_FIELD '69A:' ~(START_OF_FIELD)+ ; fld_69a_C_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69B"); }: START_OF_FIELD '69B:' ~(START_OF_FIELD)+ ; fld_69a_C_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69C"); }: START_OF_FIELD '69C:' ~(START_OF_FIELD)+ ; fld_69a_C_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69D"); }: START_OF_FIELD '69D:' ~(START_OF_FIELD)+ ; fld_69a_C_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69E"); }: START_OF_FIELD '69E:' ~(START_OF_FIELD)+ ; fld_69a_C_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69F"); }: START_OF_FIELD '69F:' ~(START_OF_FIELD)+ ; fld_99A_C_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("99A"); }: START_OF_FIELD '99A:' ~(START_OF_FIELD)+ ; fld_92a_C_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92A"); }: START_OF_FIELD '92A:' ~(START_OF_FIELD)+ ; fld_92a_C_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92F"); }: START_OF_FIELD '92F:' ~(START_OF_FIELD)+ ; fld_92a_C_K returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92K"); }: START_OF_FIELD '92K:' ~(START_OF_FIELD)+ ; fld_92a_C_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92P"); }: START_OF_FIELD '92P:' ~(START_OF_FIELD)+ ; fld_90a_C_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_C_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_90a_C_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90L"); }: START_OF_FIELD '90L:' ~(START_OF_FIELD)+ ; fld_36a_C_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("36B"); }: START_OF_FIELD '36B:' ~(START_OF_FIELD)+ ; fld_36a_C_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("36C"); }: START_OF_FIELD '36C:' ~(START_OF_FIELD)+ ; fld_13a_C_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13A"); }: START_OF_FIELD '13A:' ~(START_OF_FIELD)+ ; fld_13a_C_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13B"); }: START_OF_FIELD '13B:' ~(START_OF_FIELD)+ ; fld_17B_C_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("17B"); }: START_OF_FIELD '17B:' ~(START_OF_FIELD)+ ; fld_22F_C_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_13A_D_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("13A"); }: START_OF_FIELD '13A:' ~(START_OF_FIELD)+ ; fld_22a_D_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_22a_D_H returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22H"); }: START_OF_FIELD '22H:' ~(START_OF_FIELD)+ ; fld_11A_D_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("11A"); }: START_OF_FIELD '11A:' ~(START_OF_FIELD)+ ; fld_98a_D_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_D_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98B"); }: START_OF_FIELD '98B:' ~(START_OF_FIELD)+ ; fld_98a_D_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_98a_D_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98E"); }: START_OF_FIELD '98E:' ~(START_OF_FIELD)+ ; fld_69a_D_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69A"); }: START_OF_FIELD '69A:' ~(START_OF_FIELD)+ ; fld_69a_D_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69B"); }: START_OF_FIELD '69B:' ~(START_OF_FIELD)+ ; fld_69a_D_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69C"); }: START_OF_FIELD '69C:' ~(START_OF_FIELD)+ ; fld_69a_D_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69D"); }: START_OF_FIELD '69D:' ~(START_OF_FIELD)+ ; fld_69a_D_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69E"); }: START_OF_FIELD '69E:' ~(START_OF_FIELD)+ ; fld_69a_D_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("69F"); }: START_OF_FIELD '69F:' ~(START_OF_FIELD)+ ; fld_92a_D_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92A"); }: START_OF_FIELD '92A:' ~(START_OF_FIELD)+ ; fld_92a_D_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92F"); }: START_OF_FIELD '92F:' ~(START_OF_FIELD)+ ; fld_92a_D_H returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92H"); }: START_OF_FIELD '92H:' ~(START_OF_FIELD)+ ; fld_92a_D_J returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92J"); }: START_OF_FIELD '92J:' ~(START_OF_FIELD)+ ; fld_92a_D_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92R"); }: START_OF_FIELD '92R:' ~(START_OF_FIELD)+ ; fld_90a_D_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_D_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_94B_D_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_22a_D1_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_22a_D1_H returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22H"); }: START_OF_FIELD '22H:' ~(START_OF_FIELD)+ ; fld_35B_D1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("35B"); }: START_OF_FIELD '35B:' ~(START_OF_FIELD)+ ; fld_94B_D1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_22F_D1a_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_12a_D1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("12A"); }: START_OF_FIELD '12A:' ~(START_OF_FIELD)+ ; fld_12a_D1a_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("12C"); }: START_OF_FIELD '12C:' ~(START_OF_FIELD)+ ; fld_11A_D1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("11A"); }: START_OF_FIELD '11A:' ~(START_OF_FIELD)+ ; fld_98A_D1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_90a_D1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_D1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_92A_D1a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92A"); }: START_OF_FIELD '92A:' ~(START_OF_FIELD)+ ; fld_36B_D1a_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("36B"); }: START_OF_FIELD '36B:' ~(START_OF_FIELD)+ ; fld_36B_D1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("36B"); }: START_OF_FIELD '36B:' ~(START_OF_FIELD)+ ; fld_94a_D1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94B"); }: START_OF_FIELD '94B:' ~(START_OF_FIELD)+ ; fld_94a_D1_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94C"); }: START_OF_FIELD '94C:' ~(START_OF_FIELD)+ ; fld_94a_D1_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94F"); }: START_OF_FIELD '94F:' ~(START_OF_FIELD)+ ; fld_22F_D1_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_11A_D1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("11A"); }: START_OF_FIELD '11A:' ~(START_OF_FIELD)+ ; fld_90a_D1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_D1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_90a_D1_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90F"); }: START_OF_FIELD '90F:' ~(START_OF_FIELD)+ ; fld_90a_D1_J returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90J"); }: START_OF_FIELD '90J:' ~(START_OF_FIELD)+ ; fld_90a_D1_K returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90K"); }: START_OF_FIELD '90K:' ~(START_OF_FIELD)+ ; fld_90a_D1_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90L"); }: START_OF_FIELD '90L:' ~(START_OF_FIELD)+ ; fld_92a_D1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92A"); }: START_OF_FIELD '92A:' ~(START_OF_FIELD)+ ; fld_92a_D1_D returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92D"); }: START_OF_FIELD '92D:' ~(START_OF_FIELD)+ ; fld_92a_D1_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92F"); }: START_OF_FIELD '92F:' ~(START_OF_FIELD)+ ; fld_92a_D1_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92L"); }: START_OF_FIELD '92L:' ~(START_OF_FIELD)+ ; fld_92a_D1_M returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92M"); }: START_OF_FIELD '92M:' ~(START_OF_FIELD)+ ; fld_92a_D1_N returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92N"); }: START_OF_FIELD '92N:' ~(START_OF_FIELD)+ ; fld_98a_D1_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_D1_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98B"); }: START_OF_FIELD '98B:' ~(START_OF_FIELD)+ ; fld_98a_D1_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_98a_D1_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98E"); }: START_OF_FIELD '98E:' ~(START_OF_FIELD)+ ; fld_95a_D1b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95C"); }: START_OF_FIELD '95C:' ~(START_OF_FIELD)+ ; fld_95a_D1b_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }: START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ; fld_95a_D1b_Q returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95Q"); }: START_OF_FIELD '95Q:' ~(START_OF_FIELD)+ ; fld_95a_D1b_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }: START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ; fld_95a_D1b_S returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95S"); }: START_OF_FIELD '95S:' ~(START_OF_FIELD)+ ; fld_97A_D1b_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97A"); }: START_OF_FIELD '97A:' ~(START_OF_FIELD)+ ; fld_20C_D1b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }: START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ; fld_22a_D2_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22F"); }: START_OF_FIELD '22F:' ~(START_OF_FIELD)+ ; fld_22a_D2_H returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("22H"); }: START_OF_FIELD '22H:' ~(START_OF_FIELD)+ ; fld_94C_D2_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("94C"); }: START_OF_FIELD '94C:' ~(START_OF_FIELD)+ ; fld_97a_D2_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97A"); }: START_OF_FIELD '97A:' ~(START_OF_FIELD)+ ; fld_97a_D2_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97E"); }: START_OF_FIELD '97E:' ~(START_OF_FIELD)+ ; fld_95a_D2a_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }: START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ; fld_95a_D2a_Q returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95Q"); }: START_OF_FIELD '95Q:' ~(START_OF_FIELD)+ ; fld_95a_D2a_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }: START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ; fld_95a_D2a_S returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95S"); }: START_OF_FIELD '95S:' ~(START_OF_FIELD)+ ; fld_97a_D2a_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97A"); }: START_OF_FIELD '97A:' ~(START_OF_FIELD)+ ; fld_97a_D2a_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("97E"); }: START_OF_FIELD '97E:' ~(START_OF_FIELD)+ ; fld_20C_D2a_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }: START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ; fld_19B_D2_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("19B"); }: START_OF_FIELD '19B:' ~(START_OF_FIELD)+ ; fld_98a_D2_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_D2_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_98a_D2_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98E"); }: START_OF_FIELD '98E:' ~(START_OF_FIELD)+ ; fld_92a_D2_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92A"); }: START_OF_FIELD '92A:' ~(START_OF_FIELD)+ ; fld_92a_D2_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92B"); }: START_OF_FIELD '92B:' ~(START_OF_FIELD)+ ; fld_92a_D2_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92F"); }: START_OF_FIELD '92F:' ~(START_OF_FIELD)+ ; fld_92a_D2_H returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92H"); }: START_OF_FIELD '92H:' ~(START_OF_FIELD)+ ; fld_92a_D2_J returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92J"); }: START_OF_FIELD '92J:' ~(START_OF_FIELD)+ ; fld_92a_D2_M returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92M"); }: START_OF_FIELD '92M:' ~(START_OF_FIELD)+ ; fld_92a_D2_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("92R"); }: START_OF_FIELD '92R:' ~(START_OF_FIELD)+ ; fld_90a_D2_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90A"); }: START_OF_FIELD '90A:' ~(START_OF_FIELD)+ ; fld_90a_D2_B returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90B"); }: START_OF_FIELD '90B:' ~(START_OF_FIELD)+ ; fld_90a_D2_F returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90F"); }: START_OF_FIELD '90F:' ~(START_OF_FIELD)+ ; fld_90a_D2_J returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90J"); }: START_OF_FIELD '90J:' ~(START_OF_FIELD)+ ; fld_90a_D2_K returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90K"); }: START_OF_FIELD '90K:' ~(START_OF_FIELD)+ ; fld_90a_D2_L returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("90L"); }: START_OF_FIELD '90L:' ~(START_OF_FIELD)+ ; fld_20C_D2b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("20C"); }: START_OF_FIELD '20C:' ~(START_OF_FIELD)+ ; fld_98a_D2b_A returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98A"); }: START_OF_FIELD '98A:' ~(START_OF_FIELD)+ ; fld_98a_D2b_C returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("98C"); }: START_OF_FIELD '98C:' ~(START_OF_FIELD)+ ; fld_70E_E_E returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("70E"); }: START_OF_FIELD '70E:' ~(START_OF_FIELD)+ ; fld_95a_E_P returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95P"); }: START_OF_FIELD '95P:' ~(START_OF_FIELD)+ ; fld_95a_E_Q returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95Q"); }: START_OF_FIELD '95Q:' ~(START_OF_FIELD)+ ; fld_95a_E_R returns [message::definition::swift::mt::Field fld] @init { $fld.set_tag("95R"); }: START_OF_FIELD '95R:' ~(START_OF_FIELD)+ ; TAG_BH : '{1:' ; TAG_AH : '{2:' ; TAG_UH : '{3:' ; TAG_MT : '{4:' ; TAG_TR : '{5:' ; MT_END : '-}'; LBRACE : '{'; RBRACE : '}' ; COLON : ':'; START_OF_FIELD : '\r'? '\n:' ; ANY : . ;
out/CTLC/Equality.agda
JoeyEremondi/agda-soas
39
2974
{- This second-order equational theory was created from the following second-order syntax description: syntax CTLC | ΛC type N : 0-ary _↣_ : 2-ary | r30 ¬_ : 1-ary | r30 term app : α ↣ β α -> β | _$_ l20 lam : α.β -> α ↣ β | ƛ_ r10 throw : α ¬ α -> β callcc : ¬ α.α -> α theory (ƛβ) b : α.β a : α |> app (lam(x.b[x]), a) = b[a] (ƛη) f : α ↣ β |> lam (x. app(f, x)) = f -} module CTLC.Equality where open import SOAS.Common open import SOAS.Context open import SOAS.Variable open import SOAS.Families.Core open import SOAS.Families.Build open import SOAS.ContextMaps.Inductive open import CTLC.Signature open import CTLC.Syntax open import SOAS.Metatheory.SecondOrder.Metasubstitution ΛC:Syn open import SOAS.Metatheory.SecondOrder.Equality ΛC:Syn private variable α β γ τ : ΛCT Γ Δ Π : Ctx infix 1 _▹_⊢_≋ₐ_ -- Axioms of equality data _▹_⊢_≋ₐ_ : ∀ 𝔐 Γ {α} → (𝔐 ▷ ΛC) α Γ → (𝔐 ▷ ΛC) α Γ → Set where ƛβ : ⁅ α ⊩ β ⁆ ⁅ α ⁆̣ ▹ ∅ ⊢ (ƛ 𝔞⟨ x₀ ⟩) $ 𝔟 ≋ₐ 𝔞⟨ 𝔟 ⟩ ƛη : ⁅ α ↣ β ⁆̣ ▹ ∅ ⊢ ƛ (𝔞 $ x₀) ≋ₐ 𝔞 open EqLogic _▹_⊢_≋ₐ_ open ≋-Reasoning
example_1.1/src/draw_1_1.adb
rogermc2/GA_Ada
3
3687
-- with Blade_Types; with C3GA; with C3GA_Draw; with GA_Maths; -- with GA_Utilities; with Metric; with Multivector_Utilities; package body Draw_1_1 is -- --------------------------------------------------------------------- function Draw_Circle (Render_Program : GL.Objects.Programs.Program; C1, C2, C3 : Normalized_Point) return Circle is OP : Multivector; aCircle : Circle; begin OP := Outer_Product (C1, Outer_Product (C2, C3)); aCircle := To_Circle (OP); C3GA_Draw.Draw (Render_Program, aCircle); return aCircle; end Draw_Circle; -- --------------------------------------------------------------------- function Draw_Line (Render_Program : GL.Objects.Programs.Program; P1, P2 : Normalized_Point) return Line is aLine : constant Line := C3GA.Set_Line (P1, P2); begin C3GA_Draw.Draw (Render_Program, aLine); return aLine; end Draw_Line; -- --------------------------------------------------------------------- procedure Draw_Plane (Render_Program : GL.Objects.Programs.Program; DP : Dual_Plane) is begin C3GA_Draw.Draw (Render_Program, DP); end Draw_Plane; -- --------------------------------------------------------------------- procedure Draw_Reflected_Circle (Render_Program : GL.Objects.Programs.Program; C : Circle; DP : Dual_Plane) is begin C3GA_Draw.Draw (Render_Program, Multivector_Utilities.Reflect (C, DP)); end Draw_Reflected_Circle; -- --------------------------------------------------------------------- procedure Draw_Reflected_Line (Render_Program : GL.Objects.Programs.Program; L : Line; DP : Dual_Plane) is begin C3GA_Draw.Draw (Render_Program, Multivector_Utilities.Reflect (L, DP)); end Draw_Reflected_Line; -- --------------------------------------------------------------------- function Draw_Rotated_Circle (Render_Program : GL.Objects.Programs.Program; C: Circle; RV : TR_Versor) return Circle is MV : constant Multivector := Multivector_Utilities.Rotate (Multivector (C), RV); RC : constant Circle := To_Circle (MV); begin C3GA_Draw.Draw (Render_Program, RC); return RC; end Draw_Rotated_Circle; -- -------------------------------------------------------------------- function New_Dual_Plane (P1 : Normalized_Point; Normal : E3GA.E3_Vector) return Dual_Plane is OP : Multivector := Outer_Product (E3GA.To_MV_Vector (Normal), C3GA.ni); begin OP := Left_Contraction (P1, OP, Metric.C3_Metric); -- Checked OK against C++ return To_Dual_Plane (OP); end New_Dual_Plane; -- --------------------------------------------------------------------- function New_TR_Versor (L1 : Line) return TR_Versor is use Metric; Phi : constant Float := 0.5 * GA_Maths.Pi; Exp_MV : constant Multivector := Exp (0.5 * Phi * Dual (L1, C3_Metric), C3_Metric); LR : constant Dual_Line := To_Dual_Line (Exp_MV); begin return To_TRversor (LR); end New_TR_Versor; -- --------------------------------------------------------------------- end Draw_1_1;
libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm
jpoikela/z88dk
640
466
<filename>libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_shrink_to_fit_fastcall.asm<gh_stars>100-1000 ; int bv_priority_queue_shrink_to_fit_fastcall(bv_priority_queue_t *q) SECTION code_clib SECTION code_adt_bv_priority_queue PUBLIC _bv_priority_queue_shrink_to_fit_fastcall EXTERN asm_bv_priority_queue_shrink_to_fit defc _bv_priority_queue_shrink_to_fit_fastcall = asm_bv_priority_queue_shrink_to_fit
programs/oeis/246/A246472.asm
neoneye/loda
22
21552
<gh_stars>10-100 ; A246472: Number of order-preserving (monotone) functions from the power set of 1 = {0} to the power set of n = {0, ..., n-1}. ; 1,3,9,30,109,418,1650,6604,26589,107274,432934,1746484,7040626,28362324,114175812,459344920,1847008989,7423262554,29822432862,119766845860,480833598054,1929896415484,7744047734652,31067665113640,124613703290994,499744683756868 mov $1,$0 seq $0,28400 ; a(n) = (2^n + 1)^2. mov $2,$1 mul $2,2 bin $2,$1 sub $0,$2 sub $0,3 div $0,2 add $0,1
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/s-traent.ads
JCGobbi/Nucleo-STM32G474RE
0
5330
<reponame>JCGobbi/Nucleo-STM32G474RE ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . T R A C E B A C K _ E N T R I E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2003-2021, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package offers an abstraction of what is stored in traceback arrays -- for call-chain computation purposes. By default, as defined in this -- version of the package, an entry is a mere code location representing the -- address of a call instruction part of the call-chain. pragma Compiler_Unit_Warning; package System.Traceback_Entries is pragma Preelaborate; subtype Traceback_Entry is System.Address; -- This subtype defines what each traceback array entry contains Null_TB_Entry : constant Traceback_Entry := System.Null_Address; -- This is the value to be used when initializing an entry type Tracebacks_Array is array (Positive range <>) of Traceback_Entry; function PC_For (TB_Entry : Traceback_Entry) return System.Address; pragma Inline (PC_For); -- Returns the address of the call instruction associated with the -- provided entry. function TB_Entry_For (PC : System.Address) return Traceback_Entry; pragma Inline (TB_Entry_For); -- Returns an entry representing a frame for a call instruction at PC end System.Traceback_Entries;
arch/ARM/STM32/svd/stm32l5x2/stm32_svd-dma.ads
morbos/Ada_Drivers_Library
2
18688
<gh_stars>1-10 -- This spec has been automatically generated from STM32L5x2.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.DMA is pragma Preelaborate; --------------- -- Registers -- --------------- -- interrupt status register type ISR_Register is record -- Read-only. Channel x global interrupt flag (x = 1 ..7) GIF1 : Boolean; -- Read-only. Channel x transfer complete flag (x = 1 ..7) TCIF1 : Boolean; -- Read-only. Channel x half transfer flag (x = 1 ..7) HTIF1 : Boolean; -- Read-only. Channel x transfer error flag (x = 1 ..7) TEIF1 : Boolean; -- Read-only. Channel x global interrupt flag (x = 1 ..7) GIF2 : Boolean; -- Read-only. Channel x transfer complete flag (x = 1 ..7) TCIF2 : Boolean; -- Read-only. Channel x half transfer flag (x = 1 ..7) HTIF2 : Boolean; -- Read-only. Channel x transfer error flag (x = 1 ..7) TEIF2 : Boolean; -- Read-only. Channel x global interrupt flag (x = 1 ..7) GIF3 : Boolean; -- Read-only. Channel x transfer complete flag (x = 1 ..7) TCIF3 : Boolean; -- Read-only. Channel x half transfer flag (x = 1 ..7) HTIF3 : Boolean; -- Read-only. Channel x transfer error flag (x = 1 ..7) TEIF3 : Boolean; -- Read-only. Channel x global interrupt flag (x = 1 ..7) GIF4 : Boolean; -- Read-only. Channel x transfer complete flag (x = 1 ..7) TCIF4 : Boolean; -- Read-only. Channel x half transfer flag (x = 1 ..7) HTIF4 : Boolean; -- Read-only. Channel x transfer error flag (x = 1 ..7) TEIF4 : Boolean; -- Read-only. Channel x global interrupt flag (x = 1 ..7) GIF5 : Boolean; -- Read-only. Channel x transfer complete flag (x = 1 ..7) TCIF5 : Boolean; -- Read-only. Channel x half transfer flag (x = 1 ..7) HTIF5 : Boolean; -- Read-only. Channel x transfer error flag (x = 1 ..7) TEIF5 : Boolean; -- Read-only. Channel x global interrupt flag (x = 1 ..7) GIF6 : Boolean; -- Read-only. Channel x transfer complete flag (x = 1 ..7) TCIF6 : Boolean; -- Read-only. Channel x half transfer flag (x = 1 ..7) HTIF6 : Boolean; -- Read-only. Channel x transfer error flag (x = 1 ..7) TEIF6 : Boolean; -- Read-only. Channel x global interrupt flag (x = 1 ..7) GIF7 : Boolean; -- Read-only. Channel x transfer complete flag (x = 1 ..7) TCIF7 : Boolean; -- Read-only. Channel x half transfer flag (x = 1 ..7) HTIF7 : Boolean; -- Read-only. Channel x transfer error flag (x = 1 ..7) TEIF7 : Boolean; -- Read-only. global interrupt flag for channel 8 GIF8 : Boolean; -- Read-only. transfer complete (TC) flag for channel 8 TCIF8 : Boolean; -- Read-only. half transfer (HT) flag for channel 8 HTIF8 : Boolean; -- Read-only. transfer error (TE) flag for channel 8 TEIF8 : Boolean; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for ISR_Register use record GIF1 at 0 range 0 .. 0; TCIF1 at 0 range 1 .. 1; HTIF1 at 0 range 2 .. 2; TEIF1 at 0 range 3 .. 3; GIF2 at 0 range 4 .. 4; TCIF2 at 0 range 5 .. 5; HTIF2 at 0 range 6 .. 6; TEIF2 at 0 range 7 .. 7; GIF3 at 0 range 8 .. 8; TCIF3 at 0 range 9 .. 9; HTIF3 at 0 range 10 .. 10; TEIF3 at 0 range 11 .. 11; GIF4 at 0 range 12 .. 12; TCIF4 at 0 range 13 .. 13; HTIF4 at 0 range 14 .. 14; TEIF4 at 0 range 15 .. 15; GIF5 at 0 range 16 .. 16; TCIF5 at 0 range 17 .. 17; HTIF5 at 0 range 18 .. 18; TEIF5 at 0 range 19 .. 19; GIF6 at 0 range 20 .. 20; TCIF6 at 0 range 21 .. 21; HTIF6 at 0 range 22 .. 22; TEIF6 at 0 range 23 .. 23; GIF7 at 0 range 24 .. 24; TCIF7 at 0 range 25 .. 25; HTIF7 at 0 range 26 .. 26; TEIF7 at 0 range 27 .. 27; GIF8 at 0 range 28 .. 28; TCIF8 at 0 range 29 .. 29; HTIF8 at 0 range 30 .. 30; TEIF8 at 0 range 31 .. 31; end record; -- interrupt flag clear register type IFCR_Register is record -- Write-only. Channel x global interrupt clear (x = 1 ..7) CGIF1 : Boolean := False; -- Write-only. Channel x transfer complete clear (x = 1 ..7) CTCIF1 : Boolean := False; -- Write-only. Channel x half transfer clear (x = 1 ..7) CHTIF1 : Boolean := False; -- Write-only. Channel x transfer error clear (x = 1 ..7) CTEIF1 : Boolean := False; -- Write-only. Channel x global interrupt clear (x = 1 ..7) CGIF2 : Boolean := False; -- Write-only. Channel x transfer complete clear (x = 1 ..7) CTCIF2 : Boolean := False; -- Write-only. Channel x half transfer clear (x = 1 ..7) CHTIF2 : Boolean := False; -- Write-only. Channel x transfer error clear (x = 1 ..7) CTEIF2 : Boolean := False; -- Write-only. Channel x global interrupt clear (x = 1 ..7) CGIF3 : Boolean := False; -- Write-only. Channel x transfer complete clear (x = 1 ..7) CTCIF3 : Boolean := False; -- Write-only. Channel x half transfer clear (x = 1 ..7) CHTIF3 : Boolean := False; -- Write-only. Channel x transfer error clear (x = 1 ..7) CTEIF3 : Boolean := False; -- Write-only. Channel x global interrupt clear (x = 1 ..7) CGIF4 : Boolean := False; -- Write-only. Channel x transfer complete clear (x = 1 ..7) CTCIF4 : Boolean := False; -- Write-only. Channel x half transfer clear (x = 1 ..7) CHTIF4 : Boolean := False; -- Write-only. Channel x transfer error clear (x = 1 ..7) CTEIF4 : Boolean := False; -- Write-only. Channel x global interrupt clear (x = 1 ..7) CGIF5 : Boolean := False; -- Write-only. Channel x transfer complete clear (x = 1 ..7) CTCIF5 : Boolean := False; -- Write-only. Channel x half transfer clear (x = 1 ..7) CHTIF5 : Boolean := False; -- Write-only. Channel x transfer error clear (x = 1 ..7) CTEIF5 : Boolean := False; -- Write-only. Channel x global interrupt clear (x = 1 ..7) CGIF6 : Boolean := False; -- Write-only. Channel x transfer complete clear (x = 1 ..7) CTCIF6 : Boolean := False; -- Write-only. Channel x half transfer clear (x = 1 ..7) CHTIF6 : Boolean := False; -- Write-only. Channel x transfer error clear (x = 1 ..7) CTEIF6 : Boolean := False; -- Write-only. Channel x global interrupt clear (x = 1 ..7) CGIF7 : Boolean := False; -- Write-only. Channel x transfer complete clear (x = 1 ..7) CTCIF7 : Boolean := False; -- Write-only. Channel x half transfer clear (x = 1 ..7) CHTIF7 : Boolean := False; -- Write-only. Channel x transfer error clear (x = 1 ..7) CTEIF7 : Boolean := False; -- Write-only. global interrupt flag clear for channel 8 CGIF8 : Boolean := False; -- Write-only. transfer complete flag clear for channel 8 CTCIF8 : Boolean := False; -- Write-only. half transfer flag clear for channel 8 CHTIF8 : Boolean := False; -- Write-only. transfer error flag clear for channel 8 CTEIF8 : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for IFCR_Register use record CGIF1 at 0 range 0 .. 0; CTCIF1 at 0 range 1 .. 1; CHTIF1 at 0 range 2 .. 2; CTEIF1 at 0 range 3 .. 3; CGIF2 at 0 range 4 .. 4; CTCIF2 at 0 range 5 .. 5; CHTIF2 at 0 range 6 .. 6; CTEIF2 at 0 range 7 .. 7; CGIF3 at 0 range 8 .. 8; CTCIF3 at 0 range 9 .. 9; CHTIF3 at 0 range 10 .. 10; CTEIF3 at 0 range 11 .. 11; CGIF4 at 0 range 12 .. 12; CTCIF4 at 0 range 13 .. 13; CHTIF4 at 0 range 14 .. 14; CTEIF4 at 0 range 15 .. 15; CGIF5 at 0 range 16 .. 16; CTCIF5 at 0 range 17 .. 17; CHTIF5 at 0 range 18 .. 18; CTEIF5 at 0 range 19 .. 19; CGIF6 at 0 range 20 .. 20; CTCIF6 at 0 range 21 .. 21; CHTIF6 at 0 range 22 .. 22; CTEIF6 at 0 range 23 .. 23; CGIF7 at 0 range 24 .. 24; CTCIF7 at 0 range 25 .. 25; CHTIF7 at 0 range 26 .. 26; CTEIF7 at 0 range 27 .. 27; CGIF8 at 0 range 28 .. 28; CTCIF8 at 0 range 29 .. 29; CHTIF8 at 0 range 30 .. 30; CTEIF8 at 0 range 31 .. 31; end record; subtype CCR_PSIZE_Field is HAL.UInt2; subtype CCR_MSIZE_Field is HAL.UInt2; subtype CCR_PL_Field is HAL.UInt2; -- channel x configuration register type CCR_Register is record -- Channel enable EN : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Data transfer direction DIR : Boolean := False; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral size PSIZE : CCR_PSIZE_Field := 16#0#; -- Memory size MSIZE : CCR_MSIZE_Field := 16#0#; -- Channel priority level PL : CCR_PL_Field := 16#0#; -- Memory to memory mode MEM2MEM : Boolean := False; -- double-buffer mode DBM : Boolean := False; -- current target memory of DMA transfer in double-buffer mode CT : Boolean := False; -- secure mode SECM : Boolean := False; -- security of the DMA transfer from the source SSEC : Boolean := False; -- security of the DMA transfer to the destination DSEC : Boolean := False; -- privileged mode PRIV : Boolean := False; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CCR_Register use record EN at 0 range 0 .. 0; TCIE at 0 range 1 .. 1; HTIE at 0 range 2 .. 2; TEIE at 0 range 3 .. 3; DIR at 0 range 4 .. 4; CIRC at 0 range 5 .. 5; PINC at 0 range 6 .. 6; MINC at 0 range 7 .. 7; PSIZE at 0 range 8 .. 9; MSIZE at 0 range 10 .. 11; PL at 0 range 12 .. 13; MEM2MEM at 0 range 14 .. 14; DBM at 0 range 15 .. 15; CT at 0 range 16 .. 16; SECM at 0 range 17 .. 17; SSEC at 0 range 18 .. 18; DSEC at 0 range 19 .. 19; PRIV at 0 range 20 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype CNDTR_NDT_Field is HAL.UInt18; -- channel x number of data register type CNDTR_Register is record -- Number of data to transfer NDT : CNDTR_NDT_Field := 16#0#; -- unspecified Reserved_18_31 : HAL.UInt14 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CNDTR_Register use record NDT at 0 range 0 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; subtype CM1AR_PSIZE_Field is HAL.UInt2; subtype CM1AR_MSIZE_Field is HAL.UInt2; subtype CM1AR_PL_Field is HAL.UInt2; -- channel x memory address register type CM1AR_Register is record -- Channel enable EN : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Data transfer direction DIR : Boolean := False; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral size PSIZE : CM1AR_PSIZE_Field := 16#0#; -- Memory size MSIZE : CM1AR_MSIZE_Field := 16#0#; -- Channel priority level PL : CM1AR_PL_Field := 16#0#; -- Memory to memory mode MEM2MEM : Boolean := False; -- double-buffer mode DBM : Boolean := False; -- current target memory of DMA transfer in double-buffer mode CT : Boolean := False; -- secure mode SECM : Boolean := False; -- security of the DMA transfer from the source SSEC : Boolean := False; -- security of the DMA transfer to the destination DSEC : Boolean := False; -- privileged mode PRIV : Boolean := False; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CM1AR_Register use record EN at 0 range 0 .. 0; TCIE at 0 range 1 .. 1; HTIE at 0 range 2 .. 2; TEIE at 0 range 3 .. 3; DIR at 0 range 4 .. 4; CIRC at 0 range 5 .. 5; PINC at 0 range 6 .. 6; MINC at 0 range 7 .. 7; PSIZE at 0 range 8 .. 9; MSIZE at 0 range 10 .. 11; PL at 0 range 12 .. 13; MEM2MEM at 0 range 14 .. 14; DBM at 0 range 15 .. 15; CT at 0 range 16 .. 16; SECM at 0 range 17 .. 17; SSEC at 0 range 18 .. 18; DSEC at 0 range 19 .. 19; PRIV at 0 range 20 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype CCR_NDT_Field is HAL.UInt18; -- channel x configuration register type CCR_Register_1 is record -- Number of data to transfer NDT : CCR_NDT_Field := 16#0#; -- unspecified Reserved_18_31 : HAL.UInt14 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CCR_Register_1 use record NDT at 0 range 0 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; subtype CM0AR2_PSIZE_Field is HAL.UInt2; subtype CM0AR2_MSIZE_Field is HAL.UInt2; subtype CM0AR2_PL_Field is HAL.UInt2; -- channel x memory address register type CM0AR2_Register is record -- Channel enable EN : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Data transfer direction DIR : Boolean := False; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral size PSIZE : CM0AR2_PSIZE_Field := 16#0#; -- Memory size MSIZE : CM0AR2_MSIZE_Field := 16#0#; -- Channel priority level PL : CM0AR2_PL_Field := 16#0#; -- Memory to memory mode MEM2MEM : Boolean := False; -- double-buffer mode DBM : Boolean := False; -- current target memory of DMA transfer in double-buffer mode CT : Boolean := False; -- secure mode SECM : Boolean := False; -- security of the DMA transfer from the source SSEC : Boolean := False; -- security of the DMA transfer to the destination DSEC : Boolean := False; -- privileged mode PRIV : Boolean := False; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CM0AR2_Register use record EN at 0 range 0 .. 0; TCIE at 0 range 1 .. 1; HTIE at 0 range 2 .. 2; TEIE at 0 range 3 .. 3; DIR at 0 range 4 .. 4; CIRC at 0 range 5 .. 5; PINC at 0 range 6 .. 6; MINC at 0 range 7 .. 7; PSIZE at 0 range 8 .. 9; MSIZE at 0 range 10 .. 11; PL at 0 range 12 .. 13; MEM2MEM at 0 range 14 .. 14; DBM at 0 range 15 .. 15; CT at 0 range 16 .. 16; SECM at 0 range 17 .. 17; SSEC at 0 range 18 .. 18; DSEC at 0 range 19 .. 19; PRIV at 0 range 20 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype CM1AR2_NDT_Field is HAL.UInt18; -- channel x memory address register type CM1AR2_Register is record -- Number of data to transfer NDT : CM1AR2_NDT_Field := 16#0#; -- unspecified Reserved_18_31 : HAL.UInt14 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CM1AR2_Register use record NDT at 0 range 0 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; subtype CPAR3_PSIZE_Field is HAL.UInt2; subtype CPAR3_MSIZE_Field is HAL.UInt2; subtype CPAR3_PL_Field is HAL.UInt2; -- channel x peripheral address register type CPAR3_Register is record -- Channel enable EN : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Data transfer direction DIR : Boolean := False; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral size PSIZE : CPAR3_PSIZE_Field := 16#0#; -- Memory size MSIZE : CPAR3_MSIZE_Field := 16#0#; -- Channel priority level PL : CPAR3_PL_Field := 16#0#; -- Memory to memory mode MEM2MEM : Boolean := False; -- double-buffer mode DBM : Boolean := False; -- current target memory of DMA transfer in double-buffer mode CT : Boolean := False; -- secure mode SECM : Boolean := False; -- security of the DMA transfer from the source SSEC : Boolean := False; -- security of the DMA transfer to the destination DSEC : Boolean := False; -- privileged mode PRIV : Boolean := False; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CPAR3_Register use record EN at 0 range 0 .. 0; TCIE at 0 range 1 .. 1; HTIE at 0 range 2 .. 2; TEIE at 0 range 3 .. 3; DIR at 0 range 4 .. 4; CIRC at 0 range 5 .. 5; PINC at 0 range 6 .. 6; MINC at 0 range 7 .. 7; PSIZE at 0 range 8 .. 9; MSIZE at 0 range 10 .. 11; PL at 0 range 12 .. 13; MEM2MEM at 0 range 14 .. 14; DBM at 0 range 15 .. 15; CT at 0 range 16 .. 16; SECM at 0 range 17 .. 17; SSEC at 0 range 18 .. 18; DSEC at 0 range 19 .. 19; PRIV at 0 range 20 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype CM0AR3_NDT_Field is HAL.UInt18; -- channel x memory address register type CM0AR3_Register is record -- Number of data to transfer NDT : CM0AR3_NDT_Field := 16#0#; -- unspecified Reserved_18_31 : HAL.UInt14 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CM0AR3_Register use record NDT at 0 range 0 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; subtype CNDTR4_PSIZE_Field is HAL.UInt2; subtype CNDTR4_MSIZE_Field is HAL.UInt2; subtype CNDTR4_PL_Field is HAL.UInt2; -- channel x number of data register type CNDTR4_Register is record -- Channel enable EN : Boolean := False; -- Transfer complete interrupt enable TCIE : Boolean := False; -- Half transfer interrupt enable HTIE : Boolean := False; -- Transfer error interrupt enable TEIE : Boolean := False; -- Data transfer direction DIR : Boolean := False; -- Circular mode CIRC : Boolean := False; -- Peripheral increment mode PINC : Boolean := False; -- Memory increment mode MINC : Boolean := False; -- Peripheral size PSIZE : CNDTR4_PSIZE_Field := 16#0#; -- Memory size MSIZE : CNDTR4_MSIZE_Field := 16#0#; -- Channel priority level PL : CNDTR4_PL_Field := 16#0#; -- Memory to memory mode MEM2MEM : Boolean := False; -- double-buffer mode DBM : Boolean := False; -- current target memory of DMA transfer in double-buffer mode CT : Boolean := False; -- secure mode SECM : Boolean := False; -- security of the DMA transfer from the source SSEC : Boolean := False; -- security of the DMA transfer to the destination DSEC : Boolean := False; -- privileged mode PRIV : Boolean := False; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CNDTR4_Register use record EN at 0 range 0 .. 0; TCIE at 0 range 1 .. 1; HTIE at 0 range 2 .. 2; TEIE at 0 range 3 .. 3; DIR at 0 range 4 .. 4; CIRC at 0 range 5 .. 5; PINC at 0 range 6 .. 6; MINC at 0 range 7 .. 7; PSIZE at 0 range 8 .. 9; MSIZE at 0 range 10 .. 11; PL at 0 range 12 .. 13; MEM2MEM at 0 range 14 .. 14; DBM at 0 range 15 .. 15; CT at 0 range 16 .. 16; SECM at 0 range 17 .. 17; SSEC at 0 range 18 .. 18; DSEC at 0 range 19 .. 19; PRIV at 0 range 20 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; subtype CPAR_NDT_Field is HAL.UInt18; -- channel x peripheral address register type CPAR_Register is record -- Number of data to transfer NDT : CPAR_NDT_Field := 16#0#; -- unspecified Reserved_18_31 : HAL.UInt14 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CPAR_Register use record NDT at 0 range 0 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; subtype CM0AR6_C1S_Field is HAL.UInt4; subtype CM0AR6_C2S_Field is HAL.UInt4; subtype CM0AR6_C3S_Field is HAL.UInt4; subtype CM0AR6_C4S_Field is HAL.UInt4; subtype CM0AR6_C5S_Field is HAL.UInt4; subtype CM0AR6_C6S_Field is HAL.UInt4; subtype CM0AR6_C7S_Field is HAL.UInt4; -- channel x memory address register type CM0AR6_Register is record -- DMA channel 1 selection C1S : CM0AR6_C1S_Field := 16#0#; -- DMA channel 2 selection C2S : CM0AR6_C2S_Field := 16#0#; -- DMA channel 3 selection C3S : CM0AR6_C3S_Field := 16#0#; -- DMA channel 4 selection C4S : CM0AR6_C4S_Field := 16#0#; -- DMA channel 5 selection C5S : CM0AR6_C5S_Field := 16#0#; -- DMA channel 6 selection C6S : CM0AR6_C6S_Field := 16#0#; -- DMA channel 7 selection C7S : CM0AR6_C7S_Field := 16#0#; -- unspecified Reserved_28_31 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CM0AR6_Register use record C1S at 0 range 0 .. 3; C2S at 0 range 4 .. 7; C3S at 0 range 8 .. 11; C4S at 0 range 12 .. 15; C5S at 0 range 16 .. 19; C6S at 0 range 20 .. 23; C7S at 0 range 24 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; subtype CNDTR8_PSIZE_Field is HAL.UInt2; subtype CNDTR8_MSIZE_Field is HAL.UInt2; subtype CNDTR8_PL_Field is HAL.UInt2; -- channel x number of data register type CNDTR8_Register is record -- channel enable EN : Boolean := False; -- transfer complete interrupt enable TCIE : Boolean := False; -- half transfer interrupt enable HTIE : Boolean := False; -- transfer error interrupt enable TEIE : Boolean := False; -- data transfer direction DIR : Boolean := False; -- circular mode CIRC : Boolean := False; -- peripheral increment mode PINC : Boolean := False; -- memory increment mode MINC : Boolean := False; -- peripheral size PSIZE : CNDTR8_PSIZE_Field := 16#0#; -- memory size MSIZE : CNDTR8_MSIZE_Field := 16#0#; -- priority level PL : CNDTR8_PL_Field := 16#0#; -- memory-to-memory mode MEM2MEM : Boolean := False; -- double-buffer mode DBM : Boolean := False; -- current target memory of DMA transfer in double-buffer mode CT : Boolean := False; -- secure mode SECM : Boolean := False; -- security of the DMA transfer from the source SSEC : Boolean := False; -- security of the DMA transfer to the destination DSEC : Boolean := False; -- privileged mode PRIV : Boolean := False; -- unspecified Reserved_21_31 : HAL.UInt11 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CNDTR8_Register use record EN at 0 range 0 .. 0; TCIE at 0 range 1 .. 1; HTIE at 0 range 2 .. 2; TEIE at 0 range 3 .. 3; DIR at 0 range 4 .. 4; CIRC at 0 range 5 .. 5; PINC at 0 range 6 .. 6; MINC at 0 range 7 .. 7; PSIZE at 0 range 8 .. 9; MSIZE at 0 range 10 .. 11; PL at 0 range 12 .. 13; MEM2MEM at 0 range 14 .. 14; DBM at 0 range 15 .. 15; CT at 0 range 16 .. 16; SECM at 0 range 17 .. 17; SSEC at 0 range 18 .. 18; DSEC at 0 range 19 .. 19; PRIV at 0 range 20 .. 20; Reserved_21_31 at 0 range 21 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Direct memory access controller type DMA_Peripheral is record -- interrupt status register ISR : aliased ISR_Register; -- interrupt flag clear register IFCR : aliased IFCR_Register; -- channel x configuration register CCR1 : aliased CCR_Register; -- channel x number of data register CNDTR1 : aliased CNDTR_Register; -- channel x peripheral address register CPAR1 : aliased HAL.UInt32; -- channel x memory address register CM0AR1 : aliased HAL.UInt32; -- channel x memory address register CM1AR1 : aliased CM1AR_Register; -- channel x configuration register CCR2 : aliased CCR_Register_1; -- channel x number of data register CNDTR2 : aliased HAL.UInt32; -- channel x peripheral address register CPAR2 : aliased HAL.UInt32; -- channel x memory address register CM0AR2 : aliased CM0AR2_Register; -- channel x memory address register CM1AR2 : aliased CM1AR2_Register; -- channel x configuration register CCR3 : aliased HAL.UInt32; -- channel x number of data register CNDTR3 : aliased HAL.UInt32; -- channel x peripheral address register CPAR3 : aliased CPAR3_Register; -- channel x memory address register CM0AR3 : aliased CM0AR3_Register; -- channel x memory address register CM1AR3 : aliased HAL.UInt32; -- channel x configuration register CCR4 : aliased HAL.UInt32; -- channel x number of data register CNDTR4 : aliased CNDTR4_Register; -- channel x peripheral address register CPAR4 : aliased CPAR_Register; -- channel x memory address register CM0AR4 : aliased HAL.UInt32; -- channel x memory address register CM1AR4 : aliased HAL.UInt32; -- channel x configuration register CCR5 : aliased CCR_Register; -- channel x number of data register CNDTR5 : aliased CNDTR_Register; -- channel x peripheral address register CPAR5 : aliased HAL.UInt32; -- channel x memory address register CM0AR5 : aliased HAL.UInt32; -- channel x memory address register CM1AR5 : aliased CM1AR_Register; -- channel x configuration register CCR6 : aliased CCR_Register_1; -- channel x number of data register CNDTR6 : aliased HAL.UInt32; -- channel x peripheral address register CPAR6 : aliased HAL.UInt32; -- channel x memory address register CM0AR6 : aliased CM0AR6_Register; -- channel x memory address register CM1AR6 : aliased HAL.UInt32; -- channel x configuration register CCR7 : aliased HAL.UInt32; -- channel x number of data register CNDTR7 : aliased HAL.UInt32; -- channel x peripheral address register CPAR7 : aliased HAL.UInt32; -- channel x memory address register CM0AR7 : aliased HAL.UInt32; -- channel x memory address register CM1AR7 : aliased HAL.UInt32; -- channel x configuration register CCR8 : aliased HAL.UInt32; -- channel x number of data register CNDTR8 : aliased CNDTR8_Register; -- channel x peripheral address register CPAR8 : aliased CPAR_Register; -- channel x peripheral address register CM0AR8 : aliased HAL.UInt32; -- channel x peripheral address register CM1AR8 : aliased HAL.UInt32; -- channel selection register CSELR : aliased HAL.UInt32; end record with Volatile; for DMA_Peripheral use record ISR at 16#0# range 0 .. 31; IFCR at 16#4# range 0 .. 31; CCR1 at 16#8# range 0 .. 31; CNDTR1 at 16#C# range 0 .. 31; CPAR1 at 16#10# range 0 .. 31; CM0AR1 at 16#14# range 0 .. 31; CM1AR1 at 16#18# range 0 .. 31; CCR2 at 16#1C# range 0 .. 31; CNDTR2 at 16#20# range 0 .. 31; CPAR2 at 16#24# range 0 .. 31; CM0AR2 at 16#28# range 0 .. 31; CM1AR2 at 16#2C# range 0 .. 31; CCR3 at 16#30# range 0 .. 31; CNDTR3 at 16#34# range 0 .. 31; CPAR3 at 16#38# range 0 .. 31; CM0AR3 at 16#3C# range 0 .. 31; CM1AR3 at 16#40# range 0 .. 31; CCR4 at 16#44# range 0 .. 31; CNDTR4 at 16#48# range 0 .. 31; CPAR4 at 16#4C# range 0 .. 31; CM0AR4 at 16#50# range 0 .. 31; CM1AR4 at 16#54# range 0 .. 31; CCR5 at 16#58# range 0 .. 31; CNDTR5 at 16#5C# range 0 .. 31; CPAR5 at 16#60# range 0 .. 31; CM0AR5 at 16#64# range 0 .. 31; CM1AR5 at 16#68# range 0 .. 31; CCR6 at 16#6C# range 0 .. 31; CNDTR6 at 16#70# range 0 .. 31; CPAR6 at 16#74# range 0 .. 31; CM0AR6 at 16#78# range 0 .. 31; CM1AR6 at 16#7C# range 0 .. 31; CCR7 at 16#80# range 0 .. 31; CNDTR7 at 16#84# range 0 .. 31; CPAR7 at 16#88# range 0 .. 31; CM0AR7 at 16#8C# range 0 .. 31; CM1AR7 at 16#90# range 0 .. 31; CCR8 at 16#94# range 0 .. 31; CNDTR8 at 16#98# range 0 .. 31; CPAR8 at 16#9C# range 0 .. 31; CM0AR8 at 16#A0# range 0 .. 31; CM1AR8 at 16#A4# range 0 .. 31; CSELR at 16#A8# range 0 .. 31; end record; -- Direct memory access controller DMA1_Periph : aliased DMA_Peripheral with Import, Address => System'To_Address (16#40020000#); -- Direct memory access controller DMA2_Periph : aliased DMA_Peripheral with Import, Address => System'To_Address (16#40020400#); -- Direct memory access controller SEC_DMA1_Periph : aliased DMA_Peripheral with Import, Address => System'To_Address (16#50020000#); -- Direct memory access controller SEC_DMA2_Periph : aliased DMA_Peripheral with Import, Address => System'To_Address (16#50020400#); end STM32_SVD.DMA;
tools/uaflex/symbols.adb
faelys/gela-asis
4
28972
<reponame>faelys/gela-asis<filename>tools/uaflex/symbols.adb ------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ with Ada.Unchecked_Deallocation; with Ada.Strings.Unbounded; package body Symbols is function Min (Left, Right : Symbol) return Symbol renames Symbol'Min; function Max (Left, Right : Symbol) return Symbol renames Symbol'Max; --------- -- "*" -- --------- function "*" (Left, Right : Symbol_Set) return Boolean is L : Symbol_Ranges renames Left.Node.Ranges; R : Symbol_Ranges renames Right.Node.Ranges; begin if L'Length > R'Length then return Right * Left; elsif L'Length = 0 then return False; end if; declare L_Wide : constant Symbol_Range := (L (L'First).Lower, L (L'Last).Upper); R_Wide : constant Symbol_Range := (R (R'First).Lower, R (R'Last).Upper); begin if not (L_Wide * R_Wide) then return False; end if; end; for I in L'Range loop declare F : Positive := R'First; T : Natural := R'Last; J : Natural; begin while F <= T loop J := (F + T) / 2; if R (J).Lower > L (I).Upper then T := J - 1; elsif R (J).Upper < L (I).Lower then F := J + 1; else return True; end if; end loop; end; end loop; return False; end "*"; --------- -- "*" -- --------- function "*" (Left, Right : Symbol_Range) return Boolean is begin if Left.Upper < Right.Lower or Left.Lower > Right.Upper then return False; -- no intersect else return True; -- intersect end if; end "*"; ---------- -- "or" -- ---------- function "or" (Left, Right : Symbol_Range) return Symbol_Range is begin return (Min (Left.Lower, Right.Lower), Max (Left.Upper, Right.Upper)); end "or"; ----------- -- "and" -- ----------- function "and" (Left, Right : Symbol_Range) return Symbol_Range is begin return (Max (Left.Lower, Right.Lower), Min (Left.Upper, Right.Upper)); end "and"; --------- -- "-" -- --------- function "-" (Left, Right : Symbol_Set) return Symbol_Set is L : Symbol_Ranges renames Left.Node.Ranges; R : Symbol_Ranges renames Right.Node.Ranges; Max_Len : constant Natural := L'Length + 2 * R'Length; Result : Symbol_Ranges (1 .. Max_Len); Last : Natural := 0; Index : Positive; Start : Symbol; procedure New_Range (Lower, Upper : Symbol) is begin if Lower <= Upper then Last := Last + 1; Result (Last) := (Lower, Upper); end if; end New_Range; begin for I in L'Range loop Start := L (I).Lower; -- Binary search max Index of range less then Start declare F : Positive := R'First; T : Natural := R'Last; J : Natural; begin while F <= T loop J := (F + T) / 2; if R (J).Lower > Start then T := J - 1; elsif R (J).Upper < Start then F := J + 1; else T := J; exit; end if; end loop; Index := Positive'Max (T, R'First); end; -- End of binary search while Index in R'Range and then R (Index).Lower <= L (I).Upper loop if R (Index) * L (I) then if R (Index).Lower /= 0 then New_Range (Start, R (Index).Lower - 1); end if; Start := R (Index).Upper + 1; end if; Index := Index + 1; end loop; if Start /= 0 then New_Range (Start, L (I).Upper); end if; end loop; return (F.Controlled with new Set_Node'(Last, 1, Result (1 .. Last))); end "-"; ----------- -- "and" -- ----------- function "and" (Left, Right : Symbol_Set) return Symbol_Set is L : Symbol_Ranges renames Left.Node.Ranges; R : Symbol_Ranges renames Right.Node.Ranges; Max_Len : constant Natural := L'Length + R'Length; -- actual Max (R,L) Result : Symbol_Ranges (1 .. Max_Len); Last : Natural := 0; begin for I in L'Range loop for J in R'Range loop if R (J) * L (I) then Last := Last + 1; Result (Last) := R (J) and L (I); end if; end loop; end loop; return (F.Controlled with new Set_Node'(Last, 1, Result (1 .. Last))); end "and"; ---------- -- "or" -- ---------- function "or" (Left, Right : Symbol_Set) return Symbol_Set is L : Symbol_Ranges renames Left.Node.Ranges; R : Symbol_Ranges renames Right.Node.Ranges; Max_Len : constant Natural := L'Length + R'Length; Result : Symbol_Ranges (1 .. Max_Len); Last : Positive := 1; I, J : Positive := 1; procedure New_Range (R : Symbol_Range) is begin if Result (Last) * R then Result (Last) := Result (Last) or R; else Last := Last + 1; Result (Last) := R; end if; end New_Range; begin if L'Length = 0 then return Right; elsif R'Length = 0 then return Left; end if; Result (Last) := (Min (R (J).Lower, L (I).Lower), Min (R (J).Lower, L (I).Lower)); while I in L'Range or J in R'Range loop if I in L'Range then if J in R'Range then if R (J).Lower < L (I).Lower then New_Range (R (J)); J := J + 1; else New_Range (L (I)); I := I + 1; end if; else New_Range (L (I)); I := I + 1; end if; else New_Range (R (J)); J := J + 1; end if; end loop; return (F.Controlled with new Set_Node'(Last, 1, Result (1 .. Last))); end "or"; ------------ -- Adjust -- ------------ procedure Adjust (Object : in out Symbol_Set) is begin if Object.Node /= null then Object.Node.Count := Object.Node.Count + 1; end if; end Adjust; -------------------------- -- Distinct_Symbol_Sets -- -------------------------- function Distinct_Symbol_Sets (Next : in Symbol_Set_Array) return Symbol_Set_Array is begin for I in Next'Range loop for J in I + 1 .. Next'Last loop if not Is_Empty (Next (I)) and then not Is_Empty (Next (J)) and then Next (I) * Next (J) then declare A : constant Symbol_Set := Next (I) - Next (J); B : constant Symbol_Set := Next (J) - Next (I); C : constant Symbol_Set := Next (J) and Next (I); Index: Natural := 1; Sets : Symbol_Set_Array (1 .. Next'Length + 1); procedure Append (S : Symbol_Set_Array) is begin Sets (Index .. Index + S'Length - 1) := S; Index := Index + S'Length; end Append; begin Append (Next (Next'First .. I - 1)); if not Is_Empty (A) then Append ((1 => A)); end if; Append (Next (I + 1 .. J - 1)); if not Is_Empty (B) then Append ((1 => B)); end if; Append (Next (J + 1 .. Next'Last)); Append ((1 => C)); Index := Index - 1; return Distinct_Symbol_Sets (Sets (1 .. Index)); end; end if; end loop; end loop; return Next; end Distinct_Symbol_Sets; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Symbol_Set) is procedure Free is new Ada.Unchecked_Deallocation (Set_Node, Node_Access); begin if Object.Node /= null then Object.Node.Count := Object.Node.Count - 1; if Object.Node.Count = 0 then Free (Object.Node); end if; end if; end Finalize; -------------- -- Is_Empty -- -------------- function Is_Empty (Left : Symbol_Set) return Boolean is begin return Left.Node.Length = 0; end Is_Empty; -------------- -- Is_Equal -- -------------- function Is_Equal (Left, Right : Symbol_Set) return Boolean is begin return Left.Node.Ranges = Right.Node.Ranges; end Is_Equal; ----------------- -- Range_Image -- ----------------- function Range_Image (Left : Symbol_Set; Indent : String) return String is use Ada.Strings.Unbounded; L : Symbol_Ranges renames Left.Node.Ranges; NL : constant Character := ASCII.LF; Result : Unbounded_String; begin Result := Indent & To_Unbounded_String ("when "); for I in L'Range loop if I /= L'First then Result := Result & NL & Indent & " | "; end if; if L (I).Lower = L (I).Upper then Result := Result & Symbol'Image (L (I).Lower); else Result := Result & Symbol'Image (L (I).Lower) & " .." & Symbol'Image (L (I).Upper); end if; end loop; return To_String (Result); end Range_Image; -------------- -- To_Range -- -------------- function To_Range (Single : Symbol) return Symbol_Set is begin return (F.Controlled with new Set_Node'(1, 1, (1 => (Single, Single)))); end To_Range; -------------- -- To_Range -- -------------- function To_Range (Sequence : Symbol_Array) return Symbol_Set is Result : Symbol_Set; begin for I in Sequence'Range loop Result := Result or To_Range (Sequence (I)); end loop; return Result; end To_Range; -------------- -- To_Range -- -------------- function To_Range (Lower, Upper : Symbol) return Symbol_Set is begin return (F.Controlled with new Set_Node'(1, 1, (1 => (Lower, Upper)))); end To_Range; end Symbols; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, <NAME> -- 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 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. ------------------------------------------------------------------------------
src/API/protypo-api-engine_values-range_iterators.ads
fintatarta/protypo
0
7511
<gh_stars>0 with Protypo.Api.Engine_Values.Constant_Wrappers; with Protypo.Api.Engine_Values.Handlers; -- -- ## What is this? -- -- A _range iterator_ implements the `Iterator_Interface` and it -- allows to iterate over an interval between two integers -- package Protypo.Api.Engine_Values.Range_Iterators is type Range_Iterator is new Handlers.Iterator_Interface with private; function Create (Start, Stop : Integer) return handlers.Iterator_Interface_Access; function Create (Start, Stop : Integer) return Handler_Value is (handlers.Create (Create (Start, Stop))); overriding procedure Reset (Iter : in out Range_Iterator); overriding procedure Next (Iter : in out Range_Iterator); overriding function End_Of_Iteration (Iter : Range_Iterator) return Boolean; overriding function Element (Iter : Range_Iterator) return Handler_Value; private use Protypo.Api.Engine_Values.Constant_Wrappers; type Range_Iterator is new handlers.Iterator_Interface with record Start : Integer; Stop : Integer; Current : Integer; end record; function Create (Start, Stop : Integer) return handlers.Iterator_Interface_Access is (new Range_Iterator'(Start => Start, Stop => Stop, Current => Start)); function End_Of_Iteration (Iter : Range_Iterator) return Boolean is (Iter.Current > Iter.Stop); function Element (Iter : Range_Iterator) return Handler_Value is (handlers.Create (handlers.Constant_Interface_Access (Make_Wrapper (Iter.Current)))); end Protypo.Api.Engine_Values.Range_Iterators;
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1783.asm
ljhsiun2/medusa
9
179499
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r12 push %r8 push %rbx push %rcx // Faulty Load lea addresses_PSE+0x7d0, %rbx nop nop nop nop sub %r12, %r12 vmovups (%rbx), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $0, %xmm7, %r8 lea oracles, %rbx and $0xff, %r8 shlq $12, %r8 mov (%rbx,%r8,1), %r8 pop %rcx pop %rbx pop %r8 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
src/interface/cl-memory-images.ads
flyx/OpenCLAda
8
21682
-------------------------------------------------------------------------------- -- Copyright (c) 2013, <NAME> <<EMAIL>> -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- package CL.Memory.Images is type Channel_Order is (R, A, RG, RA, RGB, RGBA, BGRA, ARGB, Intensity, Luminance, Rx, RGx, RGBx); -- Full_Float is used here to avoid confusion with the Float type type Channel_Type is (SNorm_Int8, SNorm_Int16, UNorm_Int8, UNorm_Int16, UNorm_Short_565, UNorm_Short_555, UNorm_Int_101010, Signed_Int8, Signed_Int16, Signed_Int32, Unsigned_Int8, Unsigned_Int16, Unsigned_Int32, Half_Float, Full_Float); type Image_Type is (T_Image2D, T_Image3D); type Image_Format is record Order : Channel_Order; Data_Type : Channel_Type; end record; type Image_Format_List is array (Positive range <>) of aliased Image_Format; -- raised when a source object is passed to Create_Image* that does not -- have the minimum required size Invalid_Source_Size : exception; function Supported_Image_Formats (Context : Contexts.Context; Mode : Access_Kind; Img_Type : Image_Type; Use_Host_Memory : Boolean := False) return Image_Format_List; type Image is abstract new Memory_Object with null record; function Format (Source : Image) return Image_Format; function Element_Size (Source : Image) return CL.Size; function Row_Pitch (Source : Image) return CL.Size; function Width (Source : Image) return CL.Size; function Height (Source : Image) return CL.Size; type Image2D is new Image with null record; type Image3D is new Image with null record; package Constructors is -- Analogous to Create_Buffer function Create_Image2D (Context : Contexts.Context'Class; Mode : Access_Kind; Format : Image_Format; Width : CL.Size; Height : CL.Size; Row_Pitch : CL.Size; Use_Host_Memory : Boolean := False) return Image2D; -- Analogous to Create_Buffer function Create_Image3D (Context : Contexts.Context'Class; Mode : Access_Kind; Format : Image_Format; Width : CL.Size; Height : CL.Size; Depth : CL.Size; Row_Pitch : CL.Size; Slice_Pitch : CL.Size; Use_Host_Memory : Boolean := False) return Image3D; generic type Element is private; type Element_List is array (Integer range <>) of Element; function Create_Image2D_From_Source (Context : Contexts.Context'Class; Mode : Access_Kind; Format : Image_Format; Width : CL.Size; Height : CL.Size; Row_Pitch : CL.Size; Source : Element_List; Use_Source_As_Image : Boolean := False; Use_Host_Memory : Boolean := False) return Image2D; generic type Element is private; type Element_List is array (Integer range <>) of Element; function Create_Image3D_From_Source (Context : Contexts.Context'Class; Mode : Access_Kind; Format : Image_Format; Width : CL.Size; Height : CL.Size; Depth : CL.Size; Row_Pitch : CL.Size; Slice_Pitch : CL.Size; Source : Element_List; Use_Source_As_Image : Boolean := False; Use_Host_Memory : Boolean := False) return Image3D; end Constructors; function Slice_Pitch (Source : Image3D) return CL.Size; function Depth (Source : Image3D) return CL.Size; private for Channel_Order use (R => 16#10B0#, A => 16#10B1#, RG => 16#10B2#, RA => 16#10B3#, RGB => 16#10B4#, RGBA => 16#10B5#, BGRA => 16#10B6#, ARGB => 16#10B7#, Intensity => 16#10B8#, Luminance => 16#10B9#, Rx => 16#10BA#, RGx => 16#10BB#, RGBx => 16#10BC#); for Channel_Order'Size use UInt'Size; for Channel_Type use (SNorm_Int8 => 16#10D0#, SNorm_Int16 => 16#10D1#, UNorm_Int8 => 16#10D2#, UNorm_Int16 => 16#10D3#, UNorm_Short_565 => 16#10D4#, UNorm_Short_555 => 16#10D5#, UNorm_Int_101010 => 16#10D6#, Signed_Int8 => 16#10D7#, Signed_Int16 => 16#10D8#, Signed_Int32 => 16#10D9#, Unsigned_Int8 => 16#10DA#, Unsigned_Int16 => 16#10DB#, Unsigned_Int32 => 16#10DC#, Half_Float => 16#10DD#, Full_Float => 16#10DE#); for Channel_Type'Size use UInt'Size; for Image_Type use (T_Image2D => 16#10F1#, T_Image3D => 16#10f2#); for Image_Type'Size use UInt'Size; pragma Convention (C, Image_Format); pragma Convention (C, Image_Format_List); end CL.Memory.Images;
msvc/x86_64/memhash.asm
stoni/smhasher
0
243899
; ; Upcaste Performance Libraries ; Copyright (C) 2012-2013 <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. ; ; ; uint64_t memhash(void const* p, size_t n, uint64_t seed); ; ; Based off of the fast byteswap hash function by <NAME>. ; http://locklessinc.com/articles/fast_hash/ ; .CODE ALIGN 16 factor128 OWORD 0d6c573e9c613993d5a379ab38dc5a46bh ALIGN 16 PUBLIC memhash memhash PROC movd xmm0, rdx movd xmm1, r8 movdqa xmm2, XMMWORD PTR [factor128] cmp rdx, 32 jb SHORT _test_remaining mov rax, rdx shr rax, 5 test cl, 15 jne _unaligned_loop ; ; Aligned main-loop, process 32-byte aligned chunks at a time ; using 16-byte signed multiplication and unpack to mix. ; ALIGN 8 _aligned_loop: paddq xmm0, XMMWORD PTR [rcx] paddq xmm1, XMMWORD PTR [rcx + 16] pmullw xmm0, xmm2 pmullw xmm1, xmm2 add rcx, 32 movdqa xmm3, xmm0 punpckhbw xmm0, xmm1 punpcklbw xmm1, xmm3 dec rax jne SHORT _aligned_loop pxor xmm0, xmm1 ; ; Check for remaining chunk, if not extract 128 bits state and ; proceed to final mix. ; _test_remaining: test dl, 31 jne SHORT _remaining movhlps xmm1, xmm0 movd rax, xmm0 movd r10, xmm1 ; ; Use 3x 128bit multiply and xorshift for final mix. ; _final_mix: mov r9, 02bb6863566c4e761h mov r8, 01591aefa5e7e5a17h imul r10, r9 mul r8 add r10, rdx xor rax, r10 imul r10, r9 mul r8 add r10, rdx xor rax, r10 imul r10, r9 mul r8 add r10, rdx xor rax, r10 ret ; ; Process remaining chunk in piece-wise manner, up to 31-bytes in size. ; _remaining: test dl, 16 je SHORT _remaining_qword movdqu xmm3, XMMWORD PTR [rcx] pxor xmm0, xmm3 add rcx, 16 pmullw xmm0, xmm2 _remaining_qword: xor r11, r11 movhlps xmm1, xmm0 movd rax, xmm0 movd r10, xmm1 test dl, 8 je SHORT _remaining_dword xor rax, QWORD PTR [rcx] add rcx, 8 _remaining_dword: test dl, 4 je SHORT _remaining_word mov r11d, DWORD PTR [rcx] add rcx, 4 _remaining_word: test dl, 2 je SHORT _remaining_byte movzx r8, WORD PTR [rcx] shl r11, 16 add rcx, 2 add r11, r8 _remaining_byte: test dl, 1 je SHORT _remaining_done movzx r8, BYTE PTR [rcx] shl r11, 8 add r11, r8 _remaining_done: xor r10, r11 jmp _final_mix ; ; Unaligned main-loop, process 32-byte unaligned chunks at a time ; using 16-byte signed multiplication and unpack to mix. ; ALIGN 16 _unaligned_loop: movdqu xmm3, XMMWORD PTR [rcx] movdqu xmm4, XMMWORD PTR [rcx + 16] paddq xmm0, xmm3 paddq xmm1, xmm4 pmullw xmm0, xmm2 pmullw xmm1, xmm2 add rcx, 32 movdqa xmm3, xmm0 punpckhbw xmm0, xmm1 punpcklbw xmm1, xmm3 dec rax jne SHORT _unaligned_loop pxor xmm0, xmm1 jmp _test_remaining memhash ENDP END
lights.adb
FROL256/ada-ray-tracer
3
4074
with Interfaces; with Ada.Numerics.Float_Random; with Ada.Numerics.Generic_Elementary_Functions; with Vector_Math; use Interfaces; use Vector_Math; package body Lights is package Float_Functions is new Ada.Numerics.Generic_Elementary_Functions(float); use Float_Functions; function GetIntensity(l : LightRef) return float3 is begin return GetIntensity(l.all); end GetIntensity; function Sample(l : LightRef; gen : RandRef; lluminatingPoint : float3) return ShadowSample is begin return Sample(l.all, gen, lluminatingPoint); end Sample; function EvalPDF(l : LightRef; lluminatingPoint : float3; rayDir : float3; hitDist : float) return float is begin return EvalPDF(l.all, lluminatingPoint, rayDir, hitDist); end EvalPDF; function GetShapeType(l : LightRef) return LightShapes is begin return GetShapeType(l.all); end GetShapeType; -- explicit light sampling utils -- epsilonDiv : constant float := 1.0e-20; -- small value for bsdf/pdf divisions function PdfAtoW(aPdfA : in float; aDist : in float; aCosThere : in float) return float is begin return aPdfA*aDist*aDist/max(aCosThere, epsilonDiv); end PdfAtoW; ---- Area Light ---- function AreaPDF(l : AreaLight) return float is begin return 1.0/l.surfaceArea; end AreaPDF; function Sample(l : AreaLight; gen : RandRef; lluminatingPoint : float3) return ShadowSample is r1 : float := gen.rnd_uniform(0.0, 1.0); r2 : float := gen.rnd_uniform(0.0, 1.0); cosTheta : float; -- := max(dot(sdir, (-1.0)*lsam.norm), 0.0); rayDir : float3; d : float; res : ShadowSample; begin res.pos.x := l.boxMin.x + r1*(l.boxMax.x - l.boxMin.x); res.pos.y := l.boxMin.y; res.pos.z := l.boxMin.z + r2*(l.boxMax.z - l.boxMin.z); res.dir := l.normal; rayDir := res.pos - lluminatingPoint; d := length(rayDir); rayDir := rayDir*(1.0/d); cosTheta := max(dot(rayDir, (-1.0)*l.normal), 0.0); res.pdf := PdfAtoW(AreaPDF(l), d, cosTheta); res.intensity := l.intensity; return res; end Sample; function EvalPDF(l : AreaLight; lluminatingPoint : float3; rayDir : float3; hitDist : float) return float is cosTheta : float := max(dot(rayDir, (-1.0)*l.normal), 0.0); begin return PdfAtoW(AreaPDF(l), hitDist, cosTheta); end EvalPDF; function GetIntensity(l : AreaLight) return float3 is begin return l.intensity; end GetIntensity; function GetShapeType(l : AreaLight) return LightShapes is begin return Light_Shape_Rect; end GetShapeType; ---- Sphere Light ---- function AreaPDF(l : SphereLight) return float is begin return 1.0/l.surfaceArea; end AreaPDF; procedure CoordinateSystem(v1 : in float3; v2 : out float3; v3 : out float3) is invLen : float; begin if abs(v1.x) > abs(v1.y) then invLen := 1.0 / sqrt(v1.x*v1.x + v1.z*v1.z); v2 := (-v1.z * invLen, 0.0, v1.x * invLen); else invLen := 1.0 / sqrt(v1.y*v1.y + v1.z*v1.z); v2 := (0.0, v1.z * invLen, -v1.y * invLen); end if; v3 := cross(v1, v2); end CoordinateSystem; function DistanceSquared(a : float3; b : float3) return float is diff : float3 := (b - a); begin return dot(diff, diff); exception -- floating point overflow may happen due to diff.x*diff.x may be too large when Constraint_Error => return float'Last; end DistanceSquared; function UniformSampleSphere(u1 : float; u2 : float) return float3 is x,y,z,r,phi : float; begin z := 1.0 - 2.0 * u1; r := sqrt(max(0.0, 1.0 - z*z)); phi := 2.0 * M_PI * u2; x := r * cos(phi); y := r * sin(phi); return (x,y,z); end UniformSampleSphere; function UniformSampleCone(u1 : float; u2 : float; costhetamax : float; x : float3; y : float3; z : float3) return float3 is phi,costheta,sintheta : float; begin costheta := lerp(u1, costhetamax, 1.0); sintheta := sqrt(1.0 - costheta*costheta); phi := u2 * 2.0 * M_PI; return cos(phi) * sintheta * x + sin(phi) * sintheta * y + costheta * z; end UniformSampleCone; function UniformConePdf(cosThetaMax : float) return float is begin return 1.0 / (2.0 * M_PI * (1.0 - cosThetaMax)); exception when Constraint_Error => return 0.0; -- #NOTE: may be need return 1 ?? end UniformConePdf; function RaySphereIntersect(rayPos : float3; rayDir : float3; sphPos : float3; radius : float) return float2 is t1, t2 : float; k : float3; b, c, d, sqrtd : float; res : float2; begin k := rayPos - sphPos; b := dot(k,rayDir); c := dot(k,k) - radius*radius; d := b * b - c; if d >= 0.0 then sqrtd := sqrt(d); t1 := -b - sqrtd; t2 := -b + sqrtd; res.x := min(t1,t2); res.y := max(t1,t2); else res.x := -infinity; res.y := -infinity; end if; return res; exception when Constraint_Error => return (-infinity,-infinity); end RaySphereIntersect; function Sample(l : SphereLight; gen : RandRef; lluminatingPoint : float3) return ShadowSample is u1 : float := gen.rnd_uniform(0.0, 1.0); u2 : float := gen.rnd_uniform(0.0, 1.0); wc, wcX, wcY : float3; sinThetaMax2,cosThetaMax,thit : float; rpos, rdir : float3; hitMinMax : float2; res : ShadowSample; begin res.intensity := l.intensity; if DistanceSquared(lluminatingPoint, l.center) - l.radius*l.radius < 1.0e-4 then res.pos := l.center + l.radius*UniformSampleSphere(u1, u2); res.dir := normalize(res.pos - l.center); return res; end if; wc := normalize(l.center - lluminatingPoint); CoordinateSystem(wc, v2 => wcX, v3 => wcY); sinThetaMax2 := l.radius*l.radius / DistanceSquared(lluminatingPoint, l.center); cosThetaMax := sqrt(max(0.0, 1.0 - sinThetaMax2)); rdir := UniformSampleCone(u1, u2, cosThetaMax, wcX, wcY, wc); rpos := lluminatingPoint + rdir*(1.0e-3); -- calc ray sphere intersection and store hit distance in thit -- hitMinMax := RaySphereIntersect(rpos, rdir, l.center, l.radius); if hitMinMax.x < 0.0 then -- !Intersect(r, &thit, &rayEpsilon, &dgSphere) thit := dot(l.center - lluminatingPoint, normalize(rdir)); else thit := hitMinMax.x; end if; res.pos := rpos + thit*rdir; res.dir := normalize(res.pos - l.center); res.pdf := EvalPDF(l, lluminatingPoint, rdir, thit); return res; end Sample; function EvalPDF(l : SphereLight; lluminatingPoint : float3; rayDir : float3; hitDist : float) return float is sinThetaMax2, cosThetaMax : float; begin if DistanceSquared(lluminatingPoint, l.center) - l.radius*l.radius < 1.0e-4 then return 1.0/l.surfaceArea; end if; sinThetaMax2 := l.radius*l.radius / DistanceSquared(lluminatingPoint, l.center); cosThetaMax := sqrt(max(0.0, 1.0 - sinThetaMax2)); return UniformConePdf(cosThetaMax); end EvalPDF; function GetIntensity(l : SphereLight) return float3 is begin return l.intensity; end GetIntensity; function GetShapeType(l : SphereLight) return LightShapes is begin return Light_Shape_Sphere; end GetShapeType; end Lights;
src/instruction-test/jmp.asm
brgmnn/uob-cpu-simulator
0
96082
# 'jmp' test case code # modifying this code with cause tests to fail! jmp $1 mov r0,#1 2: mov r0,#2 jmp $end 1: jmp $2 end: halt
bb-runtimes/riscv/sifive/fe310/svd/i-fe310.ads
JCGobbi/Nucleo-STM32G474RE
0
22132
-- -- Copyright (C) 2018, AdaCore -- -- This spec has been automatically generated from FE310.svd pragma Ada_2012; pragma Style_Checks (Off); with System; -- E31 CPU Coreplex, high-performance, 32-bit RV32IMAC core -- package Interfaces.FE310 is pragma Preelaborate; pragma No_Elaboration_Code_All; --------------- -- Base type -- --------------- type UInt32 is new Interfaces.Unsigned_32; type UInt16 is new Interfaces.Unsigned_16; type Byte is new Interfaces.Unsigned_8; type Bit is mod 2**1 with Size => 1; type UInt2 is mod 2**2 with Size => 2; type UInt3 is mod 2**3 with Size => 3; type UInt4 is mod 2**4 with Size => 4; type UInt5 is mod 2**5 with Size => 5; type UInt6 is mod 2**6 with Size => 6; type UInt7 is mod 2**7 with Size => 7; type UInt9 is mod 2**9 with Size => 9; type UInt10 is mod 2**10 with Size => 10; type UInt11 is mod 2**11 with Size => 11; type UInt12 is mod 2**12 with Size => 12; type UInt13 is mod 2**13 with Size => 13; type UInt14 is mod 2**14 with Size => 14; type UInt15 is mod 2**15 with Size => 15; type UInt17 is mod 2**17 with Size => 17; type UInt18 is mod 2**18 with Size => 18; type UInt19 is mod 2**19 with Size => 19; type UInt20 is mod 2**20 with Size => 20; type UInt21 is mod 2**21 with Size => 21; type UInt22 is mod 2**22 with Size => 22; type UInt23 is mod 2**23 with Size => 23; type UInt24 is mod 2**24 with Size => 24; type UInt25 is mod 2**25 with Size => 25; type UInt26 is mod 2**26 with Size => 26; type UInt27 is mod 2**27 with Size => 27; type UInt28 is mod 2**28 with Size => 28; type UInt29 is mod 2**29 with Size => 29; type UInt30 is mod 2**30 with Size => 30; type UInt31 is mod 2**31 with Size => 31; -------------------- -- Base addresses -- -------------------- PLIC_Base : constant System.Address := System'To_Address (16#C000000#); CLINT_Base : constant System.Address := System'To_Address (16#2000000#); GPIO0_Base : constant System.Address := System'To_Address (16#10012000#); QSPI0_Base : constant System.Address := System'To_Address (16#10014000#); QSPI1_Base : constant System.Address := System'To_Address (16#10024000#); QSPI2_Base : constant System.Address := System'To_Address (16#10034000#); UART0_Base : constant System.Address := System'To_Address (16#10013000#); UART1_Base : constant System.Address := System'To_Address (16#10023000#); PWM0_Base : constant System.Address := System'To_Address (16#10015000#); PWM1_Base : constant System.Address := System'To_Address (16#10025000#); PWM2_Base : constant System.Address := System'To_Address (16#10035000#); WDT_Base : constant System.Address := System'To_Address (16#10000000#); RTC_Base : constant System.Address := System'To_Address (16#10000040#); AON_Base : constant System.Address := System'To_Address (16#10000070#); BACKUP_Base : constant System.Address := System'To_Address (16#10000080#); PMU_Base : constant System.Address := System'To_Address (16#10000100#); end Interfaces.FE310;
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_608.asm
ljhsiun2/medusa
9
25059
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r15 push %r9 push %rbx push %rdx lea addresses_A_ht+0x12f2e, %r12 clflush (%r12) nop nop inc %r11 movw $0x6162, (%r12) nop nop nop xor %rbx, %rbx lea addresses_UC_ht+0x18496, %rdx add $21577, %r12 movl $0x61626364, (%rdx) nop xor %r11, %r11 pop %rdx pop %rbx pop %r9 pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r15 push %r8 push %r9 push %rsi // Store lea addresses_normal+0x1ff0e, %r8 clflush (%r8) nop nop cmp %r13, %r13 movl $0x51525354, (%r8) nop xor %r9, %r9 // Faulty Load lea addresses_D+0xf72e, %r13 and %r10, %r10 mov (%r13), %rsi lea oracles, %r13 and $0xff, %rsi shlq $12, %rsi mov (%r13,%rsi,1), %rsi pop %rsi pop %r9 pop %r8 pop %r15 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
engine/events/squirtbottle.asm
zavytar/pokecolorless
0
93331
<reponame>zavytar/pokecolorless _Squirtbottle: ld hl, .SquirtbottleScript call QueueScript ld a, $1 ld [wItemEffectSucceeded], a ret .SquirtbottleScript: reloadmappart special UpdateTimePals callasm .CheckCanUseSquirtbottle iffalse .NothingHappenedScript ; farsjump WateredWeirdTreeScript .NothingHappenedScript: jumptext .NothingHappenedText .NothingHappenedText: ; sprinkled water. But nothing happened… text_far UnknownText_0x1c0b3b text_end .CheckCanUseSquirtbottle: ; TODO: Replace GROUP_NONE and MAP_NONE with the map of the Squirtbottle Sudowoodo. ld a, [wMapGroup] cp GROUP_NONE jr nz, .nope ld a, [wMapNumber] cp MAP_NONE jr nz, .nope farcall GetFacingObject jr c, .nope ld a, d cp SPRITEMOVEDATA_SUDOWOODO jr nz, .nope ld a, 1 ld [wScriptVar], a ret .nope xor a ld [wScriptVar], a ret
llvm-gcc-4.2-2.9/gcc/ada/i-cstrin.adb
vidkidz/crossbridge
1
9899
<filename>llvm-gcc-4.2-2.9/gcc/ada/i-cstrin.adb ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- I N T E R F A C E S . C . S T R I N G S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System; use System; with System.Storage_Elements; use System.Storage_Elements; with Unchecked_Conversion; package body Interfaces.C.Strings is -- Note that the type chars_ptr has a pragma No_Strict_Aliasing in the -- spec, to prevent any assumptions about aliasing for values of this type, -- since arbitrary addresses can be converted, and it is quite likely that -- this type will in fact be used for aliasing values of other types. function To_chars_ptr is new Unchecked_Conversion (Address, chars_ptr); function To_Address is new Unchecked_Conversion (chars_ptr, Address); ----------------------- -- Local Subprograms -- ----------------------- function Peek (From : chars_ptr) return char; pragma Inline (Peek); -- Given a chars_ptr value, obtain referenced character procedure Poke (Value : char; Into : chars_ptr); pragma Inline (Poke); -- Given a chars_ptr, modify referenced Character value function "+" (Left : chars_ptr; Right : size_t) return chars_ptr; pragma Inline ("+"); -- Address arithmetic on chars_ptr value function Position_Of_Nul (Into : char_array) return size_t; -- Returns position of the first Nul in Into or Into'Last + 1 if none -- We can't use directly System.Memory because the categorization is not -- compatible, so we directly import here the malloc and free routines. function Memory_Alloc (Size : size_t) return chars_ptr; pragma Import (C, Memory_Alloc, "__gnat_malloc"); procedure Memory_Free (Address : chars_ptr); pragma Import (C, Memory_Free, "__gnat_free"); --------- -- "+" -- --------- function "+" (Left : chars_ptr; Right : size_t) return chars_ptr is begin return To_chars_ptr (To_Address (Left) + Storage_Offset (Right)); end "+"; ---------- -- Free -- ---------- procedure Free (Item : in out chars_ptr) is begin if Item = Null_Ptr then return; end if; Memory_Free (Item); Item := Null_Ptr; end Free; -------------------- -- New_Char_Array -- -------------------- function New_Char_Array (Chars : char_array) return chars_ptr is Index : size_t; Pointer : chars_ptr; begin -- Get index of position of null. If Index > Chars'last, -- nul is absent and must be added explicitly. Index := Position_Of_Nul (Into => Chars); Pointer := Memory_Alloc ((Index - Chars'First + 1)); -- If nul is present, transfer string up to and including nul if Index <= Chars'Last then Update (Item => Pointer, Offset => 0, Chars => Chars (Chars'First .. Index), Check => False); else -- If original string has no nul, transfer whole string and add -- terminator explicitly. Update (Item => Pointer, Offset => 0, Chars => Chars, Check => False); Poke (nul, into => Pointer + size_t'(Chars'Length)); end if; return Pointer; end New_Char_Array; ---------------- -- New_String -- ---------------- function New_String (Str : String) return chars_ptr is begin return New_Char_Array (To_C (Str)); end New_String; ---------- -- Peek -- ---------- function Peek (From : chars_ptr) return char is begin return char (From.all); end Peek; ---------- -- Poke -- ---------- procedure Poke (Value : char; Into : chars_ptr) is begin Into.all := Character (Value); end Poke; --------------------- -- Position_Of_Nul -- --------------------- function Position_Of_Nul (Into : char_array) return size_t is begin for J in Into'Range loop if Into (J) = nul then return J; end if; end loop; return Into'Last + 1; end Position_Of_Nul; ------------ -- Strlen -- ------------ function Strlen (Item : chars_ptr) return size_t is Item_Index : size_t := 0; begin if Item = Null_Ptr then raise Dereference_Error; end if; loop if Peek (Item + Item_Index) = nul then return Item_Index; end if; Item_Index := Item_Index + 1; end loop; end Strlen; ------------------ -- To_Chars_Ptr -- ------------------ function To_Chars_Ptr (Item : char_array_access; Nul_Check : Boolean := False) return chars_ptr is begin if Item = null then return Null_Ptr; elsif Nul_Check and then Position_Of_Nul (Into => Item.all) > Item'Last then raise Terminator_Error; else return To_chars_ptr (Item (Item'First)'Address); end if; end To_Chars_Ptr; ------------ -- Update -- ------------ procedure Update (Item : chars_ptr; Offset : size_t; Chars : char_array; Check : Boolean := True) is Index : chars_ptr := Item + Offset; begin if Check and then Offset + Chars'Length > Strlen (Item) then raise Update_Error; end if; for J in Chars'Range loop Poke (Chars (J), Into => Index); Index := Index + size_t'(1); end loop; end Update; procedure Update (Item : chars_ptr; Offset : size_t; Str : String; Check : Boolean := True) is begin -- Note: in RM 95, the Append_Nul => False parameter is omitted. But -- this has the unintended consequence of truncating the string after -- an update. As discussed in Ada 2005 AI-242, this was unintended, -- and should be corrected. Since this is a clear error, it seems -- appropriate to apply the correction in Ada 95 mode as well. Update (Item, Offset, To_C (Str, Append_Nul => False), Check); end Update; ----------- -- Value -- ----------- function Value (Item : chars_ptr) return char_array is Result : char_array (0 .. Strlen (Item)); begin if Item = Null_Ptr then raise Dereference_Error; end if; -- Note that the following loop will also copy the terminating Nul for J in Result'Range loop Result (J) := Peek (Item + J); end loop; return Result; end Value; function Value (Item : chars_ptr; Length : size_t) return char_array is begin if Item = Null_Ptr then raise Dereference_Error; end if; -- ACATS cxb3010 checks that Constraint_Error gets raised when Length -- is 0. Seems better to check that Length is not null before declaring -- an array with size_t bounds of 0 .. Length - 1 anyway. if Length = 0 then raise Constraint_Error; end if; declare Result : char_array (0 .. Length - 1); begin for J in Result'Range loop Result (J) := Peek (Item + J); if Result (J) = nul then return Result (0 .. J); end if; end loop; return Result; end; end Value; function Value (Item : chars_ptr) return String is begin return To_Ada (Value (Item)); end Value; function Value (Item : chars_ptr; Length : size_t) return String is Result : char_array (0 .. Length); begin -- As per AI-00177, this is equivalent to: -- To_Ada (Value (Item, Length) & nul); if Item = Null_Ptr then raise Dereference_Error; end if; for J in 0 .. Length - 1 loop Result (J) := Peek (Item + J); if Result (J) = nul then return To_Ada (Result (0 .. J)); end if; end loop; Result (Length) := nul; return To_Ada (Result); end Value; end Interfaces.C.Strings;
Transynther/x86/_processed/NC/_st_zr_4k_sm_/i3-7100_9_0xca_notsx.log_119_491.asm
ljhsiun2/medusa
9
22237
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x10ae9, %rsi lea addresses_UC_ht+0x191f9, %rdi nop nop xor $44856, %r9 mov $114, %rcx rep movsb nop xor $22137, %r15 lea addresses_WT_ht+0xf859, %r14 sub $57219, %rdx mov $0x6162636465666768, %rdi movq %rdi, (%r14) nop cmp %rsi, %rsi lea addresses_A_ht+0x10d19, %rsi lea addresses_UC_ht+0x125e, %rdi nop nop nop xor $64523, %r14 mov $89, %rcx rep movsl nop nop nop nop cmp $6432, %rsi lea addresses_WC_ht+0x14219, %rcx nop nop sub $41272, %r9 and $0xffffffffffffffc0, %rcx vmovaps (%rcx), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rdx nop nop nop nop nop cmp $58326, %rdi lea addresses_UC_ht+0xdfeb, %rcx nop nop nop nop sub $47597, %rdx movw $0x6162, (%rcx) nop nop nop and $6968, %rdi lea addresses_A_ht+0x2019, %r15 nop nop nop sub $10010, %rcx mov $0x6162636465666768, %r9 movq %r9, %xmm2 vmovups %ymm2, (%r15) nop nop nop nop nop sub %r9, %r9 lea addresses_normal_ht+0x1ad19, %rsi lea addresses_D_ht+0x2922, %rdi nop nop add %r10, %r10 mov $2, %rcx rep movsb nop nop inc %r9 lea addresses_D_ht+0x19299, %r15 nop nop nop and %rdx, %rdx movw $0x6162, (%r15) nop nop cmp $8728, %rdx lea addresses_WC_ht+0xf3f1, %r14 nop nop nop cmp %r15, %r15 mov $0x6162636465666768, %rdi movq %rdi, (%r14) xor $661, %r15 lea addresses_A_ht+0xe219, %rcx nop nop nop dec %r9 mov (%rcx), %di nop nop dec %rcx lea addresses_D_ht+0x16dca, %rcx nop nop nop nop nop xor $51758, %rdx movl $0x61626364, (%rcx) nop cmp $39930, %r15 lea addresses_normal_ht+0x3a19, %rdx nop nop nop nop nop add %r10, %r10 mov $0x6162636465666768, %rdi movq %rdi, (%rdx) add %rcx, %rcx lea addresses_WC_ht+0x13d19, %r15 nop nop nop nop and $64975, %rsi movl $0x61626364, (%r15) nop sub %rdx, %rdx lea addresses_normal_ht+0x7f87, %rsi lea addresses_WT_ht+0x1de59, %rdi clflush (%rdi) nop nop nop cmp %r15, %r15 mov $35, %rcx rep movsw nop sub $5503, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r15 push %r8 push %rcx push %rdx push %rsi // Store mov $0x4a65260000000619, %rsi xor %rdx, %rdx mov $0x5152535455565758, %r10 movq %r10, %xmm0 vmovntdq %ymm0, (%rsi) nop nop nop nop xor %r15, %r15 // Store lea addresses_PSE+0x150d9, %r8 nop nop nop nop xor $27222, %r12 movl $0x51525354, (%r8) nop nop nop nop inc %r12 // Store lea addresses_WT+0x1919, %r8 nop nop cmp %rsi, %rsi mov $0x5152535455565758, %r10 movq %r10, %xmm2 movups %xmm2, (%r8) nop nop nop nop inc %r10 // Store mov $0x33c1d700000006d1, %rsi clflush (%rsi) nop nop nop nop nop cmp %r8, %r8 mov $0x5152535455565758, %r12 movq %r12, %xmm6 movaps %xmm6, (%rsi) nop inc %r10 // Store mov $0xe19, %r15 nop nop nop add %rdx, %rdx mov $0x5152535455565758, %rsi movq %rsi, %xmm3 movups %xmm3, (%r15) dec %rdx // Faulty Load mov $0x4a65260000000619, %rcx nop cmp $18413, %r12 mov (%rcx), %dx lea oracles, %r12 and $0xff, %rdx shlq $12, %rdx mov (%r12,%rdx,1), %rdx pop %rsi pop %rdx pop %rcx pop %r8 pop %r15 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_NC', 'size': 16, 'AVXalign': True}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_P', 'size': 16, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': True, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}} {'src': {'same': False, 'congruent': 5, 'NT': True, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': True}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}} {'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 6, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}} {'58': 118, '00': 1} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
oeis/133/A133383.asm
neoneye/loda-programs
11
167831
<reponame>neoneye/loda-programs<filename>oeis/133/A133383.asm ; A133383: 10 followed by 2n 9's. ; 10,1099,109999,10999999,1099999999,109999999999,10999999999999,1099999999999999,109999999999999999,10999999999999999999,1099999999999999999999,109999999999999999999999,10999999999999999999999999,1099999999999999999999999999,109999999999999999999999999999,10999999999999999999999999999999,1099999999999999999999999999999999,109999999999999999999999999999999999,10999999999999999999999999999999999999,1099999999999999999999999999999999999999,109999999999999999999999999999999999999999 mov $1,100 pow $1,$0 sub $1,1 mul $1,11 add $1,10 mov $0,$1
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/linkedlists.ads
ouankou/rose
488
18452
package LinkedLists is type IntElem; type IntElemPtr is access IntElem; type IntElem is record val : Integer; nxt : IntElemPtr; end record; type Obj is tagged; type ObjPtr is access Obj; type Obj is tagged record nxt : ObjPtr; end record; end LinkedLists;
programs/oeis/184/A184043.asm
karttu/loda
0
161082
; A184043: 1/9 the number of (n+1) X 5 0..2 arrays with all 2 X 2 subblocks having the same four values. ; 45,51,61,81,117,189,325,597,1125,2181,4261,8421,16677,33189,66085,131877,263205,525861,1050661,2100261,4198437,8394789,16785445,33566757,67125285,134242341,268468261,536920101,1073807397,2147581989,4295098405,8590131237,17180131365,34360131621,68720001061,137439739941,274878955557,549757386789,1099513724965,2199026401317,4398050705445,8796099313701,17592194433061,35184384671781,70368760954917,140737513521189,281475010265125,562950003752997,1125899973951525,2251799914348581,4503599761588261,9007199456067621 mov $4,$0 add $4,1 mov $5,$0 mov $0,$4 mov $4,1 lpb $0,1 sub $0,1 add $1,1 mul $1,2 mov $3,$2 add $2,$4 trn $3,$0 add $1,$3 lpe lpb $5,1 add $1,1 sub $5,1 lpe add $1,43
examples/shared/serial_ports/src/serial_io-nonblocking.ads
RREE/Ada_Drivers_Library
0
11646
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2022, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package defines an abstract data type for a "serial port" providing -- non-blocking input (Receive) and output (Send) procedures. The procedures -- are considered non-blocking because they return to the caller (potentially) -- before the entire message is received or sent. -- -- The serial port abstraction is a wrapper around a USART peripheral, -- described by a value of type Peripheral_Descriptor. -- -- Interrupts are used to send and receive characters. -- -- NB: clients must not send or receive messages until any prior sending or -- receiving is completed. with Message_Buffers; use Message_Buffers; with Ada.Interrupts; use Ada.Interrupts; with System; use System; package Serial_IO.Nonblocking is pragma Elaborate_Body; type Serial_Port (Device : not null access Peripheral_Descriptor; IRQ : Interrupt_ID; IRQ_Priority : Interrupt_Priority) is limited private; procedure Initialize_Hardware (This : in out Serial_Port); -- A convenience wrapper for Serial_IO.Initialize_Hardware procedure Configure (This : in out Serial_Port; Baud_Rate : Baud_Rates; Parity : Parities := No_Parity; Data_Bits : Word_Lengths := Word_Length_8; End_Bits : Stop_Bits := Stopbits_1; Control : Flow_Control := No_Flow_Control); -- A convenience wrapper for Serial_IO.Configure procedure Send (This : in out Serial_Port; Msg : not null access Message) with Inline; -- Start sending the content of Msg.all, returning potentially -- prior to the completion of the message transmission procedure Receive (This : in out Serial_Port; Msg : not null access Message) with Post => Msg.Length <= Msg.Physical_Size and (if Msg.Length > 0 then Msg.Content_At (Msg.Length) /= Msg.Terminator), Inline; -- Start receiving Msg.all content, ending when the specified -- Msg.Terminator character is received (it is not stored), or -- the physical capacity of Msg.all is reached private protected type Serial_Port (Device : not null access Peripheral_Descriptor; IRQ : Interrupt_ID; IRQ_Priority : Interrupt_Priority) -- with -- Interrupt_Priority => IRQ_Priority is pragma Interrupt_Priority (IRQ_Priority); -- use pragma as workaround for bug in CE_2021 frontend (V523-041) procedure Start_Sending (Msg : not null access Message); procedure Start_Receiving (Msg : not null access Message); private Next_Out : Positive; Outgoing_Msg : access Message; Incoming_Msg : access Message; procedure Handle_Transmission with Inline; procedure Handle_Reception with Inline; procedure Detect_Errors (Is_Xmit_IRQ : Boolean) with Inline; procedure ISR with Attach_Handler => IRQ; end Serial_Port; end Serial_IO.Nonblocking;
src/exported/ewok-exported-dma.ads
PThierry/ewok-kernel
65
19445
<gh_stars>10-100 -- -- Copyright 2018 The wookey project team <<EMAIL>> -- - <NAME> -- - <NAME> -- - <NAME> -- - <NAME> -- - <NAME> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- with ewok.tasks_shared; use ewok.tasks_shared; with soc.dma.interfaces; with types.c; package ewok.exported.dma with spark_mode => on is -- Specify DMA elements to (re)configure type t_config_mask is new soc.dma.interfaces.t_config_mask; -- -- User defined DMA configuration -- type t_controller is new soc.dma.t_dma_periph_index with size => 8; subtype t_stream is unsigned_8 range 0 .. 7; subtype t_channel is unsigned_8 range 0 .. 7; type t_dma_user_config is record controller : t_controller := ID_DMA1; stream : t_stream := 0; channel : t_channel := 0; size : unsigned_16; -- size in bytes in_addr : system_address; in_priority : soc.dma.interfaces.t_priority_level; in_handler : system_address; -- ISR out_addr : system_address; out_priority : soc.dma.interfaces.t_priority_level; out_handler : system_address; -- ISR flow_controller : soc.dma.interfaces.t_flow_controller; transfer_dir : soc.dma.interfaces.t_transfer_dir; mode : soc.dma.interfaces.t_mode; data_size : soc.dma.interfaces.t_data_size; memory_inc : types.c.bool; periph_inc : types.c.bool; mem_burst_size : soc.dma.interfaces.t_burst_size; periph_burst_size : soc.dma.interfaces.t_burst_size; end record; type t_dma_user_config_access is access t_dma_user_config; type t_dma_shm_access is (SHM_ACCESS_READ, SHM_ACCESS_WRITE); -- The caller (accessed_id) grant access to another task (granted_id) -- to a range in its inner memory space. That mechanism permits to the -- 'granted' to configure the DMA with an address that belongs to -- the 'accessed' task. type t_dma_shm_info is record granted_id : t_task_id := ID_UNUSED; accessed_id : t_task_id := ID_UNUSED; -- caller base : system_address := 0; size : unsigned_32 := 0; access_type : t_dma_shm_access := SHM_ACCESS_READ; end record; end ewok.exported.dma;
oeis/153/A153161.asm
neoneye/loda-programs
11
247145
; A153161: Numerators of Stern-Brocot tree hanging between 1/3 and 2/3; denominators=A153162. ; Submitted by <NAME>(w1) ; 1,2,3,3,3,4,5,4,5,5,4,5,7,8,7,5,7,8,7,7,8,7,5,6,9,11,10,11,13,12,9,6,9,11,10,11,13,12,9,9,12,13,11,10,11,9,6,7,11,14,13,15,18,17,13,14,19,21,18,17,19,16,11,7,11,14,13,15,18,17,13,14,19,21,18,17,19,16,11,11,16,19 mul $0,2 mov $1,1 mov $2,2 lpb $0 div $0,2 sub $0,1 mov $3,1 add $3,$0 div $3,2 add $3,1 mod $3,2 mov $4,$2 add $2,$1 sub $4,$1 mul $3,$4 add $1,$3 lpe sub $2,$1 add $4,$2 mov $0,$4
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/profile_warning.ads
best08618/asylo
7
14584
<reponame>best08618/asylo pragma Profile_Warnings (Ravenscar); with profile_warning_p; package profile_warning is pragma Elaborate_Body; procedure I is new profile_warning_p.Proc; end;
examples/pyramid/pyramid-driver__webgl.adb
godunko/adagl
6
13529
<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- Ada binding for OpenGL/WebGL -- -- -- -- Examples Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2018, <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. -- -- -- ------------------------------------------------------------------------------ with League.Strings; with WebAPI.HTML.Globals; with WebAPI.HTML.Canvas_Elements; with OpenGL.Contexts; with OpenGL.Textures; with Pyramid.Programs; procedure Pyramid.Driver is use type OpenGL.GLfloat; Points : constant Pyramid.Programs.Vertex_Data_Array := (((0.0, 0.5, 0.0), (0.5, 1.0)), ((0.5, -0.5, 0.0), (1.0, 0.0)), ((-0.5, -0.5, 0.0), (0.0, 0.0))); -- Img : constant array (1 .. 9, 1 .. 3) of OpenGL.GLubyte := -- ((255, 0, 0), (127, 0, 0), (0, 0, 127), -- (127, 255, 0), (0, 127, 0), (0, 0, 127), -- (32, 0, 255), (0, 0, 127), (0,0, 127)); Unit : constant OpenGL.Texture_Unit := 0; Context : OpenGL.Contexts.OpenGL_Context; Buffer : Pyramid.Programs.Vertex_Data_Buffers.OpenGL_Buffer (OpenGL.Vertex); Program : Pyramid.Programs.Pyramid_Program; Texture : OpenGL.Textures.OpenGL_Texture (OpenGL.Texture_2D); begin Context.Create (WebAPI.HTML.Canvas_Elements.HTML_Canvas_Element_Access (WebAPI.HTML.Globals.Window.Get_Document.Get_Element_By_Id (League.Strings.To_Universal_String ("canvas")))); Context.Make_Current; Context.Functions.Enable (OpenGL.GL_DEPTH_TEST); Buffer.Create; Buffer.Bind; Buffer.Allocate (Points); Texture.Create; Texture.Bind (Unit); -- Texture.Set_Image_2D -- (0, OpenGL.GL_RGB, 3, 3, OpenGL.GL_UNSIGNED_BYTE, Img'Address); Texture.Set_Parameter (OpenGL.GL_TEXTURE_MIN_FILTER, OpenGL.GL_LINEAR); Texture.Set_Parameter (OpenGL.GL_TEXTURE_MAG_FILTER, OpenGL.GL_LINEAR); Program.Initialize; Program.Bind; Program.Set_Vertex_Data_Buffer (Buffer); Program.Set_Texture_Unit (Unit); declare use type OpenGL.GLbitfield; Clear_Flag : OpenGL.Clear_Buffer_Mask := OpenGL.GL_DEPTH_BUFFER_BIT + OpenGL.GL_COLOR_BUFFER_BIT; begin Context.Functions.Clear (Clear_Flag); Context.Functions.Draw_Arrays (OpenGL.GL_TRIANGLES, 0, Points'Length); end; end Pyramid.Driver;
1A/S5/PIM/tps/tp8generique/test_abr.adb
MOUDDENEHamza/ENSEEIHT
4
4089
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with ABR; procedure Test_ABR is package ABR_String_Integer is new ABR (T_Cle => Character, T_Donnee => Integer, "<" => "<"); use ABR_String_Integer; procedure Afficher (C : in Character) is begin Put ("'" & C & "'"); end Afficher; procedure Afficher (N : in Integer) is begin Put (N, 1); end Afficher; procedure Afficher_Debug is new ABR_String_Integer.Afficher_Debug (Afficher, Afficher); function Est_Cle_Utilisee (Abr : in T_Abr ; Cle : in Character) return Boolean is Donnee : Integer; begin Donnee := La_Donnee (Abr, Cle); return True; exception when Cle_Absente_Exception => return False; end Est_Cle_Utilisee; Nb_Donnees : constant Integer := 10; Cles : constant array (1..Nb_Donnees) of Character := ('F', 'B', 'H', 'D', 'A', 'E', 'G', 'J', 'I', 'C'); Donnees : constant array (1..Nb_Donnees) of Integer := (56, 78, 76, 27, 90, 23, 12, 43, 24, 39); -- Initialise l'ABR Abr commen un ABR vide dans lequel ont été insérées -- les cles Cles et les données Données ci-dessus. Attention, c'est à -- l'appelant de libérer la mémoire associée à l'arbre retourné en -- utilisant Vider. procedure Construire_Exemple_Arbre (Annuaire : out T_ABR) is begin Initialiser (Annuaire); pragma Assert (Est_Vide (Annuaire)); pragma Assert (Taille (Annuaire) = 0); for I in 1..Nb_Donnees loop Inserer (Annuaire, Cles (I), Donnees (I)); Put_Line ("Après insertion de la clé " & Cles (I)); Afficher_Debug (Annuaire); New_Line; pragma Assert (not Est_Vide (Annuaire)); pragma Assert (Taille (Annuaire) = I); for J in 1..I loop pragma Assert (La_Donnee (Annuaire, Cles (J)) = Donnees (J)); end loop; for J in I+1..Nb_Donnees loop pragma Assert (not Est_Cle_Utilisee (Annuaire, Cles (J))); end loop; end loop; -- TODO à supprimer -- Vider (Annuaire); -- pragma Assert (Est_Vide (Annuaire)); -- pragma Assert (Taille (Annuaire) = 0); end Construire_Exemple_Arbre; procedure Tester_Exemple_Arbre is Annuaire : T_ABR; begin Construire_Exemple_Arbre (Annuaire); Vider (Annuaire); pragma Assert (Est_Vide (Annuaire)); pragma Assert (Taille (Annuaire) = 0); end Tester_Exemple_Arbre; -- Tester suppression en commençant par supprimer les feilles. procedure Tester_Supprimer_Inverse is Annuaire : T_ABR; begin Put("Tester_Supprimer_Inverse..."); Construire_Exemple_Arbre (Annuaire); for I in reverse 1..Nb_Donnees loop Supprimer (Annuaire, Cles (I)); Put_Line ("Après uppression de " & Cles (I) & " :"); Afficher_Debug (Annuaire); New_Line; for J in 1..I-1 loop pragma Assert (Est_Cle_Utilisee (Annuaire, Cles (J))); pragma Assert (La_Donnee (Annuaire, Cles (J)) = Donnees (J)); end loop; for J in I..Nb_Donnees loop pragma Assert (not Est_Cle_Utilisee (Annuaire, Cles (J))); end loop; end loop; Vider (Annuaire); end Tester_Supprimer_Inverse; -- Tester suppression. Suppression de noeuds avec deux fils. procedure Tester_Supprimer is Annuaire : T_ABR; begin Put("Tester_Supprimer..."); Construire_Exemple_Arbre (Annuaire); for I in 1..Nb_Donnees loop Put_Line ("Suppression de " & Cles (I) & " :"); Supprimer (Annuaire, Cles (I)); Afficher_Debug (Annuaire); New_Line; for J in 1..I loop pragma Assert (not Est_Cle_Utilisee (Annuaire, Cles (J))); end loop; for J in I+1..Nb_Donnees loop pragma Assert (Est_Cle_Utilisee (Annuaire, Cles (J))); pragma Assert (La_Donnee (Annuaire, Cles (J)) = Donnees (J)); end loop; end loop; Vider (Annuaire); end Tester_Supprimer; begin Tester_Exemple_Arbre; Tester_Supprimer_Inverse; Tester_Supprimer; end Test_ABR;
programs/oeis/006/A006186.asm
neoneye/loda
22
163883
<gh_stars>10-100 ; A006186: Number of pair-coverings with largest block size 4. ; 1,5,8,10,11,12,12,13,13,13 sub $1,$0 mul $0,4 pow $0,2 sub $1,1 div $0,$1 div $0,$1 add $0,1
test/Succeed/Issue2172.agda
cruhland/agda
1,989
13810
<filename>test/Succeed/Issue2172.agda {-# OPTIONS --allow-unsolved-metas #-} module _ where postulate Functor : (Set → Set) → Set₁ fmap : {F : Set → Set} {{_ : Functor F}} {A B : Set} → (A → B) → F A → F B postulate Id : Set → Set bla : {A : Set} → Id A → Id A bla = fmap {{?}} (λ x → x) -- should not fail!
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc1005b.ada
best08618/asylo
7
6403
<reponame>best08618/asylo -- CC1005B.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 GENERIC UNIT'S IDENTIFIER CAN BE USED IN ITS -- FORMAL PART: -- -- (A) AS THE SELECTOR IN AN EXPANDED NAME TO DENOTE AN ENTITY IN THE -- VISIBLE PART OF A PACKAGE, OR TO DENOTE AN ENTITY IMMEDIATELY -- ENCLOSED IN A CONSTRUCT OTHER THAN THE CONSTRUCT IMMEDIATELY -- ENCLOSING THE GENERIC UNIT. -- -- (B) AS A SELECTOR TO DENOTE A COMPONENT OF A RECORD OBJECT, -- AS THE NAME OF A RECORD OR DISCRIMINANT COMPONENT IN A RECORD -- AGGREGATE, AND AS THE NAME OF A FORMAL PARAMETER IN A -- FUNCTION CALL. -- HISTORY: -- BCB 08/03/88 CREATED ORIGINAL TEST. -- JRL 03/20/92 DELETED TEST IN BLOCK STATEMENT; CONSOLIDATED -- WITH CC1005C. WITH REPORT; USE REPORT; PROCEDURE CC1005B IS S : INTEGER := IDENT_INT(0); PACKAGE CC1005B IS I : INTEGER; S : INTEGER := IDENT_INT(5); GENERIC S : INTEGER := IDENT_INT(10); V : INTEGER := STANDARD.CC1005B.S; W : INTEGER := STANDARD.CC1005B.CC1005B.S; FUNCTION CC1005B RETURN INTEGER; END CC1005B; PACKAGE BODY CC1005B IS FUNCTION CC1005B RETURN INTEGER IS BEGIN IF NOT EQUAL(V,0) THEN FAILED ("WRONG VALUE OF S USED IN ASSIGNMENT OF V"); END IF; IF NOT EQUAL(W,5) THEN FAILED ("WRONG VALUE OF S USED IN ASSIGNMENT OF W"); END IF; RETURN 0; END CC1005B; FUNCTION NEW_CC IS NEW CC1005B; BEGIN TEST ("CC1005B", "CHECK THAT A GENERIC UNIT'S IDENTIFIER " & "CAN BE USED IN ITS FORMAL PART: AS THE " & "SELECTOR IN AN EXPANDED NAME TO DENOTE " & "AN ENTITY IN THE VISIBLE PART OF A " & "PACKAGE, OR TO DENOTE AN ENTITY " & "IMMEDIATELY ENCLOSED IN A CONSTRUCT " & "OTHER THAN THE CONSTRUCT IMMEDIATELY " & "ENCLOSING THE GENERIC UNIT; AND AS A " & "SELECTOR TO DENOTE A COMPONENT OF A " & "RECORD OBJECT, AS THE NAME OF A RECORD " & "OR DISCRIMINANT COMPONENT IN A RECORD " & "AGGREGATE, AND AS THE NAME OF A FORMAL " & "PARAMETER IN A FUNCTION CALL"); I := NEW_CC; END CC1005B; FUNCTION F (P : INTEGER) RETURN INTEGER IS BEGIN RETURN P; END F; BEGIN BLOCK1: DECLARE TYPE REC IS RECORD P : INTEGER := IDENT_INT(0); END RECORD; TYPE REC2 (P : INTEGER) IS RECORD NULL; END RECORD; R : REC; J : INTEGER; GENERIC V : INTEGER := R.P; X : REC := (P => IDENT_INT(10)); Y : REC2 := (P => IDENT_INT(15)); Z : INTEGER := F(P => IDENT_INT(20)); FUNCTION P RETURN INTEGER; FUNCTION P RETURN INTEGER IS BEGIN IF NOT EQUAL(V,0) THEN FAILED ("WRONG VALUE OF P USED IN ASSIGNMENT " & "OF V"); END IF; IF NOT EQUAL(X.P,10) THEN FAILED ("WRONG VALUE USED IN ASSIGNMENT OF X.P"); END IF; IF NOT EQUAL(Y.P,15) THEN FAILED ("WRONG VALUE USED IN ASSIGNMENT OF Y.P"); END IF; IF NOT EQUAL(Z,20) THEN FAILED ("WRONG VALUE OF P USED IN ASSIGNMENT " & "OF Z"); END IF; RETURN 0; END P; FUNCTION NEW_P IS NEW P; BEGIN J := NEW_P; END BLOCK1; RESULT; END CC1005B;
Examples/ch04/CopyStr.asm
satadriver/LiunuxOS_t
0
16527
<gh_stars>0 TITLE Copying a String (CopyStr.asm) ; This program copies a string. ; Last update: 2/1/02 INCLUDE Irvine32.inc .data source BYTE "This is the source string",0 target BYTE SIZEOF source DUP(0),0 .code main PROC mov esi,0 ; index register mov ecx,SIZEOF source ; loop counter L1: mov al,source[esi] ; get a character from source mov target[esi],al ; store it in the target inc esi ; move to next character loop L1 ; repeat for entire string exit main ENDP END main
core/lib/groups/GeneratedGroup.agda
AntoineAllioux/HoTT-Agda
294
15296
<reponame>AntoineAllioux/HoTT-Agda {-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.NType2 open import lib.types.Pi open import lib.types.Group open import lib.types.Int open import lib.types.List open import lib.types.Word open import lib.types.SetQuotient open import lib.groups.Homomorphism module lib.groups.GeneratedGroup {i m} where module GeneratedGroup (A : Type i) (R : Rel (Word A) m) where -- [qwr-sym] is not needed, but it seems more principled to -- make [QuotWordRel] an equivalence relation. data QuotWordRel : Word A → Word A → Type (lmax i m) where qwr-refl : ∀ {l₁ l₂} → l₁ == l₂ → QuotWordRel l₁ l₂ qwr-trans : ∀ {l₁ l₂ l₃} → QuotWordRel l₁ l₂ → QuotWordRel l₂ l₃ → QuotWordRel l₁ l₃ qwr-sym : ∀ {l₁ l₂} → QuotWordRel l₁ l₂ → QuotWordRel l₂ l₁ qwr-cong : ∀ {l₁ l₂ l₃ l₄} → QuotWordRel l₁ l₂ → QuotWordRel l₃ l₄ → QuotWordRel (l₁ ++ l₃) (l₂ ++ l₄) qwr-flip-r : ∀ x₁ → QuotWordRel (x₁ :: flip x₁ :: nil) nil qwr-rel : ∀ {l₁ l₂} → R l₁ l₂ → QuotWordRel l₁ l₂ qwr-cong-l : ∀ {l₁ l₂} → QuotWordRel l₁ l₂ → ∀ l₃ → QuotWordRel (l₁ ++ l₃) (l₂ ++ l₃) qwr-cong-l qwr l₃ = qwr-cong qwr (qwr-refl idp) qwr-cong-r : ∀ l₁ {l₂ l₃} → QuotWordRel l₂ l₃ → QuotWordRel (l₁ ++ l₂) (l₁ ++ l₃) qwr-cong-r l₁ qwr = qwr-cong (qwr-refl (idp {a = l₁})) qwr abstract infixr 10 _qwr⟨_⟩_ infixr 10 _qwr⟨id⟩_ infix 15 _qwr∎ _qwr⟨_⟩_ : ∀ l₁ {l₂ l₃} → QuotWordRel l₁ l₂ → QuotWordRel l₂ l₃ → QuotWordRel l₁ l₃ _ qwr⟨ p ⟩ q = qwr-trans p q _qwr⟨id⟩_ : ∀ l₁ {l₂} → QuotWordRel l₁ l₂ → QuotWordRel l₁ l₂ _ qwr⟨id⟩ q = q _qwr∎ : ∀ l → QuotWordRel l l _ qwr∎ = qwr-refl idp qwr-flip-l : ∀ x₁ → QuotWordRel (flip x₁ :: x₁ :: nil) nil qwr-flip-l x₁ = flip x₁ :: x₁ :: nil qwr⟨ qwr-refl (ap (λ s → flip x₁ :: s :: nil) (! (flip-flip x₁))) ⟩ flip x₁ :: flip (flip x₁) :: nil qwr⟨ qwr-flip-r (flip x₁) ⟩ nil qwr∎ -- The quotient QuotWord : Type (lmax i m) QuotWord = SetQuot QuotWordRel qw[_] : Word A → QuotWord qw[_] = q[_] {- In the case where this module is used to realize some free construction F (e.g. free group, free abelian group), this function becomes the unit of the adjunction F -| U (where U is the forgetful functor). -} insert : A → QuotWord insert a = qw[ inl a :: nil ] module QuotWordElim {k} {P : QuotWord → Type k} {{_ : {x : QuotWord} → is-set (P x)}} (incl* : (a : Word A) → P qw[ a ]) (rel* : ∀ {a₁ a₂} (r : QuotWordRel a₁ a₂) → incl* a₁ == incl* a₂ [ P ↓ quot-rel r ]) = SetQuotElim incl* rel* open QuotWordElim public renaming (f to QuotWord-elim) hiding (quot-rel-β) module QuotWordRec {k} {B : Type k} {{_ : is-set B}} (incl* : Word A → B) (rel* : ∀ {a₁ a₂} (r : QuotWordRel a₁ a₂) → incl* a₁ == incl* a₂) = SetQuotRec incl* rel* open QuotWordRec public renaming (f to QuotWord-rec) private infixl 80 _⊞_ _⊞_ : QuotWord → QuotWord → QuotWord _⊞_ = QuotWord-rec (λ l₁ → QuotWord-rec (λ l₂ → qw[ l₁ ++ l₂ ]) (λ r → quot-rel $ qwr-cong-r l₁ r)) (λ {l₁} {l₁'} r → λ= $ QuotWord-elim (λ l₂ → quot-rel $ qwr-cong-l r l₂) (λ _ → prop-has-all-paths-↓)) abstract qwr-cancel-l : ∀ l → QuotWordRel (Word-inverse l ++ l) nil qwr-cancel-l nil = qwr-refl idp qwr-cancel-l (x :: l) = Word-inverse (x :: l) ++ (x :: l) qwr⟨id⟩ (Word-inverse l ++ (flip x :: nil)) ++ (x :: l) qwr⟨ qwr-refl (++-assoc (reverse (Word-flip l)) (flip x :: nil) (x :: l)) ⟩ Word-inverse l ++ ((flip x :: nil) ++ (x :: l)) qwr⟨id⟩ Word-inverse l ++ (flip x :: x :: l) qwr⟨ qwr-cong-r (reverse (Word-flip l)) (qwr-cong-l (qwr-flip-l x) l) ⟩ Word-inverse l ++ l qwr⟨ qwr-cancel-l l ⟩ nil qwr∎ qwr-cancel-r : ∀ l → QuotWordRel (l ++ Word-inverse l) nil qwr-cancel-r l = l ++ Word-inverse l qwr⟨ qwr-refl (ap (_++ Word-inverse l) (! (Word-inverse-inverse l))) ⟩ Word-inverse (Word-inverse l) ++ Word-inverse l qwr⟨ qwr-cancel-l (Word-inverse l) ⟩ nil qwr∎ qwr-cong-inverse : ∀ {l₁ l₂} → QuotWordRel l₁ l₂ → QuotWordRel (Word-inverse l₁) (Word-inverse l₂) qwr-cong-inverse {l₁} {l₂} r = Word-inverse l₁ qwr⟨ qwr-refl (! (++-unit-r (Word-inverse l₁))) ⟩ Word-inverse l₁ ++ nil qwr⟨ qwr-cong-r (Word-inverse l₁) (qwr-sym (qwr-cancel-r l₂)) ⟩ Word-inverse l₁ ++ (l₂ ++ Word-inverse l₂) qwr⟨ qwr-cong-r (Word-inverse l₁) (qwr-cong-l (qwr-sym r) (Word-inverse l₂)) ⟩ reverse (Word-flip l₁) ++ (l₁ ++ Word-inverse l₂) qwr⟨ qwr-refl (! (++-assoc (Word-inverse l₁) l₁ (Word-inverse l₂))) ⟩ (Word-inverse l₁ ++ l₁) ++ Word-inverse l₂ qwr⟨ qwr-cong-l (qwr-cancel-l l₁) (Word-inverse l₂) ⟩ Word-inverse l₂ qwr∎ ⊟ : QuotWord → QuotWord ⊟ = QuotWord-rec (qw[_] ∘ Word-inverse) (λ r → quot-rel $ qwr-cong-inverse r) ⊞-unit : QuotWord ⊞-unit = qw[ nil ] abstract ⊞-unit-l : ∀ g → ⊞-unit ⊞ g == g ⊞-unit-l = QuotWord-elim (λ _ → idp) (λ _ → prop-has-all-paths-↓) ⊞-assoc : ∀ g₁ g₂ g₃ → (g₁ ⊞ g₂) ⊞ g₃ == g₁ ⊞ (g₂ ⊞ g₃) ⊞-assoc = QuotWord-elim (λ l₁ → QuotWord-elim (λ l₂ → QuotWord-elim (λ l₃ → ap qw[_] $ ++-assoc l₁ l₂ l₃) (λ _ → prop-has-all-paths-↓)) (λ _ → prop-has-all-paths-↓)) (λ _ → prop-has-all-paths-↓) ⊟-inv-l : ∀ g → (⊟ g) ⊞ g == ⊞-unit ⊟-inv-l = QuotWord-elim (λ l → quot-rel (qwr-cancel-l l)) (λ _ → prop-has-all-paths-↓) QuotWord-group-structure : GroupStructure QuotWord QuotWord-group-structure = record { ident = ⊞-unit ; inv = ⊟ ; comp = _⊞_ ; unit-l = ⊞-unit-l ; assoc = ⊞-assoc ; inv-l = ⊟-inv-l } GenGroup : Group (lmax i m) GenGroup = group _ QuotWord-group-structure module GenGroup = Group GenGroup open GenGroup using (El) public abstract pres-exp : ∀ (a : A) z → qw[ Word-exp a z ] == GenGroup.exp qw[ inl a :: nil ] z pres-exp a (pos O) = idp pres-exp a (pos (S O)) = idp pres-exp a (pos (S (S n))) = ap (GenGroup.comp qw[ inl a :: nil ]) (pres-exp a (pos (S n))) pres-exp a (negsucc O) = idp pres-exp a (negsucc (S n)) = ap (GenGroup.comp qw[ inr a :: nil ]) (pres-exp a (negsucc n)) rel-holds : ∀ {w₁} {w₂} (r : R w₁ w₂) → qw[ w₁ ] == qw[ w₂ ] rel-holds r = quot-rel (qwr-rel r) -- freeness module HomomorphismEquiv {j} (G : Group j) where private module G = Group G open RelationRespectingFunctions A R G public module _ (fun : RelationRespectingFunction) where private module fun = RelationRespectingFunction fun f* = fun.f abstract Word-extendᴳ-emap : ∀ {l₁ l₂} → QuotWordRel l₁ l₂ → Word-extendᴳ G f* l₁ == Word-extendᴳ G f* l₂ Word-extendᴳ-emap (qwr-refl idp) = idp Word-extendᴳ-emap (qwr-trans qwr qwr₁) = (Word-extendᴳ-emap qwr) ∙ (Word-extendᴳ-emap qwr₁) Word-extendᴳ-emap (qwr-sym qwr) = ! (Word-extendᴳ-emap qwr) Word-extendᴳ-emap (qwr-flip-r x) = G.comp (PlusMinus-extendᴳ G f* x) (PlusMinus-extendᴳ G f* (flip x)) =⟨ ap (G.comp (PlusMinus-extendᴳ G f* x)) (PlusMinus-extendᴳ-flip G f* x) ⟩ G.comp (PlusMinus-extendᴳ G f* x) (G.inv (PlusMinus-extendᴳ G f* x)) =⟨ G.inv-r (PlusMinus-extendᴳ G f* x) ⟩ G.ident =∎ Word-extendᴳ-emap (qwr-cong {l₁} {l₂} {l₃} {l₄} qwr qwr') = Word-extendᴳ G f* (l₁ ++ l₃) =⟨ Word-extendᴳ-++ G f* l₁ l₃ ⟩ G.comp (Word-extendᴳ G f* l₁) (Word-extendᴳ G f* l₃) =⟨ ap2 G.comp (Word-extendᴳ-emap qwr) (Word-extendᴳ-emap qwr') ⟩ G.comp (Word-extendᴳ G f* l₂) (Word-extendᴳ G f* l₄) =⟨ ! (Word-extendᴳ-++ G f* l₂ l₄) ⟩ Word-extendᴳ G f* (l₂ ++ l₄) =∎ Word-extendᴳ-emap (qwr-rel r) = fun.respects r extend : (GenGroup →ᴳ G) extend = record {M} where module M where f : QuotWord → G.El f = QuotWord-rec (Word-extendᴳ G f*) (λ r → Word-extendᴳ-emap r) abstract pres-comp : preserves-comp GenGroup.comp G.comp f pres-comp = QuotWord-elim (λ l₁ → QuotWord-elim (λ l₂ → Word-extendᴳ-++ G f* l₁ l₂) (λ _ → prop-has-all-paths-↓)) (λ _ → prop-has-all-paths-↓) private module Lemma (hom : GenGroup →ᴳ G) where private open GroupHom hom restr : A → G.El restr a = f qw[ inl a :: nil ] abstract PlusMinus-extendᴳ-hom : ∀ x → PlusMinus-extendᴳ G restr x == f qw[ x :: nil ] PlusMinus-extendᴳ-hom (inl x) = idp PlusMinus-extendᴳ-hom (inr x) = ! $ pres-inv qw[ inl x :: nil ] Word-extendᴳ-hom : ∀ l → Word-extendᴳ G restr l == f qw[ l ] Word-extendᴳ-hom nil = ! pres-ident Word-extendᴳ-hom (x :: nil) = PlusMinus-extendᴳ-hom x Word-extendᴳ-hom (x :: l@(_ :: _)) = G.comp (PlusMinus-extendᴳ G restr x) (Word-extendᴳ G restr l) =⟨ ap2 G.comp (PlusMinus-extendᴳ-hom x) (Word-extendᴳ-hom l) ⟩ G.comp (f qw[ x :: nil ]) (f qw[ l ]) =⟨ ! (pres-comp _ _) ⟩ f qw[ x :: l ] =∎ restr-respects-rel : ∀ {l₁ l₂} → R l₁ l₂ → Word-extendᴳ G restr l₁ == Word-extendᴳ G restr l₂ restr-respects-rel {l₁} {l₂} r = Word-extendᴳ G restr l₁ =⟨ Word-extendᴳ-hom l₁ ⟩ f qw[ l₁ ] =⟨ ap f (quot-rel (qwr-rel r)) ⟩ f qw[ l₂ ] =⟨ ! (Word-extendᴳ-hom l₂) ⟩ Word-extendᴳ G restr l₂ =∎ restrict : RelationRespectingFunction restrict = rel-res-fun restr restr-respects-rel open Lemma extend-is-equiv : is-equiv extend extend-is-equiv = is-eq _ from to-from from-to where to = extend from = restrict abstract to-from : ∀ h → to (from h) == h to-from h = group-hom= $ λ= $ QuotWord-elim (λ l → Word-extendᴳ-hom h l) (λ _ → prop-has-all-paths-↓) from-to : ∀ fun → from (to fun) == fun from-to fun = RelationRespectingFunction= (λ= λ a → idp) extend-equiv : RelationRespectingFunction ≃ (GenGroup →ᴳ G) extend-equiv = extend , extend-is-equiv
Aurora/Aurora/x64/Debug/kheap.asm
manaskamal/aurora-xeneva
8
1166
<reponame>manaskamal/aurora-xeneva ; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1 include listing.inc INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC ?kmem_start@@3PEAXEA ; kmem_start PUBLIC ?kmem_end@@3PEAXEA ; kmem_end PUBLIC ?last_header@@3PEAUkmem@@EA ; last_header _BSS SEGMENT ?kmem_start@@3PEAXEA DQ 01H DUP (?) ; kmem_start ?kmem_end@@3PEAXEA DQ 01H DUP (?) ; kmem_end ?last_header@@3PEAUkmem@@EA DQ 01H DUP (?) ; last_header _BSS ENDS CONST SEGMENT $SG3000 DB 'Heap Start -> %x', 0aH, 00H ORG $+6 $SG3001 DB 'Heap End -> %x', 0aH, 00H CONST ENDS PUBLIC ?align_next@kmem@@QEAAXXZ ; kmem::align_next PUBLIC ?align_prev@kmem@@QEAAXXZ ; kmem::align_prev PUBLIC ?split@kmem@@QEAAPEAU1@_K@Z ; kmem::split PUBLIC ?initialize_kmemory@@YAX_K@Z ; initialize_kmemory PUBLIC ?malloc@@YAPEAX_K@Z ; malloc PUBLIC ?free@@YAXPEAX@Z ; free PUBLIC ?expand_kmem@@YAX_K@Z ; expand_kmem PUBLIC ?kheap_print@@YAXXZ ; kheap_print EXTRN ?pmmngr_alloc@@YAPEAXXZ:PROC ; pmmngr_alloc EXTRN ?map_page@@YA_N_K0E@Z:PROC ; map_page EXTRN ?printf@@YAXPEBDZZ:PROC ; printf pdata SEGMENT $pdata$?align_prev@kmem@@QEAAXXZ DD imagerel $LN4 DD imagerel $LN4+57 DD imagerel $unwind$?align_prev@kmem@@QEAAXXZ $pdata$?split@kmem@@QEAAPEAU1@_K@Z DD imagerel $LN6 DD imagerel $LN6+223 DD imagerel $unwind$?split@kmem@@QEAAPEAU1@_K@Z $pdata$?initialize_kmemory@@YAX_K@Z DD imagerel $LN6 DD imagerel $LN6+246 DD imagerel $unwind$?initialize_kmemory@@YAX_K@Z $pdata$?malloc@@YAPEAX_K@Z DD imagerel $LN11 DD imagerel $LN11+274 DD imagerel $unwind$?malloc@@YAPEAX_K@Z $pdata$?free@@YAXPEAX@Z DD imagerel $LN3 DD imagerel $LN3+57 DD imagerel $unwind$?free@@YAXPEAX@Z $pdata$?expand_kmem@@YAX_K@Z DD imagerel $LN7 DD imagerel $LN7+293 DD imagerel $unwind$?expand_kmem@@YAX_K@Z $pdata$?kheap_print@@YAXXZ DD imagerel $LN3 DD imagerel $LN3+47 DD imagerel $unwind$?kheap_print@@YAXXZ pdata ENDS xdata SEGMENT $unwind$?align_prev@kmem@@QEAAXXZ DD 010901H DD 04209H $unwind$?split@kmem@@QEAAPEAU1@_K@Z DD 010e01H DD 0220eH $unwind$?initialize_kmemory@@YAX_K@Z DD 010901H DD 0a209H $unwind$?malloc@@YAPEAX_K@Z DD 010901H DD 06209H $unwind$?free@@YAXPEAX@Z DD 010901H DD 06209H $unwind$?expand_kmem@@YAX_K@Z DD 010901H DD 08209H $unwind$?kheap_print@@YAXXZ DD 010401H DD 04204H xdata ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT ?kheap_print@@YAXXZ PROC ; kheap_print ; 148 : void kheap_print () { $LN3: sub rsp, 40 ; 00000028H ; 149 : printf ("Heap Start -> %x\n", kmem_start); mov rdx, QWORD PTR ?kmem_start@@3PEAXEA ; kmem_start lea rcx, OFFSET FLAT:$SG3000 call ?printf@@YAXPEBDZZ ; printf ; 150 : printf ("Heap End -> %x\n", kmem_end); mov rdx, QWORD PTR ?kmem_end@@3PEAXEA ; kmem_end lea rcx, OFFSET FLAT:$SG3001 call ?printf@@YAXPEBDZZ ; printf ; 151 : } add rsp, 40 ; 00000028H ret 0 ?kheap_print@@YAXXZ ENDP ; kheap_print _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT new_seg$ = 32 i$1 = 40 page_count$ = 48 length$ = 80 ?expand_kmem@@YAX_K@Z PROC ; expand_kmem ; 84 : void expand_kmem (size_t length) { $LN7: mov QWORD PTR [rsp+8], rcx sub rsp, 72 ; 00000048H ; 85 : if (length % 0x1000) { xor edx, edx mov rax, QWORD PTR length$[rsp] mov ecx, 4096 ; 00001000H div rcx mov rax, rdx test rax, rax je SHORT $LN4@expand_kme ; 86 : length -= length % 0x1000; xor edx, edx mov rax, QWORD PTR length$[rsp] mov ecx, 4096 ; 00001000H div rcx mov rax, rdx mov rcx, QWORD PTR length$[rsp] sub rcx, rax mov rax, rcx mov QWORD PTR length$[rsp], rax ; 87 : length += 0x1000; mov rax, QWORD PTR length$[rsp] add rax, 4096 ; 00001000H mov QWORD PTR length$[rsp], rax $LN4@expand_kme: ; 88 : } ; 89 : ; 90 : size_t page_count = length / 0x1000; xor edx, edx mov rax, QWORD PTR length$[rsp] mov ecx, 4096 ; 00001000H div rcx mov QWORD PTR page_count$[rsp], rax ; 91 : kmem* new_seg = (kmem*)kmem_end; mov rax, QWORD PTR ?kmem_end@@3PEAXEA ; kmem_end mov QWORD PTR new_seg$[rsp], rax ; 92 : ; 93 : for (size_t i = 0; i < page_count; i++) { mov QWORD PTR i$1[rsp], 0 jmp SHORT $LN3@expand_kme $LN2@expand_kme: mov rax, QWORD PTR i$1[rsp] inc rax mov QWORD PTR i$1[rsp], rax $LN3@expand_kme: mov rax, QWORD PTR page_count$[rsp] cmp QWORD PTR i$1[rsp], rax jae SHORT $LN1@expand_kme ; 94 : map_page ((uint64_t)pmmngr_alloc(), (uint64_t)kmem_end,0); call ?pmmngr_alloc@@YAPEAXXZ ; pmmngr_alloc xor r8d, r8d mov rdx, QWORD PTR ?kmem_end@@3PEAXEA ; kmem_end mov rcx, rax call ?map_page@@YA_N_K0E@Z ; map_page ; 95 : kmem_end = (void*)((size_t)kmem_end + 0x1000); mov rax, QWORD PTR ?kmem_end@@3PEAXEA ; kmem_end add rax, 4096 ; 00001000H mov QWORD PTR ?kmem_end@@3PEAXEA, rax ; kmem_end ; 96 : } jmp SHORT $LN2@expand_kme $LN1@expand_kme: ; 97 : ; 98 : new_seg->free = true; mov rax, QWORD PTR new_seg$[rsp] mov BYTE PTR [rax+24], 1 ; 99 : new_seg->last = last_header; mov rax, QWORD PTR new_seg$[rsp] mov rcx, QWORD PTR ?last_header@@3PEAUkmem@@EA ; last_header mov QWORD PTR [rax+16], rcx ; 100 : last_header->next = new_seg; mov rax, QWORD PTR ?last_header@@3PEAUkmem@@EA ; last_header mov rcx, QWORD PTR new_seg$[rsp] mov QWORD PTR [rax+8], rcx ; 101 : last_header = new_seg; mov rax, QWORD PTR new_seg$[rsp] mov QWORD PTR ?last_header@@3PEAUkmem@@EA, rax ; last_header ; 102 : new_seg->next = NULL; mov rax, QWORD PTR new_seg$[rsp] mov QWORD PTR [rax+8], 0 ; 103 : new_seg->length = length - sizeof (kmem); mov rax, QWORD PTR length$[rsp] sub rax, 32 ; 00000020H mov rcx, QWORD PTR new_seg$[rsp] mov QWORD PTR [rcx], rax ; 104 : new_seg->align_next (); mov rcx, QWORD PTR new_seg$[rsp] call ?align_next@kmem@@QEAAXXZ ; kmem::align_next ; 105 : } add rsp, 72 ; 00000048H ret 0 ?expand_kmem@@YAX_K@Z ENDP ; expand_kmem _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT seg$ = 32 memory$ = 64 ?free@@YAXPEAX@Z PROC ; free ; 139 : void free (void* memory) { $LN3: mov QWORD PTR [rsp+8], rcx sub rsp, 56 ; 00000038H ; 140 : //x64_cli(); ; 141 : kmem* seg = (kmem*)memory - 1; mov rax, QWORD PTR memory$[rsp] sub rax, 32 ; 00000020H mov QWORD PTR seg$[rsp], rax ; 142 : seg->free = true; mov rax, QWORD PTR seg$[rsp] mov BYTE PTR [rax+24], 1 ; 143 : seg->align_next(); mov rcx, QWORD PTR seg$[rsp] call ?align_next@kmem@@QEAAXXZ ; kmem::align_next ; 144 : seg->align_prev(); mov rcx, QWORD PTR seg$[rsp] call ?align_prev@kmem@@QEAAXXZ ; kmem::align_prev ; 145 : } add rsp, 56 ; 00000038H ret 0 ?free@@YAXPEAX@Z ENDP ; free _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT current_seg$ = 32 size$ = 64 ?malloc@@YAPEAX_K@Z PROC ; malloc ; 109 : void* malloc(size_t size) { $LN11: mov QWORD PTR [rsp+8], rcx sub rsp, 56 ; 00000038H ; 110 : if (size % 0x10 > 0) { xor edx, edx mov rax, QWORD PTR size$[rsp] mov ecx, 16 div rcx mov rax, rdx test rax, rax jbe SHORT $LN8@malloc ; 111 : size -= (size % 0x10); xor edx, edx mov rax, QWORD PTR size$[rsp] mov ecx, 16 div rcx mov rax, rdx mov rcx, QWORD PTR size$[rsp] sub rcx, rax mov rax, rcx mov QWORD PTR size$[rsp], rax ; 112 : size += 0x10; mov rax, QWORD PTR size$[rsp] add rax, 16 mov QWORD PTR size$[rsp], rax $LN8@malloc: ; 113 : } ; 114 : ; 115 : if (size == 0) return NULL; cmp QWORD PTR size$[rsp], 0 jne SHORT $LN7@malloc xor eax, eax jmp $LN9@malloc $LN7@malloc: ; 116 : ; 117 : kmem* current_seg = (kmem*) kmem_start; mov rax, QWORD PTR ?kmem_start@@3PEAXEA ; kmem_start mov QWORD PTR current_seg$[rsp], rax $LN6@malloc: ; 118 : while (true) { xor eax, eax cmp eax, 1 je $LN5@malloc ; 119 : if (current_seg->free) { mov rax, QWORD PTR current_seg$[rsp] movzx eax, BYTE PTR [rax+24] test eax, eax je SHORT $LN4@malloc ; 120 : if (current_seg->length > size) { mov rax, QWORD PTR current_seg$[rsp] mov rcx, QWORD PTR size$[rsp] cmp QWORD PTR [rax], rcx jbe SHORT $LN3@malloc ; 121 : current_seg->split (size); mov rdx, QWORD PTR size$[rsp] mov rcx, QWORD PTR current_seg$[rsp] call ?split@kmem@@QEAAPEAU1@_K@Z ; kmem::split ; 122 : current_seg->free = false; mov rax, QWORD PTR current_seg$[rsp] mov BYTE PTR [rax+24], 0 ; 123 : return (void*)((uint64_t)current_seg + sizeof (kmem)); mov rax, QWORD PTR current_seg$[rsp] add rax, 32 ; 00000020H jmp SHORT $LN9@malloc $LN3@malloc: ; 124 : } ; 125 : ; 126 : if (current_seg->length == size) { mov rax, QWORD PTR current_seg$[rsp] mov rcx, QWORD PTR size$[rsp] cmp QWORD PTR [rax], rcx jne SHORT $LN2@malloc ; 127 : current_seg->free = false; mov rax, QWORD PTR current_seg$[rsp] mov BYTE PTR [rax+24], 0 ; 128 : return (void*)((uint64_t)current_seg + sizeof (kmem)); mov rax, QWORD PTR current_seg$[rsp] add rax, 32 ; 00000020H jmp SHORT $LN9@malloc $LN2@malloc: $LN4@malloc: ; 129 : } ; 130 : } ; 131 : if (current_seg->next == NULL) break; mov rax, QWORD PTR current_seg$[rsp] cmp QWORD PTR [rax+8], 0 jne SHORT $LN1@malloc jmp SHORT $LN5@malloc $LN1@malloc: ; 132 : current_seg = current_seg->next; mov rax, QWORD PTR current_seg$[rsp] mov rax, QWORD PTR [rax+8] mov QWORD PTR current_seg$[rsp], rax ; 133 : } jmp $LN6@malloc $LN5@malloc: ; 134 : ; 135 : expand_kmem(size); mov rcx, QWORD PTR size$[rsp] call ?expand_kmem@@YAX_K@Z ; expand_kmem ; 136 : return malloc(size); mov rcx, QWORD PTR size$[rsp] call ?malloc@@YAPEAX_K@Z ; malloc $LN9@malloc: ; 137 : } add rsp, 56 ; 00000038H ret 0 ?malloc@@YAPEAX_K@Z ENDP ; malloc _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT start_seg$ = 32 i$1 = 40 pos$ = 48 kmem_length$ = 56 p$2 = 64 sz$ = 96 ?initialize_kmemory@@YAX_K@Z PROC ; initialize_kmemory ; 21 : void initialize_kmemory (size_t sz) { $LN6: mov QWORD PTR [rsp+8], rcx sub rsp, 88 ; 00000058H ; 22 : ; 23 : void* pos = (void*)0xFFFF800000000000; //0xFFFFB00000000000; mov rax, -140737488355328 ; ffff800000000000H mov QWORD PTR pos$[rsp], rax ; 24 : ; 25 : for (size_t i=0; i < sz; i++) { mov QWORD PTR i$1[rsp], 0 jmp SHORT $LN3@initialize $LN2@initialize: mov rax, QWORD PTR i$1[rsp] inc rax mov QWORD PTR i$1[rsp], rax $LN3@initialize: mov rax, QWORD PTR sz$[rsp] cmp QWORD PTR i$1[rsp], rax jae SHORT $LN1@initialize ; 26 : void* p = (void*)pmmngr_alloc(); call ?pmmngr_alloc@@YAPEAXXZ ; pmmngr_alloc mov QWORD PTR p$2[rsp], rax ; 27 : map_page ((uint64_t)p,(uint64_t)pos,0); xor r8d, r8d mov rdx, QWORD PTR pos$[rsp] mov rcx, QWORD PTR p$2[rsp] call ?map_page@@YA_N_K0E@Z ; map_page ; 28 : pos = (void*)((size_t)pos + 0x1000); mov rax, QWORD PTR pos$[rsp] add rax, 4096 ; 00001000H mov QWORD PTR pos$[rsp], rax ; 29 : } jmp SHORT $LN2@initialize $LN1@initialize: ; 30 : ; 31 : size_t kmem_length = sz * 0x1000; mov rax, QWORD PTR sz$[rsp] imul rax, 4096 ; 00001000H mov QWORD PTR kmem_length$[rsp], rax ; 32 : ; 33 : kmem_start = (void*)0xFFFF800000000000; //0xFFFFB00000000000; mov rax, -140737488355328 ; ffff800000000000H mov QWORD PTR ?kmem_start@@3PEAXEA, rax ; kmem_start ; 34 : kmem_end = (void*)((size_t)kmem_start + kmem_length); mov rax, QWORD PTR kmem_length$[rsp] mov rcx, QWORD PTR ?kmem_start@@3PEAXEA ; kmem_start add rcx, rax mov rax, rcx mov QWORD PTR ?kmem_end@@3PEAXEA, rax ; kmem_end ; 35 : //printf ("Heap end -> %x\n", kmem_end); ; 36 : kmem* start_seg = (kmem*)kmem_start; mov rax, QWORD PTR ?kmem_start@@3PEAXEA ; kmem_start mov QWORD PTR start_seg$[rsp], rax ; 37 : start_seg->length = kmem_length - sizeof (kmem); mov rax, QWORD PTR kmem_length$[rsp] sub rax, 32 ; 00000020H mov rcx, QWORD PTR start_seg$[rsp] mov QWORD PTR [rcx], rax ; 38 : start_seg->next = NULL; mov rax, QWORD PTR start_seg$[rsp] mov QWORD PTR [rax+8], 0 ; 39 : start_seg->last = NULL; mov rax, QWORD PTR start_seg$[rsp] mov QWORD PTR [rax+16], 0 ; 40 : start_seg->free = true; mov rax, QWORD PTR start_seg$[rsp] mov BYTE PTR [rax+24], 1 ; 41 : last_header = start_seg; mov rax, QWORD PTR start_seg$[rsp] mov QWORD PTR ?last_header@@3PEAUkmem@@EA, rax ; last_header ; 42 : ; 43 : } add rsp, 88 ; 00000058H ret 0 ?initialize_kmemory@@YAX_K@Z ENDP ; initialize_kmemory _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT new_split$ = 0 split_seg_length$ = 8 this$ = 32 split_length$ = 40 ?split@kmem@@QEAAPEAU1@_K@Z PROC ; kmem::split ; 65 : kmem* kmem::split(size_t split_length) { $LN6: mov QWORD PTR [rsp+16], rdx mov QWORD PTR [rsp+8], rcx sub rsp, 24 ; 66 : if (split_length < 0x10) return NULL; cmp QWORD PTR split_length$[rsp], 16 jae SHORT $LN3@split xor eax, eax jmp $LN4@split $LN3@split: ; 67 : int64_t split_seg_length = length - split_length - (sizeof(kmem)); mov rax, QWORD PTR this$[rsp] mov rcx, QWORD PTR split_length$[rsp] mov rax, QWORD PTR [rax] sub rax, rcx sub rax, 32 ; 00000020H mov QWORD PTR split_seg_length$[rsp], rax ; 68 : if (split_seg_length < 0x10) return NULL; cmp QWORD PTR split_seg_length$[rsp], 16 jge SHORT $LN2@split xor eax, eax jmp $LN4@split $LN2@split: ; 69 : ; 70 : kmem* new_split = (kmem*) ((size_t)this + split_length + sizeof (kmem)); mov rax, QWORD PTR this$[rsp] mov rcx, QWORD PTR split_length$[rsp] lea rax, QWORD PTR [rax+rcx+32] mov QWORD PTR new_split$[rsp], rax ; 71 : next->last = new_split; mov rax, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+8] mov rcx, QWORD PTR new_split$[rsp] mov QWORD PTR [rax+16], rcx ; 72 : new_split->next = next; mov rax, QWORD PTR new_split$[rsp] mov rcx, QWORD PTR this$[rsp] mov rcx, QWORD PTR [rcx+8] mov QWORD PTR [rax+8], rcx ; 73 : next = new_split; mov rax, QWORD PTR this$[rsp] mov rcx, QWORD PTR new_split$[rsp] mov QWORD PTR [rax+8], rcx ; 74 : new_split->last = this; mov rax, QWORD PTR new_split$[rsp] mov rcx, QWORD PTR this$[rsp] mov QWORD PTR [rax+16], rcx ; 75 : new_split->length = split_seg_length; mov rax, QWORD PTR new_split$[rsp] mov rcx, QWORD PTR split_seg_length$[rsp] mov QWORD PTR [rax], rcx ; 76 : new_split->free = free; mov rax, QWORD PTR new_split$[rsp] mov rcx, QWORD PTR this$[rsp] movzx ecx, BYTE PTR [rcx+24] mov BYTE PTR [rax+24], cl ; 77 : length = split_length; mov rax, QWORD PTR this$[rsp] mov rcx, QWORD PTR split_length$[rsp] mov QWORD PTR [rax], rcx ; 78 : ; 79 : if (last_header == this) last_header = new_split; mov rax, QWORD PTR this$[rsp] cmp QWORD PTR ?last_header@@3PEAUkmem@@EA, rax ; last_header jne SHORT $LN1@split mov rax, QWORD PTR new_split$[rsp] mov QWORD PTR ?last_header@@3PEAUkmem@@EA, rax ; last_header $LN1@split: ; 80 : return new_split; mov rax, QWORD PTR new_split$[rsp] $LN4@split: ; 81 : } add rsp, 24 ret 0 ?split@kmem@@QEAAPEAU1@_K@Z ENDP ; kmem::split _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT this$ = 48 ?align_prev@kmem@@QEAAXXZ PROC ; kmem::align_prev ; 60 : void kmem::align_prev () { $LN4: mov QWORD PTR [rsp+8], rcx sub rsp, 40 ; 00000028H ; 61 : if (last != NULL && last->free) last->align_next(); mov rax, QWORD PTR this$[rsp] cmp QWORD PTR [rax+16], 0 je SHORT $LN1@align_prev mov rax, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+16] movzx eax, BYTE PTR [rax+24] test eax, eax je SHORT $LN1@align_prev mov rax, QWORD PTR this$[rsp] mov rcx, QWORD PTR [rax+16] call ?align_next@kmem@@QEAAXXZ ; kmem::align_next $LN1@align_prev: ; 62 : } add rsp, 40 ; 00000028H ret 0 ?align_prev@kmem@@QEAAXXZ ENDP ; kmem::align_prev _TEXT ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\arch\x86_64\kheap.cpp _TEXT SEGMENT this$ = 8 ?align_next@kmem@@QEAAXXZ PROC ; kmem::align_next ; 45 : void kmem::align_next () { mov QWORD PTR [rsp+8], rcx ; 46 : if (next == NULL) return; mov rax, QWORD PTR this$[rsp] cmp QWORD PTR [rax+8], 0 jne SHORT $LN4@align_next jmp $LN5@align_next $LN4@align_next: ; 47 : if (!next->free) return; mov rax, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+8] movzx eax, BYTE PTR [rax+24] test eax, eax jne SHORT $LN3@align_next jmp SHORT $LN5@align_next $LN3@align_next: ; 48 : ; 49 : if (next == last_header) last_header = this; mov rax, QWORD PTR this$[rsp] mov rcx, QWORD PTR ?last_header@@3PEAUkmem@@EA ; last_header cmp QWORD PTR [rax+8], rcx jne SHORT $LN2@align_next mov rax, QWORD PTR this$[rsp] mov QWORD PTR ?last_header@@3PEAUkmem@@EA, rax ; last_header $LN2@align_next: ; 50 : ; 51 : if (next->next != NULL) { mov rax, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+8] cmp QWORD PTR [rax+8], 0 je SHORT $LN1@align_next ; 52 : next->next->last = this; mov rax, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+8] mov rax, QWORD PTR [rax+8] mov rcx, QWORD PTR this$[rsp] mov QWORD PTR [rax+16], rcx $LN1@align_next: ; 53 : } ; 54 : ; 55 : length = length + next->length * sizeof(kmem); mov rax, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+8] mov rax, QWORD PTR [rax] imul rax, 32 ; 00000020H mov rcx, QWORD PTR this$[rsp] add rax, QWORD PTR [rcx] mov rcx, QWORD PTR this$[rsp] mov QWORD PTR [rcx], rax ; 56 : next = next->next; mov rax, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+8] mov rcx, QWORD PTR this$[rsp] mov rax, QWORD PTR [rax+8] mov QWORD PTR [rcx+8], rax $LN5@align_next: ; 57 : } fatret 0 ?align_next@kmem@@QEAAXXZ ENDP ; kmem::align_next _TEXT ENDS END
src/notcurses.adb
JeremyGrosser/notcursesada
5
8660
<reponame>JeremyGrosser/notcursesada -- -- Copyright 2021 (C) <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: Apache-2.0 -- package body Notcurses is function "+" (Left, Right : Coordinate) return Coordinate is ((Y => Left.Y + Right.Y, X => Left.X + Right.X)); function "-" (Left, Right : Coordinate) return Coordinate is ((Y => Left.Y - Right.Y, X => Left.X - Right.X)); function Version return String is begin return Interfaces.C.Strings.Value (Thin.notcurses_version); end Version; end Notcurses;
oeis/280/A280533.asm
neoneye/loda-programs
11
175089
<filename>oeis/280/A280533.asm ; A280533: Decimal expansion of 14*sin(Pi/14). ; Submitted by <NAME> ; 3,1,1,5,2,9,3,0,7,5,3,8,8,4,0,1,6,6,0,0,4,4,6,3,5,9,0,2,9,5,5,1,2,6,6,3,2,5,2,8,9,7,7,9,6,2,7,0,3,6,2,9,3,7,4,3,6,7,8,1,8,2,2,2,5,6,3,8,9,7,2,4,8,3,9,9,6,6,2,4,6,7,0,4,4,1,3,4,7,3,6,5,1,3,0,2,1,3,8,8 mov $1,1 mov $3,$0 mul $3,3 lpb $3 add $6,$2 add $1,$6 add $1,$2 add $2,$1 mul $1,2 mul $2,2 sub $3,1 mul $5,2 add $5,$2 mov $6,$5 lpe mov $6,$1 mul $1,7 add $2,$6 mov $4,10 pow $4,$0 div $2,$4 cmp $5,0 add $2,$5 div $1,$2 mov $0,$1 mod $0,10
oeis/028/A028149.asm
neoneye/loda-programs
11
5321
<reponame>neoneye/loda-programs ; A028149: Expansion of 1/((1-4x)(1-7x)(1-9x)(1-10x)). ; Submitted by <NAME> ; 1,30,573,8902,122829,1570422,19052461,222558534,2527254477,28081375894,306750949869,3305552387046,35230183832845,372099762869046,3900761112145197,40636558684412038,421103652688800333 mov $1,1 mov $2,$0 mov $3,$0 lpb $2 mov $0,$3 sub $2,1 sub $0,$2 seq $0,20970 ; Expansion of 1/((1-7*x)*(1-9*x)*(1-10*x)). sub $0,$1 mul $1,5 add $1,$0 lpe mov $0,$1
libsrc/_DEVELOPMENT/math/float/math32/c/sdcc/cm32_sdcc___uchar2fs_callee.asm
jpoikela/z88dk
640
96502
<filename>libsrc/_DEVELOPMENT/math/float/math32/c/sdcc/cm32_sdcc___uchar2fs_callee.asm SECTION code_fp_math32 PUBLIC cm32_sdcc___uchar2fs_callee EXTERN m32_float16u cm32_sdcc___uchar2fs_callee: pop bc ;return pop hl ;value dec sp push bc ld h,0 jp m32_float16u
programs/oeis/090/A090568.asm
neoneye/loda
22
171142
; A090568: Least m such that m^n begins with k^(n-1) for some k > 1. ; 1,2,4,3,7,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10 mul $0,1236 div $0,672 mov $1,$0 mov $2,3 lpb $0 lpb $1 sub $1,4 pow $1,$2 lpe mul $1,2 seq $1,196 ; Integer part of square root of n. Or, number of positive squares <= n. Or, n appears 2n+1 times. seq $1,54519 ; Number of increasing arithmetic progressions of nonnegative integers ending in n, including those of length 1 or 2. mov $0,$1 lpe add $0,1
arch/ARM/STM32/driver_demos/demo_adc_dma/src/demo_adc_vbat_dma.adb
morbos/Ada_Drivers_Library
2
8216
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This program demonstrates reading the VBat (battery voltage) value from -- an ADC unit, using DMA. -- The programs displays the battery voltage value so it assumes a display of -- some sort. with Ada.Real_Time; use Ada.Real_Time; with Last_Chance_Handler; pragma Unreferenced (Last_Chance_Handler); with STM32.Board; use STM32.Board; with STM32.Device; use STM32.Device; with HAL; use HAL; with STM32.ADC; use STM32.ADC; with STM32.DMA; use STM32.DMA; with STM32.GPIO; use STM32.GPIO; with LCD_Std_Out; procedure Demo_ADC_VBat_DMA is Controller : DMA_Controller renames DMA_2; Stream : constant DMA_Stream_Selector := Stream_0; Counts : UInt16 with Volatile; -- The raw sample from the ADC conversion of the VBat input Voltage : UInt32; -- in millivolts -- the converted voltage representing the VBat level, in millivolts procedure Print (X, Y : Natural; Value : UInt32; Suffix : String := ""); procedure Initialize_DMA; procedure Initialize_ADC; ----------- -- Print -- ----------- procedure Print (X, Y : Natural; Value : UInt32; Suffix : String := "") is Value_Image : constant String := Value'Img; begin LCD_Std_Out.Put (X, Y, Value_Image (2 .. Value_Image'Last) & Suffix & " "); end Print; -------------------- -- Initialize_DMA -- -------------------- procedure Initialize_DMA is Config : DMA_Stream_Configuration; begin Enable_Clock (Controller); Reset (Controller, Stream); Config.Channel := Channel_0; Config.Direction := Peripheral_To_Memory; Config.Memory_Data_Format := HalfWords; Config.Peripheral_Data_Format := HalfWords; Config.Increment_Peripheral_Address := False; Config.Increment_Memory_Address := False; Config.Operation_Mode := Circular_Mode; Config.Priority := Priority_Very_High; Config.FIFO_Enabled := False; Config.Memory_Burst_Size := Memory_Burst_Single; Config.Peripheral_Burst_Size := Peripheral_Burst_Single; Configure (Controller, Stream, Config); Clear_All_Status (Controller, Stream); end Initialize_DMA; -------------------- -- Initialize_ADC -- -------------------- procedure Initialize_ADC is All_Regular_Conversions : constant Regular_Channel_Conversions := (1 => (Channel => VBat.Channel, Sample_Time => Sample_480_Cycles)); begin Enable_Clock (VBat.ADC.all); Reset_All_ADC_Units; Configure_Common_Properties (Mode => Independent, Prescalar => PCLK2_Div_2, DMA_Mode => Disabled, Sampling_Delay => Sampling_Delay_5_Cycles); Configure_Unit (VBat.ADC.all, Resolution => ADC_Resolution_12_Bits, Alignment => Right_Aligned); Configure_Regular_Conversions (VBat.ADC.all, Continuous => True, Trigger => Software_Triggered, Enable_EOC => False, Conversions => All_Regular_Conversions); Enable_DMA (VBat.ADC.all); Enable_DMA_After_Last_Transfer (VBat.ADC.all); end Initialize_ADC; begin Initialize_LEDs; delay until Clock + Milliseconds (500); LCD_Std_Out.Clear_Screen; Initialize_DMA; Initialize_ADC; Enable (VBat.ADC.all); Start_Conversion (VBat.ADC.all); Start_Transfer (Controller, Stream, Source => Data_Register_Address (VBat.ADC.all), Destination => Counts'Address, Data_Count => 1); -- ie, 1 halfword loop Voltage := ((UInt32 (Counts) * VBat_Bridge_Divisor) * ADC_Supply_Voltage) / 16#FFF#; -- 16#FFF# because we are using 12-bit conversion resolution Print (0, 24, Voltage, "mv"); Green_LED.Toggle; delay until Clock + Milliseconds (100); end loop; end Demo_ADC_VBat_DMA;
test/interaction/Issue231.agda
cruhland/agda
1,989
5582
<reponame>cruhland/agda module Issue231 where postulate A : Set data List : Set where _∷_ : A → List → List data Any : List → Set where there : ∀ {x xs} → Any xs → Any (x ∷ xs) postulate id : (A : Set) → A → A lemma : (xs : List) → Set → (p : Any xs) → Set lemma (x ∷ xs) A (there p) with id (Any xs) p lemma (x ∷ xs) A (there p) | p′ = {!p′!} -- Before case-split: -- lemma (x ∷ xs) A (there p) | p′ = {!p′!} -- After case-split: -- lemma (A ∷ _) _ (there p) | there y = ?
Task/Roman-numerals-Encode/AppleScript/roman-numerals-encode.applescript
LaudateCorpus1/RosettaCodeData
1
4284
-- ROMAN INTEGER STRINGS ------------------------------------------------------ -- roman :: Int -> String on roman(n) set kvs to {["M", 1000], ["CM", 900], ["D", 500], ¬ ["CD", 400], ["C", 100], ["XC", 90], ["L", 50], ["XL", 40], ¬ ["X", 10], ["IX", 9], ["V", 5], ["IV", 4], ["I", 1]} script stringAddedValueDeducted on |λ|(balance, kv) set {k, v} to kv set {q, r} to quotRem(balance, v) if q > 0 then {r, concat(replicate(q, k))} else {r, ""} end if end |λ| end script concat(snd(mapAccumL(stringAddedValueDeducted, n, kvs))) end roman -- TEST ----------------------------------------------------------------------- on run map(roman, [2016, 1990, 2008, 2000, 1666]) --> {"MMXVI", "MCMXC", "MMVIII", "MM", "MDCLXVI"} end run -- GENERIC LIBRARY FUNCTIONS -------------------------------------------------- -- concat :: [[a]] -> [a] | [String] -> String on concat(xs) script append on |λ|(a, b) a & b end |λ| end script if length of xs > 0 and class of (item 1 of xs) is string then set unit to "" else set unit to {} end if foldl(append, unit, xs) end concat -- foldl :: (a -> b -> a) -> a -> [b] -> a on foldl(f, startValue, xs) tell mReturn(f) set v to startValue set lng to length of xs repeat with i from 1 to lng set v to |λ|(v, item i of xs, i, xs) end repeat return v end tell end foldl -- map :: (a -> b) -> [a] -> [b] on map(f, xs) tell mReturn(f) set lng to length of xs set lst to {} repeat with i from 1 to lng set end of lst to |λ|(item i of xs, i, xs) end repeat return lst end tell end map -- 'The mapAccumL function behaves like a combination of map and foldl; -- it applies a function to each element of a list, passing an -- accumulating parameter from left to right, and returning a final -- value of this accumulator together with the new list.' (see Hoogle) -- mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y]) on mapAccumL(f, acc, xs) script on |λ|(a, x) tell mReturn(f) to set pair to |λ|(item 1 of a, x) [item 1 of pair, (item 2 of a) & {item 2 of pair}] end |λ| end script foldl(result, [acc, {}], xs) end mapAccumL -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: Handler -> Script on mReturn(f) if class of f is script then f else script property |λ| : f end script end if end mReturn -- quotRem :: Integral a => a -> a -> (a, a) on quotRem(m, n) {m div n, m mod n} end quotRem -- Egyptian multiplication - progressively doubling a list, appending -- stages of doubling to an accumulator where needed for binary -- assembly of a target length -- replicate :: Int -> a -> [a] on replicate(n, a) set out to {} if n < 1 then return out set dbl to {a} repeat while (n > 1) if (n mod 2) > 0 then set out to out & dbl set n to (n div 2) set dbl to (dbl & dbl) end repeat return out & dbl end replicate -- snd :: (a, b) -> b on snd(xs) if class of xs is list and length of xs = 2 then item 2 of xs else missing value end if end snd
oeis/001/A001778.asm
neoneye/loda-programs
11
1027
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A001778: Lah numbers: n!*binomial(n-1,5)/6!. ; Submitted by <NAME> ; 1,42,1176,28224,635040,13970880,307359360,6849722880,155831195520,3636061228800,87265469491200,2157837063782400,55024845126451200,1447576694865100800,39291367432052736000,1100158288097476608000,31767070568814637056000,945537512224718020608000,28996483708224685965312000,915678432891305872588800000,29759549068967440859136000000,994819211734054451576832000000,34185605639588416608731136000000,1206900512145469316795203584000000,43750143565273262733826129920000000 mov $1,$0 add $1,5 mov $0,$1 bin $0,5 add $1,1 lpb $1 mul $0,$1 sub $1,1 lpe div $0,720
dev/himem/himem1.asm
minblock/msdos
0
164904
<gh_stars>0 ;/* ; * Microsoft Confidential ; * Copyright (C) Microsoft Corporation 1988-1992 ; * All Rights Reserved. ; */ page 95,160 title himem1 - A20 Handler stuff .xlist include himem.inc .list public A20Handler extrn ATA20Delay:byte extrn InstldA20HndlrN:byte extrn fQuiet:byte extrn fCPUClock:byte extrn fA20Check:byte extrn pPPFIRET:word extrn OldStackSeg:word extrn f000:word extrn MemCorr:word extrn MachineNum:word extrn TopOfTextSeg:word extrn lpExtA20Handler:dword extrn IsA20On:near extrn DispInfoMsg:near extrn DispInfoChar:near extrn InsExtA20Msg:byte extrn InsA20Msg:byte, InsA20EndMsg:byte, NoA20HandlerMsg:byte extrn AltName1:byte, AltName2:byte, AltName3:byte, AltName4:byte extrn AltName5:byte, AltName6:byte, AltName7:byte, AltName8:byte extrn AltName9:byte, AltName10:byte,AltName11:byte,AltName12:byte extrn AltName13:byte, AltName14:byte, AltName15:byte extrn AltName16:byte, ALtName17:byte ; Define a direct call to the Phoenix Cascade BIOS for A20 handling PTL_Seg segment at 0f000h assume cs:PTL_Seg org 0ff82h PTL_A20_Bios_Entry proc far PTL_A20_Bios_Entry endp PTL_Seg ends assume cs:_text,ds:nothing ;*--------------------------------------------------------------------------* ;* * ;* A20 Handler Section: * ;* * ;* The Init code copies the proper A20 Handler in place. * ;* * ;* NOTE: the A20 handler may be called from the Int 15h hook which does * ;* not set ds = _text. DO NOT ASSUME DS == _TEXT! * ;* * ;*--------------------------------------------------------------------------* A20Handler: ;*** A20 Handler is installed HERE! *** TempA20Handler dw ? ; address of A20 hander during installation ;**************************************************************************** ;* * ;* A20 Handler Section: * ;* * ;* The Init code copies the proper A20 Handler into place here. * ;* * ;* NOTE: A20 HANDLERS MUST ONLY HAVE RELATIVE JUMPS! HOWEVER ANY CALLS TO * ;* FUNCTIONS OUTSIDE OF THE HANDLER MUST BE NON-RELATIVE! * ;* * ;**************************************************************************** ;*----------------------------------------------------------------------* ;* * ;* AT_A20Handler - HARDWARE DEP. * ;* * ;* Enable/Disable the A20 line on non-PS/2 machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* NUM_ALT_A20 equ 2 ; # Alternative delay methods supported AT_A20Handler proc near ; This entry point attempts to preserve the current CPU clock rate by ; maintaining the current value of the "unused" bits in the keyboard ; controller output port. AT_A20CPUClock label near push ax ; Save enable/disable parameter in al,64h ; Ensure output buffer is empty test al,1 jz AAHOutBufFree jmp short $+2 in al,60h AAHOutBufFree: call Sync8042 ; Make sure the Keyboard Controller is Ready jnz AAHErr_pop mov al,0D0h ; Send D0h command (read output port) out 64h,al call Sync8042 jnz AAHErr_pop call AAHFullOutBuf ; Wait for data to appear jz AAHErr_pop in al,60h ; Read output port value mov ah,0Ch ; Only want to keep the "unused" bits and ah,al or ah,0D1h ; Assume disabling pop cx ; Recover enable/disable parameter jcxz AAHSetA20_1 or ah,02h ; Assumed wrong, actually enabling jmp short AAHSetA20_1 ; Routine to wait for 8042 output buffer to contain data. Only needed by the ; CPU clock code, so it's stuck here before the 'normal' AT handler. AAHFullOutBuf: mov cx,12 AAH_FOB_1: push cx xor cx,cx AAH_FOB_2: jmp short $+2 in al,64h test al,1 loopz AAH_FOB_2 pop cx loopz AAH_FOB_1 ret AAHErr_pop: pop ax ; Clear stack jmp short AAHErr ; This is the entry point for the "normal" AT style A20 handler that does ; not worry about changing the CPU clock rate. AT_A20Normal label near or ax,ax mov ah,0DFh ; Assume enabling jnz AAHSetA20 mov ah,0DDh ; Actually disabling... AAHSetA20: call Sync8042 ; Make sure the Keyboard Controller is Ready jnz AAHErr AAHSetA20_1: mov al,0D1h ; Send D1h (write output port) out 64h,al call Sync8042 jnz AAHErr mov al,ah ; Send enable/disable command out 60h,al call Sync8042 jnz AAHErr ; Delay while waiting for the A20 line to settle--there are several methods ; to do this--the variable ATA20Delay indicates which one to use... ; ; 0 = output null command to 8042 ; 1 = no delay at all ; 2 = delay on ram refresh bit toggle .errnz NUM_ALT_A20 - 2 ; code below assumes max value of 2 xor cx,cx mov cl,ATA20Delay jcxz AAHDelay0 dec cx jcxz AAHDelay1 jmp short AAHDelay2 ; A20 Delay method 0 -- method used by original IBM PC/AT AAHDelay0: mov al,0FFh ; Send FFh (Pulse Output Port NULL) out 64h,al call Sync8042 jnz AAHErr jmp short AAHExit ; A20 Delay method 2 AAHDelay2: mov cx,2 ; Implement a delay by waiting for the AAHWaitRam: ; ram refresh bit to change state twice. jmp short $+2 ; A long delay used by a few machines. in al,61h test al,10h jz AAHWaitRam @@: jmp short $+2 in al,61h test al,10h jnz @b loop AAHWaitRam AAHDelay1: ; Delay method 1 is actually no delay AAHExit: mov ax,1 ; Successful... ret AAHErr: xor ax,ax ; Failure status ret AT_A20Handler endp Sync8042 proc near xor cx,cx S8InSync: jmp short $+2 in al,64h and al,2 loopnz S8InSync ret Sync8042 endp EndAT_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* Phoenix Cascade BIOS A20 Handler - HARDWARE DEP. * ;* * ;* Enable/Disable the A20 line on Phoenix Cascade BIOS * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable, 2 for On/Off check * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* PTL_A20_DisableFunc equ 800h ; call to disable A20 PTL_A20_EnableFunc equ 801h ; call to enable A20 PTL_A20_InquireFunc equ 802h ; call to enquire about A20 status PTL_String_Offset equ 4 ; offset of "PTL" in Phoenix extension PTL_Feature1 equ 3 ; offset from PTL to Feature Byte 1 PTL_A20Bit equ 80h ; Bit for A20 support in Feature Byte 1 PTL_CASCADE_A20Handler proc near cmp ax,1 jz PTLEnable ; 1 == Enable jb PTLDisable ; 0 == Disable ; 2 == On/Off Check mov ax,PTL_A20_InquireFunc ; Inquire status call PTL_A20_Bios_Entry or ah,ah ; on or off? jz PTLErr ; returns with ax = 0 (off) jmp short PTLExit ; returns with ax = 1 (on) PTLEnable: mov ax,PTL_A20_EnableFunc ; call A20 enable function jmp short PTLDoIt PTLDisable: mov ax,PTL_A20_DisableFunc ; Disable Function PTLDoIt: call PTL_A20_Bios_Entry PTLExit: mov ax,1 ; Good status, return 1 ret PTLErr: xor ax,ax ; Bad status, return 0 ret PTL_CASCADE_A20Handler endp EndPTL_CASCADE_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* PS2_A20Handler - HARDWARE DEP. * ;* * ;* Enable/Disable the A20 line on PS/2 machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable, 2 for On/Off check * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* PS2_PORTA equ 0092h PS2_A20BIT equ 00000010b PS2_A20Handler proc near cmp ax,1 mov ah,PS2_A20BIT ; Assume enabling jz PAHEnable jb PAHDisable in al,PS2_PORTA ; 2 == On/Off check test al,PS2_A20BIT jz PAHErr ; returns ax = 0 (off) jmp short PAHExit ; returns ax = 1 (on) PAHDisable: xor ah,ah ; Disabling... PAHEnable: in al,PS2_PORTA ; Get current port 92h bits and al,NOT PS2_A20BIT ; and clear A20 or al,ah ; Enable or Disable A20 bit jmp short $+2 jmp short $+2 out PS2_PORTA,al xor cx,cx ; Wait for port 92h to show PAHWait: ; desired A20 state jmp short $+2 in al,PS2_PORTA and al,PS2_A20BIT cmp al,ah loopnz PAHWait jnz PAHErr PAHExit: mov ax,1 ret PAHErr: xor ax,ax ret PS2_A20Handler endp EndPS2_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* IC_A20Handler - * ;* * ;* Enable/Disable the A20 line on the IBM 7552 Industrial * ;* Computer. * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable, 2 for On/Off check * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* IC_MISCPORT equ 65h IC_A20BIT equ 04h IC_A20Handler proc near cmp ax,1 mov ah,IC_A20BIT ; Assume disabling jz ICAHEnable jb ICAHDisable in al,IC_MISCPORT ; 2 == On/Off check test al,IC_A20BIT jnz ICAHErr ; returns ax = 0 (off) jmp short ICAHExit ; returns ax = 1 (on) ICAHEnable: xor ah,ah ; Enabling... ICAHDisable: in al,IC_MISCPORT ; Get current port 92h bits and al,NOT IC_A20BIT ; and clear A20 or al,ah ; Enable or Disable A20 bit jmp short $+2 jmp short $+2 out IC_MISCPORT,al xor cx,cx ; Wait for port 92h to show ICAHWait: ; desired A20 state jmp short $+2 in al,IC_MISCPORT and al,IC_A20BIT cmp al,ah loopnz ICAHWait jnz ICAHErr ICAHExit: mov ax,1 ret ICAHErr: xor ax,ax ret IC_A20Handler endp EndIC_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* $6300Plus_A20Handler - HARDWARE DEP. * ;* * ;* Enable/Disable address lines A20-A23 on AT&T 6300 Plus * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, BX, and Flags clobbered * ;* * ;* Note: Don't want to do two back to back disables on PLUS, * ;* so we check to see if it is necessary. * ;* Warning: The calcuation of the Rback label depends on the * ;* expectation that this routine is being moved at init time. * ;* * ;*----------------------------------------------------------------------* PLUS_PORT equ 03F20h PLUS_STATUS equ 03FA0h PLUS_SET equ 80h ; Turn on A20-A23 PLUS_RESET equ 10h ; Turn off A20-A23 and point to our routine $6300PLUS_A20Handler proc near mov bx,ax push dx mov dx,PLUS_STATUS in al,dx pop dx and ax,1 cmp ax,bx jne $6AHEnable mov ax,1 ret ; No, just return $6AHEnable: pushf sti mov al,PLUS_SET or bx,bx ; Zero if disable jnz $6AHNext mov al,PLUS_RESET $6AHNext: push dx ; Set/reset the port mov dx,PLUS_PORT out dx,al pop dx or bx,bx jnz $6AHNext1 call $6300Reset ; Reset the processor $6AHNext1: popff mov ax,1 ret $6300Plus_A20Handler endp ; In order to address memory above 1 MB on the AT&T 6300 PLUS, it is ; necessary to use the special OS-MERGE hardware to activate lines ; A20 to A23. However, these lines can be disabled only by resetting ; the processor. The address to which to return after reset are placed ; at 40:A2, noted here as RealLoc1. BiosSeg SEGMENT AT 40h ; Used to locate 6300 PLUS reset address org 00A2h RealLoc1 dd 0 BiosSeg ends ;*----------------------------------------------------------------------* ;* * ;* $6300Reset - HARDWARE DEP. * ;* * ;* Reset the 80286 in order to turn off the address lines on the 6300 * ;* PLUS. This is the only way to do this on the current hardware. * ;* The processor itself is reset by reading or writing port 03F00h. * ;* * ;* Uses flags. * ;* * ;*----------------------------------------------------------------------* $6300Reset proc near pusha ; Save world push ds ; Save segments push es mov ax,BiosSeg ; Point to the BIOS segment mov ds,ax ; ds -> 40h ; Setup the reset return address. assume ds:nothing push word ptr ds:[RealLoc1] ; Save what might have been here push word ptr ds:[RealLoc1+2] ; Load our return address, remembering that we will be relocated ; at init time. mov word ptr ds:[RealLoc1+2],cs mov ds:word ptr [RealLoc1],offset Rback-offset $6300Plus_A20Handler+offset A20Handler mov cs:[OldStackSeg],ss ; Save the stack segment, too ; Reset the processor - turning off A20 in the process. mov dx,03F00h in ax,dx ; We shouldn't get here. Halt the machine if we do. nop nop nop nop cli hlt Rback: mov ss,cs:[OldStackSeg] ; Start the recovery pop word ptr ds:[RealLoc1+2] ; ROM code has set ds->40h pop word ptr ds:[RealLoc1] pop es pop ds xor al,al mov dx,PLUS_PORT out dx,al popa ret $6300Reset endp End6300Plus_Handler: ;*----------------------------------------------------------------------* ;* * ;* HP_A20Handler - HARDWARE DEP. * ;* * ;* Enable/Disable the A20 line on HP Vectra machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* HP_A20Handler proc near or ax,ax mov ah,0DFh ; Assume enabling jnz HAHSetA20 mov ah,0DDh ; Actually disabling... HAHSetA20: call HPSync8042 ; Make sure the Keyboard Controller is ready jnz HAHErr mov al,ah ; Send enable/disable out 64h,al call HPSync8042 jnz HAHErr mov al,ah ; And send it again... out 64h,al call HPSync8042 jnz HAHErr HAHExit: mov ax,1 ret HAHErr: xor ax,ax ret HP_A20Handler endp HPSync8042 proc near xor cx,cx H8InSync: jmp short $+2 in al,64h and al,2 loopnz H8InSync ret HPSync8042 endp EndHP_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* NHP_A20Handler - HARDWARE DEP. * ;* * ;* Enable/Disable the A20 line on HP Vectra machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* NHP_A20Handler proc near or ax,ax mov ah,0DFh ; Assume enabling jnz NHAHSetA20 mov ah,0DDh ; Actually disabling... NHAHSetA20: call NHPSync8042 ; Make sure the Keyboard Controller is ready jnz NHAHErr mov al,ah ; Send enable/disable out 64h,al call NHPSync8042 jnz NHAHErr mov al,0ffh ; And send a NULL command out 64h,al call NHPSync8042 ; and wait jnz NHAHErr NHAHExit: mov ax,1 ret NHAHErr: xor ax,ax ret NHP_A20Handler endp NHPSync8042 proc near xor cx,cx NH8InSync: jmp short $+2 in al,64h and al,2 loopnz NH8InSync ret NHPSync8042 endp EndNHP_A20Handler: ;M004 start ;*--------------------------------------------------------------------------* ;* * ;* BM60_A20Handler - HARDWARE DEP. * ;* * ;* Enable/Disable the A20 line on BULL Micral BM60 machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX and Flags clobbered * ;* * ;*--------------------------------------------------------------------------* BM60_A20Handler proc near or ax,ax jz short BM60Disable BM60Enable: mov al,0DFh ; Send DFh out 0E0h,al jmp short $+2 in al,64h and al,2 jnz short BM60Exit ; ok jmp short BM60Err BM60Disable: mov al,0DDh ; Send D1h out 0E0h,al jmp short $+2 in al,64h and al,2 jnz short BM60Err ; not ok BM60Exit: mov ax,1 ret BM60Err: xor ax,ax ret BM60_A20Handler endp EndBM60_A20Handler: ;M004 end ;*----------------------------------------------------------------------* ;* * ;* ACER_A20Handler - * ;* * ;* Enable/Disable the A20 line on ACER 1100 machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* ACER_A20Handler proc near or ax,ax mov al,0DDh ; Assume disable jz @f mov al,0DFh ; Oh, it's actually enable @@: push dx ; ACERs do it by writing to mov dx,329h ; this port out dx,al pop dx mov ax,1 ret ACER_A20Handler endp EndACER_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* Wyse_A20Handler - * ;* * ;* Enable/Disable the A20 line on Wyse 12.5 MHz 286 machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* Wyse_A20Handler proc near or ax,ax mov ah,0DFh ; Assume enabling jnz WAHSetA20 mov ah,0DDh ; Actually disabling... WAHSetA20: call Wyse8042 ; Make sure the Keyboard Controller is Ready jnz WAHErr call Wyse8042 ; and do it again! jnz WAHErr mov al,0D1h ; Send D1h out 64h,al call Wyse8042 jnz WAHErr mov al,ah ; Send enable/disable... out 60h,al call Wyse8042 jnz WAHErr WAHExit: mov ax,1 ret WAHErr: xor ax,ax ret Wyse_A20Handler endp Wyse8042 proc near xor cx,cx @@: jmp short $+2 in al,64h and al,2 loopnz @b ret Wyse8042 endp EndWyse_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* ZB_A20Handler - * ;* * ;* Enable/Disable the A20 line on Zenith ZBIOS machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* REGS: AX, CX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* ZB_A20Handler proc near call [lpExtA20Handler] ; It just so happens that AH/AL ; are setup just the way ZBIOS mov ax,1 ; wants them to gate A20 on/off ret ZB_A20Handler endp EndZB_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* Dell_A20Handler * ;* * * ;* Enable/disable A20 on Dell XBIOS-equipped machines * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 (no failure conditions) * ;* REGS: All regs/flags preserved except AX * ;* * ;* Note: Provided by Dell Computer Corp. * ;* * ;*----------------------------------------------------------------------* ; ; M010 ; Dell_A20Handler PROC NEAR pushf ; BUGBUG all regs!?!?!?!? pusha push ds push es push ax mov ax,ss mov es,ax mov bx,sp call DWORD PTR [lpExtA20Handler] add sp,2 pop es pop ds popa mov ax,1 popf ret Dell_A20Handler ENDP EndDell_A20Handler: ;*----------------------------------------------------------------------* ;* * ;* Ext_A20Handler - * ;* * ;* Enable/Disable the A20 line using an external handler. * ;* Query A20 calls (AX=2) may also be supported by the handler. * ;* * ;* ARGS: AX = 0 for Disable, 1 for Enable * ;* RETS: AX = 1 for success, 0 otherwise * ;* * ;*----------------------------------------------------------------------* Ext_A20Handler proc near call [lpExtA20Handler] ret Ext_A20Handler endp EndExt_A20Handler: ;**************************************************************************** ;* * ;* The following routines detect the special case systems supported by * ;* specific A20 handling routines. This code is called once during * ;* initialization, and then is overwritten or discarded. * ;* * ;**************************************************************************** assume cs:_text, ds:_text ;*----------------------------------------------------------------------* ;* * ;* IsAT * ;* * ;* Check for IBM PC/AT 'standard' A20 handling. * ;* * ;* This routine detects AT style A20 handling by invoking the * ;* DiddleA20 routine to toggle A20 on & off. The AT handler * ;* supports a number of different delay methods, controlled by * ;* the ATA20Delay global variable. IsAT calls DiddleA20 with * ;* different ATA20Delay values until it find one that works, or * ;* runs out of choices. * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we can control A20 via the 8042, 0 otherwise. * ;* * ;*----------------------------------------------------------------------* public IsAT IsAT proc near IATAgain: pushf ;disable ints while gating A20 cli call DiddleA20 popff or ax,ax jnz IsAT_Yes inc ATA20Delay cmp ATA20Delay,NUM_ALT_A20 jbe IATAgain IsAT_No: xor ax,ax ret IsAT_Yes: mov ax,1 ret IsAt endp ;*----------------------------------------------------------------------* ;* * ;* Trace_PTL_Func HARDWARE DEP. * ;* * ;* Check for Phoenix Cascade BIOS enabling interrupts on an A20 * ;* manipulation function call. Early copies of the Phoenix * ;* Cascade BIOS enabled interrupts on calls to manipulate the A20 * ;* line. Unfortunately, this BIOS was source-licensed to OEMs, to * ;* there is no easy detection method. This function installs a * ;* trace exception handler, then calls the ROM with the trace flag * ;* set. The trace exception handler inspects the flags image on * ;* the stack, and sets a variable if it is ever called with * ;* interrupts enabled. * ;* * ;* ARGS: AX = PTL BIOS function to call * ;* RETS: Ints_Are_Disabled set to zero if interrupts have been * ;* enabled. * ;* REGS: AX, flags used. * ;* * ;*----------------------------------------------------------------------* Ints_Are_Disabled dw 1 Original_INT1_Hook dd ? public Trace_PTL_Func Trace_PTL_Func proc near ; ; Save the original trace exception handler. ; Install our own trace exception handler. ; pushf cli push bx push ax ; AX = function number push es xor ax,ax mov es,ax lea ax,INT1_Hook xchg ax,es:[4] mov word ptr [Original_INT1_Hook],ax mov ax,cs xchg ax,es:[6] mov word ptr [Original_INT1_Hook+2],ax pop es ; ; Set the trace flag, then call the BIOS to perform the requested function. ; pop bx pushf pop ax or ah,1 ; Set the trace flag. push ax mov ax,bx popf call PTL_A20_Bios_Entry pop bx popf ret Trace_PTL_Func endp ;*----------------------------------------------------------------------* ;* * ;* INT1_Hook HARDWARE DEP. * ;* * ;* Trace exception handler. Inspects the flags image on the stack * ;* to determine whether the ROM BIOS enables interrupts. If * ;* called from code with interrupts enabled, sets the variable * ;* Ints_Are_Disabled to zero. De-installs itself if interrupts * ;* are enabled or interrupted CS is equal to our CS. * ;* * ;*----------------------------------------------------------------------* public INT1_Hook INT1_Hook proc near push bp mov bp,sp ; BP -> BP IP CS Flags push ax ; ; Un-hook INT on entry, so we can debug (portions of) this routine. ; push es pushf cli xor ax,ax mov es,ax mov ax,word ptr [Original_INT1_Hook] mov es:[4],ax mov ax,word ptr [Original_INT1_Hook+2] mov es:[6],ax and byte ptr [bp+7],NOT 1 ; Zap trace flag. popf pop es test byte ptr [bp+7],2 ; Interrupts enabled? jz I1H_checkCS mov [Ints_Are_Disabled],0 jmp short I1H_done I1H_checkCS: mov ax,cs cmp [bp+4],ax je I1H_done I1H_continue: ; ; Re-hook INT 1, and IRET to traced code. ; push es pushf cli xor ax,ax mov es,ax lea ax,INT1_Hook mov es:[4],ax mov ax,cs mov es:[6],ax popf pop es or byte ptr [bp+7],1 ; Reset trace flag. I1H_done: pop ax pop bp iret INT1_Hook endp ;*----------------------------------------------------------------------* ;* * ;* IsPTLCascade HARDWARE DEP. * ;* * ;* Check for Phoenix Cascade BIOS * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on an Phoenix Cascade BIOS, 0 otherwise * ;* REGS: AX, flags used. * ;* * ;*----------------------------------------------------------------------* public IsPTLCascade IsPTLCascade proc near mov ah,0C0h ; Get System Description Vector stc ; using interrupt 15h, function C0h. int 15h jc IPTLNo ; Error - Not a Phoenix Cascade BIOS add bx,es:[bx] ; Get to system config. table extension add bx,2+PTL_STRING_Offset ; add the offset to the PTL string cmp es:[bx],'TP' ; Look for 'TP' (start of PTL) jne IPTLNo ; Not a Phoenix Cascade BIOS cmp BYTE PTR es:[bx+2],'L' ; Look for 'L' (end of PTL) jne IPTLNo ; Not a Phoenix Cascade BIOS mov al,es:[bx+PTL_Feature1] ; Get Phoenix feature byte 1 test al,PTL_A20Bit ; Test the A20 support bit jz IPTLNo ; No support for A20 control IPTLFoundIt: ; ; Set the trace flag, then call the ROM BIOS to "inquire" A20. ; Our trace handler will detect whether the ROM BIOS enables ; interrupts or not, by monitoring the state of the flags ; word during the call. ; mov ax,PTL_A20_InquireFunc ; call to inquire A20 state call Trace_PTL_Func push ax ; save result ; ; Set the trace flag, then call the ROM BIOS to enable A20. ; Our trace handler will detect whether the ROM BIOS enables ; interrupts or not, by monitoring the state of the flags ; word during the call. ; mov ax,PTL_A20_EnableFunc ; call to enable A20 call Trace_PTL_Func ; ; Set the trace flag, then call the ROM BIOS to disable A20. ; Our trace handler will detect whether the ROM BIOS enables ; interrupts or not, by monitoring the state of the flags ; word during the call. ; mov ax,PTL_A20_DisableFunc ; call to disable A20 call Trace_PTL_Func pop ax ; AL = 1: A20 was on before or al,al jz @F mov ax,PTL_A20_EnableFunc ; call to enable A20 call PTL_A20_Bios_Entry @@: mov ax,[Ints_Are_Disabled] ; Yup! Phoenix A20 support, return 1 ret ; IsFail is an alternate entry point, used for machines that we ; don't know how to detect. IsFail: IPTLNo: xor ax,ax ; Not Phoenix or No support, return 0 ret IsPTLCascade endp ;*----------------------------------------------------------------------* ;* * ;* Is6300Plus HARDWARE DEP. * ;* * ;* Check for AT&T 6300 Plus * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on an AT&T 6300 Plus, 0 otherwise * ;* REGS: AX, flags used. * ;* * ;* Side Effects: MemCorr value updated to 384 if necessary. * ;* * ;*----------------------------------------------------------------------* public Is6300Plus Is6300Plus proc near xor ax,ax push bx mov bx,0fc00h ; Look for 'OL' at fc00:50 mov es,bx cmp es:[0050h],'LO' jne I6PNotPlus ; Not found mov es,f000 cmp word ptr es:[0fffdh],0fc00h ; Look for 6300 PLUS jne I6PNotPlus in al,66h ; Look for upper extended memory and al,00001111b cmp al,00001011b jne I6PNoMem mov [MemCorr],384 ; Save value I6PNoMem: mov ax,1 ; We found a PLUS I6PNotPlus: pop bx ret Is6300Plus endp ;*----------------------------------------------------------------------* ;* * ;* IsPS2Machine HARDWARE DEP. * ;* * ;* Check for PS/2 machine * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a valid PS/2 machine, 0 otherwise * ;* REGS: AX and Flags clobbered * ;* * ;*----------------------------------------------------------------------* public IsPS2Machine IsPS2Machine proc near mov ax,2403h ; Query A20 gate support stc int 15h jc IPMNotYet ; CY must be clear or ah,ah ; and AH must be 00h jnz IPMNotYet test bl,00000010b ; Is port 92h gating supported? jnz IPMFoundIt ; Yes! IPMNotYet: mov ah,0c0h ; Get System Description Vector stc int 15h jc IPMNoPS2 ; Error? Not a PS/2. ; Do we have a "Micro Channel" computer? mov al,byte ptr es:[bx+5] ; Get "Feature Information Byte 1" test al,00000010b ; Test the "Micro Channel Implemented" bit jnz IPMFoundIt ; MCA, use PS/2 A20 code ; The PS/2 Model 30/286 also uses the PS/2 A20 code, but it isn't ; a MCA machine, check for the 30/286 model/submodel. Likewise ; with a few others... cmp word ptr es:[bx+2],19F8h ; Tortuga ? jz IPMFoundIt cmp word ptr es:[bx+2],23F8h ; Aloha? jz IPMFoundIt cmp word ptr es:[bx+2],25F8h ; Bounty? jz IPMFoundIt cmp word ptr es:[bx+2],09FCh ; Model 30/286? jz IPMFoundIt cmp word ptr es:[bx+2],0BFCh ; Type/subtype FC/0Bh? jnz IPMNoPS2 IPMFoundIt: xor ax,ax ; Disable A20. Fixes PS2 Ctl-Alt-Del bug call PS2_A20Handler mov ax,1 ret IPMNoPS2: xor ax,ax ret IsPS2Machine endp ;*----------------------------------------------------------------------* ;* * ;* IsHPMachine HARDWARE DEP. * ;* * ;* Check for HP Vectra Machine, Model A or A+ * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a HP Vectra machine, 0 otherwise * ;* REGS: AX, ES and Flags clobbered * ;* * ;*----------------------------------------------------------------------* HPVectraMask equ 00011111b ; Bit mask to check for HP Vectra public IsHPMachine IsHPMachine proc near mov es,f000 ; ; M009 - Begin ; mov ax, NOT 'PH' ; lets not have the pattern 'PH' ; in the bus not ax ; generate it indirectly cld ; charge the bus with CLDs 0xFC cld cld cld cld cld cld cld cmp ax, word ptr es:[0f8h] cld ; Charge the bus with 0xFC even cld ; on instruction prefetch cld cld cld cld cld cld ; ; M009 - end ; jne IHMNoHP mov al,es:[0fah] ; In f000:fa, 0 means A or A+ and al,HPVectraMask ; other HP Vectras are treated as an AT jnz IHMNoHP IHMIsHP: mov ax,1 ret IHMNoHP: xor ax,ax ret IsHPMachine endp ;*----------------------------------------------------------------------* ;* * ;* IsHPVectra HARDWARE DEP. * ;* * ;* Check for HP Vectra Machine, Other than Classic A, A+ & HP LS/12* * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a HP Vectra machine, 0 otherwise * ;* REGS: AX, ES and Flags clobbered * ;* * ;* If this routine gets called then the machine has already failed to * ;* satisfy that it is a HP Classic Vectra A & A+. So we dont have to * ;* eliminate Classic Vectra explicitly in this routine * ;*----------------------------------------------------------------------* HPLS12MASK equ 01011b public IsHPVectra IsHPVectra proc near mov es,f000 ; ; M009 - Begin ; mov ax, NOT 'PH' ; lets not have the pattern 'PH' ; floating on the bus not ax ; generate it indirectly cld ; charge the bus with CLDs 0xFC cld cld cld cld cld cld cld cmp ax,word ptr es:[0f8h] cld ; Charge the bus with 0xFC even cld ; on instruction prefetch cld cld cld cld cld cld ; ; M009 - end ; jne IHVNoHP mov al,es:[0fah] ; In f000:fa, 0 means A or A+ and al,HPVectraMask ; other HP Vectras are treated as an AT cmp al, HPLS12MASK je IHVNoHP IHVIsHP: mov ax,1 ret IHVNoHP: xor ax,ax ret IsHPVectra endp ;*----------------------------------------------------------------------* ;* * ;* IsToshiba * ;* * ;* Check for Toshiba 1600 or 1200XE * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a T1600 or T1200XE, 0 otherwise * ;* REGS: AX, ES and Flags clobbered * ;* * ;*----------------------------------------------------------------------* public IsToshiba IsToshiba proc near mov ax,0FFFFh mov es,ax cmp byte ptr es:[0Eh],0FCh ; PC/AT id? jne ITNo ; can't be what we want then mov al,byte ptr es:[0Ah] ; Toshiba puts their own id here cmp al,02Bh ; Special T1600 id? je ITMaybe cmp al,02Ah ; Special T1200XE id? jne ITNo ITMaybe: mov ax,0FE00h ; Do a further check, the Toshiba mov es,ax ; machines have a name string at cmp word ptr es:[0],'1T' ; FE00:0000 (T1600 or T1200XE) jne ITNo mov ax,word ptr es:[2] cmp ax,'06' ; T160... je ITYes cmp ax,'02' ; T120... jne ITNo ITYes: mov ax,1 ret ITNo: xor ax,ax ret IsToshiba endp ;*----------------------------------------------------------------------* ;* * ;* IsZBIOS * ;* * ;* Check for Zenith ZBIOS machine * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a Zenith ZBIOS system, 0 otherwise * ;* REGS: BX, ES and Flags clobbered * ;* * ;*----------------------------------------------------------------------* ZBIOS_Id dw 0FFE3h, 0F000h ZBIOS_Entry_Off equ 0FFE8h public IsZBIOS IsZBIOS proc near push cx les bx,dword ptr cs:[ZBIOS_ID] ; ZBIOS Machines are cmp es:[bx],'BZ' ; identified by the jnz IZB_No ; string 'ZBIOS' at cmp es:[bx+2],'OI' ; a fixed location jnz IZB_No cmp byte ptr es:[bx+4],'S' jnz IZB_No mov bx,es:[ZBIOS_Entry_Off] ; Build far pointer to mov word ptr [lpExtA20Handler],bx ; ZBIOS entry point for mov word ptr [lpExtA20Handler+2],es ; A20 handler ; This machine has a ZBIOS. Make sure it supports the Gate A20 function. mov ax, 00FFh ; ZBIOS Gate A20 Query call call [lpExtA20Handler] ; Is Gate A20 supported? jc IZB_No ; CY set if not... mov ax,1 ; Yes, it's a ZBIOS machine pop cx ret IZB_No: ; Not a ZBIOS machine xor ax,ax pop cx ret IsZBIOS endp ;*----------------------------------------------------------------------* ;* * ;* IsBM60 * ;* * ;* Check for Bull Micral BM60 * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a BM60, 0 otherwise * ;* REGS: BX, ES and Flags clobbered * ;* * ;*----------------------------------------------------------------------* BullSA_ID dw 0E01Eh, 0F000h public IsBM60 IsBM60 proc near xor ax,ax ; Clear AX les bx,dword ptr cs:[BullSA_ID] ; Check for "Bull S.A" cmp es:[bx ],'uB' ; to determine correct jnz IsBM60_No ; family of machines cmp es:[bx+2],'ll' jnz IsBM60_No cmp es:[bx+4],'S ' jnz IsBM60_No cmp es:[bx+6],'A.' jnz IsBM60_No cmp byte ptr es:[bx-14h],'V' ; Q: Is this a BM60? jne IsBM60_No ; N: inc ax ; Y: We found one IsBM60_NO: ret IsBM60 endp ;*----------------------------------------------------------------------* ;* * ;* IsPhilips * ;* * ;* Check for Philips machines * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a Philips machine, 0 otherwise * ;* REGS: AX and Flags clobbered * ;* * ;* Note: Philips code received from Philips Corp. * ;* * ;*----------------------------------------------------------------------* IsPhilips proc near push cx push ds push es push si push di mov ax,0f000h mov ds,ax mov si,0e000h ; ds:si -> @ BIOS signature location push cs pop es mov di,offset phl_name ; es:di -> @ signature to check mov cx,phl_name_len repz cmpsb mov ax,1 ; assume found it jz IsPhilips_exit ; condition from 'cmpsb' mov ax,0 ; did not find it IsPhilips_exit: pop di pop si pop es pop ds pop cx ret phl_name db ' PHILIPS' phl_name_len equ $-phl_name IsPhilips endp ;*----------------------------------------------------------------------* ;* * ;* IsCSS * ;* * ;* Check for CSS Lab machines * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a CSS Lab machine, 0 otherwise * ;* REGS: AX and Flags clobbered * ;* * ;* Note: ID method given by CSS labs & Award Software Inc. ;* * ;*----------------------------------------------------------------------* ROMCSSPtr dw 0e0c1h, 0f000h CSSStr db 'CSS LAB' CSSSTRLEN equ $ - offset CSSStr IsCSS proc near push ds push si push es push di push cx xor ax, ax ; assume it is not mov si, offset CSSStr push cs pop ds les di, dword ptr cs:ROMCSSPtr mov cx, CSSSTRLEN rep cmpsb jne @f inc ax @@: pop cx pop di pop es pop si pop ds ret IsCSS endp ;*----------------------------------------------------------------------* ;* * ;* IsDellXBIOS * ;* * * ;* Check for Dell XBIOS machines * ;* * ;* ARGS: None * ;* RETS: AX = 1 if we're on a Dell XBIOS machine, 0 otherwise * ;* REGS: trashes SI, DI, CX, AX * ;* * ;* Stores address of XBIOS A20 handler in lpExtA20Handler * ;* * ;* Note: ID method given by Dell Computer Corp. * ;* * ;*----------------------------------------------------------------------* ; ; M010 ; xb_signature db 'DELLXBIOS',00 ;XBIOS signature string & len xb_sig_len equ 10 PUBLIC IsDellXBIOS IsDellXBIOS PROC NEAR push ds push es cld mov ax,0f000h mov es,ax les di,es:[0ed00h] push ds push cs pop ds lea si,cs:xb_signature mov cx,xb_sig_len ;look for XBIOS signature text ; repe cmpsb ;at *(F000:ED00) idx05: lodsb cld cld cld cld cld cld cld cld cmp al, byte ptr es:[di] jne idx10 inc di loop idx05 idx10: pop ds add di,2 ;skip version ID, if present jcxz for_feature xbios_fail: xor ax, ax ;no XBIOS A20 handler present jmp short xb_init_done xbios_chain: les di,es:[di+2] ;handle XFT chain feature... for_feature: mov ax,es:[di] ;get feature identifier add di,2 ;index attribute flags cmp ax,0 ;NULL feature? je xbios_fail ;yes, end of feature table cmp ax,65535 ;CHAIN feature? je xbios_chain ;yes, go find next fragment... cmp ax,11 ;A20 feature? jne next_feature ;no, skip it mov ax,es:[di] ;else get feature attributes test ax,00001000b ;standard seg:off pointer? jz next_feature ;no, wouldn't be prudent at ;this juncture les bx,es:[di+2] mov WORD PTR lpExtA20Handler,bx ;else record handler addr... mov WORD PTR lpExtA20Handler+2,es mov ax, 1 xb_init_done: pop es ;C=1 if XBIOS OK, 0 otherwise pop ds ret next_feature: mov ax,es:[di] ;get feature attributes add di,6 ;skip attribs & handler addr test al,110000b ;keystroke or appendix? jz for_feature ;no, nothing else to skip mov bx,ax and bx,10000b ;keystroke? shr bx,1 shr bx,1 ;BX=2 if keystroke present, shr bx,1 ;else 0 add di,bx test ax,100000b ;appendix? jz for_feature add di,es:[di] ;yes, add blocklen+2 to skip add di,2 jmp for_feature IsDellXBIOS ENDP ;*----------------------------------------------------------------------* ;* * ;* DiddleA20 - * ;* * ;* Test the operation of the A20 line. * ;* * ;* ARGS: None * ;* RETS: AX = 1, able to enable & disable A20 * ;* AX = 0 & * ;* CY clear, able to enable, but not disable * ;* CY set, unable to enable * ;* * ;*----------------------------------------------------------------------* public DiddleA20 DiddleA20 proc near call IsA20On ; Is A20 already on? or ax,ax ; no, go check it out... jz DiddleIt xor ax,ax ; yes, try to start off clean call [TempA20Handler] ; (disabled) ; Verify that we can turn A20 on and off on command. DiddleIt: mov cx,1024 ; Diddle A20 this many times to be ; somewhat assured it really works. DiddleAgain: push cx mov ax,1 call [TempA20Handler] ; Try to enable A20 or ax,ax jz DA20Error ; Nope - phoosh ourselves call IsA20On ; Is A20 on? or ax,ax jz DA20Error ; Nope - phoosh ourselves xor ax,ax call [TempA20Handler] ; Try to disable A20 or ax,ax jz DA20Warn call IsA20On ; Is A20 off? or ax,ax jnz DA20Warn pop cx loop DiddleAgain DA20Okay: mov ax,1 ; Able to control A20, or ax,ax ; success == AX != 0 & CY clear ret DA20Warn: ; Able to enable, but not disable! pop cx ; warning == AX = 0 & CY clear xor ax,ax ret DA20Error: ; Unable to enable! pop cx ; error == AX = 0 & CY set xor ax,ax stc ret DiddleA20 endp ;**************************************************************************** ;* * ;* The following routines install the proper A20 handler for this system. * ;* This code is called once during initialization, and then is overwritten * ;* or discarded. * ;* * ;**************************************************************************** A20Struc struc pfnDetect dw 0 ; offset of detection routine pStart dw 0 ; A20 handler starting offset pEnd dw 0 ; A20 handler ending offset fA20Query db 0 ; NZ if handler supports A20 on/off query fDelayType db 0 ; -1 normally, otherwise special delay logic szName dw 0 ; offset of handler name string bNum db 0 ; A20 handler number M008 A20Struc ends ;*----------------------------------------------------------------------* ;* * ;* InstallA20 - HARDWARE DEP. * ;* * ;* Attempt to install the proper A20 Handler * ;* * ;* ARGS: None * ;* RETS: None * ;* REGS: AX, BX, CX, DI, SI, ES and Flags are clobbered * ;* * ;*----------------------------------------------------------------------* public InstallA20 InstallA20 proc near ; If the user selected a specific A20 handler, then use it. mov bx,MachineNum ; if a machine number has been cmp bx,-1 ; selected, use the corresponding jz IA20Detect ; A20 handler, else try to detect mov ax,size A20Struc ; point to selected handler entry mul bx mov bx,ax add bx,offset A20_scan_table ; invoke the handler's detection rtn call InsA20Detect ; in case it needs to set something ; up for later use by the handler jmp short InstallA20_Foundit ; User didn't select A20 hander, detect which one to use. First look ; for an external handler. IA20Detect: mov ax,(INT2F_ID SHL 8) OR INT2F_EXT_A20 int 2Fh cmp al,80h ; al set to 80h if external handler jne IA20NotExt mov word ptr [lpExtA20Handler],bx ; got one, es:bx = entry point mov word ptr [lpExtA20Handler+2],es mov bx,offset ExtA20Entry mov [bx].fA20Query,cl ; cl = query support flag push dx mov dx, offset InsExtA20Msg ; "Installed external A20 handler." call DispInfoMsg pop dx jmp short InstallA20_Foundit ; No external A20 handler, go down our internal list of handlers, ; and pick one. IA20NotExt: mov bx,offset A20_scan_table InstallA20_scanloop: cmp bx,offset EndA20_scan_table jae InstallA20_none call InsA20Detect ; is this the one for us? or ax,ax jnz InstallA20_Foundit add bx,size A20Struc jmp short InstallA20_scanloop ; We didn't detect a valid A20 handler, point to error msg & return with error InstallA20_none: mov dx, offset NoA20HandlerMsg stc ret InstallA20_Foundit: mov cl, [bx].bNum mov InstldA20HndlrN, cl ; update the handler number xor cx,cx mov cl,[bx].fA20Query ; global flag for handler supporting mov fA20Check,cl ; it's own A20 on/off check mov cl,[bx].fDelayType ; flag for special A20 delay routine cmp cl,-1 ; -1 if no special delay required jz @f mov ATA20Delay,cl @@: mov si,[bx].pStart cmp si,offset _text:AT_A20Handler jnz InsA20AsIs ; if this is the AT handler, do cmp fCPUClock,0 ; we need to install the CPU Clock jnz InsA20AsIs ; rate prefix? mov si,offset _text:AT_A20Normal ;AT_A20Normal == No InsA20AsIs: mov cx,[bx].pEnd sub cx,si ; get length of driver to install push cs ; es = cs pop es mov di,offset A20Handler rep movsb ; move it! mov [TopOfTextSeg],di ; keep track of used space ifndef debug_tsr ; Display which A20 handler was selected. mov bx,[bx].szName ; skip it if no name string to display or bx,bx jz IA20NoName cmp fQuiet, 0 ; skip it if quiet mode jnz IA20NoName push dx ; display which handler installed mov dx, offset InsA20Msg ; "Installed A20 handler number " call DispInfoMsg @@: mov dl,[bx] or dl,dl ; name string is null, not $ terminated jz @f call DispInfoChar inc bx jmp short @b @@: cmp ATA20Delay,0 ; display which delay code is in effect jz @f ; (if any) mov dl,',' call DispInfoChar mov dl,ATA20Delay or dl,30h call DispInfoChar @@: mov dl,'.' call DispInfoChar pop dx IA20NoName: endif ret ; Common routine to invoke A20 handler detect routine InsA20Detect: push bx ; put A20 handler start address in mov ax,[bx].pStart ; known location for detect routine cmp ax,offset _text:AT_A20Handler jnz InsA20AsIs_1 ; if this is the AT handler, do cmp fCPUClock,0 ; we need to install the CPU Clock jnz InsA20AsIs_1 ; rate prefix? mov ax,offset _text:AT_A20Normal ;AT_A20Normal == No InsA20AsIs_1: mov TempA20Handler,ax call [bx].pfnDetect ; is this the one for us? pop bx ret ; Note: the following table MUST be in the same order as the entries in ; the MachineName table. If you add one here, also add one there! A20_scan_table label byte A20Struc <IsPTLCascade,PTL_CASCADE_A20Handler,EndPTL_CASCADE_A20Handler,1,-1,AltName3,3> A20Struc <Is6300Plus,$6300PLUS_A20Handler,End6300PLUS_Handler,0,-1,AltName5,5> A20Struc <IsPS2Machine,PS2_A20Handler,EndPS2_A20Handler,1,-1,AltName2,2> A20Struc <IsHPMachine,HP_A20Handler,EndHP_A20Handler,0,-1,AltName4,4> A20Struc <IsFail,ACER_A20Handler,EndACER_A20Handler,0,-1,AltName6,6> A20Struc <IsToshiba,AT_A20Handler,EndAT_A20Handler,0,2,AltName7,7> A20Struc <IsFail,Wyse_A20Handler,EndWyse_A20Handler,0,-1,AltName8,8> A20Struc <IsFail,Wyse_A20Handler,EndWyse_A20Handler,0,-1,AltName9,9> A20Struc <IsZBIOS,ZB_A20Handler,EndZB_A20Handler,0,-1,AltName10,10> A20Struc <IsFail,AT_A20Handler,EndAT_A20Handler,0,0,AltName11,11> A20Struc <IsFail,AT_A20Handler,EndAT_A20Handler,0,1,AltName12,12> A20Struc <IsFail,AT_A20Handler,EndAT_A20Handler,0,2,AltName13,13> A20Struc <IsPhilips,AT_A20Handler,EndAT_A20Handler,0,2,AltName13,13> A20Struc <IsCSS,AT_A20Handler,EndAT_A20Handler,0,1,AltName12,12> A20Struc <IsHPVectra,NHP_A20Handler,EndNHP_A20Handler,0,-1,AltName14,14> A20Struc <isFail,IC_A20Handler,EndIC_A20Handler,1,-1,AltName15,15> A20Struc <IsBM60,BM60_A20Handler,EndBM60_A20Handler,0,-1,AltName16,16> A20Struc <isDellXBIOS,Dell_A20Handler,EndDell_A20Handler,0,-1,AltName17,17> A20Struc <IsAT,AT_A20Handler,EndAT_A20Handler,0,-1,AltName1,1> EndA20_scan_table label byte ExtA20Entry label byte A20Struc <IsFail,Ext_A20Handler,EndExt_A20Handler,0,-1,0,0> InstallA20 endp _text ends end  
data/pokemon/dex_entries/infernape.asm
AtmaBuster/pokeplat-gen2
6
10788
db "FLAME@" ; species name db "It tosses its" next "enemies around" next "with agility. It" page "uses all its limbs" next "to fight in its " next "own unique style.@"
src/lang/stemmer-tamil.adb
stcarrez/ada-stemmer
3
28599
<filename>src/lang/stemmer-tamil.adb -- Generated by Snowball 2.2.0 - https://snowballstem.org/ package body Stemmer.Tamil is pragma Style_Checks ("-mr"); pragma Warnings (Off, "*variable*is never read and never assigned*"); pragma Warnings (Off, "*mode could be*instead of*"); pragma Warnings (Off, "*formal parameter.*is not modified*"); pragma Warnings (Off, "*this line is too long*"); pragma Warnings (Off, "*is not referenced*"); procedure R_Has_min_length (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_common_word_endings (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_tense_suffixes (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_tense_suffix (Z : in out Context_Type; Result : out Boolean); procedure R_Fix_endings (Z : in out Context_Type; Result : out Boolean); procedure R_Fix_ending (Z : in out Context_Type; Result : out Boolean); procedure R_Fix_va_start (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_vetrumai_urupukal (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_um (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_command_suffixes (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_pronoun_prefixes (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_question_prefixes (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_question_suffixes (Z : in out Context_Type; Result : out Boolean); procedure R_Remove_plural_suffix (Z : in out Context_Type; Result : out Boolean); Among_String : constant String := "க" & "ங" & "ச" & "ஞ" & "த" & "ந" & "ப" & "ம" & "ய" & "வ" & "ந்த்" & "ந்" & "ந்த" & "ீ" & "ை" & "ி" & "க" & "ச" & "ட" & "த" & "ப" & "ற" & "க" & "ச" & "ட" & "த" & "ப" & "ற" & "க" & "ச" & "ட" & "த" & "ப" & "ற" & "ய" & "ர" & "ல" & "ள" & "ழ" & "வ" & "ங" & "ஞ" & "ண" & "ந" & "ன" & "ம" & "வ்" & "ய" & "வ" & "ீ" & "ு" & "ூ" & "ெ" & "ே" & "ை" & "ா" & "ி" & "ீ" & "ு" & "ூ" & "ெ" & "ே" & "ை" & "ா" & "ி" & "அ" & "இ" & "உ" & "க" & "ங" & "ச" & "ஞ" & "த" & "ந" & "ப" & "ம" & "ய" & "வ" & "க" & "ச" & "ட" & "த" & "ப" & "ற" & "ே" & "ோ" & "ா" & "பி" & "வி" & "ீ" & "ு" & "ூ" & "ெ" & "ே" & "ை" & "ா" & "ி" & "பட்டு" & "விட்டு" & "படு" & "விடு" & "பட்டது" & "ெல்லாம்" & "பட்ட" & "பட்டண" & "தான" & "படிதான" & "குரிய" & "படி" & "பற்றி" & "க" & "ச" & "ட" & "த" & "ப" & "ற" & "க" & "ச" & "ட" & "த" & "ப" & "ற" & "ீ" & "ு" & "ூ" & "ெ" & "ே" & "ை" & "ா" & "ி" & "ீ" & "ு" & "ூ" & "ெ" & "ே" & "ை" & "ா" & "ி" & "படு" & "கொண்டிர்" & "அ" & "ஆ" & "இ" & "ஈ" & "உ" & "ஊ" & "எ" & "ஏ" & "ஐ" & "ஒ" & "ஓ" & "ஔ" & "ீ" & "ு" & "ூ" & "ெ" & "ே" & "ை" & "ா" & "ி" & "கின்ற்" & "ாநின்ற்" & "கிற்" & "கின்ற" & "ாநின்ற" & "கிற"; A_0 : constant Among_Array_Type (0 .. 9) := ( (1, 3, -1, -1, 0), (4, 6, -1, -1, 0), (7, 9, -1, -1, 0), (10, 12, -1, -1, 0), (13, 15, -1, -1, 0), (16, 18, -1, -1, 0), (19, 21, -1, -1, 0), (22, 24, -1, -1, 0), (25, 27, -1, -1, 0), (28, 30, -1, -1, 0)); A_1 : constant Among_Array_Type (0 .. 2) := ( (31, 42, -1, -1, 0), (43, 48, -1, -1, 0), (49, 57, -1, -1, 0)); A_2 : constant Among_Array_Type (0 .. 2) := ( (58, 60, -1, -1, 0), (61, 63, -1, -1, 0), (64, 66, -1, -1, 0)); A_3 : constant Among_Array_Type (0 .. 5) := ( (67, 69, -1, -1, 0), (70, 72, -1, -1, 0), (73, 75, -1, -1, 0), (76, 78, -1, -1, 0), (79, 81, -1, -1, 0), (82, 84, -1, -1, 0)); A_4 : constant Among_Array_Type (0 .. 5) := ( (85, 87, -1, -1, 0), (88, 90, -1, -1, 0), (91, 93, -1, -1, 0), (94, 96, -1, -1, 0), (97, 99, -1, -1, 0), (100, 102, -1, -1, 0)); A_5 : constant Among_Array_Type (0 .. 5) := ( (103, 105, -1, -1, 0), (106, 108, -1, -1, 0), (109, 111, -1, -1, 0), (112, 114, -1, -1, 0), (115, 117, -1, -1, 0), (118, 120, -1, -1, 0)); A_6 : constant Among_Array_Type (0 .. 5) := ( (121, 123, -1, -1, 0), (124, 126, -1, -1, 0), (127, 129, -1, -1, 0), (130, 132, -1, -1, 0), (133, 135, -1, -1, 0), (136, 138, -1, -1, 0)); A_7 : constant Among_Array_Type (0 .. 5) := ( (139, 141, -1, -1, 0), (142, 144, -1, -1, 0), (145, 147, -1, -1, 0), (148, 150, -1, -1, 0), (151, 153, -1, -1, 0), (154, 156, -1, -1, 0)); A_8 : constant Among_Array_Type (0 .. 2) := ( (157, 162, -1, -1, 0), (163, 165, -1, -1, 0), (166, 168, -1, -1, 0)); A_9 : constant Among_Array_Type (0 .. 7) := ( (169, 171, -1, -1, 0), (172, 174, -1, -1, 0), (175, 177, -1, -1, 0), (178, 180, -1, -1, 0), (181, 183, -1, -1, 0), (184, 186, -1, -1, 0), (187, 189, -1, -1, 0), (190, 192, -1, -1, 0)); A_10 : constant Among_Array_Type (0 .. 7) := ( (193, 195, -1, -1, 0), (196, 198, -1, -1, 0), (199, 201, -1, -1, 0), (202, 204, -1, -1, 0), (205, 207, -1, -1, 0), (208, 210, -1, -1, 0), (211, 213, -1, -1, 0), (214, 216, -1, -1, 0)); A_11 : constant Among_Array_Type (0 .. 2) := ( (217, 219, -1, -1, 0), (220, 222, -1, -1, 0), (223, 225, -1, -1, 0)); A_12 : constant Among_Array_Type (0 .. 9) := ( (226, 228, -1, -1, 0), (229, 231, -1, -1, 0), (232, 234, -1, -1, 0), (235, 237, -1, -1, 0), (238, 240, -1, -1, 0), (241, 243, -1, -1, 0), (244, 246, -1, -1, 0), (247, 249, -1, -1, 0), (250, 252, -1, -1, 0), (253, 255, -1, -1, 0)); A_13 : constant Among_Array_Type (0 .. 5) := ( (256, 258, -1, -1, 0), (259, 261, -1, -1, 0), (262, 264, -1, -1, 0), (265, 267, -1, -1, 0), (268, 270, -1, -1, 0), (271, 273, -1, -1, 0)); A_14 : constant Among_Array_Type (0 .. 2) := ( (274, 276, -1, -1, 0), (277, 279, -1, -1, 0), (280, 282, -1, -1, 0)); A_15 : constant Among_Array_Type (0 .. 1) := ( (283, 288, -1, -1, 0), (289, 294, -1, -1, 0)); A_16 : constant Among_Array_Type (0 .. 7) := ( (295, 297, -1, -1, 0), (298, 300, -1, -1, 0), (301, 303, -1, -1, 0), (304, 306, -1, -1, 0), (307, 309, -1, -1, 0), (310, 312, -1, -1, 0), (313, 315, -1, -1, 0), (316, 318, -1, -1, 0)); A_17 : constant Among_Array_Type (0 .. 12) := ( (319, 333, -1, -1, 0), (334, 351, -1, -1, 0), (352, 360, -1, -1, 0), (361, 372, -1, -1, 0), (373, 390, -1, -1, 0), (391, 411, -1, -1, 0), (412, 423, -1, -1, 0), (424, 438, -1, -1, 0), (439, 447, -1, -1, 0), (448, 465, 8, -1, 0), (466, 480, -1, -1, 0), (481, 489, -1, -1, 0), (490, 504, -1, -1, 0)); A_18 : constant Among_Array_Type (0 .. 5) := ( (505, 507, -1, -1, 0), (508, 510, -1, -1, 0), (511, 513, -1, -1, 0), (514, 516, -1, -1, 0), (517, 519, -1, -1, 0), (520, 522, -1, -1, 0)); A_19 : constant Among_Array_Type (0 .. 5) := ( (523, 525, -1, -1, 0), (526, 528, -1, -1, 0), (529, 531, -1, -1, 0), (532, 534, -1, -1, 0), (535, 537, -1, -1, 0), (538, 540, -1, -1, 0)); A_20 : constant Among_Array_Type (0 .. 7) := ( (541, 543, -1, -1, 0), (544, 546, -1, -1, 0), (547, 549, -1, -1, 0), (550, 552, -1, -1, 0), (553, 555, -1, -1, 0), (556, 558, -1, -1, 0), (559, 561, -1, -1, 0), (562, 564, -1, -1, 0)); A_21 : constant Among_Array_Type (0 .. 7) := ( (565, 567, -1, -1, 0), (568, 570, -1, -1, 0), (571, 573, -1, -1, 0), (574, 576, -1, -1, 0), (577, 579, -1, -1, 0), (580, 582, -1, -1, 0), (583, 585, -1, -1, 0), (586, 588, -1, -1, 0)); A_22 : constant Among_Array_Type (0 .. 1) := ( (589, 597, -1, -1, 0), (598, 621, -1, -1, 0)); A_23 : constant Among_Array_Type (0 .. 11) := ( (622, 624, -1, -1, 0), (625, 627, -1, -1, 0), (628, 630, -1, -1, 0), (631, 633, -1, -1, 0), (634, 636, -1, -1, 0), (637, 639, -1, -1, 0), (640, 642, -1, -1, 0), (643, 645, -1, -1, 0), (646, 648, -1, -1, 0), (649, 651, -1, -1, 0), (652, 654, -1, -1, 0), (655, 657, -1, -1, 0)); A_24 : constant Among_Array_Type (0 .. 7) := ( (658, 660, -1, -1, 0), (661, 663, -1, -1, 0), (664, 666, -1, -1, 0), (667, 669, -1, -1, 0), (670, 672, -1, -1, 0), (673, 675, -1, -1, 0), (676, 678, -1, -1, 0), (679, 681, -1, -1, 0)); A_25 : constant Among_Array_Type (0 .. 5) := ( (682, 699, -1, -1, 0), (700, 720, -1, -1, 0), (721, 732, -1, -1, 0), (733, 747, -1, -1, 0), (748, 765, -1, -1, 0), (766, 774, -1, -1, 0)); procedure R_Has_min_length (Z : in out Context_Type; Result : out Boolean) is begin Result := (Length_Utf8 (Z) > 4); end R_Has_min_length; procedure R_Fix_va_start (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; v_3 : Char_Index; v_4 : Char_Index; v_5 : Char_Index; v_6 : Char_Index; v_7 : Char_Index; v_8 : Char_Index; v_9 : Char_Index; begin -- or, line 104 v_1 := Z.C; -- (, line 104 -- and, line 104 v_2 := Z.C; -- try, line 104 v_3 := Z.C; -- literal, line 104 C := Eq_S (Z, "வோ"); if C = 0 then Z.C := v_3; goto lab2; end if; Z.C := Z.C + C; <<lab2>> Z.C := v_2; Z.Bra := Z.C; -- [, line 104 -- literal, line 104 C := Eq_S (Z, "வோ"); if C = 0 then goto lab1; end if; Z.C := Z.C + C; Z.Ket := Z.C; -- ], line 104 -- <-, line 104 Slice_From (Z, "ஓ"); goto lab0; <<lab1>> Z.C := v_1; -- (, line 105 -- and, line 105 v_4 := Z.C; -- try, line 105 v_5 := Z.C; -- literal, line 105 C := Eq_S (Z, "வொ"); if C = 0 then Z.C := v_5; goto lab4; end if; Z.C := Z.C + C; <<lab4>> Z.C := v_4; Z.Bra := Z.C; -- [, line 105 -- literal, line 105 C := Eq_S (Z, "வொ"); if C = 0 then goto lab3; end if; Z.C := Z.C + C; Z.Ket := Z.C; -- ], line 105 -- <-, line 105 Slice_From (Z, "ஒ"); goto lab0; <<lab3>> Z.C := v_1; -- (, line 106 -- and, line 106 v_6 := Z.C; -- try, line 106 v_7 := Z.C; -- literal, line 106 C := Eq_S (Z, "வு"); if C = 0 then Z.C := v_7; goto lab6; end if; Z.C := Z.C + C; <<lab6>> Z.C := v_6; Z.Bra := Z.C; -- [, line 106 -- literal, line 106 C := Eq_S (Z, "வு"); if C = 0 then goto lab5; end if; Z.C := Z.C + C; Z.Ket := Z.C; -- ], line 106 -- <-, line 106 Slice_From (Z, "உ"); goto lab0; <<lab5>> Z.C := v_1; -- (, line 107 -- and, line 107 v_8 := Z.C; -- try, line 107 v_9 := Z.C; -- literal, line 107 C := Eq_S (Z, "வூ"); if C = 0 then Z.C := v_9; goto lab7; end if; Z.C := Z.C + C; <<lab7>> Z.C := v_8; Z.Bra := Z.C; -- [, line 107 -- literal, line 107 C := Eq_S (Z, "வூ"); if C = 0 then Result := False; return; end if; Z.C := Z.C + C; Z.Ket := Z.C; -- ], line 107 -- <-, line 107 Slice_From (Z, "ஊ"); <<lab0>> Result := True; end R_Fix_va_start; procedure R_Fix_endings (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; begin -- do, line 111 v_1 := Z.C; -- repeat, line 111 <<lab1>> loop v_2 := Z.C; -- call fix_ending, line 111 R_Fix_ending (Z, Result); if not Result then goto lab2; end if; goto lab1; <<lab2>> Z.C := v_2; exit; end loop; <<lab0>> Z.C := v_1; Result := True; end R_Fix_endings; procedure R_Remove_question_prefixes (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; begin -- (, line 114 Z.Bra := Z.C; -- [, line 115 -- literal, line 115 C := Eq_S (Z, "எ"); if C = 0 then Result := False; return; end if; Z.C := Z.C + C; -- among, line 115 Find_Among (Z, A_0, Among_String, null, A); if A = 0 then Result := False; return; end if; -- literal, line 115 C := Eq_S (Z, "்"); if C = 0 then Result := False; return; end if; Z.C := Z.C + C; Z.Ket := Z.C; -- ], line 115 -- delete, line 115 Slice_Del (Z); -- do, line 116 v_1 := Z.C; -- call fix_va_start, line 116 R_Fix_va_start (Z, Result); Z.C := v_1; Result := True; end R_Remove_question_prefixes; procedure R_Fix_ending (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; v_3 : Char_Index; v_4 : Char_Index; v_5 : Char_Index; v_6 : Char_Index; v_7 : Char_Index; v_8 : Char_Index; v_9 : Char_Index; v_10 : Char_Index; v_11 : Char_Index; v_12 : Char_Index; v_13 : Char_Index; begin -- (, line 120 if not (Length_Utf8 (Z) > 3) then Result := False; return; end if; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 122 -- or, line 124 v_1 := Z.L - Z.C; -- (, line 123 Z.Ket := Z.C; -- [, line 123 -- among, line 123 if Z.C - 5 <= Z.Lb or else (Character'Pos (Z.P (Z.C)) /= 141 and then Character'Pos (Z.P (Z.C)) /= 164) then goto lab1; -- among, line 123 end if; Find_Among_Backward (Z, A_1, Among_String, null, A); if A = 0 then goto lab1; end if; Z.Bra := Z.C; -- ], line 123 -- delete, line 123 Slice_Del (Z); goto lab0; <<lab1>> Z.C := Z.L - v_1; -- (, line 125 Z.Ket := Z.C; -- [, line 125 -- literal, line 125 C := Eq_S_Backward (Z, "ய்"); if C = 0 then goto lab2; end if; Z.C := Z.C - C; -- test, line 125 v_2 := Z.L - Z.C; -- among, line 125 Find_Among_Backward (Z, A_2, Among_String, null, A); if A = 0 then goto lab2; end if; Z.C := Z.L - v_2; Z.Bra := Z.C; -- ], line 125 -- delete, line 125 Slice_Del (Z); goto lab0; <<lab2>> Z.C := Z.L - v_1; -- (, line 127 Z.Ket := Z.C; -- [, line 127 -- or, line 127 v_3 := Z.L - Z.C; -- literal, line 127 C := Eq_S_Backward (Z, "ட்ப்"); if C = 0 then goto lab5; end if; Z.C := Z.C - C; goto lab4; <<lab5>> Z.C := Z.L - v_3; -- literal, line 127 C := Eq_S_Backward (Z, "ட்க்"); if C = 0 then goto lab3; end if; Z.C := Z.C - C; <<lab4>> Z.Bra := Z.C; -- ], line 127 -- <-, line 127 Slice_From (Z, "ள்"); goto lab0; <<lab3>> Z.C := Z.L - v_1; -- (, line 129 Z.Ket := Z.C; -- [, line 129 -- literal, line 129 C := Eq_S_Backward (Z, "ன்ற்"); if C = 0 then goto lab6; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 129 -- <-, line 129 Slice_From (Z, "ல்"); goto lab0; <<lab6>> Z.C := Z.L - v_1; -- (, line 132 Z.Ket := Z.C; -- [, line 132 -- literal, line 132 C := Eq_S_Backward (Z, "ற்க்"); if C = 0 then goto lab7; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 132 -- <-, line 132 Slice_From (Z, "ல்"); goto lab0; <<lab7>> Z.C := Z.L - v_1; -- (, line 134 Z.Ket := Z.C; -- [, line 134 -- literal, line 134 C := Eq_S_Backward (Z, "ட்ட்"); if C = 0 then goto lab8; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 134 -- <-, line 134 Slice_From (Z, "டு"); goto lab0; <<lab8>> Z.C := Z.L - v_1; -- (, line 136 -- Boolean test found_vetrumai_urupu, line 136 if not Z.B_Found_vetrumai_urupu then goto lab9; end if; Z.Ket := Z.C; -- [, line 136 -- literal, line 136 C := Eq_S_Backward (Z, "த்த்"); if C = 0 then goto lab9; end if; Z.C := Z.C - C; -- test, line 136 v_4 := Z.L - Z.C; -- not, line 136 v_5 := Z.L - Z.C; -- literal, line 136 C := Eq_S_Backward (Z, "ை"); if C = 0 then goto lab10; end if; Z.C := Z.C - C; goto lab9; <<lab10>> Z.C := Z.L - v_5; Z.C := Z.L - v_4; Z.Bra := Z.C; -- ], line 136 -- <-, line 136 Slice_From (Z, "ம்"); Z.Bra := Z.C; -- ], line 136 goto lab0; <<lab9>> Z.C := Z.L - v_1; -- (, line 138 Z.Ket := Z.C; -- [, line 138 -- or, line 138 v_6 := Z.L - Z.C; -- literal, line 138 C := Eq_S_Backward (Z, "ுக்"); if C = 0 then goto lab13; end if; Z.C := Z.C - C; goto lab12; <<lab13>> Z.C := Z.L - v_6; -- literal, line 138 C := Eq_S_Backward (Z, "ுக்க்"); if C = 0 then goto lab11; end if; Z.C := Z.C - C; <<lab12>> Z.Bra := Z.C; -- ], line 138 -- <-, line 138 Slice_From (Z, "்"); goto lab0; <<lab11>> Z.C := Z.L - v_1; -- (, line 140 Z.Ket := Z.C; -- [, line 140 -- literal, line 140 C := Eq_S_Backward (Z, "்"); if C = 0 then goto lab14; end if; Z.C := Z.C - C; -- among, line 140 Find_Among_Backward (Z, A_3, Among_String, null, A); if A = 0 then goto lab14; end if; -- literal, line 140 C := Eq_S_Backward (Z, "்"); if C = 0 then goto lab14; end if; Z.C := Z.C - C; -- among, line 140 Find_Among_Backward (Z, A_4, Among_String, null, A); if A = 0 then goto lab14; end if; Z.Bra := Z.C; -- ], line 140 -- delete, line 140 Slice_Del (Z); goto lab0; <<lab14>> Z.C := Z.L - v_1; -- (, line 142 Z.Ket := Z.C; -- [, line 142 -- literal, line 142 C := Eq_S_Backward (Z, "ுக்"); if C = 0 then goto lab15; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 142 -- <-, line 142 Slice_From (Z, "்"); goto lab0; <<lab15>> Z.C := Z.L - v_1; -- (, line 144 Z.Ket := Z.C; -- [, line 144 -- literal, line 144 C := Eq_S_Backward (Z, "்"); if C = 0 then goto lab16; end if; Z.C := Z.C - C; -- among, line 144 Find_Among_Backward (Z, A_5, Among_String, null, A); if A = 0 then goto lab16; end if; Z.Bra := Z.C; -- ], line 144 -- delete, line 144 Slice_Del (Z); goto lab0; <<lab16>> Z.C := Z.L - v_1; -- (, line 146 Z.Ket := Z.C; -- [, line 146 -- literal, line 146 C := Eq_S_Backward (Z, "்"); if C = 0 then goto lab17; end if; Z.C := Z.C - C; -- or, line 146 v_7 := Z.L - Z.C; -- among, line 146 if Z.C - 2 <= Z.Lb or else Check_Among (Z, Z.C - 1, 5, 16#3d8000#) then goto lab19; -- among, line 146 end if; Find_Among_Backward (Z, A_6, Among_String, null, A); if A = 0 then goto lab19; end if; goto lab18; <<lab19>> Z.C := Z.L - v_7; -- among, line 146 Find_Among_Backward (Z, A_7, Among_String, null, A); if A = 0 then goto lab17; end if; <<lab18>> -- literal, line 146 C := Eq_S_Backward (Z, "்"); if C = 0 then goto lab17; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 146 -- <-, line 146 Slice_From (Z, "்"); goto lab0; <<lab17>> Z.C := Z.L - v_1; -- (, line 148 Z.Ket := Z.C; -- [, line 148 -- among, line 148 Find_Among_Backward (Z, A_8, Among_String, null, A); if A = 0 then goto lab20; end if; Z.Bra := Z.C; -- ], line 148 -- delete, line 148 Slice_Del (Z); goto lab0; <<lab20>> Z.C := Z.L - v_1; -- (, line 150 Z.Ket := Z.C; -- [, line 150 -- literal, line 150 C := Eq_S_Backward (Z, "னு"); if C = 0 then goto lab21; end if; Z.C := Z.C - C; -- test, line 150 v_8 := Z.L - Z.C; -- not, line 150 v_9 := Z.L - Z.C; -- among, line 150 Find_Among_Backward (Z, A_9, Among_String, null, A); if A = 0 then goto lab22; end if; goto lab21; <<lab22>> Z.C := Z.L - v_9; Z.C := Z.L - v_8; Z.Bra := Z.C; -- ], line 150 -- delete, line 150 Slice_Del (Z); goto lab0; <<lab21>> Z.C := Z.L - v_1; -- (, line 152 Z.Ket := Z.C; -- [, line 152 -- literal, line 152 C := Eq_S_Backward (Z, "ங்"); if C = 0 then goto lab23; end if; Z.C := Z.C - C; -- test, line 152 v_10 := Z.L - Z.C; -- not, line 152 v_11 := Z.L - Z.C; -- literal, line 152 C := Eq_S_Backward (Z, "ை"); if C = 0 then goto lab24; end if; Z.C := Z.C - C; goto lab23; <<lab24>> Z.C := Z.L - v_11; Z.C := Z.L - v_10; Z.Bra := Z.C; -- ], line 152 -- <-, line 152 Slice_From (Z, "ம்"); goto lab0; <<lab23>> Z.C := Z.L - v_1; -- (, line 154 Z.Ket := Z.C; -- [, line 154 -- literal, line 154 C := Eq_S_Backward (Z, "ங்"); if C = 0 then goto lab25; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 154 -- delete, line 154 Slice_Del (Z); goto lab0; <<lab25>> Z.C := Z.L - v_1; -- (, line 156 Z.Ket := Z.C; -- [, line 156 -- literal, line 156 C := Eq_S_Backward (Z, "்"); if C = 0 then Result := False; return; end if; Z.C := Z.C - C; -- test, line 156 v_12 := Z.L - Z.C; -- or, line 156 v_13 := Z.L - Z.C; -- among, line 156 Find_Among_Backward (Z, A_10, Among_String, null, A); if A = 0 then goto lab27; end if; goto lab26; <<lab27>> Z.C := Z.L - v_13; -- literal, line 156 C := Eq_S_Backward (Z, "்"); if C = 0 then Result := False; return; end if; Z.C := Z.C - C; <<lab26>> Z.C := Z.L - v_12; Z.Bra := Z.C; -- ], line 156 -- delete, line 156 Slice_Del (Z); <<lab0>> Z.C := Z.Lb; Result := True; end R_Fix_ending; procedure R_Remove_pronoun_prefixes (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; begin -- (, line 160 -- unset found_a_match, line 161 Z.B_Found_a_match := False; Z.Bra := Z.C; -- [, line 162 -- among, line 162 if Z.C + 2 >= Z.L or else Check_Among (Z, Z.C + 2, 4, 16#2a0#) then Result := False; return; -- among, line 162 end if; Find_Among (Z, A_11, Among_String, null, A); if A = 0 then Result := False; return; end if; -- among, line 162 Find_Among (Z, A_12, Among_String, null, A); if A = 0 then Result := False; return; end if; -- literal, line 162 C := Eq_S (Z, "்"); if C = 0 then Result := False; return; end if; Z.C := Z.C + C; Z.Ket := Z.C; -- ], line 162 -- delete, line 162 Slice_Del (Z); -- set found_a_match, line 163 Z.B_Found_a_match := True; -- do, line 164 v_1 := Z.C; -- call fix_va_start, line 164 R_Fix_va_start (Z, Result); Z.C := v_1; Result := True; end R_Remove_pronoun_prefixes; procedure R_Remove_plural_suffix (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; v_3 : Char_Index; begin -- (, line 167 -- unset found_a_match, line 168 Z.B_Found_a_match := False; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 169 -- (, line 169 -- or, line 170 v_1 := Z.L - Z.C; -- (, line 170 Z.Ket := Z.C; -- [, line 170 -- literal, line 170 C := Eq_S_Backward (Z, "ுங்கள்"); if C = 0 then goto lab1; end if; Z.C := Z.C - C; -- test, line 170 v_2 := Z.L - Z.C; -- not, line 170 v_3 := Z.L - Z.C; -- among, line 170 Find_Among_Backward (Z, A_13, Among_String, null, A); if A = 0 then goto lab2; end if; goto lab1; <<lab2>> Z.C := Z.L - v_3; Z.C := Z.L - v_2; Z.Bra := Z.C; -- ], line 170 -- <-, line 170 Slice_From (Z, "்"); goto lab0; <<lab1>> Z.C := Z.L - v_1; -- (, line 171 Z.Ket := Z.C; -- [, line 171 -- literal, line 171 C := Eq_S_Backward (Z, "ற்கள்"); if C = 0 then goto lab3; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 171 -- <-, line 171 Slice_From (Z, "ல்"); goto lab0; <<lab3>> Z.C := Z.L - v_1; -- (, line 172 Z.Ket := Z.C; -- [, line 172 -- literal, line 172 C := Eq_S_Backward (Z, "ட்கள்"); if C = 0 then goto lab4; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 172 -- <-, line 172 Slice_From (Z, "ள்"); goto lab0; <<lab4>> Z.C := Z.L - v_1; -- (, line 173 Z.Ket := Z.C; -- [, line 173 -- literal, line 173 C := Eq_S_Backward (Z, "கள்"); if C = 0 then Result := False; return; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 173 -- delete, line 173 Slice_Del (Z); <<lab0>> -- set found_a_match, line 174 Z.B_Found_a_match := True; Z.C := Z.Lb; Result := True; end R_Remove_plural_suffix; procedure R_Remove_question_suffixes (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; begin -- (, line 178 -- call has_min_length, line 179 R_Has_min_length (Z, Result); if not Result then Result := False; return; end if; -- unset found_a_match, line 180 Z.B_Found_a_match := False; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 181 -- do, line 182 v_1 := Z.L - Z.C; -- (, line 182 Z.Ket := Z.C; -- [, line 183 -- among, line 183 Find_Among_Backward (Z, A_14, Among_String, null, A); if A = 0 then goto lab0; end if; Z.Bra := Z.C; -- ], line 183 -- <-, line 183 Slice_From (Z, "்"); -- set found_a_match, line 184 Z.B_Found_a_match := True; <<lab0>> Z.C := Z.L - v_1; Z.C := Z.Lb; -- do, line 187 -- call fix_endings, line 187 R_Fix_endings (Z, Result); Result := True; end R_Remove_question_suffixes; procedure R_Remove_command_suffixes (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; begin -- (, line 190 -- call has_min_length, line 191 R_Has_min_length (Z, Result); if not Result then Result := False; return; end if; -- unset found_a_match, line 192 Z.B_Found_a_match := False; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 193 -- (, line 193 Z.Ket := Z.C; -- [, line 194 -- among, line 194 if Z.C - 5 <= Z.Lb or else Character'Pos (Z.P (Z.C)) /= 191 then Result := False; return; -- among, line 194 end if; Find_Among_Backward (Z, A_15, Among_String, null, A); if A = 0 then Result := False; return; end if; Z.Bra := Z.C; -- ], line 194 -- delete, line 194 Slice_Del (Z); -- set found_a_match, line 195 Z.B_Found_a_match := True; Z.C := Z.Lb; Result := True; end R_Remove_command_suffixes; procedure R_Remove_um (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; begin -- (, line 199 -- unset found_a_match, line 200 Z.B_Found_a_match := False; -- call has_min_length, line 201 R_Has_min_length (Z, Result); if not Result then Result := False; return; end if; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 202 -- (, line 202 Z.Ket := Z.C; -- [, line 202 -- literal, line 202 C := Eq_S_Backward (Z, "ும்"); if C = 0 then Result := False; return; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 202 -- <-, line 202 Slice_From (Z, "்"); -- set found_a_match, line 203 Z.B_Found_a_match := True; Z.C := Z.Lb; -- do, line 205 v_1 := Z.C; -- call fix_ending, line 205 R_Fix_ending (Z, Result); Z.C := v_1; Result := True; end R_Remove_um; procedure R_Remove_common_word_endings (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; v_3 : Char_Index; v_4 : Char_Index; v_5 : Char_Index; v_6 : Char_Index; begin -- (, line 208 -- unset found_a_match, line 212 Z.B_Found_a_match := False; -- call has_min_length, line 213 R_Has_min_length (Z, Result); if not Result then Result := False; return; end if; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 214 -- or, line 231 v_1 := Z.L - Z.C; -- test, line 215 v_2 := Z.L - Z.C; -- (, line 215 Z.Ket := Z.C; -- [, line 215 -- or, line 215 v_3 := Z.L - Z.C; -- literal, line 215 C := Eq_S_Backward (Z, "ுடன்"); if C = 0 then goto lab3; end if; Z.C := Z.C - C; goto lab2; <<lab3>> Z.C := Z.L - v_3; -- literal, line 216 C := Eq_S_Backward (Z, "ில்லை"); if C = 0 then goto lab4; end if; Z.C := Z.C - C; goto lab2; <<lab4>> Z.C := Z.L - v_3; -- literal, line 217 C := Eq_S_Backward (Z, "ிடம்"); if C = 0 then goto lab5; end if; Z.C := Z.C - C; goto lab2; <<lab5>> Z.C := Z.L - v_3; -- literal, line 218 C := Eq_S_Backward (Z, "ின்றி"); if C = 0 then goto lab6; end if; Z.C := Z.C - C; goto lab2; <<lab6>> Z.C := Z.L - v_3; -- literal, line 219 C := Eq_S_Backward (Z, "ாகி"); if C = 0 then goto lab7; end if; Z.C := Z.C - C; goto lab2; <<lab7>> Z.C := Z.L - v_3; -- literal, line 220 C := Eq_S_Backward (Z, "ாகிய"); if C = 0 then goto lab8; end if; Z.C := Z.C - C; goto lab2; <<lab8>> Z.C := Z.L - v_3; -- literal, line 221 C := Eq_S_Backward (Z, "ென்று"); if C = 0 then goto lab9; end if; Z.C := Z.C - C; goto lab2; <<lab9>> Z.C := Z.L - v_3; -- literal, line 222 C := Eq_S_Backward (Z, "ுள்ள"); if C = 0 then goto lab10; end if; Z.C := Z.C - C; goto lab2; <<lab10>> Z.C := Z.L - v_3; -- literal, line 223 C := Eq_S_Backward (Z, "ுடைய"); if C = 0 then goto lab11; end if; Z.C := Z.C - C; goto lab2; <<lab11>> Z.C := Z.L - v_3; -- literal, line 224 C := Eq_S_Backward (Z, "ுடை"); if C = 0 then goto lab12; end if; Z.C := Z.C - C; goto lab2; <<lab12>> Z.C := Z.L - v_3; -- literal, line 225 C := Eq_S_Backward (Z, "ெனும்"); if C = 0 then goto lab13; end if; Z.C := Z.C - C; goto lab2; <<lab13>> Z.C := Z.L - v_3; -- (, line 226 -- literal, line 226 C := Eq_S_Backward (Z, "ல்ல"); if C = 0 then goto lab14; end if; Z.C := Z.C - C; -- test, line 226 v_4 := Z.L - Z.C; -- not, line 226 v_5 := Z.L - Z.C; -- among, line 226 Find_Among_Backward (Z, A_16, Among_String, null, A); if A = 0 then goto lab15; end if; goto lab14; <<lab15>> Z.C := Z.L - v_5; Z.C := Z.L - v_4; goto lab2; <<lab14>> Z.C := Z.L - v_3; -- literal, line 227 C := Eq_S_Backward (Z, "ென"); if C = 0 then goto lab16; end if; Z.C := Z.C - C; goto lab2; <<lab16>> Z.C := Z.L - v_3; -- literal, line 228 C := Eq_S_Backward (Z, "ாகி"); if C = 0 then goto lab1; end if; Z.C := Z.C - C; <<lab2>> Z.Bra := Z.C; -- ], line 228 -- <-, line 228 Slice_From (Z, "்"); -- set found_a_match, line 229 Z.B_Found_a_match := True; Z.C := Z.L - v_2; goto lab0; <<lab1>> Z.C := Z.L - v_1; -- test, line 232 v_6 := Z.L - Z.C; -- (, line 232 Z.Ket := Z.C; -- [, line 232 -- among, line 232 Find_Among_Backward (Z, A_17, Among_String, null, A); if A = 0 then Result := False; return; end if; Z.Bra := Z.C; -- ], line 245 -- delete, line 245 Slice_Del (Z); -- set found_a_match, line 246 Z.B_Found_a_match := True; Z.C := Z.L - v_6; <<lab0>> Z.C := Z.Lb; -- do, line 249 -- call fix_endings, line 249 R_Fix_endings (Z, Result); Result := True; end R_Remove_common_word_endings; procedure R_Remove_vetrumai_urupukal (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; v_3 : Char_Index; v_4 : Char_Index; v_5 : Char_Index; v_6 : Char_Index; v_7 : Char_Index; v_8 : Char_Index; v_9 : Char_Index; v_10 : Char_Index; v_11 : Char_Index; v_12 : Char_Index; v_13 : Char_Index; v_14 : Char_Index; v_15 : Char_Index; v_16 : Char_Index; v_17 : Char_Index; v_18 : Char_Index; v_19 : Char_Index; v_20 : Char_Index; begin -- (, line 252 -- unset found_a_match, line 253 Z.B_Found_a_match := False; -- unset found_vetrumai_urupu, line 254 Z.B_Found_vetrumai_urupu := False; -- call has_min_length, line 255 R_Has_min_length (Z, Result); if not Result then Result := False; return; end if; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 256 -- (, line 256 -- or, line 259 v_1 := Z.L - Z.C; -- test, line 258 v_2 := Z.L - Z.C; -- (, line 258 Z.Ket := Z.C; -- [, line 258 -- literal, line 258 C := Eq_S_Backward (Z, "னை"); if C = 0 then goto lab1; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 258 -- delete, line 258 Slice_Del (Z); Z.C := Z.L - v_2; goto lab0; <<lab1>> Z.C := Z.L - v_1; -- test, line 260 v_3 := Z.L - Z.C; -- (, line 260 Z.Ket := Z.C; -- [, line 260 -- or, line 261 v_4 := Z.L - Z.C; -- (, line 260 -- or, line 260 v_5 := Z.L - Z.C; -- literal, line 260 C := Eq_S_Backward (Z, "ினை"); if C = 0 then goto lab6; end if; Z.C := Z.C - C; goto lab5; <<lab6>> Z.C := Z.L - v_5; -- literal, line 261 C := Eq_S_Backward (Z, "ை"); if C = 0 then goto lab4; end if; Z.C := Z.C - C; <<lab5>> -- test, line 261 v_6 := Z.L - Z.C; -- not, line 261 v_7 := Z.L - Z.C; -- among, line 261 Find_Among_Backward (Z, A_18, Among_String, null, A); if A = 0 then goto lab7; end if; goto lab4; <<lab7>> Z.C := Z.L - v_7; Z.C := Z.L - v_6; goto lab3; <<lab4>> Z.C := Z.L - v_4; -- (, line 262 -- literal, line 262 C := Eq_S_Backward (Z, "ை"); if C = 0 then goto lab2; end if; Z.C := Z.C - C; -- test, line 262 v_8 := Z.L - Z.C; -- (, line 262 -- among, line 262 Find_Among_Backward (Z, A_19, Among_String, null, A); if A = 0 then goto lab2; end if; -- literal, line 262 C := Eq_S_Backward (Z, "்"); if C = 0 then goto lab2; end if; Z.C := Z.C - C; Z.C := Z.L - v_8; <<lab3>> Z.Bra := Z.C; -- ], line 263 -- <-, line 263 Slice_From (Z, "்"); Z.C := Z.L - v_3; goto lab0; <<lab2>> Z.C := Z.L - v_1; -- test, line 266 v_9 := Z.L - Z.C; -- (, line 266 Z.Ket := Z.C; -- [, line 266 -- or, line 267 v_10 := Z.L - Z.C; -- literal, line 267 C := Eq_S_Backward (Z, "ொடு"); if C = 0 then goto lab10; end if; Z.C := Z.C - C; goto lab9; <<lab10>> Z.C := Z.L - v_10; -- literal, line 268 C := Eq_S_Backward (Z, "ோடு"); if C = 0 then goto lab11; end if; Z.C := Z.C - C; goto lab9; <<lab11>> Z.C := Z.L - v_10; -- literal, line 269 C := Eq_S_Backward (Z, "ில்"); if C = 0 then goto lab12; end if; Z.C := Z.C - C; goto lab9; <<lab12>> Z.C := Z.L - v_10; -- literal, line 270 C := Eq_S_Backward (Z, "ிற்"); if C = 0 then goto lab13; end if; Z.C := Z.C - C; goto lab9; <<lab13>> Z.C := Z.L - v_10; -- (, line 271 -- literal, line 271 C := Eq_S_Backward (Z, "ின்"); if C = 0 then goto lab14; end if; Z.C := Z.C - C; -- test, line 271 v_11 := Z.L - Z.C; -- not, line 271 v_12 := Z.L - Z.C; -- literal, line 271 C := Eq_S_Backward (Z, "ம"); if C = 0 then goto lab15; end if; Z.C := Z.C - C; goto lab14; <<lab15>> Z.C := Z.L - v_12; Z.C := Z.L - v_11; goto lab9; <<lab14>> Z.C := Z.L - v_10; -- literal, line 272 C := Eq_S_Backward (Z, "ின்று"); if C = 0 then goto lab16; end if; Z.C := Z.C - C; goto lab9; <<lab16>> Z.C := Z.L - v_10; -- literal, line 273 C := Eq_S_Backward (Z, "ிருந்து"); if C = 0 then goto lab17; end if; Z.C := Z.C - C; goto lab9; <<lab17>> Z.C := Z.L - v_10; -- literal, line 274 C := Eq_S_Backward (Z, "விட"); if C = 0 then goto lab18; end if; Z.C := Z.C - C; goto lab9; <<lab18>> Z.C := Z.L - v_10; -- (, line 275 if not (Length_Utf8 (Z) >= 7) then goto lab19; end if; -- literal, line 275 C := Eq_S_Backward (Z, "ிடம்"); if C = 0 then goto lab19; end if; Z.C := Z.C - C; goto lab9; <<lab19>> Z.C := Z.L - v_10; -- literal, line 276 C := Eq_S_Backward (Z, "ால்"); if C = 0 then goto lab20; end if; Z.C := Z.C - C; goto lab9; <<lab20>> Z.C := Z.L - v_10; -- literal, line 277 C := Eq_S_Backward (Z, "ுடை"); if C = 0 then goto lab21; end if; Z.C := Z.C - C; goto lab9; <<lab21>> Z.C := Z.L - v_10; -- literal, line 278 C := Eq_S_Backward (Z, "ாமல்"); if C = 0 then goto lab22; end if; Z.C := Z.C - C; goto lab9; <<lab22>> Z.C := Z.L - v_10; -- (, line 279 -- literal, line 279 C := Eq_S_Backward (Z, "ல்"); if C = 0 then goto lab23; end if; Z.C := Z.C - C; -- test, line 279 v_13 := Z.L - Z.C; -- not, line 279 v_14 := Z.L - Z.C; -- among, line 279 Find_Among_Backward (Z, A_20, Among_String, null, A); if A = 0 then goto lab24; end if; goto lab23; <<lab24>> Z.C := Z.L - v_14; Z.C := Z.L - v_13; goto lab9; <<lab23>> Z.C := Z.L - v_10; -- literal, line 280 C := Eq_S_Backward (Z, "ுள்"); if C = 0 then goto lab8; end if; Z.C := Z.C - C; <<lab9>> Z.Bra := Z.C; -- ], line 281 -- <-, line 281 Slice_From (Z, "்"); Z.C := Z.L - v_9; goto lab0; <<lab8>> Z.C := Z.L - v_1; -- test, line 284 v_15 := Z.L - Z.C; -- (, line 284 Z.Ket := Z.C; -- [, line 284 -- or, line 285 v_16 := Z.L - Z.C; -- literal, line 285 C := Eq_S_Backward (Z, "கண்"); if C = 0 then goto lab27; end if; Z.C := Z.C - C; goto lab26; <<lab27>> Z.C := Z.L - v_16; -- literal, line 286 C := Eq_S_Backward (Z, "முன்"); if C = 0 then goto lab28; end if; Z.C := Z.C - C; goto lab26; <<lab28>> Z.C := Z.L - v_16; -- literal, line 287 C := Eq_S_Backward (Z, "மேல்"); if C = 0 then goto lab29; end if; Z.C := Z.C - C; goto lab26; <<lab29>> Z.C := Z.L - v_16; -- literal, line 288 C := Eq_S_Backward (Z, "மேற்"); if C = 0 then goto lab30; end if; Z.C := Z.C - C; goto lab26; <<lab30>> Z.C := Z.L - v_16; -- literal, line 289 C := Eq_S_Backward (Z, "கீழ்"); if C = 0 then goto lab31; end if; Z.C := Z.C - C; goto lab26; <<lab31>> Z.C := Z.L - v_16; -- literal, line 290 C := Eq_S_Backward (Z, "பின்"); if C = 0 then goto lab32; end if; Z.C := Z.C - C; goto lab26; <<lab32>> Z.C := Z.L - v_16; -- (, line 291 -- literal, line 291 C := Eq_S_Backward (Z, "து"); if C = 0 then goto lab25; end if; Z.C := Z.C - C; -- test, line 291 v_17 := Z.L - Z.C; -- not, line 291 v_18 := Z.L - Z.C; -- among, line 291 Find_Among_Backward (Z, A_21, Among_String, null, A); if A = 0 then goto lab33; end if; goto lab25; <<lab33>> Z.C := Z.L - v_18; Z.C := Z.L - v_17; <<lab26>> Z.Bra := Z.C; -- ], line 292 -- delete, line 292 Slice_Del (Z); Z.C := Z.L - v_15; goto lab0; <<lab25>> Z.C := Z.L - v_1; -- test, line 295 v_19 := Z.L - Z.C; -- (, line 295 Z.Ket := Z.C; -- [, line 295 -- literal, line 295 C := Eq_S_Backward (Z, "ீ"); if C = 0 then Result := False; return; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 295 -- <-, line 295 Slice_From (Z, "ி"); Z.C := Z.L - v_19; <<lab0>> -- set found_a_match, line 297 Z.B_Found_a_match := True; -- set found_vetrumai_urupu, line 298 Z.B_Found_vetrumai_urupu := True; -- do, line 299 v_20 := Z.L - Z.C; -- (, line 299 Z.Ket := Z.C; -- [, line 299 -- literal, line 299 C := Eq_S_Backward (Z, "ின்"); if C = 0 then goto lab34; end if; Z.C := Z.C - C; Z.Bra := Z.C; -- ], line 299 -- <-, line 299 Slice_From (Z, "்"); <<lab34>> Z.C := Z.L - v_20; Z.C := Z.Lb; -- do, line 301 -- call fix_endings, line 301 R_Fix_endings (Z, Result); Result := True; end R_Remove_vetrumai_urupukal; procedure R_Remove_tense_suffixes (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; begin -- (, line 304 -- set found_a_match, line 305 Z.B_Found_a_match := True; -- repeat, line 306 <<lab0>> loop v_1 := Z.C; -- (, line 306 -- Boolean test found_a_match, line 306 if not Z.B_Found_a_match then goto lab1; end if; -- do, line 306 v_2 := Z.C; -- call remove_tense_suffix, line 306 R_Remove_tense_suffix (Z, Result); Z.C := v_2; goto lab0; <<lab1>> Z.C := v_1; exit; end loop; Result := True; end R_Remove_tense_suffixes; procedure R_Remove_tense_suffix (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; v_3 : Char_Index; v_4 : Char_Index; v_5 : Char_Index; v_6 : Char_Index; v_7 : Char_Index; v_8 : Char_Index; v_9 : Char_Index; v_10 : Char_Index; v_11 : Char_Index; v_12 : Char_Index; v_13 : Char_Index; v_14 : Char_Index; v_15 : Char_Index; v_16 : Char_Index; v_17 : Char_Index; begin -- (, line 309 -- unset found_a_match, line 310 Z.B_Found_a_match := False; -- call has_min_length, line 311 R_Has_min_length (Z, Result); if not Result then Result := False; return; end if; Z.Lb := Z.C; Z.C := Z.L; -- backwards, line 312 -- (, line 312 -- do, line 313 v_1 := Z.L - Z.C; -- or, line 320 v_2 := Z.L - Z.C; -- test, line 314 v_3 := Z.L - Z.C; -- (, line 314 Z.Ket := Z.C; -- [, line 314 -- among, line 314 if Z.C - 8 <= Z.Lb or else (Character'Pos (Z.P (Z.C)) /= 129 and then Character'Pos (Z.P (Z.C)) /= 141) then goto lab2; -- among, line 314 end if; Find_Among_Backward (Z, A_22, Among_String, null, A); if A = 0 then goto lab2; end if; Z.Bra := Z.C; -- ], line 317 -- delete, line 317 Slice_Del (Z); -- set found_a_match, line 318 Z.B_Found_a_match := True; Z.C := Z.L - v_3; goto lab1; <<lab2>> Z.C := Z.L - v_2; -- test, line 321 v_4 := Z.L - Z.C; -- (, line 321 Z.Ket := Z.C; -- [, line 321 -- or, line 322 v_5 := Z.L - Z.C; -- literal, line 322 C := Eq_S_Backward (Z, "மார்"); if C = 0 then goto lab5; end if; Z.C := Z.C - C; goto lab4; <<lab5>> Z.C := Z.L - v_5; -- literal, line 323 C := Eq_S_Backward (Z, "மின்"); if C = 0 then goto lab6; end if; Z.C := Z.C - C; goto lab4; <<lab6>> Z.C := Z.L - v_5; -- literal, line 324 C := Eq_S_Backward (Z, "னன்"); if C = 0 then goto lab7; end if; Z.C := Z.C - C; goto lab4; <<lab7>> Z.C := Z.L - v_5; -- literal, line 325 C := Eq_S_Backward (Z, "னான்"); if C = 0 then goto lab8; end if; Z.C := Z.C - C; goto lab4; <<lab8>> Z.C := Z.L - v_5; -- literal, line 326 C := Eq_S_Backward (Z, "னாள்"); if C = 0 then goto lab9; end if; Z.C := Z.C - C; goto lab4; <<lab9>> Z.C := Z.L - v_5; -- literal, line 327 C := Eq_S_Backward (Z, "னார்"); if C = 0 then goto lab10; end if; Z.C := Z.C - C; goto lab4; <<lab10>> Z.C := Z.L - v_5; -- (, line 328 -- literal, line 328 C := Eq_S_Backward (Z, "வன்"); if C = 0 then goto lab11; end if; Z.C := Z.C - C; -- test, line 328 v_6 := Z.L - Z.C; -- not, line 328 v_7 := Z.L - Z.C; -- among, line 328 if Z.C - 2 <= Z.Lb or else Check_Among (Z, Z.C - 1, 4, 16#1dc7e0#) then goto lab12; -- among, line 328 end if; Find_Among_Backward (Z, A_23, Among_String, null, A); if A = 0 then goto lab12; end if; goto lab11; <<lab12>> Z.C := Z.L - v_7; Z.C := Z.L - v_6; goto lab4; <<lab11>> Z.C := Z.L - v_5; -- literal, line 329 C := Eq_S_Backward (Z, "னள்"); if C = 0 then goto lab13; end if; Z.C := Z.C - C; goto lab4; <<lab13>> Z.C := Z.L - v_5; -- literal, line 330 C := Eq_S_Backward (Z, "வள்"); if C = 0 then goto lab14; end if; Z.C := Z.C - C; goto lab4; <<lab14>> Z.C := Z.L - v_5; -- literal, line 331 C := Eq_S_Backward (Z, "னர்"); if C = 0 then goto lab15; end if; Z.C := Z.C - C; goto lab4; <<lab15>> Z.C := Z.L - v_5; -- literal, line 332 C := Eq_S_Backward (Z, "வர்"); if C = 0 then goto lab16; end if; Z.C := Z.C - C; goto lab4; <<lab16>> Z.C := Z.L - v_5; -- literal, line 333 C := Eq_S_Backward (Z, "ன"); if C = 0 then goto lab17; end if; Z.C := Z.C - C; goto lab4; <<lab17>> Z.C := Z.L - v_5; -- literal, line 333 C := Eq_S_Backward (Z, "ப"); if C = 0 then goto lab18; end if; Z.C := Z.C - C; goto lab4; <<lab18>> Z.C := Z.L - v_5; -- literal, line 333 C := Eq_S_Backward (Z, "க"); if C = 0 then goto lab19; end if; Z.C := Z.C - C; goto lab4; <<lab19>> Z.C := Z.L - v_5; -- literal, line 333 C := Eq_S_Backward (Z, "த"); if C = 0 then goto lab20; end if; Z.C := Z.C - C; goto lab4; <<lab20>> Z.C := Z.L - v_5; -- literal, line 333 C := Eq_S_Backward (Z, "ய"); if C = 0 then goto lab21; end if; Z.C := Z.C - C; goto lab4; <<lab21>> Z.C := Z.L - v_5; -- literal, line 334 C := Eq_S_Backward (Z, "பன்"); if C = 0 then goto lab22; end if; Z.C := Z.C - C; goto lab4; <<lab22>> Z.C := Z.L - v_5; -- literal, line 335 C := Eq_S_Backward (Z, "பள்"); if C = 0 then goto lab23; end if; Z.C := Z.C - C; goto lab4; <<lab23>> Z.C := Z.L - v_5; -- literal, line 336 C := Eq_S_Backward (Z, "பர்"); if C = 0 then goto lab24; end if; Z.C := Z.C - C; goto lab4; <<lab24>> Z.C := Z.L - v_5; -- (, line 337 -- literal, line 337 C := Eq_S_Backward (Z, "து"); if C = 0 then goto lab25; end if; Z.C := Z.C - C; -- test, line 337 v_8 := Z.L - Z.C; -- not, line 337 v_9 := Z.L - Z.C; -- among, line 337 Find_Among_Backward (Z, A_24, Among_String, null, A); if A = 0 then goto lab26; end if; goto lab25; <<lab26>> Z.C := Z.L - v_9; Z.C := Z.L - v_8; goto lab4; <<lab25>> Z.C := Z.L - v_5; -- literal, line 338 C := Eq_S_Backward (Z, "ிற்று"); if C = 0 then goto lab27; end if; Z.C := Z.C - C; goto lab4; <<lab27>> Z.C := Z.L - v_5; -- literal, line 339 C := Eq_S_Backward (Z, "பம்"); if C = 0 then goto lab28; end if; Z.C := Z.C - C; goto lab4; <<lab28>> Z.C := Z.L - v_5; -- literal, line 340 C := Eq_S_Backward (Z, "னம்"); if C = 0 then goto lab29; end if; Z.C := Z.C - C; goto lab4; <<lab29>> Z.C := Z.L - v_5; -- literal, line 341 C := Eq_S_Backward (Z, "தும்"); if C = 0 then goto lab30; end if; Z.C := Z.C - C; goto lab4; <<lab30>> Z.C := Z.L - v_5; -- literal, line 342 C := Eq_S_Backward (Z, "றும்"); if C = 0 then goto lab31; end if; Z.C := Z.C - C; goto lab4; <<lab31>> Z.C := Z.L - v_5; -- literal, line 343 C := Eq_S_Backward (Z, "கும்"); if C = 0 then goto lab32; end if; Z.C := Z.C - C; goto lab4; <<lab32>> Z.C := Z.L - v_5; -- literal, line 344 C := Eq_S_Backward (Z, "னென்"); if C = 0 then goto lab33; end if; Z.C := Z.C - C; goto lab4; <<lab33>> Z.C := Z.L - v_5; -- literal, line 345 C := Eq_S_Backward (Z, "னை"); if C = 0 then goto lab34; end if; Z.C := Z.C - C; goto lab4; <<lab34>> Z.C := Z.L - v_5; -- literal, line 346 C := Eq_S_Backward (Z, "வை"); if C = 0 then goto lab3; end if; Z.C := Z.C - C; <<lab4>> Z.Bra := Z.C; -- ], line 347 -- delete, line 347 Slice_Del (Z); -- set found_a_match, line 348 Z.B_Found_a_match := True; Z.C := Z.L - v_4; goto lab1; <<lab3>> Z.C := Z.L - v_2; -- test, line 351 v_10 := Z.L - Z.C; -- (, line 351 Z.Ket := Z.C; -- [, line 351 -- or, line 352 v_11 := Z.L - Z.C; -- (, line 352 -- literal, line 352 C := Eq_S_Backward (Z, "ான்"); if C = 0 then goto lab37; end if; Z.C := Z.C - C; -- test, line 352 v_12 := Z.L - Z.C; -- not, line 352 v_13 := Z.L - Z.C; -- literal, line 352 C := Eq_S_Backward (Z, "ச"); if C = 0 then goto lab38; end if; Z.C := Z.C - C; goto lab37; <<lab38>> Z.C := Z.L - v_13; Z.C := Z.L - v_12; goto lab36; <<lab37>> Z.C := Z.L - v_11; -- literal, line 353 C := Eq_S_Backward (Z, "ாள்"); if C = 0 then goto lab39; end if; Z.C := Z.C - C; goto lab36; <<lab39>> Z.C := Z.L - v_11; -- literal, line 354 C := Eq_S_Backward (Z, "ார்"); if C = 0 then goto lab40; end if; Z.C := Z.C - C; goto lab36; <<lab40>> Z.C := Z.L - v_11; -- literal, line 355 C := Eq_S_Backward (Z, "ேன்"); if C = 0 then goto lab41; end if; Z.C := Z.C - C; goto lab36; <<lab41>> Z.C := Z.L - v_11; -- literal, line 356 C := Eq_S_Backward (Z, "ா"); if C = 0 then goto lab42; end if; Z.C := Z.C - C; goto lab36; <<lab42>> Z.C := Z.L - v_11; -- literal, line 357 C := Eq_S_Backward (Z, "ாம்"); if C = 0 then goto lab43; end if; Z.C := Z.C - C; goto lab36; <<lab43>> Z.C := Z.L - v_11; -- literal, line 358 C := Eq_S_Backward (Z, "ெம்"); if C = 0 then goto lab44; end if; Z.C := Z.C - C; goto lab36; <<lab44>> Z.C := Z.L - v_11; -- literal, line 359 C := Eq_S_Backward (Z, "ேம்"); if C = 0 then goto lab45; end if; Z.C := Z.C - C; goto lab36; <<lab45>> Z.C := Z.L - v_11; -- literal, line 360 C := Eq_S_Backward (Z, "ோம்"); if C = 0 then goto lab46; end if; Z.C := Z.C - C; goto lab36; <<lab46>> Z.C := Z.L - v_11; -- literal, line 361 C := Eq_S_Backward (Z, "கும்"); if C = 0 then goto lab47; end if; Z.C := Z.C - C; goto lab36; <<lab47>> Z.C := Z.L - v_11; -- literal, line 362 C := Eq_S_Backward (Z, "தும்"); if C = 0 then goto lab48; end if; Z.C := Z.C - C; goto lab36; <<lab48>> Z.C := Z.L - v_11; -- literal, line 363 C := Eq_S_Backward (Z, "டும்"); if C = 0 then goto lab49; end if; Z.C := Z.C - C; goto lab36; <<lab49>> Z.C := Z.L - v_11; -- literal, line 364 C := Eq_S_Backward (Z, "றும்"); if C = 0 then goto lab50; end if; Z.C := Z.C - C; goto lab36; <<lab50>> Z.C := Z.L - v_11; -- literal, line 365 C := Eq_S_Backward (Z, "ாய்"); if C = 0 then goto lab51; end if; Z.C := Z.C - C; goto lab36; <<lab51>> Z.C := Z.L - v_11; -- literal, line 366 C := Eq_S_Backward (Z, "னென்"); if C = 0 then goto lab52; end if; Z.C := Z.C - C; goto lab36; <<lab52>> Z.C := Z.L - v_11; -- literal, line 367 C := Eq_S_Backward (Z, "னிர்"); if C = 0 then goto lab53; end if; Z.C := Z.C - C; goto lab36; <<lab53>> Z.C := Z.L - v_11; -- literal, line 368 C := Eq_S_Backward (Z, "ீர்"); if C = 0 then goto lab54; end if; Z.C := Z.C - C; goto lab36; <<lab54>> Z.C := Z.L - v_11; -- literal, line 369 C := Eq_S_Backward (Z, "ீயர்"); if C = 0 then goto lab35; end if; Z.C := Z.C - C; <<lab36>> Z.Bra := Z.C; -- ], line 370 -- <-, line 370 Slice_From (Z, "்"); -- set found_a_match, line 371 Z.B_Found_a_match := True; Z.C := Z.L - v_10; goto lab1; <<lab35>> Z.C := Z.L - v_2; -- test, line 374 v_14 := Z.L - Z.C; -- (, line 374 -- (, line 374 Z.Ket := Z.C; -- [, line 374 -- or, line 374 v_15 := Z.L - Z.C; -- literal, line 374 C := Eq_S_Backward (Z, "கு"); if C = 0 then goto lab56; end if; Z.C := Z.C - C; goto lab55; <<lab56>> Z.C := Z.L - v_15; -- literal, line 374 C := Eq_S_Backward (Z, "து"); if C = 0 then goto lab0; end if; Z.C := Z.C - C; <<lab55>> -- test, line 374 v_16 := Z.L - Z.C; -- literal, line 374 C := Eq_S_Backward (Z, "்"); if C = 0 then goto lab0; end if; Z.C := Z.C - C; Z.C := Z.L - v_16; Z.Bra := Z.C; -- ], line 374 -- delete, line 374 Slice_Del (Z); -- set found_a_match, line 375 Z.B_Found_a_match := True; Z.C := Z.L - v_14; <<lab1>> <<lab0>> Z.C := Z.L - v_1; -- do, line 378 v_17 := Z.L - Z.C; -- (, line 378 Z.Ket := Z.C; -- [, line 378 -- among, line 378 if Z.C - 8 <= Z.Lb or else (Character'Pos (Z.P (Z.C)) /= 141 and then Character'Pos (Z.P (Z.C)) /= 177) then goto lab57; -- among, line 378 end if; Find_Among_Backward (Z, A_25, Among_String, null, A); if A = 0 then goto lab57; end if; Z.Bra := Z.C; -- ], line 385 -- delete, line 385 Slice_Del (Z); -- set found_a_match, line 386 Z.B_Found_a_match := True; <<lab57>> Z.C := Z.L - v_17; Z.C := Z.Lb; -- do, line 389 -- call fix_endings, line 389 R_Fix_endings (Z, Result); Result := True; end R_Remove_tense_suffix; procedure Stem (Z : in out Context_Type; Result : out Boolean) is C : Result_Index; A : Integer; v_1 : Char_Index; v_2 : Char_Index; v_3 : Char_Index; v_4 : Char_Index; v_5 : Char_Index; v_6 : Char_Index; v_7 : Char_Index; v_8 : Char_Index; v_9 : Char_Index; v_10 : Char_Index; begin -- (, line 392 -- unset found_vetrumai_urupu, line 393 Z.B_Found_vetrumai_urupu := False; -- do, line 394 v_1 := Z.C; -- call fix_ending, line 394 R_Fix_ending (Z, Result); Z.C := v_1; -- call has_min_length, line 395 R_Has_min_length (Z, Result); if not Result then Result := False; return; end if; -- do, line 396 v_2 := Z.C; -- call remove_question_prefixes, line 396 R_Remove_question_prefixes (Z, Result); Z.C := v_2; -- do, line 397 v_3 := Z.C; -- call remove_pronoun_prefixes, line 397 R_Remove_pronoun_prefixes (Z, Result); Z.C := v_3; -- do, line 398 v_4 := Z.C; -- call remove_question_suffixes, line 398 R_Remove_question_suffixes (Z, Result); Z.C := v_4; -- do, line 399 v_5 := Z.C; -- call remove_um, line 399 R_Remove_um (Z, Result); Z.C := v_5; -- do, line 400 v_6 := Z.C; -- call remove_common_word_endings, line 400 R_Remove_common_word_endings (Z, Result); Z.C := v_6; -- do, line 401 v_7 := Z.C; -- call remove_vetrumai_urupukal, line 401 R_Remove_vetrumai_urupukal (Z, Result); Z.C := v_7; -- do, line 402 v_8 := Z.C; -- call remove_plural_suffix, line 402 R_Remove_plural_suffix (Z, Result); Z.C := v_8; -- do, line 403 v_9 := Z.C; -- call remove_command_suffixes, line 403 R_Remove_command_suffixes (Z, Result); Z.C := v_9; -- do, line 404 v_10 := Z.C; -- call remove_tense_suffixes, line 404 R_Remove_tense_suffixes (Z, Result); Z.C := v_10; Result := True; end Stem; end Stemmer.Tamil;
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_2_1699.asm
ljhsiun2/medusa
9
29781
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r15 push %r8 push %r9 push %rcx push %rdi push %rsi lea addresses_D_ht+0x19e64, %rsi lea addresses_D_ht+0xc024, %rdi nop nop nop nop dec %r14 mov $9, %rcx rep movsw nop nop nop nop cmp $59982, %r15 lea addresses_D_ht+0x16c06, %rdi nop and %r8, %r8 mov $0x6162636465666768, %rcx movq %rcx, %xmm6 movups %xmm6, (%rdi) nop nop nop dec %r15 lea addresses_WC_ht+0x70e4, %rdi nop nop xor $33022, %r9 movups (%rdi), %xmm7 vpextrq $1, %xmm7, %rcx nop nop nop nop dec %rcx lea addresses_UC_ht+0x12064, %r8 nop nop nop add $58503, %rcx movw $0x6162, (%r8) nop nop nop nop nop xor %r15, %r15 lea addresses_WC_ht+0x37a2, %r14 nop nop and $47781, %rdi movl $0x61626364, (%r14) nop nop nop nop nop dec %r15 pop %rsi pop %rdi pop %rcx pop %r9 pop %r8 pop %r15 pop %r14 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %rbx push %rcx push %rdi push %rdx // Load lea addresses_D+0x16160, %rdx nop nop nop nop nop and %r11, %r11 mov (%rdx), %ecx nop nop nop nop add %rdx, %rdx // Store mov $0x6c218d0000000e64, %rdx nop inc %r10 movb $0x51, (%rdx) nop nop nop nop sub %rdx, %rdx // Store lea addresses_normal+0xe97a, %r11 xor %rbx, %rbx movl $0x51525354, (%r11) nop nop nop nop add %r10, %r10 // Store lea addresses_UC+0x1bd78, %r14 nop nop cmp $23926, %rcx movw $0x5152, (%r14) nop nop nop nop and $21571, %r11 // Store lea addresses_WC+0x1524, %r10 nop nop sub $23981, %rdx movw $0x5152, (%r10) nop nop nop nop add %r11, %r11 // Store mov $0x2126d90000000b54, %r10 nop and %rbx, %rbx mov $0x5152535455565758, %rcx movq %rcx, %xmm0 vmovups %ymm0, (%r10) cmp $12638, %rcx // Store lea addresses_WC+0x1dab4, %r10 clflush (%r10) nop nop nop nop nop sub $56511, %rdx mov $0x5152535455565758, %rcx movq %rcx, %xmm5 movntdq %xmm5, (%r10) nop nop nop xor $47814, %rdx // Store lea addresses_A+0x1c864, %rdx nop nop nop nop nop and %r14, %r14 mov $0x5152535455565758, %rdi movq %rdi, %xmm0 movups %xmm0, (%rdx) cmp %rdi, %rdi // Faulty Load lea addresses_WT+0x12464, %r14 nop nop nop nop dec %rbx mov (%r14), %rdi lea oracles, %r11 and $0xff, %rdi shlq $12, %rdi mov (%r11,%rdi,1), %rdi pop %rdx pop %rdi pop %rcx pop %rbx pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 1, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 8, 'same': True, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'39': 2} 39 39 */
openfl-webm/0,0,4/project/libvpx-generic/vp8/common/arm/neon/bilinearpredict4x4_neon.asm
kudorado/HaxePlus
28
3840
<gh_stars>10-100 ; ; Copyright (c) 2010 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; EXPORT |vp8_bilinear_predict4x4_neon| ARM REQUIRE8 PRESERVE8 AREA ||.text||, CODE, READONLY, ALIGN=2 ; r0 unsigned char *src_ptr, ; r1 int src_pixels_per_line, ; r2 int xoffset, ; r3 int yoffset, ; r4 unsigned char *dst_ptr, ; stack(lr) int dst_pitch |vp8_bilinear_predict4x4_neon| PROC push {r4, lr} adr r12, bifilter4_coeff ldr r4, [sp, #8] ;load parameters from stack ldr lr, [sp, #12] ;load parameters from stack cmp r2, #0 ;skip first_pass filter if xoffset=0 beq skip_firstpass_filter ;First pass: output_height lines x output_width columns (5x4) vld1.u8 {d2}, [r0], r1 ;load src data add r2, r12, r2, lsl #3 ;calculate Hfilter location (2coeffsx4bytes=8bytes) vld1.u8 {d3}, [r0], r1 vld1.u32 {d31}, [r2] ;first_pass filter vld1.u8 {d4}, [r0], r1 vdup.8 d0, d31[0] ;first_pass filter (d0-d1) vld1.u8 {d5}, [r0], r1 vdup.8 d1, d31[4] vld1.u8 {d6}, [r0], r1 vshr.u64 q4, q1, #8 ;construct src_ptr[1] vshr.u64 q5, q2, #8 vshr.u64 d12, d6, #8 vzip.32 d2, d3 ;put 2-line data in 1 register (src_ptr[0]) vzip.32 d4, d5 vzip.32 d8, d9 ;put 2-line data in 1 register (src_ptr[1]) vzip.32 d10, d11 vmull.u8 q7, d2, d0 ;(src_ptr[0] * vp8_filter[0]) vmull.u8 q8, d4, d0 vmull.u8 q9, d6, d0 vmlal.u8 q7, d8, d1 ;(src_ptr[1] * vp8_filter[1]) vmlal.u8 q8, d10, d1 vmlal.u8 q9, d12, d1 vqrshrn.u16 d28, q7, #7 ;shift/round/saturate to u8 vqrshrn.u16 d29, q8, #7 vqrshrn.u16 d30, q9, #7 ;Second pass: 4x4 secondpass_filter cmp r3, #0 ;skip second_pass filter if yoffset=0 beq skip_secondpass_filter add r3, r12, r3, lsl #3 ;calculate Vfilter location vld1.u32 {d31}, [r3] ;load second_pass filter vdup.8 d0, d31[0] ;second_pass filter parameters (d0-d5) vdup.8 d1, d31[4] vmull.u8 q1, d28, d0 vmull.u8 q2, d29, d0 vext.8 d26, d28, d29, #4 ;construct src_ptr[pixel_step] vext.8 d27, d29, d30, #4 vmlal.u8 q1, d26, d1 vmlal.u8 q2, d27, d1 add r0, r4, lr add r1, r0, lr add r2, r1, lr vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8 vqrshrn.u16 d3, q2, #7 vst1.32 {d2[0]}, [r4] ;store result vst1.32 {d2[1]}, [r0] vst1.32 {d3[0]}, [r1] vst1.32 {d3[1]}, [r2] pop {r4, pc} ;-------------------- skip_firstpass_filter vld1.32 {d28[0]}, [r0], r1 ;load src data vld1.32 {d28[1]}, [r0], r1 vld1.32 {d29[0]}, [r0], r1 vld1.32 {d29[1]}, [r0], r1 vld1.32 {d30[0]}, [r0], r1 b secondpass_filter ;--------------------- skip_secondpass_filter vst1.32 {d28[0]}, [r4], lr ;store result vst1.32 {d28[1]}, [r4], lr vst1.32 {d29[0]}, [r4], lr vst1.32 {d29[1]}, [r4], lr pop {r4, pc} ENDP ;----------------- bifilter4_coeff DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112 END
programs/oeis/060/A060632.asm
karttu/loda
1
9666
; A060632: a(n) = 2^wt(floor(n/2)) (i.e., 2^A000120(floor(n/2)), or A001316(floor(n/2))). ; 1,1,2,2,2,2,4,4,2,2,4,4,4,4,8,8,2,2,4,4,4,4,8,8,4,4,8,8,8,8,16,16,2,2,4,4,4,4,8,8,4,4,8,8,8,8,16,16,4,4,8,8,8,8,16,16,8,8,16,16,16,16,32,32,2,2,4,4,4,4,8,8,4,4,8,8,8,8,16,16,4,4,8,8,8,8,16,16,8,8,16,16,16,16,32,32,4,4,8,8,8,8,16,16,8,8,16,16,16,16,32,32,8,8,16,16,16,16,32,32,16,16,32,32,32,32,64,64,2,2,4,4,4,4,8,8,4,4,8,8,8,8,16,16,4,4,8,8,8,8,16,16,8,8,16,16,16,16,32,32,4,4,8,8,8,8,16,16,8,8,16,16,16,16,32,32,8,8,16,16,16,16,32,32,16,16,32,32,32,32,64,64,4,4,8,8,8,8,16,16,8,8,16,16,16,16,32,32,8,8,16,16,16,16,32,32,16,16,32,32,32,32,64,64,8,8,16,16,16,16,32,32,16,16,32,32,32,32,64,64,16,16,32,32,32,32,64,64,32,32 div $0,2 cal $0,1316 ; Gould's sequence: a(n) = Sum_{k=0..n} (binomial(n,k) mod 2); number of odd entries in row n of Pascal's triangle (A007318); 2^A000120(n). mov $1,$0
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_1148.asm
ljhsiun2/medusa
9
177829
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %r8 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x7099, %rdx nop nop sub %r10, %r10 movl $0x61626364, (%rdx) nop nop nop nop inc %rsi lea addresses_WT_ht+0x11099, %rsi lea addresses_UC_ht+0x9271, %rdi nop nop inc %r10 mov $70, %rcx rep movsw nop nop nop nop nop xor %rdx, %rdx lea addresses_WT_ht+0x2499, %r15 nop nop sub $10457, %r8 mov $0x6162636465666768, %rcx movq %rcx, %xmm7 vmovups %ymm7, (%r15) and $7541, %rcx lea addresses_UC_ht+0x5099, %rsi lea addresses_D_ht+0x8499, %rdi nop nop dec %rbp mov $123, %rcx rep movsl nop mfence lea addresses_WC_ht+0x5ef9, %r10 nop dec %rbp mov (%r10), %r8w nop nop nop sub %r8, %r8 lea addresses_WC_ht+0x14099, %rdi clflush (%rdi) nop nop add $65452, %rcx movb (%rdi), %r15b nop nop nop nop inc %r8 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r8 pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %rax push %rbp push %rbx push %rcx push %rsi // Faulty Load lea addresses_RW+0x2099, %rbp nop nop nop nop inc %rax mov (%rbp), %si lea oracles, %rbx and $0xff, %rsi shlq $12, %rsi mov (%rbx,%rsi,1), %rsi pop %rsi pop %rcx pop %rbx pop %rbp pop %rax pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_RW', 'same': True, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 1, 'congruent': 11, 'NT': False, '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 */
Library/SpecUI/CommonUI/CGadget/copenRange.asm
steakknife/pcgeos
504
13038
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1989 -- All Rights Reserved PROJECT: PC GEOS MODULE: CommonUI/Open (gadgets) FILE: copenRange.asm ROUTINES: Name Description ---- ----------- GLB OLRangeClass Open look numeric range gadget REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 12/89 Initial version DESCRIPTION: $Id: copenRange.asm,v 1.1 97/04/07 10:54:15 newdeal Exp $ ------------------------------------------------------------------------------@ Nuked. 7/ 7/92 cbh
programs/oeis/049/A049777.asm
karttu/loda
0
94273
<gh_stars>0 ; A049777: Triangular array read by rows: T(m,n) = n + n+1 + ... + m = (m+n)(m-n+1)/2. ; 1,3,2,6,5,3,10,9,7,4,15,14,12,9,5,21,20,18,15,11,6,28,27,25,22,18,13,7,36,35,33,30,26,21,15,8,45,44,42,39,35,30,24,17,9,55,54,52,49,45,40,34,27,19,10,66,65,63,60,56,51,45,38,30,21,11,78,77,75,72,68,63,57,50,42,33,23,12,91,90,88,85,81,76,70,63,55,46,36,25,13,105,104,102,99,95,90,84,77,69,60,50,39,27,14,120,119,117,114,110,105,99,92,84,75,65,54,42,29,15,136,135,133,130,126,121,115,108,100,91,81,70,58,45,31,16,153,152,150,147,143,138,132,125,117,108,98,87,75,62,48,33,17,171,170,168,165,161,156,150,143,135,126,116,105,93,80,66,51,35,18,190,189,187,184,180,175,169,162,154,145,135,124,112,99,85,70,54,37,19,210,209,207,204,200,195,189,182,174,165,155,144,132,119,105,90,74,57,39,20,231,230,228,225,221,216,210,203,195,186,176,165,153,140,126,111,95,78,60,41,21,253,252,250,247,243,238,232,225,217,208,198,187,175,162,148,133,117,100,82 add $0,1 mov $1,1 lpb $0,1 sub $0,$1 lpb $0,1 add $0,1 add $2,$1 sub $1,1 lpe add $1,$2 add $1,1 lpe sub $1,1
gdb/testsuite/gdb.ada/unchecked_union/unchecked_union.adb
greyblue9/binutils-gdb
1
4359
<filename>gdb/testsuite/gdb.ada/unchecked_union/unchecked_union.adb -- Copyright 2019-2021 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with System; with Pck; use Pck; procedure Foo is type Key is (Alpha, Omega); type Inner(Disc : Key := Omega) is record case Disc is when Alpha => Small : Integer range 0..255; when others => Large : Integer range 255..510; end case; end record; pragma Unchecked_Union (Inner); type Outer(Disc : Key := Alpha) is record case Disc is when Alpha => Field_One : Integer range 0..255; when others => Field_Two : Integer range 255..510; end case; end record; pragma Unchecked_Union (Outer); type Pair is record Pone : Inner; Ptwo : Outer; end record; Value : Pair; begin Do_Nothing (Value'Address); -- BREAK end Foo;
bb-runtimes/runtimes/ravenscar-sfp-stm32g474/gnarl/s-tposen.adb
JCGobbi/Nucleo-STM32G474RE
0
18249
<filename>bb-runtimes/runtimes/ravenscar-sfp-stm32g474/gnarl/s-tposen.adb ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- -- S I N G L E _ E N T R Y -- -- -- -- B o d y -- -- -- -- Copyright (C) 1998-2021, AdaCore -- -- -- -- GNARL 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. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); -- Turn off subprogram ordering check, since restricted GNARLI -- subprograms are gathered together at end. -- This package provides an optimized version of Protected_Objects.Operations -- and Protected_Objects.Entries making the following assumptions: -- -- PO have only one entry -- There is only one caller at a time (No_Entry_Queue) -- There is no dynamic priority support (No_Dynamic_Priorities) -- No Abort Statements -- (No_Abort_Statements, Max_Asynchronous_Select_Nesting => 0) -- PO are at library level -- No Requeue -- None of the tasks will terminate (no need for finalization) -- -- This interface is intended to be used in the ravenscar and restricted -- profiles, the compiler is responsible for ensuring that the conditions -- mentioned above are respected, except for the No_Entry_Queue restriction -- that is checked dynamically in this package, since the check cannot be -- performed at compile time (see Protected_Single_Entry_Call, Service_Entry). pragma Suppress (All_Checks); with System.Multiprocessors; with System.Task_Primitives.Operations; -- used for Self -- Get_Priority -- Set_Priority with System.Tasking.Protected_Objects.Multiprocessors; package body System.Tasking.Protected_Objects.Single_Entry is use System.Multiprocessors; package STPO renames System.Task_Primitives.Operations; package STPOM renames System.Tasking.Protected_Objects.Multiprocessors; Multiprocessor : constant Boolean := CPU'Range_Length /= 1; --------------------------------- -- Initialize_Protection_Entry -- --------------------------------- procedure Initialize_Protection_Entry (Object : Protection_Entry_Access; Ceiling_Priority : Integer; Compiler_Info : System.Address; Entry_Body : Entry_Body_Access) is begin Initialize_Protection (Object.Common'Access, Ceiling_Priority); Object.Compiler_Info := Compiler_Info; Object.Call_In_Progress := null; Object.Entry_Body := Entry_Body; Object.Entry_Queue := null; end Initialize_Protection_Entry; ---------------- -- Lock_Entry -- ---------------- procedure Lock_Entry (Object : Protection_Entry_Access) is begin Lock (Object.Common'Access); end Lock_Entry; --------------------------- -- Protected_Count_Entry -- --------------------------- function Protected_Count_Entry (Object : Protection_Entry) return Natural is begin return Boolean'Pos (Object.Entry_Queue /= null); end Protected_Count_Entry; --------------------------------- -- Protected_Single_Entry_Call -- --------------------------------- procedure Protected_Single_Entry_Call (Object : Protection_Entry_Access; Uninterpreted_Data : System.Address) is Self_Id : constant Task_Id := STPO.Self; begin -- For this run time, pragma Detect_Blocking is always active, so we -- must raise Program_Error if this potentially blocking operation is -- called from a protected action. if Self_Id.Common.Protected_Action_Nesting > 0 then raise Program_Error; end if; Lock_Entry (Object); Self_Id.Entry_Call.Uninterpreted_Data := Uninterpreted_Data; if Object.Entry_Body.Barrier (Object.Compiler_Info, 1) then -- No other task can be executing an entry within this protected -- object. On a single processor implementation (such as this one), -- the ceiling priority protocol and the strictly preemptive priority -- scheduling policy guarantee that protected objects are always -- available when any task tries to use them (otherwise, either the -- currently executing task would not have had a high enough priority -- to be executing, or a blocking operation would have been called -- from within the entry body). pragma Assert (Object.Call_In_Progress = null); Object.Call_In_Progress := Self_Id.Entry_Call'Access; Object.Entry_Body.Action (Object.Compiler_Info, Self_Id.Entry_Call.Uninterpreted_Data, 1); Object.Call_In_Progress := null; -- Entry call is over Unlock_Entry (Object); else if Object.Entry_Queue /= null then -- This violates the No_Entry_Queue restriction, raise -- Program_Error. Unlock_Entry (Object); raise Program_Error; end if; -- There is a potential race condition between the Unlock_Entry and -- the Sleep below (the Wakeup may be called before the Sleep). This -- case is explicitly handled in the Sleep and Wakeup procedures: -- Sleep won't block if Wakeup has been called before. Object.Entry_Queue := Self_Id.Entry_Call'Access; Unlock_Entry (Object); -- Suspend until entry call has been completed. -- On exit, the call will not be queued. Self_Id.Common.State := Entry_Caller_Sleep; STPO.Sleep (Self_Id, Entry_Caller_Sleep); Self_Id.Common.State := Runnable; end if; end Protected_Single_Entry_Call; ----------------------------------- -- Protected_Single_Entry_Caller -- ----------------------------------- function Protected_Single_Entry_Caller (Object : Protection_Entry) return Task_Id is begin return Object.Call_In_Progress.Self; end Protected_Single_Entry_Caller; ------------------- -- Service_Entry -- ------------------- procedure Service_Entry (Object : Protection_Entry_Access) is Entry_Call : constant Entry_Call_Link := Object.Entry_Queue; Caller : Task_Id; begin if Entry_Call /= null and then Object.Entry_Body.Barrier (Object.Compiler_Info, 1) then Object.Entry_Queue := null; -- No other task can be executing an entry within this protected -- object. On a single processor implementation (such as this one), -- the ceiling priority protocol and the strictly preemptive -- priority scheduling policy guarantee that protected objects are -- always available when any task tries to use them (otherwise, -- either the currently executing task would not have had a high -- enough priority to be executing, or a blocking operation would -- have been called from within the entry body). pragma Assert (Object.Call_In_Progress = null); Object.Call_In_Progress := Entry_Call; Object.Entry_Body.Action (Object.Compiler_Info, Entry_Call.Uninterpreted_Data, 1); Object.Call_In_Progress := null; Caller := Entry_Call.Self; Unlock_Entry (Object); -- Signal the entry caller that the entry is completed if not Multiprocessor or else Caller.Common.Base_CPU = STPO.Self.Common.Base_CPU then -- Entry caller and servicing tasks are on the same CPU. -- We are allowed to directly wake up the task. STPO.Wakeup (Caller, Entry_Caller_Sleep); else -- The entry caller is on a different CPU. STPOM.Served (Entry_Call); end if; else -- Just unlock the entry Unlock_Entry (Object); end if; end Service_Entry; ------------------ -- Unlock_Entry -- ------------------ procedure Unlock_Entry (Object : Protection_Entry_Access) is begin Unlock (Object.Common'Access); end Unlock_Entry; end System.Tasking.Protected_Objects.Single_Entry;
programs/oeis/050/A050483.asm
neoneye/loda
22
165744
<gh_stars>10-100 ; A050483: Partial sums of A051947. ; 1,11,60,228,690,1782,4092,8580,16731,30745,53768,90168,145860,228684,348840,519384,756789,1081575,1519012,2099900,2861430,3848130,5112900,6718140,8736975,11254581,14369616,18195760,22863368,28521240,35338512 add $0,1 mov $1,$0 seq $1,50404 ; Partial sums of A051878. mul $1,2 mul $0,$1 sub $0,28 div $0,28 add $0,1
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_4545_1090.asm
ljhsiun2/medusa
9
174257
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r8 push %rbx push %rdx lea addresses_UC_ht+0x17980, %rdx nop nop nop sub $49817, %r8 movw $0x6162, (%rdx) nop nop nop nop nop cmp %r10, %r10 pop %rdx pop %rbx pop %r8 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r15 push %r9 push %rax push %rcx push %rdi // Load lea addresses_US+0x17624, %rax and %rdi, %rdi movb (%rax), %r9b cmp $16829, %r15 // Faulty Load lea addresses_WT+0x7b00, %r15 nop nop nop nop inc %r10 mov (%r15), %r9 lea oracles, %rdi and $0xff, %r9 shlq $12, %r9 mov (%rdi,%r9,1), %r9 pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'00': 4545} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
oscomp/build/asm/umount.asm
wei-huan/MyOS
2
14940
<filename>oscomp/build/asm/umount.asm<gh_stars>1-10 /home/weihuan/Documents/testsuits-for-oskernel-preliminary/riscv-syscalls-testing/user/build/riscv64/umount: file format elf64-littleriscv Disassembly of section .text: 0000000000001000 <_start>: .section .text.entry .globl _start _start: mv a0, sp 1000: 850a mv a0,sp tail __start_main 1002: aa21 j 111a <__start_main> 0000000000001004 <test_umount>: static char mntpoint[64] = "./mnt"; static char device[64] = "/dev/vda2"; static const char *fs_type = "vfat"; void test_umount() { 1004: 1101 addi sp,sp,-32 TEST_START(__func__); 1006: 00001517 auipc a0,0x1 100a: f5250513 addi a0,a0,-174 # 1f58 <__clone+0x2c> void test_umount() { 100e: ec06 sd ra,24(sp) 1010: e822 sd s0,16(sp) TEST_START(__func__); 1012: 37a000ef jal ra,138c <puts> 1016: 00001517 auipc a0,0x1 101a: 09250513 addi a0,a0,146 # 20a8 <__func__.0> 101e: 36e000ef jal ra,138c <puts> 1022: 00001517 auipc a0,0x1 1026: f4e50513 addi a0,a0,-178 # 1f70 <__clone+0x44> 102a: 362000ef jal ra,138c <puts> printf("Mounting dev:%s to %s\n", device, mntpoint); 102e: 00001617 auipc a2,0x1 1032: ffa60613 addi a2,a2,-6 # 2028 <mntpoint> 1036: 00001597 auipc a1,0x1 103a: 03258593 addi a1,a1,50 # 2068 <device> 103e: 00001517 auipc a0,0x1 1042: f4250513 addi a0,a0,-190 # 1f80 <__clone+0x54> 1046: 368000ef jal ra,13ae <printf> int ret = mount(device, mntpoint, fs_type, 0, NULL); 104a: 00001597 auipc a1,0x1 104e: fde58593 addi a1,a1,-34 # 2028 <mntpoint> 1052: 4701 li a4,0 1054: 4681 li a3,0 1056: 00001617 auipc a2,0x1 105a: f4260613 addi a2,a2,-190 # 1f98 <__clone+0x6c> 105e: 00001517 auipc a0,0x1 1062: 00a50513 addi a0,a0,10 # 2068 <device> 1066: 6ad000ef jal ra,1f12 <mount> 106a: 842a mv s0,a0 printf("mount return: %d\n", ret); 106c: 85aa mv a1,a0 106e: 00001517 auipc a0,0x1 1072: f3250513 addi a0,a0,-206 # 1fa0 <__clone+0x74> 1076: 338000ef jal ra,13ae <printf> if (ret == 0) { 107a: c40d beqz s0,10a4 <test_umount+0xa0> ret = umount(mntpoint); assert(ret == 0); printf("umount success.\nreturn: %d\n", ret); } TEST_END(__func__); 107c: 00001517 auipc a0,0x1 1080: f7c50513 addi a0,a0,-132 # 1ff8 <__clone+0xcc> 1084: 308000ef jal ra,138c <puts> 1088: 00001517 auipc a0,0x1 108c: 02050513 addi a0,a0,32 # 20a8 <__func__.0> 1090: 2fc000ef jal ra,138c <puts> } 1094: 6442 ld s0,16(sp) 1096: 60e2 ld ra,24(sp) TEST_END(__func__); 1098: 00001517 auipc a0,0x1 109c: ed850513 addi a0,a0,-296 # 1f70 <__clone+0x44> } 10a0: 6105 addi sp,sp,32 TEST_END(__func__); 10a2: a4ed j 138c <puts> ret = umount(mntpoint); 10a4: 00001517 auipc a0,0x1 10a8: f8450513 addi a0,a0,-124 # 2028 <mntpoint> 10ac: 673000ef jal ra,1f1e <umount> 10b0: 85aa mv a1,a0 assert(ret == 0); 10b2: e901 bnez a0,10c2 <test_umount+0xbe> printf("umount success.\nreturn: %d\n", ret); 10b4: 00001517 auipc a0,0x1 10b8: f2450513 addi a0,a0,-220 # 1fd8 <__clone+0xac> 10bc: 2f2000ef jal ra,13ae <printf> 10c0: bf75 j 107c <test_umount+0x78> 10c2: e42a sd a0,8(sp) assert(ret == 0); 10c4: 00001517 auipc a0,0x1 10c8: ef450513 addi a0,a0,-268 # 1fb8 <__clone+0x8c> 10cc: 566000ef jal ra,1632 <panic> 10d0: 65a2 ld a1,8(sp) 10d2: b7cd j 10b4 <test_umount+0xb0> 00000000000010d4 <main>: int main(int argc,char *argv[]) { 10d4: 1101 addi sp,sp,-32 10d6: ec06 sd ra,24(sp) 10d8: e822 sd s0,16(sp) 10da: e426 sd s1,8(sp) if(argc >= 2){ 10dc: 4785 li a5,1 10de: 00a7ca63 blt a5,a0,10f2 <main+0x1e> if(argc >= 3){ strcpy(mntpoint, argv[2]); } test_umount(); 10e2: f23ff0ef jal ra,1004 <test_umount> return 0; } 10e6: 60e2 ld ra,24(sp) 10e8: 6442 ld s0,16(sp) 10ea: 64a2 ld s1,8(sp) 10ec: 4501 li a0,0 10ee: 6105 addi sp,sp,32 10f0: 8082 ret strcpy(device, argv[1]); 10f2: 84ae mv s1,a1 10f4: 658c ld a1,8(a1) 10f6: 842a mv s0,a0 10f8: 00001517 auipc a0,0x1 10fc: f7050513 addi a0,a0,-144 # 2068 <device> 1100: 12b000ef jal ra,1a2a <strcpy> if(argc >= 3){ 1104: 4789 li a5,2 1106: fcf40ee3 beq s0,a5,10e2 <main+0xe> strcpy(mntpoint, argv[2]); 110a: 688c ld a1,16(s1) 110c: 00001517 auipc a0,0x1 1110: f1c50513 addi a0,a0,-228 # 2028 <mntpoint> 1114: 117000ef jal ra,1a2a <strcpy> 1118: b7e9 j 10e2 <main+0xe> 000000000000111a <__start_main>: #include <unistd.h> extern int main(); int __start_main(long *p) { 111a: 85aa mv a1,a0 int argc = p[0]; char **argv = (void *)(p+1); exit(main(argc, argv)); 111c: 4108 lw a0,0(a0) { 111e: 1141 addi sp,sp,-16 exit(main(argc, argv)); 1120: 05a1 addi a1,a1,8 { 1122: e406 sd ra,8(sp) exit(main(argc, argv)); 1124: fb1ff0ef jal ra,10d4 <main> 1128: 41d000ef jal ra,1d44 <exit> return 0; } 112c: 60a2 ld ra,8(sp) 112e: 4501 li a0,0 1130: 0141 addi sp,sp,16 1132: 8082 ret 0000000000001134 <printint.constprop.0>: write(f, s, l); } static char digits[] = "0123456789abcdef"; static void printint(int xx, int base, int sign) 1134: 7179 addi sp,sp,-48 1136: f406 sd ra,40(sp) { char buf[16 + 1]; int i; uint x; if (sign && (sign = xx < 0)) 1138: 12054b63 bltz a0,126e <printint.constprop.0+0x13a> buf[16] = 0; i = 15; do { buf[i--] = digits[x % base]; 113c: 02b577bb remuw a5,a0,a1 1140: 00001617 auipc a2,0x1 1144: f7860613 addi a2,a2,-136 # 20b8 <digits> buf[16] = 0; 1148: 00010c23 sb zero,24(sp) buf[i--] = digits[x % base]; 114c: 0005871b sext.w a4,a1 1150: 1782 slli a5,a5,0x20 1152: 9381 srli a5,a5,0x20 1154: 97b2 add a5,a5,a2 1156: 0007c783 lbu a5,0(a5) } while ((x /= base) != 0); 115a: 02b5583b divuw a6,a0,a1 buf[i--] = digits[x % base]; 115e: 00f10ba3 sb a5,23(sp) } while ((x /= base) != 0); 1162: 1cb56363 bltu a0,a1,1328 <printint.constprop.0+0x1f4> buf[i--] = digits[x % base]; 1166: 45b9 li a1,14 1168: 02e877bb remuw a5,a6,a4 116c: 1782 slli a5,a5,0x20 116e: 9381 srli a5,a5,0x20 1170: 97b2 add a5,a5,a2 1172: 0007c783 lbu a5,0(a5) } while ((x /= base) != 0); 1176: 02e856bb divuw a3,a6,a4 buf[i--] = digits[x % base]; 117a: 00f10b23 sb a5,22(sp) } while ((x /= base) != 0); 117e: 0ce86e63 bltu a6,a4,125a <printint.constprop.0+0x126> buf[i--] = digits[x % base]; 1182: 02e6f5bb remuw a1,a3,a4 } while ((x /= base) != 0); 1186: 02e6d7bb divuw a5,a3,a4 buf[i--] = digits[x % base]; 118a: 1582 slli a1,a1,0x20 118c: 9181 srli a1,a1,0x20 118e: 95b2 add a1,a1,a2 1190: 0005c583 lbu a1,0(a1) 1194: 00b10aa3 sb a1,21(sp) } while ((x /= base) != 0); 1198: 0007859b sext.w a1,a5 119c: 12e6ec63 bltu a3,a4,12d4 <printint.constprop.0+0x1a0> buf[i--] = digits[x % base]; 11a0: 02e7f6bb remuw a3,a5,a4 11a4: 1682 slli a3,a3,0x20 11a6: 9281 srli a3,a3,0x20 11a8: 96b2 add a3,a3,a2 11aa: 0006c683 lbu a3,0(a3) } while ((x /= base) != 0); 11ae: 02e7d83b divuw a6,a5,a4 buf[i--] = digits[x % base]; 11b2: 00d10a23 sb a3,20(sp) } while ((x /= base) != 0); 11b6: 12e5e863 bltu a1,a4,12e6 <printint.constprop.0+0x1b2> buf[i--] = digits[x % base]; 11ba: 02e876bb remuw a3,a6,a4 11be: 1682 slli a3,a3,0x20 11c0: 9281 srli a3,a3,0x20 11c2: 96b2 add a3,a3,a2 11c4: 0006c683 lbu a3,0(a3) } while ((x /= base) != 0); 11c8: 02e855bb divuw a1,a6,a4 buf[i--] = digits[x % base]; 11cc: 00d109a3 sb a3,19(sp) } while ((x /= base) != 0); 11d0: 12e86463 bltu a6,a4,12f8 <printint.constprop.0+0x1c4> buf[i--] = digits[x % base]; 11d4: 02e5f6bb remuw a3,a1,a4 11d8: 1682 slli a3,a3,0x20 11da: 9281 srli a3,a3,0x20 11dc: 96b2 add a3,a3,a2 11de: 0006c683 lbu a3,0(a3) } while ((x /= base) != 0); 11e2: 02e5d83b divuw a6,a1,a4 buf[i--] = digits[x % base]; 11e6: 00d10923 sb a3,18(sp) } while ((x /= base) != 0); 11ea: 0ce5ec63 bltu a1,a4,12c2 <printint.constprop.0+0x18e> buf[i--] = digits[x % base]; 11ee: 02e876bb remuw a3,a6,a4 11f2: 1682 slli a3,a3,0x20 11f4: 9281 srli a3,a3,0x20 11f6: 96b2 add a3,a3,a2 11f8: 0006c683 lbu a3,0(a3) } while ((x /= base) != 0); 11fc: 02e855bb divuw a1,a6,a4 buf[i--] = digits[x % base]; 1200: 00d108a3 sb a3,17(sp) } while ((x /= base) != 0); 1204: 10e86963 bltu a6,a4,1316 <printint.constprop.0+0x1e2> buf[i--] = digits[x % base]; 1208: 02e5f6bb remuw a3,a1,a4 120c: 1682 slli a3,a3,0x20 120e: 9281 srli a3,a3,0x20 1210: 96b2 add a3,a3,a2 1212: 0006c683 lbu a3,0(a3) } while ((x /= base) != 0); 1216: 02e5d83b divuw a6,a1,a4 buf[i--] = digits[x % base]; 121a: 00d10823 sb a3,16(sp) } while ((x /= base) != 0); 121e: 10e5e763 bltu a1,a4,132c <printint.constprop.0+0x1f8> buf[i--] = digits[x % base]; 1222: 02e876bb remuw a3,a6,a4 1226: 1682 slli a3,a3,0x20 1228: 9281 srli a3,a3,0x20 122a: 96b2 add a3,a3,a2 122c: 0006c683 lbu a3,0(a3) } while ((x /= base) != 0); 1230: 02e857bb divuw a5,a6,a4 buf[i--] = digits[x % base]; 1234: 00d107a3 sb a3,15(sp) } while ((x /= base) != 0); 1238: 10e86363 bltu a6,a4,133e <printint.constprop.0+0x20a> buf[i--] = digits[x % base]; 123c: 1782 slli a5,a5,0x20 123e: 9381 srli a5,a5,0x20 1240: 97b2 add a5,a5,a2 1242: 0007c783 lbu a5,0(a5) 1246: 4599 li a1,6 1248: 00f10723 sb a5,14(sp) if (sign) 124c: 00055763 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 1250: 02d00793 li a5,45 1254: 00f106a3 sb a5,13(sp) buf[i--] = digits[x % base]; 1258: 4595 li a1,5 write(f, s, l); 125a: 003c addi a5,sp,8 125c: 4641 li a2,16 125e: 9e0d subw a2,a2,a1 1260: 4505 li a0,1 1262: 95be add a1,a1,a5 1264: 291000ef jal ra,1cf4 <write> i++; if (i < 0) puts("printint error"); out(stdout, buf + i, 16 - i); } 1268: 70a2 ld ra,40(sp) 126a: 6145 addi sp,sp,48 126c: 8082 ret x = -xx; 126e: 40a0083b negw a6,a0 buf[i--] = digits[x % base]; 1272: 02b877bb remuw a5,a6,a1 1276: 00001617 auipc a2,0x1 127a: e4260613 addi a2,a2,-446 # 20b8 <digits> buf[16] = 0; 127e: 00010c23 sb zero,24(sp) buf[i--] = digits[x % base]; 1282: 0005871b sext.w a4,a1 1286: 1782 slli a5,a5,0x20 1288: 9381 srli a5,a5,0x20 128a: 97b2 add a5,a5,a2 128c: 0007c783 lbu a5,0(a5) } while ((x /= base) != 0); 1290: 02b858bb divuw a7,a6,a1 buf[i--] = digits[x % base]; 1294: 00f10ba3 sb a5,23(sp) } while ((x /= base) != 0); 1298: 06b86963 bltu a6,a1,130a <printint.constprop.0+0x1d6> buf[i--] = digits[x % base]; 129c: 02e8f7bb remuw a5,a7,a4 12a0: 1782 slli a5,a5,0x20 12a2: 9381 srli a5,a5,0x20 12a4: 97b2 add a5,a5,a2 12a6: 0007c783 lbu a5,0(a5) } while ((x /= base) != 0); 12aa: 02e8d6bb divuw a3,a7,a4 buf[i--] = digits[x % base]; 12ae: 00f10b23 sb a5,22(sp) } while ((x /= base) != 0); 12b2: ece8f8e3 bgeu a7,a4,1182 <printint.constprop.0+0x4e> buf[i--] = '-'; 12b6: 02d00793 li a5,45 12ba: 00f10aa3 sb a5,21(sp) buf[i--] = digits[x % base]; 12be: 45b5 li a1,13 12c0: bf69 j 125a <printint.constprop.0+0x126> 12c2: 45a9 li a1,10 if (sign) 12c4: f8055be3 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 12c8: 02d00793 li a5,45 12cc: 00f108a3 sb a5,17(sp) buf[i--] = digits[x % base]; 12d0: 45a5 li a1,9 12d2: b761 j 125a <printint.constprop.0+0x126> 12d4: 45b5 li a1,13 if (sign) 12d6: f80552e3 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 12da: 02d00793 li a5,45 12de: 00f10a23 sb a5,20(sp) buf[i--] = digits[x % base]; 12e2: 45b1 li a1,12 12e4: bf9d j 125a <printint.constprop.0+0x126> 12e6: 45b1 li a1,12 if (sign) 12e8: f60559e3 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 12ec: 02d00793 li a5,45 12f0: 00f109a3 sb a5,19(sp) buf[i--] = digits[x % base]; 12f4: 45ad li a1,11 12f6: b795 j 125a <printint.constprop.0+0x126> 12f8: 45ad li a1,11 if (sign) 12fa: f60550e3 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 12fe: 02d00793 li a5,45 1302: 00f10923 sb a5,18(sp) buf[i--] = digits[x % base]; 1306: 45a9 li a1,10 1308: bf89 j 125a <printint.constprop.0+0x126> buf[i--] = '-'; 130a: 02d00793 li a5,45 130e: 00f10b23 sb a5,22(sp) buf[i--] = digits[x % base]; 1312: 45b9 li a1,14 1314: b799 j 125a <printint.constprop.0+0x126> 1316: 45a5 li a1,9 if (sign) 1318: f40551e3 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 131c: 02d00793 li a5,45 1320: 00f10823 sb a5,16(sp) buf[i--] = digits[x % base]; 1324: 45a1 li a1,8 1326: bf15 j 125a <printint.constprop.0+0x126> i = 15; 1328: 45bd li a1,15 132a: bf05 j 125a <printint.constprop.0+0x126> buf[i--] = digits[x % base]; 132c: 45a1 li a1,8 if (sign) 132e: f20556e3 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 1332: 02d00793 li a5,45 1336: 00f107a3 sb a5,15(sp) buf[i--] = digits[x % base]; 133a: 459d li a1,7 133c: bf39 j 125a <printint.constprop.0+0x126> 133e: 459d li a1,7 if (sign) 1340: f0055de3 bgez a0,125a <printint.constprop.0+0x126> buf[i--] = '-'; 1344: 02d00793 li a5,45 1348: 00f10723 sb a5,14(sp) buf[i--] = digits[x % base]; 134c: 4599 li a1,6 134e: b731 j 125a <printint.constprop.0+0x126> 0000000000001350 <getchar>: { 1350: 1101 addi sp,sp,-32 read(stdin, &byte, 1); 1352: 00f10593 addi a1,sp,15 1356: 4605 li a2,1 1358: 4501 li a0,0 { 135a: ec06 sd ra,24(sp) char byte = 0; 135c: 000107a3 sb zero,15(sp) read(stdin, &byte, 1); 1360: 18b000ef jal ra,1cea <read> } 1364: 60e2 ld ra,24(sp) 1366: 00f14503 lbu a0,15(sp) 136a: 6105 addi sp,sp,32 136c: 8082 ret 000000000000136e <putchar>: { 136e: 1101 addi sp,sp,-32 1370: 87aa mv a5,a0 return write(stdout, &byte, 1); 1372: 00f10593 addi a1,sp,15 1376: 4605 li a2,1 1378: 4505 li a0,1 { 137a: ec06 sd ra,24(sp) char byte = c; 137c: 00f107a3 sb a5,15(sp) return write(stdout, &byte, 1); 1380: 175000ef jal ra,1cf4 <write> } 1384: 60e2 ld ra,24(sp) 1386: 2501 sext.w a0,a0 1388: 6105 addi sp,sp,32 138a: 8082 ret 000000000000138c <puts>: { 138c: 1141 addi sp,sp,-16 138e: e406 sd ra,8(sp) 1390: e022 sd s0,0(sp) 1392: 842a mv s0,a0 r = -(write(stdout, s, strlen(s)) < 0); 1394: 57c000ef jal ra,1910 <strlen> 1398: 862a mv a2,a0 139a: 85a2 mv a1,s0 139c: 4505 li a0,1 139e: 157000ef jal ra,1cf4 <write> } 13a2: 60a2 ld ra,8(sp) 13a4: 6402 ld s0,0(sp) r = -(write(stdout, s, strlen(s)) < 0); 13a6: 957d srai a0,a0,0x3f return r; 13a8: 2501 sext.w a0,a0 } 13aa: 0141 addi sp,sp,16 13ac: 8082 ret 00000000000013ae <printf>: out(stdout, buf, i); } // Print to the console. only understands %d, %x, %p, %s. void printf(const char *fmt, ...) { 13ae: 7171 addi sp,sp,-176 13b0: fc56 sd s5,56(sp) 13b2: ed3e sd a5,152(sp) buf[i++] = '0'; 13b4: 7ae1 lui s5,0xffff8 va_list ap; int cnt = 0, l = 0; char *a, *z, *s = (char *)fmt, str; int f = stdout; va_start(ap, fmt); 13b6: 18bc addi a5,sp,120 { 13b8: e8ca sd s2,80(sp) 13ba: e4ce sd s3,72(sp) 13bc: e0d2 sd s4,64(sp) 13be: f85a sd s6,48(sp) 13c0: f486 sd ra,104(sp) 13c2: f0a2 sd s0,96(sp) 13c4: eca6 sd s1,88(sp) 13c6: fcae sd a1,120(sp) 13c8: e132 sd a2,128(sp) 13ca: e536 sd a3,136(sp) 13cc: e93a sd a4,144(sp) 13ce: f142 sd a6,160(sp) 13d0: f546 sd a7,168(sp) va_start(ap, fmt); 13d2: e03e sd a5,0(sp) for (;;) { if (!*s) break; for (a = s; *s && *s != '%'; s++) 13d4: 02500913 li s2,37 out(f, a, l); if (l) continue; if (s[1] == 0) break; switch (s[1]) 13d8: 07300a13 li s4,115 case 'p': printptr(va_arg(ap, uint64)); break; case 's': if ((a = va_arg(ap, char *)) == 0) a = "(null)"; 13dc: 00001b17 auipc s6,0x1 13e0: c2cb0b13 addi s6,s6,-980 # 2008 <__clone+0xdc> buf[i++] = '0'; 13e4: 830aca93 xori s5,s5,-2000 buf[i++] = digits[x >> (sizeof(uint64) * 8 - 4)]; 13e8: 00001997 auipc s3,0x1 13ec: cd098993 addi s3,s3,-816 # 20b8 <digits> if (!*s) 13f0: 00054783 lbu a5,0(a0) 13f4: 16078a63 beqz a5,1568 <printf+0x1ba> 13f8: 862a mv a2,a0 for (a = s; *s && *s != '%'; s++) 13fa: 19278163 beq a5,s2,157c <printf+0x1ce> 13fe: 00164783 lbu a5,1(a2) 1402: 0605 addi a2,a2,1 1404: fbfd bnez a5,13fa <printf+0x4c> 1406: 84b2 mv s1,a2 l = z - a; 1408: 40a6043b subw s0,a2,a0 write(f, s, l); 140c: 85aa mv a1,a0 140e: 8622 mv a2,s0 1410: 4505 li a0,1 1412: 0e3000ef jal ra,1cf4 <write> if (l) 1416: 18041c63 bnez s0,15ae <printf+0x200> if (s[1] == 0) 141a: 0014c783 lbu a5,1(s1) 141e: 14078563 beqz a5,1568 <printf+0x1ba> switch (s[1]) 1422: 1d478063 beq a5,s4,15e2 <printf+0x234> 1426: 18fa6663 bltu s4,a5,15b2 <printf+0x204> 142a: 06400713 li a4,100 142e: 1ae78063 beq a5,a4,15ce <printf+0x220> 1432: 07000713 li a4,112 1436: 1ce79963 bne a5,a4,1608 <printf+0x25a> printptr(va_arg(ap, uint64)); 143a: 6702 ld a4,0(sp) buf[i++] = '0'; 143c: 01511423 sh s5,8(sp) write(f, s, l); 1440: 4649 li a2,18 printptr(va_arg(ap, uint64)); 1442: 631c ld a5,0(a4) 1444: 0721 addi a4,a4,8 1446: e03a sd a4,0(sp) for (j = 0; j < (sizeof(uint64) * 2); j++, x <<= 4) 1448: 00479293 slli t0,a5,0x4 144c: 00879f93 slli t6,a5,0x8 1450: 00c79f13 slli t5,a5,0xc 1454: 01079e93 slli t4,a5,0x10 1458: 01479e13 slli t3,a5,0x14 145c: 01879313 slli t1,a5,0x18 1460: 01c79893 slli a7,a5,0x1c 1464: 02479813 slli a6,a5,0x24 1468: 02879513 slli a0,a5,0x28 146c: 02c79593 slli a1,a5,0x2c 1470: 03079693 slli a3,a5,0x30 1474: 03479713 slli a4,a5,0x34 buf[i++] = digits[x >> (sizeof(uint64) * 8 - 4)]; 1478: 03c7d413 srli s0,a5,0x3c 147c: 01c7d39b srliw t2,a5,0x1c 1480: 03c2d293 srli t0,t0,0x3c 1484: 03cfdf93 srli t6,t6,0x3c 1488: 03cf5f13 srli t5,t5,0x3c 148c: 03cede93 srli t4,t4,0x3c 1490: 03ce5e13 srli t3,t3,0x3c 1494: 03c35313 srli t1,t1,0x3c 1498: 03c8d893 srli a7,a7,0x3c 149c: 03c85813 srli a6,a6,0x3c 14a0: 9171 srli a0,a0,0x3c 14a2: 91f1 srli a1,a1,0x3c 14a4: 92f1 srli a3,a3,0x3c 14a6: 9371 srli a4,a4,0x3c 14a8: 96ce add a3,a3,s3 14aa: 974e add a4,a4,s3 14ac: 944e add s0,s0,s3 14ae: 92ce add t0,t0,s3 14b0: 9fce add t6,t6,s3 14b2: 9f4e add t5,t5,s3 14b4: 9ece add t4,t4,s3 14b6: 9e4e add t3,t3,s3 14b8: 934e add t1,t1,s3 14ba: 98ce add a7,a7,s3 14bc: 93ce add t2,t2,s3 14be: 984e add a6,a6,s3 14c0: 954e add a0,a0,s3 14c2: 95ce add a1,a1,s3 14c4: 0006c083 lbu ra,0(a3) 14c8: 0002c283 lbu t0,0(t0) 14cc: 00074683 lbu a3,0(a4) 14d0: 000fcf83 lbu t6,0(t6) 14d4: 000f4f03 lbu t5,0(t5) 14d8: 000ece83 lbu t4,0(t4) 14dc: 000e4e03 lbu t3,0(t3) 14e0: 00034303 lbu t1,0(t1) 14e4: 0008c883 lbu a7,0(a7) 14e8: 0003c383 lbu t2,0(t2) 14ec: 00084803 lbu a6,0(a6) 14f0: 00054503 lbu a0,0(a0) 14f4: 0005c583 lbu a1,0(a1) 14f8: 00044403 lbu s0,0(s0) for (j = 0; j < (sizeof(uint64) * 2); j++, x <<= 4) 14fc: 03879713 slli a4,a5,0x38 buf[i++] = digits[x >> (sizeof(uint64) * 8 - 4)]; 1500: 9371 srli a4,a4,0x3c 1502: 8bbd andi a5,a5,15 1504: 974e add a4,a4,s3 1506: 97ce add a5,a5,s3 1508: 005105a3 sb t0,11(sp) 150c: 01f10623 sb t6,12(sp) 1510: 01e106a3 sb t5,13(sp) 1514: 01d10723 sb t4,14(sp) 1518: 01c107a3 sb t3,15(sp) 151c: 00610823 sb t1,16(sp) 1520: 011108a3 sb a7,17(sp) 1524: 00710923 sb t2,18(sp) 1528: 010109a3 sb a6,19(sp) 152c: 00a10a23 sb a0,20(sp) 1530: 00b10aa3 sb a1,21(sp) 1534: 00110b23 sb ra,22(sp) 1538: 00d10ba3 sb a3,23(sp) 153c: 00810523 sb s0,10(sp) 1540: 00074703 lbu a4,0(a4) 1544: 0007c783 lbu a5,0(a5) write(f, s, l); 1548: 002c addi a1,sp,8 154a: 4505 li a0,1 buf[i++] = digits[x >> (sizeof(uint64) * 8 - 4)]; 154c: 00e10c23 sb a4,24(sp) 1550: 00f10ca3 sb a5,25(sp) buf[i] = 0; 1554: 00010d23 sb zero,26(sp) write(f, s, l); 1558: 79c000ef jal ra,1cf4 <write> // Print unknown % sequence to draw attention. putchar('%'); putchar(s[1]); break; } s += 2; 155c: 00248513 addi a0,s1,2 if (!*s) 1560: 00054783 lbu a5,0(a0) 1564: e8079ae3 bnez a5,13f8 <printf+0x4a> } va_end(ap); } 1568: 70a6 ld ra,104(sp) 156a: 7406 ld s0,96(sp) 156c: 64e6 ld s1,88(sp) 156e: 6946 ld s2,80(sp) 1570: 69a6 ld s3,72(sp) 1572: 6a06 ld s4,64(sp) 1574: 7ae2 ld s5,56(sp) 1576: 7b42 ld s6,48(sp) 1578: 614d addi sp,sp,176 157a: 8082 ret for (z = s; s[0] == '%' && s[1] == '%'; z++, s += 2) 157c: 00064783 lbu a5,0(a2) 1580: 84b2 mv s1,a2 1582: 01278963 beq a5,s2,1594 <printf+0x1e6> 1586: b549 j 1408 <printf+0x5a> 1588: 0024c783 lbu a5,2(s1) 158c: 0605 addi a2,a2,1 158e: 0489 addi s1,s1,2 1590: e7279ce3 bne a5,s2,1408 <printf+0x5a> 1594: 0014c783 lbu a5,1(s1) 1598: ff2788e3 beq a5,s2,1588 <printf+0x1da> l = z - a; 159c: 40a6043b subw s0,a2,a0 write(f, s, l); 15a0: 85aa mv a1,a0 15a2: 8622 mv a2,s0 15a4: 4505 li a0,1 15a6: 74e000ef jal ra,1cf4 <write> if (l) 15aa: e60408e3 beqz s0,141a <printf+0x6c> 15ae: 8526 mv a0,s1 15b0: b581 j 13f0 <printf+0x42> switch (s[1]) 15b2: 07800713 li a4,120 15b6: 04e79963 bne a5,a4,1608 <printf+0x25a> printint(va_arg(ap, int), 16, 1); 15ba: 6782 ld a5,0(sp) 15bc: 45c1 li a1,16 15be: 4388 lw a0,0(a5) 15c0: 07a1 addi a5,a5,8 15c2: e03e sd a5,0(sp) 15c4: b71ff0ef jal ra,1134 <printint.constprop.0> s += 2; 15c8: 00248513 addi a0,s1,2 15cc: bf51 j 1560 <printf+0x1b2> printint(va_arg(ap, int), 10, 1); 15ce: 6782 ld a5,0(sp) 15d0: 45a9 li a1,10 15d2: 4388 lw a0,0(a5) 15d4: 07a1 addi a5,a5,8 15d6: e03e sd a5,0(sp) 15d8: b5dff0ef jal ra,1134 <printint.constprop.0> s += 2; 15dc: 00248513 addi a0,s1,2 15e0: b741 j 1560 <printf+0x1b2> if ((a = va_arg(ap, char *)) == 0) 15e2: 6782 ld a5,0(sp) 15e4: 6380 ld s0,0(a5) 15e6: 07a1 addi a5,a5,8 15e8: e03e sd a5,0(sp) 15ea: c031 beqz s0,162e <printf+0x280> l = strnlen(a, 200); 15ec: 0c800593 li a1,200 15f0: 8522 mv a0,s0 15f2: 40a000ef jal ra,19fc <strnlen> write(f, s, l); 15f6: 0005061b sext.w a2,a0 15fa: 85a2 mv a1,s0 15fc: 4505 li a0,1 15fe: 6f6000ef jal ra,1cf4 <write> s += 2; 1602: 00248513 addi a0,s1,2 1606: bfa9 j 1560 <printf+0x1b2> return write(stdout, &byte, 1); 1608: 4605 li a2,1 160a: 002c addi a1,sp,8 160c: 4505 li a0,1 char byte = c; 160e: 01210423 sb s2,8(sp) return write(stdout, &byte, 1); 1612: 6e2000ef jal ra,1cf4 <write> char byte = c; 1616: 0014c783 lbu a5,1(s1) return write(stdout, &byte, 1); 161a: 4605 li a2,1 161c: 002c addi a1,sp,8 161e: 4505 li a0,1 char byte = c; 1620: 00f10423 sb a5,8(sp) return write(stdout, &byte, 1); 1624: 6d0000ef jal ra,1cf4 <write> s += 2; 1628: 00248513 addi a0,s1,2 162c: bf15 j 1560 <printf+0x1b2> a = "(null)"; 162e: 845a mv s0,s6 1630: bf75 j 15ec <printf+0x23e> 0000000000001632 <panic>: #include <stdlib.h> #include <stdio.h> #include <unistd.h> void panic(char *m) { 1632: 1141 addi sp,sp,-16 1634: e406 sd ra,8(sp) puts(m); 1636: d57ff0ef jal ra,138c <puts> exit(-100); } 163a: 60a2 ld ra,8(sp) exit(-100); 163c: f9c00513 li a0,-100 } 1640: 0141 addi sp,sp,16 exit(-100); 1642: a709 j 1d44 <exit> 0000000000001644 <isspace>: #define HIGHS (ONES * (UCHAR_MAX / 2 + 1)) #define HASZERO(x) (((x)-ONES) & ~(x)&HIGHS) int isspace(int c) { return c == ' ' || (unsigned)c - '\t' < 5; 1644: 02000793 li a5,32 1648: 00f50663 beq a0,a5,1654 <isspace+0x10> 164c: 355d addiw a0,a0,-9 164e: 00553513 sltiu a0,a0,5 1652: 8082 ret 1654: 4505 li a0,1 } 1656: 8082 ret 0000000000001658 <isdigit>: int isdigit(int c) { return (unsigned)c - '0' < 10; 1658: fd05051b addiw a0,a0,-48 } 165c: 00a53513 sltiu a0,a0,10 1660: 8082 ret 0000000000001662 <atoi>: return c == ' ' || (unsigned)c - '\t' < 5; 1662: 02000613 li a2,32 1666: 4591 li a1,4 int atoi(const char *s) { int n = 0, neg = 0; while (isspace(*s)) 1668: 00054703 lbu a4,0(a0) return c == ' ' || (unsigned)c - '\t' < 5; 166c: ff77069b addiw a3,a4,-9 1670: 04c70d63 beq a4,a2,16ca <atoi+0x68> 1674: 0007079b sext.w a5,a4 1678: 04d5f963 bgeu a1,a3,16ca <atoi+0x68> s++; switch (*s) 167c: 02b00693 li a3,43 1680: 04d70a63 beq a4,a3,16d4 <atoi+0x72> 1684: 02d00693 li a3,45 1688: 06d70463 beq a4,a3,16f0 <atoi+0x8e> neg = 1; case '+': s++; } /* Compute n as a negative number to avoid overflow on INT_MIN */ while (isdigit(*s)) 168c: fd07859b addiw a1,a5,-48 1690: 4625 li a2,9 1692: 873e mv a4,a5 1694: 86aa mv a3,a0 int n = 0, neg = 0; 1696: 4e01 li t3,0 while (isdigit(*s)) 1698: 04b66a63 bltu a2,a1,16ec <atoi+0x8a> int n = 0, neg = 0; 169c: 4501 li a0,0 while (isdigit(*s)) 169e: 4825 li a6,9 16a0: 0016c603 lbu a2,1(a3) n = 10 * n - (*s++ - '0'); 16a4: 0025179b slliw a5,a0,0x2 16a8: 9d3d addw a0,a0,a5 16aa: fd07031b addiw t1,a4,-48 16ae: 0015189b slliw a7,a0,0x1 while (isdigit(*s)) 16b2: fd06059b addiw a1,a2,-48 n = 10 * n - (*s++ - '0'); 16b6: 0685 addi a3,a3,1 16b8: 4068853b subw a0,a7,t1 while (isdigit(*s)) 16bc: 0006071b sext.w a4,a2 16c0: feb870e3 bgeu a6,a1,16a0 <atoi+0x3e> return neg ? n : -n; 16c4: 000e0563 beqz t3,16ce <atoi+0x6c> } 16c8: 8082 ret s++; 16ca: 0505 addi a0,a0,1 16cc: bf71 j 1668 <atoi+0x6> return neg ? n : -n; 16ce: 4113053b subw a0,t1,a7 16d2: 8082 ret while (isdigit(*s)) 16d4: 00154783 lbu a5,1(a0) 16d8: 4625 li a2,9 s++; 16da: 00150693 addi a3,a0,1 while (isdigit(*s)) 16de: fd07859b addiw a1,a5,-48 16e2: 0007871b sext.w a4,a5 int n = 0, neg = 0; 16e6: 4e01 li t3,0 while (isdigit(*s)) 16e8: fab67ae3 bgeu a2,a1,169c <atoi+0x3a> 16ec: 4501 li a0,0 } 16ee: 8082 ret while (isdigit(*s)) 16f0: 00154783 lbu a5,1(a0) 16f4: 4625 li a2,9 s++; 16f6: 00150693 addi a3,a0,1 while (isdigit(*s)) 16fa: fd07859b addiw a1,a5,-48 16fe: 0007871b sext.w a4,a5 1702: feb665e3 bltu a2,a1,16ec <atoi+0x8a> neg = 1; 1706: 4e05 li t3,1 1708: bf51 j 169c <atoi+0x3a> 000000000000170a <memset>: void *memset(void *dest, int c, size_t n) { char *p = dest; for (int i = 0; i < n; ++i, *(p++) = c) 170a: 16060d63 beqz a2,1884 <memset+0x17a> 170e: 40a007b3 neg a5,a0 1712: 8b9d andi a5,a5,7 1714: 00778713 addi a4,a5,7 1718: 482d li a6,11 171a: 0ff5f593 zext.b a1,a1 171e: fff60693 addi a3,a2,-1 1722: 17076263 bltu a4,a6,1886 <memset+0x17c> 1726: 16e6ea63 bltu a3,a4,189a <memset+0x190> 172a: 16078563 beqz a5,1894 <memset+0x18a> 172e: 00b50023 sb a1,0(a0) 1732: 4705 li a4,1 1734: 00150e93 addi t4,a0,1 1738: 14e78c63 beq a5,a4,1890 <memset+0x186> 173c: 00b500a3 sb a1,1(a0) 1740: 4709 li a4,2 1742: 00250e93 addi t4,a0,2 1746: 14e78d63 beq a5,a4,18a0 <memset+0x196> 174a: 00b50123 sb a1,2(a0) 174e: 470d li a4,3 1750: 00350e93 addi t4,a0,3 1754: 12e78b63 beq a5,a4,188a <memset+0x180> 1758: 00b501a3 sb a1,3(a0) 175c: 4711 li a4,4 175e: 00450e93 addi t4,a0,4 1762: 14e78163 beq a5,a4,18a4 <memset+0x19a> 1766: 00b50223 sb a1,4(a0) 176a: 4715 li a4,5 176c: 00550e93 addi t4,a0,5 1770: 12e78c63 beq a5,a4,18a8 <memset+0x19e> 1774: 00b502a3 sb a1,5(a0) 1778: 471d li a4,7 177a: 00650e93 addi t4,a0,6 177e: 12e79763 bne a5,a4,18ac <memset+0x1a2> 1782: 00750e93 addi t4,a0,7 1786: 00b50323 sb a1,6(a0) 178a: 4f1d li t5,7 178c: 00859713 slli a4,a1,0x8 1790: 8f4d or a4,a4,a1 1792: 01059e13 slli t3,a1,0x10 1796: 01c76e33 or t3,a4,t3 179a: 01859313 slli t1,a1,0x18 179e: 006e6333 or t1,t3,t1 17a2: 02059893 slli a7,a1,0x20 17a6: 011368b3 or a7,t1,a7 17aa: 02859813 slli a6,a1,0x28 17ae: 40f60333 sub t1,a2,a5 17b2: 0108e833 or a6,a7,a6 17b6: 03059693 slli a3,a1,0x30 17ba: 00d866b3 or a3,a6,a3 17be: 03859713 slli a4,a1,0x38 17c2: 97aa add a5,a5,a0 17c4: ff837813 andi a6,t1,-8 17c8: 8f55 or a4,a4,a3 17ca: 00f806b3 add a3,a6,a5 17ce: e398 sd a4,0(a5) 17d0: 07a1 addi a5,a5,8 17d2: fed79ee3 bne a5,a3,17ce <memset+0xc4> 17d6: ff837693 andi a3,t1,-8 17da: 00de87b3 add a5,t4,a3 17de: 01e6873b addw a4,a3,t5 17e2: 0ad30663 beq t1,a3,188e <memset+0x184> 17e6: 00b78023 sb a1,0(a5) 17ea: 0017069b addiw a3,a4,1 17ee: 08c6fb63 bgeu a3,a2,1884 <memset+0x17a> 17f2: 00b780a3 sb a1,1(a5) 17f6: 0027069b addiw a3,a4,2 17fa: 08c6f563 bgeu a3,a2,1884 <memset+0x17a> 17fe: 00b78123 sb a1,2(a5) 1802: 0037069b addiw a3,a4,3 1806: 06c6ff63 bgeu a3,a2,1884 <memset+0x17a> 180a: 00b781a3 sb a1,3(a5) 180e: 0047069b addiw a3,a4,4 1812: 06c6f963 bgeu a3,a2,1884 <memset+0x17a> 1816: 00b78223 sb a1,4(a5) 181a: 0057069b addiw a3,a4,5 181e: 06c6f363 bgeu a3,a2,1884 <memset+0x17a> 1822: 00b782a3 sb a1,5(a5) 1826: 0067069b addiw a3,a4,6 182a: 04c6fd63 bgeu a3,a2,1884 <memset+0x17a> 182e: 00b78323 sb a1,6(a5) 1832: 0077069b addiw a3,a4,7 1836: 04c6f763 bgeu a3,a2,1884 <memset+0x17a> 183a: 00b783a3 sb a1,7(a5) 183e: 0087069b addiw a3,a4,8 1842: 04c6f163 bgeu a3,a2,1884 <memset+0x17a> 1846: 00b78423 sb a1,8(a5) 184a: 0097069b addiw a3,a4,9 184e: 02c6fb63 bgeu a3,a2,1884 <memset+0x17a> 1852: 00b784a3 sb a1,9(a5) 1856: 00a7069b addiw a3,a4,10 185a: 02c6f563 bgeu a3,a2,1884 <memset+0x17a> 185e: 00b78523 sb a1,10(a5) 1862: 00b7069b addiw a3,a4,11 1866: 00c6ff63 bgeu a3,a2,1884 <memset+0x17a> 186a: 00b785a3 sb a1,11(a5) 186e: 00c7069b addiw a3,a4,12 1872: 00c6f963 bgeu a3,a2,1884 <memset+0x17a> 1876: 00b78623 sb a1,12(a5) 187a: 2735 addiw a4,a4,13 187c: 00c77463 bgeu a4,a2,1884 <memset+0x17a> 1880: 00b786a3 sb a1,13(a5) ; return dest; } 1884: 8082 ret 1886: 472d li a4,11 1888: bd79 j 1726 <memset+0x1c> for (int i = 0; i < n; ++i, *(p++) = c) 188a: 4f0d li t5,3 188c: b701 j 178c <memset+0x82> 188e: 8082 ret 1890: 4f05 li t5,1 1892: bded j 178c <memset+0x82> 1894: 8eaa mv t4,a0 1896: 4f01 li t5,0 1898: bdd5 j 178c <memset+0x82> 189a: 87aa mv a5,a0 189c: 4701 li a4,0 189e: b7a1 j 17e6 <memset+0xdc> 18a0: 4f09 li t5,2 18a2: b5ed j 178c <memset+0x82> 18a4: 4f11 li t5,4 18a6: b5dd j 178c <memset+0x82> 18a8: 4f15 li t5,5 18aa: b5cd j 178c <memset+0x82> 18ac: 4f19 li t5,6 18ae: bdf9 j 178c <memset+0x82> 00000000000018b0 <strcmp>: int strcmp(const char *l, const char *r) { for (; *l == *r && *l; l++, r++) 18b0: 00054783 lbu a5,0(a0) 18b4: 0005c703 lbu a4,0(a1) 18b8: 00e79863 bne a5,a4,18c8 <strcmp+0x18> 18bc: 0505 addi a0,a0,1 18be: 0585 addi a1,a1,1 18c0: fbe5 bnez a5,18b0 <strcmp> 18c2: 4501 li a0,0 ; return *(unsigned char *)l - *(unsigned char *)r; } 18c4: 9d19 subw a0,a0,a4 18c6: 8082 ret return *(unsigned char *)l - *(unsigned char *)r; 18c8: 0007851b sext.w a0,a5 18cc: bfe5 j 18c4 <strcmp+0x14> 00000000000018ce <strncmp>: int strncmp(const char *_l, const char *_r, size_t n) { const unsigned char *l = (void *)_l, *r = (void *)_r; if (!n--) 18ce: ce05 beqz a2,1906 <strncmp+0x38> return 0; for (; *l && *r && n && *l == *r; l++, r++, n--) 18d0: 00054703 lbu a4,0(a0) 18d4: 0005c783 lbu a5,0(a1) 18d8: cb0d beqz a4,190a <strncmp+0x3c> if (!n--) 18da: 167d addi a2,a2,-1 18dc: 00c506b3 add a3,a0,a2 18e0: a819 j 18f6 <strncmp+0x28> for (; *l && *r && n && *l == *r; l++, r++, n--) 18e2: 00a68e63 beq a3,a0,18fe <strncmp+0x30> 18e6: 0505 addi a0,a0,1 18e8: 00e79b63 bne a5,a4,18fe <strncmp+0x30> 18ec: 00054703 lbu a4,0(a0) ; return *l - *r; 18f0: 0005c783 lbu a5,0(a1) for (; *l && *r && n && *l == *r; l++, r++, n--) 18f4: cb19 beqz a4,190a <strncmp+0x3c> 18f6: 0005c783 lbu a5,0(a1) 18fa: 0585 addi a1,a1,1 18fc: f3fd bnez a5,18e2 <strncmp+0x14> return *l - *r; 18fe: 0007051b sext.w a0,a4 1902: 9d1d subw a0,a0,a5 1904: 8082 ret return 0; 1906: 4501 li a0,0 } 1908: 8082 ret 190a: 4501 li a0,0 return *l - *r; 190c: 9d1d subw a0,a0,a5 190e: 8082 ret 0000000000001910 <strlen>: size_t strlen(const char *s) { const char *a = s; typedef size_t __attribute__((__may_alias__)) word; const word *w; for (; (uintptr_t)s % SS; s++) 1910: 00757793 andi a5,a0,7 1914: cf89 beqz a5,192e <strlen+0x1e> 1916: 87aa mv a5,a0 1918: a029 j 1922 <strlen+0x12> 191a: 0785 addi a5,a5,1 191c: 0077f713 andi a4,a5,7 1920: cb01 beqz a4,1930 <strlen+0x20> if (!*s) 1922: 0007c703 lbu a4,0(a5) 1926: fb75 bnez a4,191a <strlen+0xa> for (w = (const void *)s; !HASZERO(*w); w++) ; s = (const void *)w; for (; *s; s++) ; return s - a; 1928: 40a78533 sub a0,a5,a0 } 192c: 8082 ret for (; (uintptr_t)s % SS; s++) 192e: 87aa mv a5,a0 for (w = (const void *)s; !HASZERO(*w); w++) 1930: 6394 ld a3,0(a5) 1932: 00000597 auipc a1,0x0 1936: 6de5b583 ld a1,1758(a1) # 2010 <__clone+0xe4> 193a: 00000617 auipc a2,0x0 193e: 6de63603 ld a2,1758(a2) # 2018 <__clone+0xec> 1942: a019 j 1948 <strlen+0x38> 1944: 6794 ld a3,8(a5) 1946: 07a1 addi a5,a5,8 1948: 00b68733 add a4,a3,a1 194c: fff6c693 not a3,a3 1950: 8f75 and a4,a4,a3 1952: 8f71 and a4,a4,a2 1954: db65 beqz a4,1944 <strlen+0x34> for (; *s; s++) 1956: 0007c703 lbu a4,0(a5) 195a: d779 beqz a4,1928 <strlen+0x18> 195c: 0017c703 lbu a4,1(a5) 1960: 0785 addi a5,a5,1 1962: d379 beqz a4,1928 <strlen+0x18> 1964: 0017c703 lbu a4,1(a5) 1968: 0785 addi a5,a5,1 196a: fb6d bnez a4,195c <strlen+0x4c> 196c: bf75 j 1928 <strlen+0x18> 000000000000196e <memchr>: void *memchr(const void *src, int c, size_t n) { const unsigned char *s = src; c = (unsigned char)c; for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--) 196e: 00757713 andi a4,a0,7 { 1972: 87aa mv a5,a0 c = (unsigned char)c; 1974: 0ff5f593 zext.b a1,a1 for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--) 1978: cb19 beqz a4,198e <memchr+0x20> 197a: ce25 beqz a2,19f2 <memchr+0x84> 197c: 0007c703 lbu a4,0(a5) 1980: 04b70e63 beq a4,a1,19dc <memchr+0x6e> 1984: 0785 addi a5,a5,1 1986: 0077f713 andi a4,a5,7 198a: 167d addi a2,a2,-1 198c: f77d bnez a4,197a <memchr+0xc> ; s = (const void *)w; } for (; n && *s != c; s++, n--) ; return n ? (void *)s : 0; 198e: 4501 li a0,0 if (n && *s != c) 1990: c235 beqz a2,19f4 <memchr+0x86> 1992: 0007c703 lbu a4,0(a5) 1996: 04b70363 beq a4,a1,19dc <memchr+0x6e> size_t k = ONES * c; 199a: 00000517 auipc a0,0x0 199e: 68653503 ld a0,1670(a0) # 2020 <__clone+0xf4> for (w = (const void *)s; n >= SS && !HASZERO(*w ^ k); w++, n -= SS) 19a2: 471d li a4,7 size_t k = ONES * c; 19a4: 02a58533 mul a0,a1,a0 for (w = (const void *)s; n >= SS && !HASZERO(*w ^ k); w++, n -= SS) 19a8: 02c77a63 bgeu a4,a2,19dc <memchr+0x6e> 19ac: 00000897 auipc a7,0x0 19b0: 6648b883 ld a7,1636(a7) # 2010 <__clone+0xe4> 19b4: 00000817 auipc a6,0x0 19b8: 66483803 ld a6,1636(a6) # 2018 <__clone+0xec> 19bc: 431d li t1,7 19be: a029 j 19c8 <memchr+0x5a> 19c0: 1661 addi a2,a2,-8 19c2: 07a1 addi a5,a5,8 19c4: 02c37963 bgeu t1,a2,19f6 <memchr+0x88> 19c8: 6398 ld a4,0(a5) 19ca: 8f29 xor a4,a4,a0 19cc: 011706b3 add a3,a4,a7 19d0: fff74713 not a4,a4 19d4: 8f75 and a4,a4,a3 19d6: 01077733 and a4,a4,a6 19da: d37d beqz a4,19c0 <memchr+0x52> 19dc: 853e mv a0,a5 19de: 97b2 add a5,a5,a2 19e0: a021 j 19e8 <memchr+0x7a> for (; n && *s != c; s++, n--) 19e2: 0505 addi a0,a0,1 19e4: 00f50763 beq a0,a5,19f2 <memchr+0x84> 19e8: 00054703 lbu a4,0(a0) 19ec: feb71be3 bne a4,a1,19e2 <memchr+0x74> 19f0: 8082 ret return n ? (void *)s : 0; 19f2: 4501 li a0,0 } 19f4: 8082 ret return n ? (void *)s : 0; 19f6: 4501 li a0,0 for (; n && *s != c; s++, n--) 19f8: f275 bnez a2,19dc <memchr+0x6e> } 19fa: 8082 ret 00000000000019fc <strnlen>: size_t strnlen(const char *s, size_t n) { 19fc: 1101 addi sp,sp,-32 19fe: e822 sd s0,16(sp) const char *p = memchr(s, 0, n); 1a00: 862e mv a2,a1 { 1a02: 842e mv s0,a1 const char *p = memchr(s, 0, n); 1a04: 4581 li a1,0 { 1a06: e426 sd s1,8(sp) 1a08: ec06 sd ra,24(sp) 1a0a: 84aa mv s1,a0 const char *p = memchr(s, 0, n); 1a0c: f63ff0ef jal ra,196e <memchr> return p ? p - s : n; 1a10: c519 beqz a0,1a1e <strnlen+0x22> } 1a12: 60e2 ld ra,24(sp) 1a14: 6442 ld s0,16(sp) return p ? p - s : n; 1a16: 8d05 sub a0,a0,s1 } 1a18: 64a2 ld s1,8(sp) 1a1a: 6105 addi sp,sp,32 1a1c: 8082 ret 1a1e: 60e2 ld ra,24(sp) return p ? p - s : n; 1a20: 8522 mv a0,s0 } 1a22: 6442 ld s0,16(sp) 1a24: 64a2 ld s1,8(sp) 1a26: 6105 addi sp,sp,32 1a28: 8082 ret 0000000000001a2a <strcpy>: char *strcpy(char *restrict d, const char *s) { typedef size_t __attribute__((__may_alias__)) word; word *wd; const word *ws; if ((uintptr_t)s % SS == (uintptr_t)d % SS) 1a2a: 00b547b3 xor a5,a0,a1 1a2e: 8b9d andi a5,a5,7 1a30: eb95 bnez a5,1a64 <strcpy+0x3a> { for (; (uintptr_t)s % SS; s++, d++) 1a32: 0075f793 andi a5,a1,7 1a36: e7b1 bnez a5,1a82 <strcpy+0x58> if (!(*d = *s)) return d; wd = (void *)d; ws = (const void *)s; for (; !HASZERO(*ws); *wd++ = *ws++) 1a38: 6198 ld a4,0(a1) 1a3a: 00000617 auipc a2,0x0 1a3e: 5d663603 ld a2,1494(a2) # 2010 <__clone+0xe4> 1a42: 00000817 auipc a6,0x0 1a46: 5d683803 ld a6,1494(a6) # 2018 <__clone+0xec> 1a4a: a029 j 1a54 <strcpy+0x2a> 1a4c: e118 sd a4,0(a0) 1a4e: 6598 ld a4,8(a1) 1a50: 05a1 addi a1,a1,8 1a52: 0521 addi a0,a0,8 1a54: 00c707b3 add a5,a4,a2 1a58: fff74693 not a3,a4 1a5c: 8ff5 and a5,a5,a3 1a5e: 0107f7b3 and a5,a5,a6 1a62: d7ed beqz a5,1a4c <strcpy+0x22> ; d = (void *)wd; s = (const void *)ws; } for (; (*d = *s); s++, d++) 1a64: 0005c783 lbu a5,0(a1) 1a68: 00f50023 sb a5,0(a0) 1a6c: c785 beqz a5,1a94 <strcpy+0x6a> 1a6e: 0015c783 lbu a5,1(a1) 1a72: 0505 addi a0,a0,1 1a74: 0585 addi a1,a1,1 1a76: 00f50023 sb a5,0(a0) 1a7a: fbf5 bnez a5,1a6e <strcpy+0x44> ; return d; } 1a7c: 8082 ret for (; (uintptr_t)s % SS; s++, d++) 1a7e: 0505 addi a0,a0,1 1a80: df45 beqz a4,1a38 <strcpy+0xe> if (!(*d = *s)) 1a82: 0005c783 lbu a5,0(a1) for (; (uintptr_t)s % SS; s++, d++) 1a86: 0585 addi a1,a1,1 1a88: 0075f713 andi a4,a1,7 if (!(*d = *s)) 1a8c: 00f50023 sb a5,0(a0) 1a90: f7fd bnez a5,1a7e <strcpy+0x54> } 1a92: 8082 ret 1a94: 8082 ret 0000000000001a96 <strncpy>: char *strncpy(char *restrict d, const char *s, size_t n) { typedef size_t __attribute__((__may_alias__)) word; word *wd; const word *ws; if (((uintptr_t)s & ALIGN) == ((uintptr_t)d & ALIGN)) 1a96: 00b547b3 xor a5,a0,a1 1a9a: 8b9d andi a5,a5,7 1a9c: 1a079863 bnez a5,1c4c <strncpy+0x1b6> { for (; ((uintptr_t)s & ALIGN) && n && (*d = *s); n--, s++, d++) 1aa0: 0075f793 andi a5,a1,7 1aa4: 16078463 beqz a5,1c0c <strncpy+0x176> 1aa8: ea01 bnez a2,1ab8 <strncpy+0x22> 1aaa: a421 j 1cb2 <strncpy+0x21c> 1aac: 167d addi a2,a2,-1 1aae: 0505 addi a0,a0,1 1ab0: 14070e63 beqz a4,1c0c <strncpy+0x176> 1ab4: 1a060863 beqz a2,1c64 <strncpy+0x1ce> 1ab8: 0005c783 lbu a5,0(a1) 1abc: 0585 addi a1,a1,1 1abe: 0075f713 andi a4,a1,7 1ac2: 00f50023 sb a5,0(a0) 1ac6: f3fd bnez a5,1aac <strncpy+0x16> 1ac8: 4805 li a6,1 1aca: 1a061863 bnez a2,1c7a <strncpy+0x1e4> 1ace: 40a007b3 neg a5,a0 1ad2: 8b9d andi a5,a5,7 1ad4: 4681 li a3,0 1ad6: 18061a63 bnez a2,1c6a <strncpy+0x1d4> 1ada: 00778713 addi a4,a5,7 1ade: 45ad li a1,11 1ae0: 18b76363 bltu a4,a1,1c66 <strncpy+0x1d0> 1ae4: 1ae6eb63 bltu a3,a4,1c9a <strncpy+0x204> 1ae8: 1a078363 beqz a5,1c8e <strncpy+0x1f8> for (int i = 0; i < n; ++i, *(p++) = c) 1aec: 00050023 sb zero,0(a0) 1af0: 4685 li a3,1 1af2: 00150713 addi a4,a0,1 1af6: 18d78f63 beq a5,a3,1c94 <strncpy+0x1fe> 1afa: 000500a3 sb zero,1(a0) 1afe: 4689 li a3,2 1b00: 00250713 addi a4,a0,2 1b04: 18d78e63 beq a5,a3,1ca0 <strncpy+0x20a> 1b08: 00050123 sb zero,2(a0) 1b0c: 468d li a3,3 1b0e: 00350713 addi a4,a0,3 1b12: 16d78c63 beq a5,a3,1c8a <strncpy+0x1f4> 1b16: 000501a3 sb zero,3(a0) 1b1a: 4691 li a3,4 1b1c: 00450713 addi a4,a0,4 1b20: 18d78263 beq a5,a3,1ca4 <strncpy+0x20e> 1b24: 00050223 sb zero,4(a0) 1b28: 4695 li a3,5 1b2a: 00550713 addi a4,a0,5 1b2e: 16d78d63 beq a5,a3,1ca8 <strncpy+0x212> 1b32: 000502a3 sb zero,5(a0) 1b36: 469d li a3,7 1b38: 00650713 addi a4,a0,6 1b3c: 16d79863 bne a5,a3,1cac <strncpy+0x216> 1b40: 00750713 addi a4,a0,7 1b44: 00050323 sb zero,6(a0) 1b48: 40f80833 sub a6,a6,a5 1b4c: ff887593 andi a1,a6,-8 1b50: 97aa add a5,a5,a0 1b52: 95be add a1,a1,a5 1b54: 0007b023 sd zero,0(a5) 1b58: 07a1 addi a5,a5,8 1b5a: feb79de3 bne a5,a1,1b54 <strncpy+0xbe> 1b5e: ff887593 andi a1,a6,-8 1b62: 9ead addw a3,a3,a1 1b64: 00b707b3 add a5,a4,a1 1b68: 12b80863 beq a6,a1,1c98 <strncpy+0x202> 1b6c: 00078023 sb zero,0(a5) 1b70: 0016871b addiw a4,a3,1 1b74: 0ec77863 bgeu a4,a2,1c64 <strncpy+0x1ce> 1b78: 000780a3 sb zero,1(a5) 1b7c: 0026871b addiw a4,a3,2 1b80: 0ec77263 bgeu a4,a2,1c64 <strncpy+0x1ce> 1b84: 00078123 sb zero,2(a5) 1b88: 0036871b addiw a4,a3,3 1b8c: 0cc77c63 bgeu a4,a2,1c64 <strncpy+0x1ce> 1b90: 000781a3 sb zero,3(a5) 1b94: 0046871b addiw a4,a3,4 1b98: 0cc77663 bgeu a4,a2,1c64 <strncpy+0x1ce> 1b9c: 00078223 sb zero,4(a5) 1ba0: 0056871b addiw a4,a3,5 1ba4: 0cc77063 bgeu a4,a2,1c64 <strncpy+0x1ce> 1ba8: 000782a3 sb zero,5(a5) 1bac: 0066871b addiw a4,a3,6 1bb0: 0ac77a63 bgeu a4,a2,1c64 <strncpy+0x1ce> 1bb4: 00078323 sb zero,6(a5) 1bb8: 0076871b addiw a4,a3,7 1bbc: 0ac77463 bgeu a4,a2,1c64 <strncpy+0x1ce> 1bc0: 000783a3 sb zero,7(a5) 1bc4: 0086871b addiw a4,a3,8 1bc8: 08c77e63 bgeu a4,a2,1c64 <strncpy+0x1ce> 1bcc: 00078423 sb zero,8(a5) 1bd0: 0096871b addiw a4,a3,9 1bd4: 08c77863 bgeu a4,a2,1c64 <strncpy+0x1ce> 1bd8: 000784a3 sb zero,9(a5) 1bdc: 00a6871b addiw a4,a3,10 1be0: 08c77263 bgeu a4,a2,1c64 <strncpy+0x1ce> 1be4: 00078523 sb zero,10(a5) 1be8: 00b6871b addiw a4,a3,11 1bec: 06c77c63 bgeu a4,a2,1c64 <strncpy+0x1ce> 1bf0: 000785a3 sb zero,11(a5) 1bf4: 00c6871b addiw a4,a3,12 1bf8: 06c77663 bgeu a4,a2,1c64 <strncpy+0x1ce> 1bfc: 00078623 sb zero,12(a5) 1c00: 26b5 addiw a3,a3,13 1c02: 06c6f163 bgeu a3,a2,1c64 <strncpy+0x1ce> 1c06: 000786a3 sb zero,13(a5) 1c0a: 8082 ret ; if (!n || !*s) 1c0c: c645 beqz a2,1cb4 <strncpy+0x21e> 1c0e: 0005c783 lbu a5,0(a1) 1c12: ea078be3 beqz a5,1ac8 <strncpy+0x32> goto tail; wd = (void *)d; ws = (const void *)s; for (; n >= sizeof(size_t) && !HASZERO(*ws); n -= sizeof(size_t), ws++, wd++) 1c16: 479d li a5,7 1c18: 02c7ff63 bgeu a5,a2,1c56 <strncpy+0x1c0> 1c1c: 00000897 auipc a7,0x0 1c20: 3f48b883 ld a7,1012(a7) # 2010 <__clone+0xe4> 1c24: 00000817 auipc a6,0x0 1c28: 3f483803 ld a6,1012(a6) # 2018 <__clone+0xec> 1c2c: 431d li t1,7 1c2e: 6198 ld a4,0(a1) 1c30: 011707b3 add a5,a4,a7 1c34: fff74693 not a3,a4 1c38: 8ff5 and a5,a5,a3 1c3a: 0107f7b3 and a5,a5,a6 1c3e: ef81 bnez a5,1c56 <strncpy+0x1c0> *wd = *ws; 1c40: e118 sd a4,0(a0) for (; n >= sizeof(size_t) && !HASZERO(*ws); n -= sizeof(size_t), ws++, wd++) 1c42: 1661 addi a2,a2,-8 1c44: 05a1 addi a1,a1,8 1c46: 0521 addi a0,a0,8 1c48: fec363e3 bltu t1,a2,1c2e <strncpy+0x198> d = (void *)wd; s = (const void *)ws; } for (; n && (*d = *s); n--, s++, d++) 1c4c: e609 bnez a2,1c56 <strncpy+0x1c0> 1c4e: a08d j 1cb0 <strncpy+0x21a> 1c50: 167d addi a2,a2,-1 1c52: 0505 addi a0,a0,1 1c54: ca01 beqz a2,1c64 <strncpy+0x1ce> 1c56: 0005c783 lbu a5,0(a1) 1c5a: 0585 addi a1,a1,1 1c5c: 00f50023 sb a5,0(a0) 1c60: fbe5 bnez a5,1c50 <strncpy+0x1ba> ; tail: 1c62: b59d j 1ac8 <strncpy+0x32> memset(d, 0, n); return d; } 1c64: 8082 ret 1c66: 472d li a4,11 1c68: bdb5 j 1ae4 <strncpy+0x4e> 1c6a: 00778713 addi a4,a5,7 1c6e: 45ad li a1,11 1c70: fff60693 addi a3,a2,-1 1c74: e6b778e3 bgeu a4,a1,1ae4 <strncpy+0x4e> 1c78: b7fd j 1c66 <strncpy+0x1d0> 1c7a: 40a007b3 neg a5,a0 1c7e: 8832 mv a6,a2 1c80: 8b9d andi a5,a5,7 1c82: 4681 li a3,0 1c84: e4060be3 beqz a2,1ada <strncpy+0x44> 1c88: b7cd j 1c6a <strncpy+0x1d4> for (int i = 0; i < n; ++i, *(p++) = c) 1c8a: 468d li a3,3 1c8c: bd75 j 1b48 <strncpy+0xb2> 1c8e: 872a mv a4,a0 1c90: 4681 li a3,0 1c92: bd5d j 1b48 <strncpy+0xb2> 1c94: 4685 li a3,1 1c96: bd4d j 1b48 <strncpy+0xb2> 1c98: 8082 ret 1c9a: 87aa mv a5,a0 1c9c: 4681 li a3,0 1c9e: b5f9 j 1b6c <strncpy+0xd6> 1ca0: 4689 li a3,2 1ca2: b55d j 1b48 <strncpy+0xb2> 1ca4: 4691 li a3,4 1ca6: b54d j 1b48 <strncpy+0xb2> 1ca8: 4695 li a3,5 1caa: bd79 j 1b48 <strncpy+0xb2> 1cac: 4699 li a3,6 1cae: bd69 j 1b48 <strncpy+0xb2> 1cb0: 8082 ret 1cb2: 8082 ret 1cb4: 8082 ret 0000000000001cb6 <open>: #include <unistd.h> #include "syscall.h" int open(const char *path, int flags) { 1cb6: 87aa mv a5,a0 1cb8: 862e mv a2,a1 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) } static inline long __syscall4(long n, long a, long b, long c, long d) { register long a7 __asm__("a7") = n; 1cba: 03800893 li a7,56 register long a0 __asm__("a0") = a; 1cbe: f9c00513 li a0,-100 register long a1 __asm__("a1") = b; 1cc2: 85be mv a1,a5 register long a2 __asm__("a2") = c; register long a3 __asm__("a3") = d; 1cc4: 4689 li a3,2 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3)) 1cc6: 00000073 ecall return syscall(SYS_openat, AT_FDCWD, path, flags, O_RDWR); } 1cca: 2501 sext.w a0,a0 1ccc: 8082 ret 0000000000001cce <openat>: register long a7 __asm__("a7") = n; 1cce: 03800893 li a7,56 register long a3 __asm__("a3") = d; 1cd2: 18000693 li a3,384 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3)) 1cd6: 00000073 ecall int openat(int dirfd,const char *path, int flags) { return syscall(SYS_openat, dirfd, path, flags, 0600); } 1cda: 2501 sext.w a0,a0 1cdc: 8082 ret 0000000000001cde <close>: register long a7 __asm__("a7") = n; 1cde: 03900893 li a7,57 __asm_syscall("r"(a7), "0"(a0)) 1ce2: 00000073 ecall int close(int fd) { return syscall(SYS_close, fd); } 1ce6: 2501 sext.w a0,a0 1ce8: 8082 ret 0000000000001cea <read>: register long a7 __asm__("a7") = n; 1cea: 03f00893 li a7,63 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1cee: 00000073 ecall ssize_t read(int fd, void *buf, size_t len) { return syscall(SYS_read, fd, buf, len); } 1cf2: 8082 ret 0000000000001cf4 <write>: register long a7 __asm__("a7") = n; 1cf4: 04000893 li a7,64 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1cf8: 00000073 ecall ssize_t write(int fd, const void *buf, size_t len) { return syscall(SYS_write, fd, buf, len); } 1cfc: 8082 ret 0000000000001cfe <getpid>: register long a7 __asm__("a7") = n; 1cfe: 0ac00893 li a7,172 __asm_syscall("r"(a7)) 1d02: 00000073 ecall pid_t getpid(void) { return syscall(SYS_getpid); } 1d06: 2501 sext.w a0,a0 1d08: 8082 ret 0000000000001d0a <getppid>: register long a7 __asm__("a7") = n; 1d0a: 0ad00893 li a7,173 __asm_syscall("r"(a7)) 1d0e: 00000073 ecall pid_t getppid(void) { return syscall(SYS_getppid); } 1d12: 2501 sext.w a0,a0 1d14: 8082 ret 0000000000001d16 <sched_yield>: register long a7 __asm__("a7") = n; 1d16: 07c00893 li a7,124 __asm_syscall("r"(a7)) 1d1a: 00000073 ecall int sched_yield(void) { return syscall(SYS_sched_yield); } 1d1e: 2501 sext.w a0,a0 1d20: 8082 ret 0000000000001d22 <fork>: register long a7 __asm__("a7") = n; 1d22: 0dc00893 li a7,220 register long a0 __asm__("a0") = a; 1d26: 4545 li a0,17 register long a1 __asm__("a1") = b; 1d28: 4581 li a1,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1d2a: 00000073 ecall pid_t fork(void) { return syscall(SYS_clone, SIGCHLD, 0); } 1d2e: 2501 sext.w a0,a0 1d30: 8082 ret 0000000000001d32 <clone>: pid_t clone(int (*fn)(void *arg), void *arg, void *stack, size_t stack_size, unsigned long flags) { 1d32: 85b2 mv a1,a2 1d34: 863a mv a2,a4 if (stack) 1d36: c191 beqz a1,1d3a <clone+0x8> stack += stack_size; 1d38: 95b6 add a1,a1,a3 return __clone(fn, stack, flags, NULL, NULL, NULL); 1d3a: 4781 li a5,0 1d3c: 4701 li a4,0 1d3e: 4681 li a3,0 1d40: 2601 sext.w a2,a2 1d42: a2ed j 1f2c <__clone> 0000000000001d44 <exit>: register long a7 __asm__("a7") = n; 1d44: 05d00893 li a7,93 __asm_syscall("r"(a7), "0"(a0)) 1d48: 00000073 ecall //return syscall(SYS_clone, fn, stack, flags, NULL, NULL, NULL); } void exit(int code) { syscall(SYS_exit, code); } 1d4c: 8082 ret 0000000000001d4e <waitpid>: register long a7 __asm__("a7") = n; 1d4e: 10400893 li a7,260 register long a3 __asm__("a3") = d; 1d52: 4681 li a3,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3)) 1d54: 00000073 ecall int waitpid(int pid, int *code, int options) { return syscall(SYS_wait4, pid, code, options, 0); } 1d58: 2501 sext.w a0,a0 1d5a: 8082 ret 0000000000001d5c <exec>: register long a7 __asm__("a7") = n; 1d5c: 0dd00893 li a7,221 __asm_syscall("r"(a7), "0"(a0)) 1d60: 00000073 ecall int exec(char *name) { return syscall(SYS_execve, name); } 1d64: 2501 sext.w a0,a0 1d66: 8082 ret 0000000000001d68 <execve>: register long a7 __asm__("a7") = n; 1d68: 0dd00893 li a7,221 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1d6c: 00000073 ecall int execve(const char *name, char *const argv[], char *const argp[]) { return syscall(SYS_execve, name, argv, argp); } 1d70: 2501 sext.w a0,a0 1d72: 8082 ret 0000000000001d74 <times>: register long a7 __asm__("a7") = n; 1d74: 09900893 li a7,153 __asm_syscall("r"(a7), "0"(a0)) 1d78: 00000073 ecall int times(void *mytimes) { return syscall(SYS_times, mytimes); } 1d7c: 2501 sext.w a0,a0 1d7e: 8082 ret 0000000000001d80 <get_time>: int64 get_time() { 1d80: 1141 addi sp,sp,-16 register long a7 __asm__("a7") = n; 1d82: 0a900893 li a7,169 register long a0 __asm__("a0") = a; 1d86: 850a mv a0,sp register long a1 __asm__("a1") = b; 1d88: 4581 li a1,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1d8a: 00000073 ecall TimeVal time; int err = sys_get_time(&time, 0); if (err == 0) 1d8e: 2501 sext.w a0,a0 1d90: ed09 bnez a0,1daa <get_time+0x2a> { return ((time.sec & 0xffff) * 1000 + time.usec / 1000); 1d92: 67a2 ld a5,8(sp) 1d94: 3e800713 li a4,1000 1d98: 00015503 lhu a0,0(sp) 1d9c: 02e7d7b3 divu a5,a5,a4 1da0: 02e50533 mul a0,a0,a4 1da4: 953e add a0,a0,a5 } else { return -1; } } 1da6: 0141 addi sp,sp,16 1da8: 8082 ret return -1; 1daa: 557d li a0,-1 1dac: bfed j 1da6 <get_time+0x26> 0000000000001dae <sys_get_time>: register long a7 __asm__("a7") = n; 1dae: 0a900893 li a7,169 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1db2: 00000073 ecall int sys_get_time(TimeVal *ts, int tz) { return syscall(SYS_gettimeofday, ts, tz); } 1db6: 2501 sext.w a0,a0 1db8: 8082 ret 0000000000001dba <time>: register long a7 __asm__("a7") = n; 1dba: 42600893 li a7,1062 __asm_syscall("r"(a7), "0"(a0)) 1dbe: 00000073 ecall int time(unsigned long *tloc) { return syscall(SYS_time, tloc); } 1dc2: 2501 sext.w a0,a0 1dc4: 8082 ret 0000000000001dc6 <sleep>: int sleep(unsigned long long time) { 1dc6: 1141 addi sp,sp,-16 TimeVal tv = {.sec = time, .usec = 0}; 1dc8: e02a sd a0,0(sp) register long a0 __asm__("a0") = a; 1dca: 850a mv a0,sp 1dcc: e402 sd zero,8(sp) register long a7 __asm__("a7") = n; 1dce: 06500893 li a7,101 register long a1 __asm__("a1") = b; 1dd2: 85aa mv a1,a0 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1dd4: 00000073 ecall if (syscall(SYS_nanosleep, &tv, &tv)) return tv.sec; 1dd8: e501 bnez a0,1de0 <sleep+0x1a> return 0; 1dda: 4501 li a0,0 } 1ddc: 0141 addi sp,sp,16 1dde: 8082 ret if (syscall(SYS_nanosleep, &tv, &tv)) return tv.sec; 1de0: 4502 lw a0,0(sp) } 1de2: 0141 addi sp,sp,16 1de4: 8082 ret 0000000000001de6 <set_priority>: register long a7 __asm__("a7") = n; 1de6: 08c00893 li a7,140 __asm_syscall("r"(a7), "0"(a0)) 1dea: 00000073 ecall int set_priority(int prio) { return syscall(SYS_setpriority, prio); } 1dee: 2501 sext.w a0,a0 1df0: 8082 ret 0000000000001df2 <mmap>: __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4)) } static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f) { register long a7 __asm__("a7") = n; 1df2: 0de00893 li a7,222 register long a1 __asm__("a1") = b; register long a2 __asm__("a2") = c; register long a3 __asm__("a3") = d; register long a4 __asm__("a4") = e; register long a5 __asm__("a5") = f; __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a5)) 1df6: 00000073 ecall void *mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) { return syscall(SYS_mmap, start, len, prot, flags, fd, off); } 1dfa: 8082 ret 0000000000001dfc <munmap>: register long a7 __asm__("a7") = n; 1dfc: 0d700893 li a7,215 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1e00: 00000073 ecall int munmap(void *start, size_t len) { return syscall(SYS_munmap, start, len); } 1e04: 2501 sext.w a0,a0 1e06: 8082 ret 0000000000001e08 <wait>: int wait(int *code) { 1e08: 85aa mv a1,a0 register long a7 __asm__("a7") = n; 1e0a: 10400893 li a7,260 register long a0 __asm__("a0") = a; 1e0e: 557d li a0,-1 register long a2 __asm__("a2") = c; 1e10: 4601 li a2,0 register long a3 __asm__("a3") = d; 1e12: 4681 li a3,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3)) 1e14: 00000073 ecall return waitpid((int)-1, code, 0); } 1e18: 2501 sext.w a0,a0 1e1a: 8082 ret 0000000000001e1c <spawn>: register long a7 __asm__("a7") = n; 1e1c: 19000893 li a7,400 __asm_syscall("r"(a7), "0"(a0)) 1e20: 00000073 ecall int spawn(char *file) { return syscall(SYS_spawn, file); } 1e24: 2501 sext.w a0,a0 1e26: 8082 ret 0000000000001e28 <mailread>: register long a7 __asm__("a7") = n; 1e28: 19100893 li a7,401 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1e2c: 00000073 ecall int mailread(void *buf, int len) { return syscall(SYS_mailread, buf, len); } 1e30: 2501 sext.w a0,a0 1e32: 8082 ret 0000000000001e34 <mailwrite>: register long a7 __asm__("a7") = n; 1e34: 19200893 li a7,402 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1e38: 00000073 ecall int mailwrite(int pid, void *buf, int len) { return syscall(SYS_mailwrite, pid, buf, len); } 1e3c: 2501 sext.w a0,a0 1e3e: 8082 ret 0000000000001e40 <fstat>: register long a7 __asm__("a7") = n; 1e40: 05000893 li a7,80 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1e44: 00000073 ecall int fstat(int fd, struct kstat *st) { return syscall(SYS_fstat, fd, st); } 1e48: 2501 sext.w a0,a0 1e4a: 8082 ret 0000000000001e4c <sys_linkat>: register long a4 __asm__("a4") = e; 1e4c: 1702 slli a4,a4,0x20 register long a7 __asm__("a7") = n; 1e4e: 02500893 li a7,37 register long a4 __asm__("a4") = e; 1e52: 9301 srli a4,a4,0x20 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4)) 1e54: 00000073 ecall int sys_linkat(int olddirfd, char *oldpath, int newdirfd, char *newpath, unsigned int flags) { return syscall(SYS_linkat, olddirfd, oldpath, newdirfd, newpath, flags); } 1e58: 2501 sext.w a0,a0 1e5a: 8082 ret 0000000000001e5c <sys_unlinkat>: register long a2 __asm__("a2") = c; 1e5c: 1602 slli a2,a2,0x20 register long a7 __asm__("a7") = n; 1e5e: 02300893 li a7,35 register long a2 __asm__("a2") = c; 1e62: 9201 srli a2,a2,0x20 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1e64: 00000073 ecall int sys_unlinkat(int dirfd, char *path, unsigned int flags) { return syscall(SYS_unlinkat, dirfd, path, flags); } 1e68: 2501 sext.w a0,a0 1e6a: 8082 ret 0000000000001e6c <link>: int link(char *old_path, char *new_path) { 1e6c: 87aa mv a5,a0 1e6e: 86ae mv a3,a1 register long a7 __asm__("a7") = n; 1e70: 02500893 li a7,37 register long a0 __asm__("a0") = a; 1e74: f9c00513 li a0,-100 register long a1 __asm__("a1") = b; 1e78: 85be mv a1,a5 register long a2 __asm__("a2") = c; 1e7a: f9c00613 li a2,-100 register long a4 __asm__("a4") = e; 1e7e: 4701 li a4,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4)) 1e80: 00000073 ecall return sys_linkat(AT_FDCWD, old_path, AT_FDCWD, new_path, 0); } 1e84: 2501 sext.w a0,a0 1e86: 8082 ret 0000000000001e88 <unlink>: int unlink(char *path) { 1e88: 85aa mv a1,a0 register long a7 __asm__("a7") = n; 1e8a: 02300893 li a7,35 register long a0 __asm__("a0") = a; 1e8e: f9c00513 li a0,-100 register long a2 __asm__("a2") = c; 1e92: 4601 li a2,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1e94: 00000073 ecall return sys_unlinkat(AT_FDCWD, path, 0); } 1e98: 2501 sext.w a0,a0 1e9a: 8082 ret 0000000000001e9c <uname>: register long a7 __asm__("a7") = n; 1e9c: 0a000893 li a7,160 __asm_syscall("r"(a7), "0"(a0)) 1ea0: 00000073 ecall int uname(void *buf) { return syscall(SYS_uname, buf); } 1ea4: 2501 sext.w a0,a0 1ea6: 8082 ret 0000000000001ea8 <brk>: register long a7 __asm__("a7") = n; 1ea8: 0d600893 li a7,214 __asm_syscall("r"(a7), "0"(a0)) 1eac: 00000073 ecall int brk(void *addr) { return syscall(SYS_brk, addr); } 1eb0: 2501 sext.w a0,a0 1eb2: 8082 ret 0000000000001eb4 <getcwd>: register long a7 __asm__("a7") = n; 1eb4: 48c5 li a7,17 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1eb6: 00000073 ecall char *getcwd(char *buf, size_t size){ return syscall(SYS_getcwd, buf, size); } 1eba: 8082 ret 0000000000001ebc <chdir>: register long a7 __asm__("a7") = n; 1ebc: 03100893 li a7,49 __asm_syscall("r"(a7), "0"(a0)) 1ec0: 00000073 ecall int chdir(const char *path){ return syscall(SYS_chdir, path); } 1ec4: 2501 sext.w a0,a0 1ec6: 8082 ret 0000000000001ec8 <mkdir>: int mkdir(const char *path, mode_t mode){ 1ec8: 862e mv a2,a1 1eca: 87aa mv a5,a0 register long a2 __asm__("a2") = c; 1ecc: 1602 slli a2,a2,0x20 register long a7 __asm__("a7") = n; 1ece: 02200893 li a7,34 register long a0 __asm__("a0") = a; 1ed2: f9c00513 li a0,-100 register long a1 __asm__("a1") = b; 1ed6: 85be mv a1,a5 register long a2 __asm__("a2") = c; 1ed8: 9201 srli a2,a2,0x20 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1eda: 00000073 ecall return syscall(SYS_mkdirat, AT_FDCWD, path, mode); } 1ede: 2501 sext.w a0,a0 1ee0: 8082 ret 0000000000001ee2 <getdents>: register long a7 __asm__("a7") = n; 1ee2: 03d00893 li a7,61 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1ee6: 00000073 ecall int getdents(int fd, struct linux_dirent64 *dirp64, unsigned long len){ //return syscall(SYS_getdents64, fd, dirp64, len); return syscall(SYS_getdents64, fd, dirp64, len); } 1eea: 2501 sext.w a0,a0 1eec: 8082 ret 0000000000001eee <pipe>: register long a7 __asm__("a7") = n; 1eee: 03b00893 li a7,59 register long a1 __asm__("a1") = b; 1ef2: 4581 li a1,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1ef4: 00000073 ecall int pipe(int fd[2]){ return syscall(SYS_pipe2, fd, 0); } 1ef8: 2501 sext.w a0,a0 1efa: 8082 ret 0000000000001efc <dup>: register long a7 __asm__("a7") = n; 1efc: 48dd li a7,23 __asm_syscall("r"(a7), "0"(a0)) 1efe: 00000073 ecall int dup(int fd){ return syscall(SYS_dup, fd); } 1f02: 2501 sext.w a0,a0 1f04: 8082 ret 0000000000001f06 <dup2>: register long a7 __asm__("a7") = n; 1f06: 48e1 li a7,24 register long a2 __asm__("a2") = c; 1f08: 4601 li a2,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2)) 1f0a: 00000073 ecall int dup2(int old, int new){ return syscall(SYS_dup3, old, new, 0); } 1f0e: 2501 sext.w a0,a0 1f10: 8082 ret 0000000000001f12 <mount>: register long a7 __asm__("a7") = n; 1f12: 02800893 li a7,40 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4)) 1f16: 00000073 ecall int mount(const char *special, const char *dir, const char *fstype, unsigned long flags, const void *data) { return syscall(SYS_mount, special, dir, fstype, flags, data); } 1f1a: 2501 sext.w a0,a0 1f1c: 8082 ret 0000000000001f1e <umount>: register long a7 __asm__("a7") = n; 1f1e: 02700893 li a7,39 register long a1 __asm__("a1") = b; 1f22: 4581 li a1,0 __asm_syscall("r"(a7), "0"(a0), "r"(a1)) 1f24: 00000073 ecall int umount(const char *special) { return syscall(SYS_umount2, special, 0); } 1f28: 2501 sext.w a0,a0 1f2a: 8082 ret 0000000000001f2c <__clone>: .global __clone .type __clone, %function __clone: # Save func and arg to stack addi a1, a1, -16 1f2c: 15c1 addi a1,a1,-16 sd a0, 0(a1) 1f2e: e188 sd a0,0(a1) sd a3, 8(a1) 1f30: e594 sd a3,8(a1) # Call SYS_clone mv a0, a2 1f32: 8532 mv a0,a2 mv a2, a4 1f34: 863a mv a2,a4 mv a3, a5 1f36: 86be mv a3,a5 mv a4, a6 1f38: 8742 mv a4,a6 li a7, 220 # SYS_clone 1f3a: 0dc00893 li a7,220 ecall 1f3e: 00000073 ecall beqz a0, 1f 1f42: c111 beqz a0,1f46 <__clone+0x1a> # Parent ret 1f44: 8082 ret # Child 1: ld a1, 0(sp) 1f46: 6582 ld a1,0(sp) ld a0, 8(sp) 1f48: 6522 ld a0,8(sp) jalr a1 1f4a: 9582 jalr a1 # Exit li a7, 93 # SYS_exit 1f4c: 05d00893 li a7,93 ecall 1f50: 00000073 ecall
i4k_OGLShader/exe/ext.asm
Polyrhythm/demo
0
164228
<reponame>Polyrhythm/demo<filename>i4k_OGLShader/exe/ext.asm ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.10.25019.0 TITLE C:\Users\polyr\Development\cpp\4k\i4k_OGLShader\src\ext.cpp .686P .XMM include listing.inc .model flat INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC ?myglfunc@@3PAPAXA ; myglfunc _BSS SEGMENT ?myglfunc@@3PAPAXA DD 05H DUP (?) ; myglfunc _BSS ENDS PUBLIC ?EXT_Init@@YGHXZ ; EXT_Init PUBLIC ??_C@_0BH@BOJGDFJN@glCreateShaderProgramv?$AA@ ; `string' PUBLIC ??_C@_0BG@CCBKOCA@glGenProgramPipelines?$AA@ ; `string' PUBLIC ??_C@_0BG@GLPOKNCG@glBindProgramPipeline?$AA@ ; `string' PUBLIC ??_C@_0BD@CADKHDMH@glUseProgramStages?$AA@ ; `string' PUBLIC ??_C@_0BE@KBMHINLC@glProgramUniform4fv?$AA@ ; `string' EXTRN __imp__wglGetProcAddress@4:PROC ; COMDAT ??_C@_0BE@KBMHINLC@glProgramUniform4fv?$AA@ CONST SEGMENT ??_C@_0BE@KBMHINLC@glProgramUniform4fv?$AA@ DB 'glProgramUniform4fv', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0BD@CADKHDMH@glUseProgramStages?$AA@ CONST SEGMENT ??_C@_0BD@CADKHDMH@glUseProgramStages?$AA@ DB 'glUseProgramStages', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0BG@GLPOKNCG@glBindProgramPipeline?$AA@ CONST SEGMENT ??_C@_0BG@GLPOKNCG@glBindProgramPipeline?$AA@ DB 'glBindProgramPipeline', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0BG@CCBKOCA@glGenProgramPipelines?$AA@ CONST SEGMENT ??_C@_0BG@CCBKOCA@glGenProgramPipelines?$AA@ DB 'glGenProgramPipelines', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0BH@BOJGDFJN@glCreateShaderProgramv?$AA@ CONST SEGMENT ??_C@_0BH@BOJGDFJN@glCreateShaderProgramv?$AA@ DB 'glCreateShaderProgramv' DB 00H ; `string' CONST ENDS _DATA SEGMENT ?strs@@3PAPADA DD FLAT:??_C@_0BH@BOJGDFJN@glCreateShaderProgramv?$AA@ ; strs DD FLAT:??_C@_0BG@CCBKOCA@glGenProgramPipelines?$AA@ DD FLAT:??_C@_0BG@GLPOKNCG@glBindProgramPipeline?$AA@ DD FLAT:??_C@_0BD@CADKHDMH@glUseProgramStages?$AA@ DD FLAT:??_C@_0BE@KBMHINLC@glProgramUniform4fv?$AA@ _DATA ENDS ; Function compile flags: /Ogspy ; File c:\users\polyr\development\cpp\4k\i4k_oglshader\src\ext.cpp ; COMDAT ?EXT_Init@@YGHXZ _TEXT SEGMENT ?EXT_Init@@YGHXZ PROC ; EXT_Init, COMDAT ; 36 : { push esi ; 37 : for( int i=0; i<NUMFUNCIONES; i++ ) xor esi, esi $LL4@EXT_Init: ; 38 : { ; 39 : #ifdef WINDOWS ; 40 : myglfunc[i] = wglGetProcAddress( strs[i] ); push DWORD PTR ?strs@@3PAPADA[esi] call DWORD PTR __imp__wglGetProcAddress@4 mov DWORD PTR ?myglfunc@@3PAPAXA[esi], eax ; 41 : #endif ; 42 : #ifdef LINUX ; 43 : myglfunc[i] = glXGetProcAddress( (const unsigned char *)strs[i] ); ; 44 : #endif ; 45 : if( !myglfunc[i] ) test eax, eax je SHORT $LN8@EXT_Init ; 37 : for( int i=0; i<NUMFUNCIONES; i++ ) add esi, 4 cmp esi, 20 ; 00000014H jl SHORT $LL4@EXT_Init ; 47 : } ; 48 : return( 1 ); xor eax, eax inc eax pop esi ; 49 : } ret 0 $LN8@EXT_Init: ; 46 : return( 0 ); xor eax, eax pop esi ; 49 : } ret 0 ?EXT_Init@@YGHXZ ENDP ; EXT_Init _TEXT ENDS END