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
alloy4fun_models/trainstlt/models/4/ky9YJucPD3vwY9JFu.als
Kaixi26/org.alloytools.alloy
0
2719
<reponame>Kaixi26/org.alloytools.alloy open main pred idky9YJucPD3vwY9JFu_prop5 { all t:Train { some t.pos =>{ t.pos in Exit => t.pos' = t.pos - t.pos t.pos in (Track - Exit) => { one tk:((t.pos).prox) | t.pos' = tk } } } } pred __repair { idky9YJucPD3vwY9JFu_prop5 } check __repair { idky9YJucPD3vwY9JFu_prop5 <=> prop5o }
org.sourcepit.antlr4.eclipse.lang.tests/LittleJ.g4
berndv/antlr4-eclipse
0
6584
grammar LittleJ; @header { /** * Copyright 2015 <NAME> and others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.sourcepit.antlr4.eclipse.lang.tests.littlej; } compilationUnit : packageDeclaration? importDeclaration* classDeclaration EOF ; packageDeclaration : 'package' ID ( '.' ID )* ; importDeclaration : singleTypeImportDeclaration | typeImportOnDemandDeclaration | singleStaticImportDeclaration | staticImportOnDemandDeclaration ; singleTypeImportDeclaration : 'import' typeName ; typeImportOnDemandDeclaration : 'import' packageOrTypeName '.' '*' ; singleStaticImportDeclaration : 'import' 'static' typeName '.' ID ; staticImportOnDemandDeclaration : 'import' 'static' typeName '.' '*' ; classDeclaration : 'class' ID classBody ; classBody : '{' classBodyDeclaration* '}' ; classBodyDeclaration : memberDeclaration | methodDeclaration ; memberDeclaration : typeName fieldName ';' ; methodDeclaration : typeName methodName methodBody ; methodBody : '{' methodBodyDeclaration* '}' ; methodBodyDeclaration : statement ; statement : ifStatement | doWhileStatement ; ifStatement : 'if' '(' expression ')' block ; doWhileStatement : 'do' block 'while' '(' expression ')' ; expression : ID '==' ID ; block : '{' '}' ; packageOrTypeName : qualifiedName ; typeName : qualifiedName ; fieldName : ID ; methodName : ID ; qualifiedName : ID ( '.' ID )* ; ID : NameStartChar NameChar* ; fragment NameChar : NameStartChar | '0'..'9' | '_' | '\u00B7' | '\u0300'..'\u036F' | '\u203F'..'\u2040' ; fragment NameStartChar : 'A'..'Z' | 'a'..'z' | '\u00C0'..'\u00D6' | '\u00D8'..'\u00F6' | '\u00F8'..'\u02FF' | '\u0370'..'\u037D' | '\u037F'..'\u1FFF' | '\u200C'..'\u200D' | '\u2070'..'\u218F' | '\u2C00'..'\u2FEF' | '\u3001'..'\uD7FF' | '\uF900'..'\uFDCF' | '\uFDF0'..'\uFFFD' ; // ignores | ['\u10000-'\uEFFFF] ; WS : [ \t\r\n\u000C]+ -> channel(WS) ; COMMENT : '/*' .*? '*/' -> channel(HIDDEN) ; LINE_COMMENT : '//' ~[\r\n]* -> channel(HIDDEN) ;
libsrc/_DEVELOPMENT/l/z80/l_ei_reti.asm
ahjelm/z88dk
640
80634
<reponame>ahjelm/z88dk<gh_stars>100-1000 IF !__CPU_RABBIT__ SECTION code_clib SECTION code_l PUBLIC l_ei_reti l_ei_reti: ei reti ENDIF
zombie.asm
tphan022/CS153assn2_p1
0
19165
_zombie: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(void) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 e4 f0 and $0xfffffff0,%esp 6: 83 ec 10 sub $0x10,%esp if(fork() > 0) 9: e8 72 02 00 00 call 280 <fork> e: 85 c0 test %eax,%eax 10: 7e 0c jle 1e <main+0x1e> sleep(5); // Let child exit before parent. 12: c7 04 24 05 00 00 00 movl $0x5,(%esp) 19: e8 fa 02 00 00 call 318 <sleep> exit(); 1e: e8 65 02 00 00 call 288 <exit> 23: 90 nop 00000024 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 24: 55 push %ebp 25: 89 e5 mov %esp,%ebp 27: 57 push %edi 28: 53 push %ebx asm volatile("cld; rep stosb" : 29: 8b 4d 08 mov 0x8(%ebp),%ecx 2c: 8b 55 10 mov 0x10(%ebp),%edx 2f: 8b 45 0c mov 0xc(%ebp),%eax 32: 89 cb mov %ecx,%ebx 34: 89 df mov %ebx,%edi 36: 89 d1 mov %edx,%ecx 38: fc cld 39: f3 aa rep stos %al,%es:(%edi) 3b: 89 ca mov %ecx,%edx 3d: 89 fb mov %edi,%ebx 3f: 89 5d 08 mov %ebx,0x8(%ebp) 42: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 45: 5b pop %ebx 46: 5f pop %edi 47: 5d pop %ebp 48: c3 ret 00000049 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 49: 55 push %ebp 4a: 89 e5 mov %esp,%ebp 4c: 83 ec 10 sub $0x10,%esp char *os; os = s; 4f: 8b 45 08 mov 0x8(%ebp),%eax 52: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 55: 8b 45 0c mov 0xc(%ebp),%eax 58: 0f b6 10 movzbl (%eax),%edx 5b: 8b 45 08 mov 0x8(%ebp),%eax 5e: 88 10 mov %dl,(%eax) 60: 8b 45 08 mov 0x8(%ebp),%eax 63: 0f b6 00 movzbl (%eax),%eax 66: 84 c0 test %al,%al 68: 0f 95 c0 setne %al 6b: 83 45 08 01 addl $0x1,0x8(%ebp) 6f: 83 45 0c 01 addl $0x1,0xc(%ebp) 73: 84 c0 test %al,%al 75: 75 de jne 55 <strcpy+0xc> ; return os; 77: 8b 45 fc mov -0x4(%ebp),%eax } 7a: c9 leave 7b: c3 ret 0000007c <strcmp>: int strcmp(const char *p, const char *q) { 7c: 55 push %ebp 7d: 89 e5 mov %esp,%ebp while(*p && *p == *q) 7f: eb 08 jmp 89 <strcmp+0xd> p++, q++; 81: 83 45 08 01 addl $0x1,0x8(%ebp) 85: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 89: 8b 45 08 mov 0x8(%ebp),%eax 8c: 0f b6 00 movzbl (%eax),%eax 8f: 84 c0 test %al,%al 91: 74 10 je a3 <strcmp+0x27> 93: 8b 45 08 mov 0x8(%ebp),%eax 96: 0f b6 10 movzbl (%eax),%edx 99: 8b 45 0c mov 0xc(%ebp),%eax 9c: 0f b6 00 movzbl (%eax),%eax 9f: 38 c2 cmp %al,%dl a1: 74 de je 81 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; a3: 8b 45 08 mov 0x8(%ebp),%eax a6: 0f b6 00 movzbl (%eax),%eax a9: 0f b6 d0 movzbl %al,%edx ac: 8b 45 0c mov 0xc(%ebp),%eax af: 0f b6 00 movzbl (%eax),%eax b2: 0f b6 c0 movzbl %al,%eax b5: 89 d1 mov %edx,%ecx b7: 29 c1 sub %eax,%ecx b9: 89 c8 mov %ecx,%eax } bb: 5d pop %ebp bc: c3 ret 000000bd <strlen>: uint strlen(char *s) { bd: 55 push %ebp be: 89 e5 mov %esp,%ebp c0: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) c3: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) ca: eb 04 jmp d0 <strlen+0x13> cc: 83 45 fc 01 addl $0x1,-0x4(%ebp) d0: 8b 45 fc mov -0x4(%ebp),%eax d3: 03 45 08 add 0x8(%ebp),%eax d6: 0f b6 00 movzbl (%eax),%eax d9: 84 c0 test %al,%al db: 75 ef jne cc <strlen+0xf> ; return n; dd: 8b 45 fc mov -0x4(%ebp),%eax } e0: c9 leave e1: c3 ret 000000e2 <memset>: void* memset(void *dst, int c, uint n) { e2: 55 push %ebp e3: 89 e5 mov %esp,%ebp e5: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); e8: 8b 45 10 mov 0x10(%ebp),%eax eb: 89 44 24 08 mov %eax,0x8(%esp) ef: 8b 45 0c mov 0xc(%ebp),%eax f2: 89 44 24 04 mov %eax,0x4(%esp) f6: 8b 45 08 mov 0x8(%ebp),%eax f9: 89 04 24 mov %eax,(%esp) fc: e8 23 ff ff ff call 24 <stosb> return dst; 101: 8b 45 08 mov 0x8(%ebp),%eax } 104: c9 leave 105: c3 ret 00000106 <strchr>: char* strchr(const char *s, char c) { 106: 55 push %ebp 107: 89 e5 mov %esp,%ebp 109: 83 ec 04 sub $0x4,%esp 10c: 8b 45 0c mov 0xc(%ebp),%eax 10f: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 112: eb 14 jmp 128 <strchr+0x22> if(*s == c) 114: 8b 45 08 mov 0x8(%ebp),%eax 117: 0f b6 00 movzbl (%eax),%eax 11a: 3a 45 fc cmp -0x4(%ebp),%al 11d: 75 05 jne 124 <strchr+0x1e> return (char*)s; 11f: 8b 45 08 mov 0x8(%ebp),%eax 122: eb 13 jmp 137 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 124: 83 45 08 01 addl $0x1,0x8(%ebp) 128: 8b 45 08 mov 0x8(%ebp),%eax 12b: 0f b6 00 movzbl (%eax),%eax 12e: 84 c0 test %al,%al 130: 75 e2 jne 114 <strchr+0xe> if(*s == c) return (char*)s; return 0; 132: b8 00 00 00 00 mov $0x0,%eax } 137: c9 leave 138: c3 ret 00000139 <gets>: char* gets(char *buf, int max) { 139: 55 push %ebp 13a: 89 e5 mov %esp,%ebp 13c: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 13f: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 146: eb 44 jmp 18c <gets+0x53> cc = read(0, &c, 1); 148: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 14f: 00 150: 8d 45 ef lea -0x11(%ebp),%eax 153: 89 44 24 04 mov %eax,0x4(%esp) 157: c7 04 24 00 00 00 00 movl $0x0,(%esp) 15e: e8 3d 01 00 00 call 2a0 <read> 163: 89 45 f4 mov %eax,-0xc(%ebp) if(cc < 1) 166: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 16a: 7e 2d jle 199 <gets+0x60> break; buf[i++] = c; 16c: 8b 45 f0 mov -0x10(%ebp),%eax 16f: 03 45 08 add 0x8(%ebp),%eax 172: 0f b6 55 ef movzbl -0x11(%ebp),%edx 176: 88 10 mov %dl,(%eax) 178: 83 45 f0 01 addl $0x1,-0x10(%ebp) if(c == '\n' || c == '\r') 17c: 0f b6 45 ef movzbl -0x11(%ebp),%eax 180: 3c 0a cmp $0xa,%al 182: 74 16 je 19a <gets+0x61> 184: 0f b6 45 ef movzbl -0x11(%ebp),%eax 188: 3c 0d cmp $0xd,%al 18a: 74 0e je 19a <gets+0x61> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 18c: 8b 45 f0 mov -0x10(%ebp),%eax 18f: 83 c0 01 add $0x1,%eax 192: 3b 45 0c cmp 0xc(%ebp),%eax 195: 7c b1 jl 148 <gets+0xf> 197: eb 01 jmp 19a <gets+0x61> cc = read(0, &c, 1); if(cc < 1) break; 199: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 19a: 8b 45 f0 mov -0x10(%ebp),%eax 19d: 03 45 08 add 0x8(%ebp),%eax 1a0: c6 00 00 movb $0x0,(%eax) return buf; 1a3: 8b 45 08 mov 0x8(%ebp),%eax } 1a6: c9 leave 1a7: c3 ret 000001a8 <stat>: int stat(char *n, struct stat *st) { 1a8: 55 push %ebp 1a9: 89 e5 mov %esp,%ebp 1ab: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 1ae: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1b5: 00 1b6: 8b 45 08 mov 0x8(%ebp),%eax 1b9: 89 04 24 mov %eax,(%esp) 1bc: e8 07 01 00 00 call 2c8 <open> 1c1: 89 45 f0 mov %eax,-0x10(%ebp) if(fd < 0) 1c4: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1c8: 79 07 jns 1d1 <stat+0x29> return -1; 1ca: b8 ff ff ff ff mov $0xffffffff,%eax 1cf: eb 23 jmp 1f4 <stat+0x4c> r = fstat(fd, st); 1d1: 8b 45 0c mov 0xc(%ebp),%eax 1d4: 89 44 24 04 mov %eax,0x4(%esp) 1d8: 8b 45 f0 mov -0x10(%ebp),%eax 1db: 89 04 24 mov %eax,(%esp) 1de: e8 fd 00 00 00 call 2e0 <fstat> 1e3: 89 45 f4 mov %eax,-0xc(%ebp) close(fd); 1e6: 8b 45 f0 mov -0x10(%ebp),%eax 1e9: 89 04 24 mov %eax,(%esp) 1ec: e8 bf 00 00 00 call 2b0 <close> return r; 1f1: 8b 45 f4 mov -0xc(%ebp),%eax } 1f4: c9 leave 1f5: c3 ret 000001f6 <atoi>: int atoi(const char *s) { 1f6: 55 push %ebp 1f7: 89 e5 mov %esp,%ebp 1f9: 83 ec 10 sub $0x10,%esp int n; n = 0; 1fc: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 203: eb 24 jmp 229 <atoi+0x33> n = n*10 + *s++ - '0'; 205: 8b 55 fc mov -0x4(%ebp),%edx 208: 89 d0 mov %edx,%eax 20a: c1 e0 02 shl $0x2,%eax 20d: 01 d0 add %edx,%eax 20f: 01 c0 add %eax,%eax 211: 89 c2 mov %eax,%edx 213: 8b 45 08 mov 0x8(%ebp),%eax 216: 0f b6 00 movzbl (%eax),%eax 219: 0f be c0 movsbl %al,%eax 21c: 8d 04 02 lea (%edx,%eax,1),%eax 21f: 83 e8 30 sub $0x30,%eax 222: 89 45 fc mov %eax,-0x4(%ebp) 225: 83 45 08 01 addl $0x1,0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 229: 8b 45 08 mov 0x8(%ebp),%eax 22c: 0f b6 00 movzbl (%eax),%eax 22f: 3c 2f cmp $0x2f,%al 231: 7e 0a jle 23d <atoi+0x47> 233: 8b 45 08 mov 0x8(%ebp),%eax 236: 0f b6 00 movzbl (%eax),%eax 239: 3c 39 cmp $0x39,%al 23b: 7e c8 jle 205 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 23d: 8b 45 fc mov -0x4(%ebp),%eax } 240: c9 leave 241: c3 ret 00000242 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 242: 55 push %ebp 243: 89 e5 mov %esp,%ebp 245: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 248: 8b 45 08 mov 0x8(%ebp),%eax 24b: 89 45 f8 mov %eax,-0x8(%ebp) src = vsrc; 24e: 8b 45 0c mov 0xc(%ebp),%eax 251: 89 45 fc mov %eax,-0x4(%ebp) while(n-- > 0) 254: eb 13 jmp 269 <memmove+0x27> *dst++ = *src++; 256: 8b 45 fc mov -0x4(%ebp),%eax 259: 0f b6 10 movzbl (%eax),%edx 25c: 8b 45 f8 mov -0x8(%ebp),%eax 25f: 88 10 mov %dl,(%eax) 261: 83 45 f8 01 addl $0x1,-0x8(%ebp) 265: 83 45 fc 01 addl $0x1,-0x4(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 269: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 26d: 0f 9f c0 setg %al 270: 83 6d 10 01 subl $0x1,0x10(%ebp) 274: 84 c0 test %al,%al 276: 75 de jne 256 <memmove+0x14> *dst++ = *src++; return vdst; 278: 8b 45 08 mov 0x8(%ebp),%eax } 27b: c9 leave 27c: c3 ret 27d: 90 nop 27e: 90 nop 27f: 90 nop 00000280 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 280: b8 01 00 00 00 mov $0x1,%eax 285: cd 40 int $0x40 287: c3 ret 00000288 <exit>: SYSCALL(exit) 288: b8 02 00 00 00 mov $0x2,%eax 28d: cd 40 int $0x40 28f: c3 ret 00000290 <wait>: SYSCALL(wait) 290: b8 03 00 00 00 mov $0x3,%eax 295: cd 40 int $0x40 297: c3 ret 00000298 <pipe>: SYSCALL(pipe) 298: b8 04 00 00 00 mov $0x4,%eax 29d: cd 40 int $0x40 29f: c3 ret 000002a0 <read>: SYSCALL(read) 2a0: b8 05 00 00 00 mov $0x5,%eax 2a5: cd 40 int $0x40 2a7: c3 ret 000002a8 <write>: SYSCALL(write) 2a8: b8 10 00 00 00 mov $0x10,%eax 2ad: cd 40 int $0x40 2af: c3 ret 000002b0 <close>: SYSCALL(close) 2b0: b8 15 00 00 00 mov $0x15,%eax 2b5: cd 40 int $0x40 2b7: c3 ret 000002b8 <kill>: SYSCALL(kill) 2b8: b8 06 00 00 00 mov $0x6,%eax 2bd: cd 40 int $0x40 2bf: c3 ret 000002c0 <exec>: SYSCALL(exec) 2c0: b8 07 00 00 00 mov $0x7,%eax 2c5: cd 40 int $0x40 2c7: c3 ret 000002c8 <open>: SYSCALL(open) 2c8: b8 0f 00 00 00 mov $0xf,%eax 2cd: cd 40 int $0x40 2cf: c3 ret 000002d0 <mknod>: SYSCALL(mknod) 2d0: b8 11 00 00 00 mov $0x11,%eax 2d5: cd 40 int $0x40 2d7: c3 ret 000002d8 <unlink>: SYSCALL(unlink) 2d8: b8 12 00 00 00 mov $0x12,%eax 2dd: cd 40 int $0x40 2df: c3 ret 000002e0 <fstat>: SYSCALL(fstat) 2e0: b8 08 00 00 00 mov $0x8,%eax 2e5: cd 40 int $0x40 2e7: c3 ret 000002e8 <link>: SYSCALL(link) 2e8: b8 13 00 00 00 mov $0x13,%eax 2ed: cd 40 int $0x40 2ef: c3 ret 000002f0 <mkdir>: SYSCALL(mkdir) 2f0: b8 14 00 00 00 mov $0x14,%eax 2f5: cd 40 int $0x40 2f7: c3 ret 000002f8 <chdir>: SYSCALL(chdir) 2f8: b8 09 00 00 00 mov $0x9,%eax 2fd: cd 40 int $0x40 2ff: c3 ret 00000300 <dup>: SYSCALL(dup) 300: b8 0a 00 00 00 mov $0xa,%eax 305: cd 40 int $0x40 307: c3 ret 00000308 <getpid>: SYSCALL(getpid) 308: b8 0b 00 00 00 mov $0xb,%eax 30d: cd 40 int $0x40 30f: c3 ret 00000310 <sbrk>: SYSCALL(sbrk) 310: b8 0c 00 00 00 mov $0xc,%eax 315: cd 40 int $0x40 317: c3 ret 00000318 <sleep>: SYSCALL(sleep) 318: b8 0d 00 00 00 mov $0xd,%eax 31d: cd 40 int $0x40 31f: c3 ret 00000320 <uptime>: SYSCALL(uptime) 320: b8 0e 00 00 00 mov $0xe,%eax 325: cd 40 int $0x40 327: c3 ret 00000328 <clone>: SYSCALL(clone) 328: b8 16 00 00 00 mov $0x16,%eax 32d: cd 40 int $0x40 32f: c3 ret 00000330 <texit>: SYSCALL(texit) 330: b8 17 00 00 00 mov $0x17,%eax 335: cd 40 int $0x40 337: c3 ret 00000338 <tsleep>: SYSCALL(tsleep) 338: b8 18 00 00 00 mov $0x18,%eax 33d: cd 40 int $0x40 33f: c3 ret 00000340 <twakeup>: SYSCALL(twakeup) 340: b8 19 00 00 00 mov $0x19,%eax 345: cd 40 int $0x40 347: c3 ret 00000348 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 348: 55 push %ebp 349: 89 e5 mov %esp,%ebp 34b: 83 ec 28 sub $0x28,%esp 34e: 8b 45 0c mov 0xc(%ebp),%eax 351: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 354: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 35b: 00 35c: 8d 45 f4 lea -0xc(%ebp),%eax 35f: 89 44 24 04 mov %eax,0x4(%esp) 363: 8b 45 08 mov 0x8(%ebp),%eax 366: 89 04 24 mov %eax,(%esp) 369: e8 3a ff ff ff call 2a8 <write> } 36e: c9 leave 36f: c3 ret 00000370 <printint>: static void printint(int fd, int xx, int base, int sgn) { 370: 55 push %ebp 371: 89 e5 mov %esp,%ebp 373: 53 push %ebx 374: 83 ec 44 sub $0x44,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 377: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 37e: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 382: 74 17 je 39b <printint+0x2b> 384: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 388: 79 11 jns 39b <printint+0x2b> neg = 1; 38a: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 391: 8b 45 0c mov 0xc(%ebp),%eax 394: f7 d8 neg %eax 396: 89 45 f4 mov %eax,-0xc(%ebp) char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 399: eb 06 jmp 3a1 <printint+0x31> neg = 1; x = -xx; } else { x = xx; 39b: 8b 45 0c mov 0xc(%ebp),%eax 39e: 89 45 f4 mov %eax,-0xc(%ebp) } i = 0; 3a1: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) do{ buf[i++] = digits[x % base]; 3a8: 8b 4d ec mov -0x14(%ebp),%ecx 3ab: 8b 5d 10 mov 0x10(%ebp),%ebx 3ae: 8b 45 f4 mov -0xc(%ebp),%eax 3b1: ba 00 00 00 00 mov $0x0,%edx 3b6: f7 f3 div %ebx 3b8: 89 d0 mov %edx,%eax 3ba: 0f b6 80 8c 0a 00 00 movzbl 0xa8c(%eax),%eax 3c1: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) 3c5: 83 45 ec 01 addl $0x1,-0x14(%ebp) }while((x /= base) != 0); 3c9: 8b 45 10 mov 0x10(%ebp),%eax 3cc: 89 45 d4 mov %eax,-0x2c(%ebp) 3cf: 8b 45 f4 mov -0xc(%ebp),%eax 3d2: ba 00 00 00 00 mov $0x0,%edx 3d7: f7 75 d4 divl -0x2c(%ebp) 3da: 89 45 f4 mov %eax,-0xc(%ebp) 3dd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 3e1: 75 c5 jne 3a8 <printint+0x38> if(neg) 3e3: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 3e7: 74 28 je 411 <printint+0xa1> buf[i++] = '-'; 3e9: 8b 45 ec mov -0x14(%ebp),%eax 3ec: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) 3f1: 83 45 ec 01 addl $0x1,-0x14(%ebp) while(--i >= 0) 3f5: eb 1a jmp 411 <printint+0xa1> putc(fd, buf[i]); 3f7: 8b 45 ec mov -0x14(%ebp),%eax 3fa: 0f b6 44 05 dc movzbl -0x24(%ebp,%eax,1),%eax 3ff: 0f be c0 movsbl %al,%eax 402: 89 44 24 04 mov %eax,0x4(%esp) 406: 8b 45 08 mov 0x8(%ebp),%eax 409: 89 04 24 mov %eax,(%esp) 40c: e8 37 ff ff ff call 348 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 411: 83 6d ec 01 subl $0x1,-0x14(%ebp) 415: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 419: 79 dc jns 3f7 <printint+0x87> putc(fd, buf[i]); } 41b: 83 c4 44 add $0x44,%esp 41e: 5b pop %ebx 41f: 5d pop %ebp 420: c3 ret 00000421 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 421: 55 push %ebp 422: 89 e5 mov %esp,%ebp 424: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 427: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) ap = (uint*)(void*)&fmt + 1; 42e: 8d 45 0c lea 0xc(%ebp),%eax 431: 83 c0 04 add $0x4,%eax 434: 89 45 f4 mov %eax,-0xc(%ebp) for(i = 0; fmt[i]; i++){ 437: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) 43e: e9 7e 01 00 00 jmp 5c1 <printf+0x1a0> c = fmt[i] & 0xff; 443: 8b 55 0c mov 0xc(%ebp),%edx 446: 8b 45 ec mov -0x14(%ebp),%eax 449: 8d 04 02 lea (%edx,%eax,1),%eax 44c: 0f b6 00 movzbl (%eax),%eax 44f: 0f be c0 movsbl %al,%eax 452: 25 ff 00 00 00 and $0xff,%eax 457: 89 45 e8 mov %eax,-0x18(%ebp) if(state == 0){ 45a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 45e: 75 2c jne 48c <printf+0x6b> if(c == '%'){ 460: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 464: 75 0c jne 472 <printf+0x51> state = '%'; 466: c7 45 f0 25 00 00 00 movl $0x25,-0x10(%ebp) 46d: e9 4b 01 00 00 jmp 5bd <printf+0x19c> } else { putc(fd, c); 472: 8b 45 e8 mov -0x18(%ebp),%eax 475: 0f be c0 movsbl %al,%eax 478: 89 44 24 04 mov %eax,0x4(%esp) 47c: 8b 45 08 mov 0x8(%ebp),%eax 47f: 89 04 24 mov %eax,(%esp) 482: e8 c1 fe ff ff call 348 <putc> 487: e9 31 01 00 00 jmp 5bd <printf+0x19c> } } else if(state == '%'){ 48c: 83 7d f0 25 cmpl $0x25,-0x10(%ebp) 490: 0f 85 27 01 00 00 jne 5bd <printf+0x19c> if(c == 'd'){ 496: 83 7d e8 64 cmpl $0x64,-0x18(%ebp) 49a: 75 2d jne 4c9 <printf+0xa8> printint(fd, *ap, 10, 1); 49c: 8b 45 f4 mov -0xc(%ebp),%eax 49f: 8b 00 mov (%eax),%eax 4a1: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 4a8: 00 4a9: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 4b0: 00 4b1: 89 44 24 04 mov %eax,0x4(%esp) 4b5: 8b 45 08 mov 0x8(%ebp),%eax 4b8: 89 04 24 mov %eax,(%esp) 4bb: e8 b0 fe ff ff call 370 <printint> ap++; 4c0: 83 45 f4 04 addl $0x4,-0xc(%ebp) 4c4: e9 ed 00 00 00 jmp 5b6 <printf+0x195> } else if(c == 'x' || c == 'p'){ 4c9: 83 7d e8 78 cmpl $0x78,-0x18(%ebp) 4cd: 74 06 je 4d5 <printf+0xb4> 4cf: 83 7d e8 70 cmpl $0x70,-0x18(%ebp) 4d3: 75 2d jne 502 <printf+0xe1> printint(fd, *ap, 16, 0); 4d5: 8b 45 f4 mov -0xc(%ebp),%eax 4d8: 8b 00 mov (%eax),%eax 4da: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 4e1: 00 4e2: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 4e9: 00 4ea: 89 44 24 04 mov %eax,0x4(%esp) 4ee: 8b 45 08 mov 0x8(%ebp),%eax 4f1: 89 04 24 mov %eax,(%esp) 4f4: e8 77 fe ff ff call 370 <printint> ap++; 4f9: 83 45 f4 04 addl $0x4,-0xc(%ebp) } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 4fd: e9 b4 00 00 00 jmp 5b6 <printf+0x195> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 502: 83 7d e8 73 cmpl $0x73,-0x18(%ebp) 506: 75 46 jne 54e <printf+0x12d> s = (char*)*ap; 508: 8b 45 f4 mov -0xc(%ebp),%eax 50b: 8b 00 mov (%eax),%eax 50d: 89 45 e4 mov %eax,-0x1c(%ebp) ap++; 510: 83 45 f4 04 addl $0x4,-0xc(%ebp) if(s == 0) 514: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 518: 75 27 jne 541 <printf+0x120> s = "(null)"; 51a: c7 45 e4 59 0a 00 00 movl $0xa59,-0x1c(%ebp) while(*s != 0){ 521: eb 1f jmp 542 <printf+0x121> putc(fd, *s); 523: 8b 45 e4 mov -0x1c(%ebp),%eax 526: 0f b6 00 movzbl (%eax),%eax 529: 0f be c0 movsbl %al,%eax 52c: 89 44 24 04 mov %eax,0x4(%esp) 530: 8b 45 08 mov 0x8(%ebp),%eax 533: 89 04 24 mov %eax,(%esp) 536: e8 0d fe ff ff call 348 <putc> s++; 53b: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 53f: eb 01 jmp 542 <printf+0x121> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 541: 90 nop 542: 8b 45 e4 mov -0x1c(%ebp),%eax 545: 0f b6 00 movzbl (%eax),%eax 548: 84 c0 test %al,%al 54a: 75 d7 jne 523 <printf+0x102> 54c: eb 68 jmp 5b6 <printf+0x195> putc(fd, *s); s++; } } else if(c == 'c'){ 54e: 83 7d e8 63 cmpl $0x63,-0x18(%ebp) 552: 75 1d jne 571 <printf+0x150> putc(fd, *ap); 554: 8b 45 f4 mov -0xc(%ebp),%eax 557: 8b 00 mov (%eax),%eax 559: 0f be c0 movsbl %al,%eax 55c: 89 44 24 04 mov %eax,0x4(%esp) 560: 8b 45 08 mov 0x8(%ebp),%eax 563: 89 04 24 mov %eax,(%esp) 566: e8 dd fd ff ff call 348 <putc> ap++; 56b: 83 45 f4 04 addl $0x4,-0xc(%ebp) 56f: eb 45 jmp 5b6 <printf+0x195> } else if(c == '%'){ 571: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 575: 75 17 jne 58e <printf+0x16d> putc(fd, c); 577: 8b 45 e8 mov -0x18(%ebp),%eax 57a: 0f be c0 movsbl %al,%eax 57d: 89 44 24 04 mov %eax,0x4(%esp) 581: 8b 45 08 mov 0x8(%ebp),%eax 584: 89 04 24 mov %eax,(%esp) 587: e8 bc fd ff ff call 348 <putc> 58c: eb 28 jmp 5b6 <printf+0x195> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 58e: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 595: 00 596: 8b 45 08 mov 0x8(%ebp),%eax 599: 89 04 24 mov %eax,(%esp) 59c: e8 a7 fd ff ff call 348 <putc> putc(fd, c); 5a1: 8b 45 e8 mov -0x18(%ebp),%eax 5a4: 0f be c0 movsbl %al,%eax 5a7: 89 44 24 04 mov %eax,0x4(%esp) 5ab: 8b 45 08 mov 0x8(%ebp),%eax 5ae: 89 04 24 mov %eax,(%esp) 5b1: e8 92 fd ff ff call 348 <putc> } state = 0; 5b6: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 5bd: 83 45 ec 01 addl $0x1,-0x14(%ebp) 5c1: 8b 55 0c mov 0xc(%ebp),%edx 5c4: 8b 45 ec mov -0x14(%ebp),%eax 5c7: 8d 04 02 lea (%edx,%eax,1),%eax 5ca: 0f b6 00 movzbl (%eax),%eax 5cd: 84 c0 test %al,%al 5cf: 0f 85 6e fe ff ff jne 443 <printf+0x22> putc(fd, c); } state = 0; } } } 5d5: c9 leave 5d6: c3 ret 5d7: 90 nop 000005d8 <free>: static Header base; static Header *freep; void free(void *ap) { 5d8: 55 push %ebp 5d9: 89 e5 mov %esp,%ebp 5db: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 5de: 8b 45 08 mov 0x8(%ebp),%eax 5e1: 83 e8 08 sub $0x8,%eax 5e4: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 5e7: a1 ac 0a 00 00 mov 0xaac,%eax 5ec: 89 45 fc mov %eax,-0x4(%ebp) 5ef: eb 24 jmp 615 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 5f1: 8b 45 fc mov -0x4(%ebp),%eax 5f4: 8b 00 mov (%eax),%eax 5f6: 3b 45 fc cmp -0x4(%ebp),%eax 5f9: 77 12 ja 60d <free+0x35> 5fb: 8b 45 f8 mov -0x8(%ebp),%eax 5fe: 3b 45 fc cmp -0x4(%ebp),%eax 601: 77 24 ja 627 <free+0x4f> 603: 8b 45 fc mov -0x4(%ebp),%eax 606: 8b 00 mov (%eax),%eax 608: 3b 45 f8 cmp -0x8(%ebp),%eax 60b: 77 1a ja 627 <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) 60d: 8b 45 fc mov -0x4(%ebp),%eax 610: 8b 00 mov (%eax),%eax 612: 89 45 fc mov %eax,-0x4(%ebp) 615: 8b 45 f8 mov -0x8(%ebp),%eax 618: 3b 45 fc cmp -0x4(%ebp),%eax 61b: 76 d4 jbe 5f1 <free+0x19> 61d: 8b 45 fc mov -0x4(%ebp),%eax 620: 8b 00 mov (%eax),%eax 622: 3b 45 f8 cmp -0x8(%ebp),%eax 625: 76 ca jbe 5f1 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 627: 8b 45 f8 mov -0x8(%ebp),%eax 62a: 8b 40 04 mov 0x4(%eax),%eax 62d: c1 e0 03 shl $0x3,%eax 630: 89 c2 mov %eax,%edx 632: 03 55 f8 add -0x8(%ebp),%edx 635: 8b 45 fc mov -0x4(%ebp),%eax 638: 8b 00 mov (%eax),%eax 63a: 39 c2 cmp %eax,%edx 63c: 75 24 jne 662 <free+0x8a> bp->s.size += p->s.ptr->s.size; 63e: 8b 45 f8 mov -0x8(%ebp),%eax 641: 8b 50 04 mov 0x4(%eax),%edx 644: 8b 45 fc mov -0x4(%ebp),%eax 647: 8b 00 mov (%eax),%eax 649: 8b 40 04 mov 0x4(%eax),%eax 64c: 01 c2 add %eax,%edx 64e: 8b 45 f8 mov -0x8(%ebp),%eax 651: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 654: 8b 45 fc mov -0x4(%ebp),%eax 657: 8b 00 mov (%eax),%eax 659: 8b 10 mov (%eax),%edx 65b: 8b 45 f8 mov -0x8(%ebp),%eax 65e: 89 10 mov %edx,(%eax) 660: eb 0a jmp 66c <free+0x94> } else bp->s.ptr = p->s.ptr; 662: 8b 45 fc mov -0x4(%ebp),%eax 665: 8b 10 mov (%eax),%edx 667: 8b 45 f8 mov -0x8(%ebp),%eax 66a: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 66c: 8b 45 fc mov -0x4(%ebp),%eax 66f: 8b 40 04 mov 0x4(%eax),%eax 672: c1 e0 03 shl $0x3,%eax 675: 03 45 fc add -0x4(%ebp),%eax 678: 3b 45 f8 cmp -0x8(%ebp),%eax 67b: 75 20 jne 69d <free+0xc5> p->s.size += bp->s.size; 67d: 8b 45 fc mov -0x4(%ebp),%eax 680: 8b 50 04 mov 0x4(%eax),%edx 683: 8b 45 f8 mov -0x8(%ebp),%eax 686: 8b 40 04 mov 0x4(%eax),%eax 689: 01 c2 add %eax,%edx 68b: 8b 45 fc mov -0x4(%ebp),%eax 68e: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 691: 8b 45 f8 mov -0x8(%ebp),%eax 694: 8b 10 mov (%eax),%edx 696: 8b 45 fc mov -0x4(%ebp),%eax 699: 89 10 mov %edx,(%eax) 69b: eb 08 jmp 6a5 <free+0xcd> } else p->s.ptr = bp; 69d: 8b 45 fc mov -0x4(%ebp),%eax 6a0: 8b 55 f8 mov -0x8(%ebp),%edx 6a3: 89 10 mov %edx,(%eax) freep = p; 6a5: 8b 45 fc mov -0x4(%ebp),%eax 6a8: a3 ac 0a 00 00 mov %eax,0xaac } 6ad: c9 leave 6ae: c3 ret 000006af <morecore>: static Header* morecore(uint nu) { 6af: 55 push %ebp 6b0: 89 e5 mov %esp,%ebp 6b2: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 6b5: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 6bc: 77 07 ja 6c5 <morecore+0x16> nu = 4096; 6be: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 6c5: 8b 45 08 mov 0x8(%ebp),%eax 6c8: c1 e0 03 shl $0x3,%eax 6cb: 89 04 24 mov %eax,(%esp) 6ce: e8 3d fc ff ff call 310 <sbrk> 6d3: 89 45 f0 mov %eax,-0x10(%ebp) if(p == (char*)-1) 6d6: 83 7d f0 ff cmpl $0xffffffff,-0x10(%ebp) 6da: 75 07 jne 6e3 <morecore+0x34> return 0; 6dc: b8 00 00 00 00 mov $0x0,%eax 6e1: eb 22 jmp 705 <morecore+0x56> hp = (Header*)p; 6e3: 8b 45 f0 mov -0x10(%ebp),%eax 6e6: 89 45 f4 mov %eax,-0xc(%ebp) hp->s.size = nu; 6e9: 8b 45 f4 mov -0xc(%ebp),%eax 6ec: 8b 55 08 mov 0x8(%ebp),%edx 6ef: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 6f2: 8b 45 f4 mov -0xc(%ebp),%eax 6f5: 83 c0 08 add $0x8,%eax 6f8: 89 04 24 mov %eax,(%esp) 6fb: e8 d8 fe ff ff call 5d8 <free> return freep; 700: a1 ac 0a 00 00 mov 0xaac,%eax } 705: c9 leave 706: c3 ret 00000707 <malloc>: void* malloc(uint nbytes) { 707: 55 push %ebp 708: 89 e5 mov %esp,%ebp 70a: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 70d: 8b 45 08 mov 0x8(%ebp),%eax 710: 83 c0 07 add $0x7,%eax 713: c1 e8 03 shr $0x3,%eax 716: 83 c0 01 add $0x1,%eax 719: 89 45 f4 mov %eax,-0xc(%ebp) if((prevp = freep) == 0){ 71c: a1 ac 0a 00 00 mov 0xaac,%eax 721: 89 45 f0 mov %eax,-0x10(%ebp) 724: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 728: 75 23 jne 74d <malloc+0x46> base.s.ptr = freep = prevp = &base; 72a: c7 45 f0 a4 0a 00 00 movl $0xaa4,-0x10(%ebp) 731: 8b 45 f0 mov -0x10(%ebp),%eax 734: a3 ac 0a 00 00 mov %eax,0xaac 739: a1 ac 0a 00 00 mov 0xaac,%eax 73e: a3 a4 0a 00 00 mov %eax,0xaa4 base.s.size = 0; 743: c7 05 a8 0a 00 00 00 movl $0x0,0xaa8 74a: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 74d: 8b 45 f0 mov -0x10(%ebp),%eax 750: 8b 00 mov (%eax),%eax 752: 89 45 ec mov %eax,-0x14(%ebp) if(p->s.size >= nunits){ 755: 8b 45 ec mov -0x14(%ebp),%eax 758: 8b 40 04 mov 0x4(%eax),%eax 75b: 3b 45 f4 cmp -0xc(%ebp),%eax 75e: 72 4d jb 7ad <malloc+0xa6> if(p->s.size == nunits) 760: 8b 45 ec mov -0x14(%ebp),%eax 763: 8b 40 04 mov 0x4(%eax),%eax 766: 3b 45 f4 cmp -0xc(%ebp),%eax 769: 75 0c jne 777 <malloc+0x70> prevp->s.ptr = p->s.ptr; 76b: 8b 45 ec mov -0x14(%ebp),%eax 76e: 8b 10 mov (%eax),%edx 770: 8b 45 f0 mov -0x10(%ebp),%eax 773: 89 10 mov %edx,(%eax) 775: eb 26 jmp 79d <malloc+0x96> else { p->s.size -= nunits; 777: 8b 45 ec mov -0x14(%ebp),%eax 77a: 8b 40 04 mov 0x4(%eax),%eax 77d: 89 c2 mov %eax,%edx 77f: 2b 55 f4 sub -0xc(%ebp),%edx 782: 8b 45 ec mov -0x14(%ebp),%eax 785: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 788: 8b 45 ec mov -0x14(%ebp),%eax 78b: 8b 40 04 mov 0x4(%eax),%eax 78e: c1 e0 03 shl $0x3,%eax 791: 01 45 ec add %eax,-0x14(%ebp) p->s.size = nunits; 794: 8b 45 ec mov -0x14(%ebp),%eax 797: 8b 55 f4 mov -0xc(%ebp),%edx 79a: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 79d: 8b 45 f0 mov -0x10(%ebp),%eax 7a0: a3 ac 0a 00 00 mov %eax,0xaac return (void*)(p + 1); 7a5: 8b 45 ec mov -0x14(%ebp),%eax 7a8: 83 c0 08 add $0x8,%eax 7ab: eb 38 jmp 7e5 <malloc+0xde> } if(p == freep) 7ad: a1 ac 0a 00 00 mov 0xaac,%eax 7b2: 39 45 ec cmp %eax,-0x14(%ebp) 7b5: 75 1b jne 7d2 <malloc+0xcb> if((p = morecore(nunits)) == 0) 7b7: 8b 45 f4 mov -0xc(%ebp),%eax 7ba: 89 04 24 mov %eax,(%esp) 7bd: e8 ed fe ff ff call 6af <morecore> 7c2: 89 45 ec mov %eax,-0x14(%ebp) 7c5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 7c9: 75 07 jne 7d2 <malloc+0xcb> return 0; 7cb: b8 00 00 00 00 mov $0x0,%eax 7d0: eb 13 jmp 7e5 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7d2: 8b 45 ec mov -0x14(%ebp),%eax 7d5: 89 45 f0 mov %eax,-0x10(%ebp) 7d8: 8b 45 ec mov -0x14(%ebp),%eax 7db: 8b 00 mov (%eax),%eax 7dd: 89 45 ec mov %eax,-0x14(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 7e0: e9 70 ff ff ff jmp 755 <malloc+0x4e> } 7e5: c9 leave 7e6: c3 ret 7e7: 90 nop 000007e8 <xchg>: asm volatile("sti"); } static inline uint xchg(volatile uint *addr, uint newval) { 7e8: 55 push %ebp 7e9: 89 e5 mov %esp,%ebp 7eb: 83 ec 10 sub $0x10,%esp uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 7ee: 8b 55 08 mov 0x8(%ebp),%edx 7f1: 8b 45 0c mov 0xc(%ebp),%eax 7f4: 8b 4d 08 mov 0x8(%ebp),%ecx 7f7: f0 87 02 lock xchg %eax,(%edx) 7fa: 89 45 fc mov %eax,-0x4(%ebp) "+m" (*addr), "=a" (result) : "1" (newval) : "cc"); return result; 7fd: 8b 45 fc mov -0x4(%ebp),%eax } 800: c9 leave 801: c3 ret 00000802 <lock_init>: #include "x86.h" #include "proc.h" unsigned long rands = 1; void lock_init(lock_t *lock){ 802: 55 push %ebp 803: 89 e5 mov %esp,%ebp lock->locked = 0; 805: 8b 45 08 mov 0x8(%ebp),%eax 808: c7 00 00 00 00 00 movl $0x0,(%eax) } 80e: 5d pop %ebp 80f: c3 ret 00000810 <lock_acquire>: void lock_acquire(lock_t *lock){ 810: 55 push %ebp 811: 89 e5 mov %esp,%ebp 813: 83 ec 08 sub $0x8,%esp while(xchg(&lock->locked,1) != 0); 816: 8b 45 08 mov 0x8(%ebp),%eax 819: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 820: 00 821: 89 04 24 mov %eax,(%esp) 824: e8 bf ff ff ff call 7e8 <xchg> 829: 85 c0 test %eax,%eax 82b: 75 e9 jne 816 <lock_acquire+0x6> } 82d: c9 leave 82e: c3 ret 0000082f <lock_release>: void lock_release(lock_t *lock){ 82f: 55 push %ebp 830: 89 e5 mov %esp,%ebp 832: 83 ec 08 sub $0x8,%esp xchg(&lock->locked,0); 835: 8b 45 08 mov 0x8(%ebp),%eax 838: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 83f: 00 840: 89 04 24 mov %eax,(%esp) 843: e8 a0 ff ff ff call 7e8 <xchg> } 848: c9 leave 849: c3 ret 0000084a <thread_create>: void *thread_create(void(*start_routine)(void*), void *arg){ 84a: 55 push %ebp 84b: 89 e5 mov %esp,%ebp 84d: 83 ec 28 sub $0x28,%esp int tid; void * stack = malloc(2 * 4096); 850: c7 04 24 00 20 00 00 movl $0x2000,(%esp) 857: e8 ab fe ff ff call 707 <malloc> 85c: 89 45 f0 mov %eax,-0x10(%ebp) void *garbage_stack = stack; 85f: 8b 45 f0 mov -0x10(%ebp),%eax 862: 89 45 f4 mov %eax,-0xc(%ebp) // printf(1,"start routine addr : %d\n",(uint)start_routine); if((uint)stack % 4096){ 865: 8b 45 f0 mov -0x10(%ebp),%eax 868: 25 ff 0f 00 00 and $0xfff,%eax 86d: 85 c0 test %eax,%eax 86f: 74 15 je 886 <thread_create+0x3c> stack = stack + (4096 - (uint)stack % 4096); 871: 8b 45 f0 mov -0x10(%ebp),%eax 874: 89 c2 mov %eax,%edx 876: 81 e2 ff 0f 00 00 and $0xfff,%edx 87c: b8 00 10 00 00 mov $0x1000,%eax 881: 29 d0 sub %edx,%eax 883: 01 45 f0 add %eax,-0x10(%ebp) } if (stack == 0){ 886: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 88a: 75 1b jne 8a7 <thread_create+0x5d> printf(1,"malloc fail \n"); 88c: c7 44 24 04 60 0a 00 movl $0xa60,0x4(%esp) 893: 00 894: c7 04 24 01 00 00 00 movl $0x1,(%esp) 89b: e8 81 fb ff ff call 421 <printf> return 0; 8a0: b8 00 00 00 00 mov $0x0,%eax 8a5: eb 6f jmp 916 <thread_create+0xcc> } tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg); 8a7: 8b 4d 0c mov 0xc(%ebp),%ecx 8aa: 8b 55 08 mov 0x8(%ebp),%edx 8ad: 8b 45 f0 mov -0x10(%ebp),%eax 8b0: 89 4c 24 0c mov %ecx,0xc(%esp) 8b4: 89 54 24 08 mov %edx,0x8(%esp) 8b8: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp) 8bf: 00 8c0: 89 04 24 mov %eax,(%esp) 8c3: e8 60 fa ff ff call 328 <clone> 8c8: 89 45 ec mov %eax,-0x14(%ebp) if(tid < 0){ 8cb: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 8cf: 79 1b jns 8ec <thread_create+0xa2> printf(1,"clone fails\n"); 8d1: c7 44 24 04 6e 0a 00 movl $0xa6e,0x4(%esp) 8d8: 00 8d9: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8e0: e8 3c fb ff ff call 421 <printf> return 0; 8e5: b8 00 00 00 00 mov $0x0,%eax 8ea: eb 2a jmp 916 <thread_create+0xcc> } if(tid > 0){ 8ec: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 8f0: 7e 05 jle 8f7 <thread_create+0xad> //store threads on thread table return garbage_stack; 8f2: 8b 45 f4 mov -0xc(%ebp),%eax 8f5: eb 1f jmp 916 <thread_create+0xcc> } if(tid == 0){ 8f7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 8fb: 75 14 jne 911 <thread_create+0xc7> printf(1,"tid = 0 return \n"); 8fd: c7 44 24 04 7b 0a 00 movl $0xa7b,0x4(%esp) 904: 00 905: c7 04 24 01 00 00 00 movl $0x1,(%esp) 90c: e8 10 fb ff ff call 421 <printf> } // wait(); // free(garbage_stack); return 0; 911: b8 00 00 00 00 mov $0x0,%eax } 916: c9 leave 917: c3 ret 00000918 <random>: // generate 0 -> max random number exclude max. int random(int max){ 918: 55 push %ebp 919: 89 e5 mov %esp,%ebp rands = rands * 1664525 + 1013904233; 91b: a1 a0 0a 00 00 mov 0xaa0,%eax 920: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax 926: 05 69 f3 6e 3c add $0x3c6ef369,%eax 92b: a3 a0 0a 00 00 mov %eax,0xaa0 return (int)(rands % max); 930: a1 a0 0a 00 00 mov 0xaa0,%eax 935: 8b 4d 08 mov 0x8(%ebp),%ecx 938: ba 00 00 00 00 mov $0x0,%edx 93d: f7 f1 div %ecx 93f: 89 d0 mov %edx,%eax } 941: 5d pop %ebp 942: c3 ret 943: 90 nop 00000944 <init_q>: #include "queue.h" #include "types.h" #include "user.h" void init_q(struct queue *q){ 944: 55 push %ebp 945: 89 e5 mov %esp,%ebp q->size = 0; 947: 8b 45 08 mov 0x8(%ebp),%eax 94a: c7 00 00 00 00 00 movl $0x0,(%eax) q->head = 0; 950: 8b 45 08 mov 0x8(%ebp),%eax 953: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 95a: 8b 45 08 mov 0x8(%ebp),%eax 95d: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 964: 5d pop %ebp 965: c3 ret 00000966 <add_q>: void add_q(struct queue *q, int v){ 966: 55 push %ebp 967: 89 e5 mov %esp,%ebp 969: 83 ec 28 sub $0x28,%esp struct node * n = malloc(sizeof(struct node)); 96c: c7 04 24 08 00 00 00 movl $0x8,(%esp) 973: e8 8f fd ff ff call 707 <malloc> 978: 89 45 f4 mov %eax,-0xc(%ebp) n->next = 0; 97b: 8b 45 f4 mov -0xc(%ebp),%eax 97e: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) n->value = v; 985: 8b 45 f4 mov -0xc(%ebp),%eax 988: 8b 55 0c mov 0xc(%ebp),%edx 98b: 89 10 mov %edx,(%eax) if(q->head == 0){ 98d: 8b 45 08 mov 0x8(%ebp),%eax 990: 8b 40 04 mov 0x4(%eax),%eax 993: 85 c0 test %eax,%eax 995: 75 0b jne 9a2 <add_q+0x3c> q->head = n; 997: 8b 45 08 mov 0x8(%ebp),%eax 99a: 8b 55 f4 mov -0xc(%ebp),%edx 99d: 89 50 04 mov %edx,0x4(%eax) 9a0: eb 0c jmp 9ae <add_q+0x48> }else{ q->tail->next = n; 9a2: 8b 45 08 mov 0x8(%ebp),%eax 9a5: 8b 40 08 mov 0x8(%eax),%eax 9a8: 8b 55 f4 mov -0xc(%ebp),%edx 9ab: 89 50 04 mov %edx,0x4(%eax) } q->tail = n; 9ae: 8b 45 08 mov 0x8(%ebp),%eax 9b1: 8b 55 f4 mov -0xc(%ebp),%edx 9b4: 89 50 08 mov %edx,0x8(%eax) q->size++; 9b7: 8b 45 08 mov 0x8(%ebp),%eax 9ba: 8b 00 mov (%eax),%eax 9bc: 8d 50 01 lea 0x1(%eax),%edx 9bf: 8b 45 08 mov 0x8(%ebp),%eax 9c2: 89 10 mov %edx,(%eax) } 9c4: c9 leave 9c5: c3 ret 000009c6 <empty_q>: int empty_q(struct queue *q){ 9c6: 55 push %ebp 9c7: 89 e5 mov %esp,%ebp if(q->size == 0) 9c9: 8b 45 08 mov 0x8(%ebp),%eax 9cc: 8b 00 mov (%eax),%eax 9ce: 85 c0 test %eax,%eax 9d0: 75 07 jne 9d9 <empty_q+0x13> return 1; 9d2: b8 01 00 00 00 mov $0x1,%eax 9d7: eb 05 jmp 9de <empty_q+0x18> else return 0; 9d9: b8 00 00 00 00 mov $0x0,%eax } 9de: 5d pop %ebp 9df: c3 ret 000009e0 <pop_q>: int pop_q(struct queue *q){ 9e0: 55 push %ebp 9e1: 89 e5 mov %esp,%ebp 9e3: 83 ec 28 sub $0x28,%esp int val; struct node *destroy; if(!empty_q(q)){ 9e6: 8b 45 08 mov 0x8(%ebp),%eax 9e9: 89 04 24 mov %eax,(%esp) 9ec: e8 d5 ff ff ff call 9c6 <empty_q> 9f1: 85 c0 test %eax,%eax 9f3: 75 5d jne a52 <pop_q+0x72> val = q->head->value; 9f5: 8b 45 08 mov 0x8(%ebp),%eax 9f8: 8b 40 04 mov 0x4(%eax),%eax 9fb: 8b 00 mov (%eax),%eax 9fd: 89 45 f0 mov %eax,-0x10(%ebp) destroy = q->head; a00: 8b 45 08 mov 0x8(%ebp),%eax a03: 8b 40 04 mov 0x4(%eax),%eax a06: 89 45 f4 mov %eax,-0xc(%ebp) q->head = q->head->next; a09: 8b 45 08 mov 0x8(%ebp),%eax a0c: 8b 40 04 mov 0x4(%eax),%eax a0f: 8b 50 04 mov 0x4(%eax),%edx a12: 8b 45 08 mov 0x8(%ebp),%eax a15: 89 50 04 mov %edx,0x4(%eax) free(destroy); a18: 8b 45 f4 mov -0xc(%ebp),%eax a1b: 89 04 24 mov %eax,(%esp) a1e: e8 b5 fb ff ff call 5d8 <free> q->size--; a23: 8b 45 08 mov 0x8(%ebp),%eax a26: 8b 00 mov (%eax),%eax a28: 8d 50 ff lea -0x1(%eax),%edx a2b: 8b 45 08 mov 0x8(%ebp),%eax a2e: 89 10 mov %edx,(%eax) if(q->size == 0){ a30: 8b 45 08 mov 0x8(%ebp),%eax a33: 8b 00 mov (%eax),%eax a35: 85 c0 test %eax,%eax a37: 75 14 jne a4d <pop_q+0x6d> q->head = 0; a39: 8b 45 08 mov 0x8(%ebp),%eax a3c: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; a43: 8b 45 08 mov 0x8(%ebp),%eax a46: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } return val; a4d: 8b 45 f0 mov -0x10(%ebp),%eax a50: eb 05 jmp a57 <pop_q+0x77> } return -1; a52: b8 ff ff ff ff mov $0xffffffff,%eax } a57: c9 leave a58: c3 ret
tests/010_Direct_memory_operations_MOV__ADD__SUB__like_mov_byte__0x77__0xF.asm
tpisto/pasm
103
102974
; name: Direct memory operations MOV, ADD, SUB (like mov byte [0x77],0xF) ; code: "C646770FC60677000FC70677000F0066C70677000F00000066812E770077665500668106770077665500C64443770FC640770FC6000FC605770000000F66C705770000000F00C705770000000F000000812D77000000776655008105770000007766550067C64443770F67C640770F67C6000FC64443770FC640770FC6000FC60425770000000F66C70425770000000F00C70425770000000F00000048C70425770000000F00000048812C257700000077665500488104257700000077665500" [bits 16] mov byte [bp+0x77],0xF mov byte [0x77],0xF mov word [0x77],0xF mov dword [0x77],0xF sub dword [0x77],0x556677 add dword [0x77],0x556677 [bits 32] mov byte [eax*2+ebx+0x77],0xF mov byte [eax+0x77],0xF mov byte [eax],0xF mov byte [0x77],0xF mov word [0x77],0xF mov dword [0x77],0xF sub dword [0x77],0x556677 add dword [0x77],0x556677 [bits 64] mov byte [eax*2+ebx+0x77],0xF mov byte [eax+0x77],0xF mov byte [eax],0xF mov byte [rax*2+rbx+0x77],0xF mov byte [rax+0x77],0xF mov byte [rax],0xF mov byte [0x77],0xF mov word [0x77],0xF mov dword [0x77],0xF mov qword [0x77],0xF sub qword [0x77],0x556677 add qword [0x77],0x556677
src/SizedIO/Object.agda
agda/ooAgda
23
7925
<filename>src/SizedIO/Object.agda module SizedIO.Object where open import Data.Product record Interface : Set₁ where field Method : Set Result : (m : Method) → Set open Interface public -- A simple object just returns for a method the response -- and the object itself record Object (i : Interface) : Set where coinductive field objectMethod : (m : Method i) → Result i m × Object i open Object public _▹_ : {A : Set} → {B : Set} → A → (A → B) → B a ▹ f = f a
src/Data/Fin/Subset/Cardinality.agda
tizmd/agda-finitary
0
3538
module Data.Fin.Subset.Cardinality where open import Data.Fin.Subset _∖_ : ∀ {n} → Subset n → Subset n → Subset n _∖_ {n} a b = a ∩ ∁ b
oeis/008/A008440.asm
neoneye/loda-programs
11
178436
<reponame>neoneye/loda-programs ; A008440: Expansion of Jacobi theta constant theta_2^6 /(64q^(3/2)). ; Submitted by <NAME> ; 1,6,15,26,45,66,82,120,156,170,231,276,290,390,435,438,561,630,651,780,861,842,1020,1170,1095,1326,1431,1370,1716,1740,1682,2016,2145,2132,2415,2550,2353,2850,3120,2810,3321,3486,3285,3906,4005,3722,4350,4560,4420,4950,5052,4818,5565,6006,5330,6216,6441,5760,7176,7140,6643,7650,7875,7540,8220,8646,7922,9180,9765,8760,10011,10092,9410,11310,11220,10202,11781,12090,11388,12630,13050,11882,13695,14586,12770,14412,15051,13940,16380,16110,14521,16836,16860,16276,17955,18336,16863,19140,20280,17280 mul $0,2 add $0,1 seq $0,122854 ; Expansion of phi(q)^2*psi(q)^4 in powers of q where phi(),psi() are Ramanujan theta functions. div $0,8
bootsector/printfuncs32.asm
drakeor/koiz-os-v1
0
27426
<reponame>drakeor/koiz-os-v1 use32 ; This is pretty much a copy-paste from Page 32 of OS-DEV but fixed the bug in it ; I'll rewrite it later.. with local labels and stuff VIDEO_MEMORY equ 0xb8000 WHITE_ON_BLACK equ 0x0f ; prints a null - terminated string pointed to by EDX print_string_pm : pusha mov edx, VIDEO_MEMORY ; Set edx to the start of vid mem. print_string_pm_loop : mov al, [ ebx ] ; Store the char at EBX in AL mov ah, WHITE_ON_BLACK ; Store the attributes in AH cmp al, 0 ; if (al == 0) , at end of string , so je print_string_pm_done ; jump to done mov [edx], ax ; Store char and attributes at current ; character cell. add ebx, 1 ; Increment EBX to the next char in string. add edx, 2 ; Move to next character cell in vid mem. jmp print_string_pm_loop ; loop around to print the next char. print_string_pm_done : popa ret ; Return from the function
test/Fail/Issue1216.agda
cruhland/agda
1,989
4558
<reponame>cruhland/agda -- Andreas, 2014-06-27 test case by Ulf -- {-# OPTIONS -v tc.lhs:40 #-} {-# OPTIONS --copatterns #-} record Coind : Set where coinductive field ind : Coind open Coind loop : Set -> Coind ind A loop = ind (loop A) -- WAS: Internal error. -- NOW: Proper error. -- Ill-formed projection pattern ind A -- when checking that the clause ind A loop = ind (loop A) has type -- Set → Coind
address-book/export-address-book.applescript
asbjornu/macos-scripts
0
3534
<gh_stars>0 property targetfolder : "" as Unicode text try set targetfolder to choose folder with prompt "Choose a folder or volume:" as Unicode text on error beep display dialog "Invalid path" buttons "Exit" return end try tell application "Address Book" set groupnames to name of every group copy "All" to the beginning of groupnames set selectedgroups to choose from list groupnames ¬ with title "Groups" with prompt "Choose group(s) to export" with multiple selections allowed if selectedgroups is equal to false then return if selectedgroups contains "All" then set contacts to every person else set contacts to {} repeat with selectedgroup in selectedgroups copy every person in group selectedgroup to contacts end repeat end if repeat with contact in contacts set firstname to first name of contact set lastname to last name of contact set middlename to middle name of contact set orgname to organization of contact if firstname is not equal to "" and firstname is not missing value and lastname is not equal to "" and lastname is not missing value then if middlename is equal to "" or middlename is missing value then set middlename to "" as Unicode text else set middlename to middlename & " " as Unicode text end if set filename to (firstname & " " & middlename & lastname & ".vcf") as Unicode text else if orgname is not equal to "" and orgname is not missing value then set filename to (orgname & ".vcf") as Unicode text else set filename to "No Name.vcf" as Unicode text end if set filepath to (targetfolder as Unicode text) & (filename as Unicode text) set card to (get vcard of contact) as Unicode text try set output to open for access file filepath with write permission set eof output to 0 write card to output close access output on error try close access file filepath end try end try end repeat display dialog "Finished exporting " & (count of contacts) & " contacts!" end tell
ROM/include/funcs_math.asm
mspeculatrix/Zolatron64
0
9740
\ MATHS & Numbers -- funcs_math.asm -------------------------------------------- \ NOT CURRENTLY USING THIS .subtract16u ; subtracts a 16-bit number stored in INT16uB from another 16-bit value ; in INT16uA. pha sec lda INT16uA sbc INT16uB sta FUNC_RES_L lda INT16uA + 1 sbc INT16uB + 1 sta FUNC_RES_H pla rts .compare16u ; Compare two 16-bit unsigned values pha lda INT16uA+1 cmp INT16uB+1 bcc compare16u_less_than bne compare16u_more_than lda INT16uA cmp INT16uB bcc compare16u_less_than bne compare16u_more_than lda #EQUAL ; A = B jmp compare16u_end .compare16u_less_than lda #LESS_THAN ; A < B jmp compare16u_end .compare16u_more_than lda #MORE_THAN ; A > B .compare16u_end sta FUNC_RESULT pla rts .compare32u ; Compare two 32-bit unsigned values pha lda INT32uA+3 cmp INT32uB+3 bcc compare32u_less_than ; NUMA < NUMB bne compare32u_more_than ; if NUMA+3 <> NUMB+3 then NUMA > NUMB lda INT32uA+2 cmp INT32uB+2 bcc compare32u_less_than bne compare32u_more_than lda INT32uA+1 cmp INT32uB+1 bcc compare32u_less_than bne compare32u_more_than lda INT32uA cmp INT32uB bcc compare32u_less_than bne compare32u_more_than lda #EQUAL ; A = B jmp compare32u_end .compare32u_less_than lda #LESS_THAN ; A < B jmp compare32u_end .compare32u_more_than lda #MORE_THAN ; A > B .compare32u_end sta FUNC_RESULT pla rts
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_437.asm
ljhsiun2/medusa
9
24063
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %rbp push %rdi push %rdx // Faulty Load lea addresses_WC+0x4317, %rdx nop add $45077, %r13 movups (%rdx), %xmm7 vpextrq $1, %xmm7, %r14 lea oracles, %rdx and $0xff, %r14 shlq $12, %r14 mov (%rdx,%r14,1), %r14 pop %rdx pop %rdi pop %rbp pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'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 */
arch/ARM/RP/svd/rp2040/rp_svd-ppb.ads
morbos/Ada_Drivers_Library
2
23171
-- Copyright (c) 2020 Raspberry Pi (Trading) Ltd. -- -- SPDX-License-Identifier: BSD-3-Clause -- This spec has been automatically generated from rp2040.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package RP_SVD.PPB is pragma Preelaborate; --------------- -- Registers -- --------------- -- Use the SysTick Control and Status Register to enable the SysTick -- features. type SYST_CSR_Register is record -- Enable SysTick counter:\n 0 = Counter disabled.\n 1 = Counter -- enabled. ENABLE : Boolean := False; -- Enables SysTick exception request:\n 0 = Counting down to zero does -- not assert the SysTick exception request.\n 1 = Counting down to zero -- to asserts the SysTick exception request. TICKINT : Boolean := False; -- SysTick clock source. Always reads as one if SYST_CALIB reports -- NOREF.\n Selects the SysTick timer clock source:\n 0 = External -- reference clock.\n 1 = Processor clock. CLKSOURCE : Boolean := False; -- unspecified Reserved_3_15 : HAL.UInt13 := 16#0#; -- Read-only. Returns 1 if timer counted to 0 since last time this was -- read. Clears on read by application or debugger. COUNTFLAG : Boolean := False; -- unspecified Reserved_17_31 : HAL.UInt15 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SYST_CSR_Register use record ENABLE at 0 range 0 .. 0; TICKINT at 0 range 1 .. 1; CLKSOURCE at 0 range 2 .. 2; Reserved_3_15 at 0 range 3 .. 15; COUNTFLAG at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; subtype SYST_RVR_RELOAD_Field is HAL.UInt24; -- Use the SysTick Reload Value Register to specify the start value to load -- into the current value register when the counter reaches 0. It can be -- any value between 0 and 0x00FFFFFF. A start value of 0 is possible, but -- has no effect because the SysTick interrupt and COUNTFLAG are activated -- when counting from 1 to 0. The reset value of this register is -- UNKNOWN.\n To generate a multi-shot timer with a period of N processor -- clock cycles, use a RELOAD value of N-1. For example, if the SysTick -- interrupt is required every 100 clock pulses, set RELOAD to 99. type SYST_RVR_Register is record -- Value to load into the SysTick Current Value Register when the -- counter reaches 0. RELOAD : SYST_RVR_RELOAD_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SYST_RVR_Register use record RELOAD at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype SYST_CVR_CURRENT_Field is HAL.UInt24; -- Use the SysTick Current Value Register to find the current value in the -- register. The reset value of this register is UNKNOWN. type SYST_CVR_Register is record -- Reads return the current value of the SysTick counter. This register -- is write-clear. Writing to it with any value clears the register to -- 0. Clearing this register also clears the COUNTFLAG bit of the -- SysTick Control and Status Register. CURRENT : SYST_CVR_CURRENT_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SYST_CVR_Register use record CURRENT at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype SYST_CALIB_TENMS_Field is HAL.UInt24; -- Use the SysTick Calibration Value Register to enable software to scale -- to any required speed using divide and multiply. type SYST_CALIB_Register is record -- Read-only. An optional Reload value to be used for 10ms (100Hz) -- timing, subject to system clock skew errors. If the value reads as 0, -- the calibration value is not known. TENMS : SYST_CALIB_TENMS_Field; -- unspecified Reserved_24_29 : HAL.UInt6; -- Read-only. If reads as 1, the calibration value for 10ms is inexact -- (due to clock frequency). SKEW : Boolean; -- Read-only. If reads as 1, the Reference clock is not provided - the -- CLKSOURCE bit of the SysTick Control and Status register will be -- forced to 1 and cannot be cleared to 0. NOREF : Boolean; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SYST_CALIB_Register use record TENMS at 0 range 0 .. 23; Reserved_24_29 at 0 range 24 .. 29; SKEW at 0 range 30 .. 30; NOREF at 0 range 31 .. 31; end record; subtype NVIC_IPR0_IP_0_Field is HAL.UInt2; subtype NVIC_IPR0_IP_1_Field is HAL.UInt2; subtype NVIC_IPR0_IP_2_Field is HAL.UInt2; subtype NVIC_IPR0_IP_3_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest.\n Note: Writing 1 to an NVIC_ICPR bit does not affect the -- active state of the corresponding interrupt.\n These registers are only -- word-accessible type NVIC_IPR0_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 0 IP_0 : NVIC_IPR0_IP_0_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 1 IP_1 : NVIC_IPR0_IP_1_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 2 IP_2 : NVIC_IPR0_IP_2_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 3 IP_3 : NVIC_IPR0_IP_3_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR0_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_0 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_1 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_2 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_3 at 0 range 30 .. 31; end record; subtype NVIC_IPR1_IP_4_Field is HAL.UInt2; subtype NVIC_IPR1_IP_5_Field is HAL.UInt2; subtype NVIC_IPR1_IP_6_Field is HAL.UInt2; subtype NVIC_IPR1_IP_7_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest. type NVIC_IPR1_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 4 IP_4 : NVIC_IPR1_IP_4_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 5 IP_5 : NVIC_IPR1_IP_5_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 6 IP_6 : NVIC_IPR1_IP_6_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 7 IP_7 : NVIC_IPR1_IP_7_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR1_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_4 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_5 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_6 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_7 at 0 range 30 .. 31; end record; subtype NVIC_IPR2_IP_8_Field is HAL.UInt2; subtype NVIC_IPR2_IP_9_Field is HAL.UInt2; subtype NVIC_IPR2_IP_10_Field is HAL.UInt2; subtype NVIC_IPR2_IP_11_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest. type NVIC_IPR2_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 8 IP_8 : NVIC_IPR2_IP_8_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 9 IP_9 : NVIC_IPR2_IP_9_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 10 IP_10 : NVIC_IPR2_IP_10_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 11 IP_11 : NVIC_IPR2_IP_11_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR2_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_8 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_9 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_10 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_11 at 0 range 30 .. 31; end record; subtype NVIC_IPR3_IP_12_Field is HAL.UInt2; subtype NVIC_IPR3_IP_13_Field is HAL.UInt2; subtype NVIC_IPR3_IP_14_Field is HAL.UInt2; subtype NVIC_IPR3_IP_15_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest. type NVIC_IPR3_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 12 IP_12 : NVIC_IPR3_IP_12_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 13 IP_13 : NVIC_IPR3_IP_13_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 14 IP_14 : NVIC_IPR3_IP_14_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 15 IP_15 : NVIC_IPR3_IP_15_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR3_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_12 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_13 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_14 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_15 at 0 range 30 .. 31; end record; subtype NVIC_IPR4_IP_16_Field is HAL.UInt2; subtype NVIC_IPR4_IP_17_Field is HAL.UInt2; subtype NVIC_IPR4_IP_18_Field is HAL.UInt2; subtype NVIC_IPR4_IP_19_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest. type NVIC_IPR4_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 16 IP_16 : NVIC_IPR4_IP_16_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 17 IP_17 : NVIC_IPR4_IP_17_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 18 IP_18 : NVIC_IPR4_IP_18_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 19 IP_19 : NVIC_IPR4_IP_19_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR4_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_16 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_17 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_18 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_19 at 0 range 30 .. 31; end record; subtype NVIC_IPR5_IP_20_Field is HAL.UInt2; subtype NVIC_IPR5_IP_21_Field is HAL.UInt2; subtype NVIC_IPR5_IP_22_Field is HAL.UInt2; subtype NVIC_IPR5_IP_23_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest. type NVIC_IPR5_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 20 IP_20 : NVIC_IPR5_IP_20_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 21 IP_21 : NVIC_IPR5_IP_21_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 22 IP_22 : NVIC_IPR5_IP_22_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 23 IP_23 : NVIC_IPR5_IP_23_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR5_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_20 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_21 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_22 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_23 at 0 range 30 .. 31; end record; subtype NVIC_IPR6_IP_24_Field is HAL.UInt2; subtype NVIC_IPR6_IP_25_Field is HAL.UInt2; subtype NVIC_IPR6_IP_26_Field is HAL.UInt2; subtype NVIC_IPR6_IP_27_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest. type NVIC_IPR6_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 24 IP_24 : NVIC_IPR6_IP_24_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 25 IP_25 : NVIC_IPR6_IP_25_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 26 IP_26 : NVIC_IPR6_IP_26_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 27 IP_27 : NVIC_IPR6_IP_27_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR6_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_24 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_25 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_26 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_27 at 0 range 30 .. 31; end record; subtype NVIC_IPR7_IP_28_Field is HAL.UInt2; subtype NVIC_IPR7_IP_29_Field is HAL.UInt2; subtype NVIC_IPR7_IP_30_Field is HAL.UInt2; subtype NVIC_IPR7_IP_31_Field is HAL.UInt2; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 to -- each of the available interrupts. 0 is the highest priority, and 3 is -- the lowest. type NVIC_IPR7_Register is record -- unspecified Reserved_0_5 : HAL.UInt6 := 16#0#; -- Priority of interrupt 28 IP_28 : NVIC_IPR7_IP_28_Field := 16#0#; -- unspecified Reserved_8_13 : HAL.UInt6 := 16#0#; -- Priority of interrupt 29 IP_29 : NVIC_IPR7_IP_29_Field := 16#0#; -- unspecified Reserved_16_21 : HAL.UInt6 := 16#0#; -- Priority of interrupt 30 IP_30 : NVIC_IPR7_IP_30_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of interrupt 31 IP_31 : NVIC_IPR7_IP_31_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for NVIC_IPR7_Register use record Reserved_0_5 at 0 range 0 .. 5; IP_28 at 0 range 6 .. 7; Reserved_8_13 at 0 range 8 .. 13; IP_29 at 0 range 14 .. 15; Reserved_16_21 at 0 range 16 .. 21; IP_30 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; IP_31 at 0 range 30 .. 31; end record; subtype CPUID_REVISION_Field is HAL.UInt4; subtype CPUID_PARTNO_Field is HAL.UInt12; subtype CPUID_ARCHITECTURE_Field is HAL.UInt4; subtype CPUID_VARIANT_Field is HAL.UInt4; subtype CPUID_IMPLEMENTER_Field is HAL.UInt8; -- Read the CPU ID Base Register to determine: the ID number of the -- processor core, the version number of the processor core, the -- implementation details of the processor core. type CPUID_Register is record -- Read-only. Minor revision number m in the rnpm revision status:\n 0x1 -- = Patch 1. REVISION : CPUID_REVISION_Field; -- Read-only. Number of processor within family: 0xC60 = Cortex-M0+ PARTNO : CPUID_PARTNO_Field; -- Read-only. Constant that defines the architecture of the processor:\n -- 0xC = ARMv6-M architecture. ARCHITECTURE : CPUID_ARCHITECTURE_Field; -- Read-only. Major revision number n in the rnpm revision status:\n 0x0 -- = Revision 0. VARIANT : CPUID_VARIANT_Field; -- Read-only. Implementor code: 0x41 = ARM IMPLEMENTER : CPUID_IMPLEMENTER_Field; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CPUID_Register use record REVISION at 0 range 0 .. 3; PARTNO at 0 range 4 .. 15; ARCHITECTURE at 0 range 16 .. 19; VARIANT at 0 range 20 .. 23; IMPLEMENTER at 0 range 24 .. 31; end record; subtype ICSR_VECTACTIVE_Field is HAL.UInt9; subtype ICSR_VECTPENDING_Field is HAL.UInt9; -- Use the Interrupt Control State Register to set a pending Non-Maskable -- Interrupt (NMI), set or clear a pending PendSV, set or clear a pending -- SysTick, check for pending exceptions, check the vector number of the -- highest priority pended exception, check the vector number of the active -- exception. type ICSR_Register is record -- Read-only. Active exception number field. Reset clears the VECTACTIVE -- field. VECTACTIVE : ICSR_VECTACTIVE_Field := 16#0#; -- unspecified Reserved_9_11 : HAL.UInt3 := 16#0#; -- Read-only. Indicates the exception number for the highest priority -- pending exception: 0 = no pending exceptions. Non zero = The pending -- state includes the effect of memory-mapped enable and mask registers. -- It does not include the PRIMASK special-purpose register qualifier. VECTPENDING : ICSR_VECTPENDING_Field := 16#0#; -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Read-only. External interrupt pending flag ISRPENDING : Boolean := False; -- Read-only. The system can only access this bit when the core is -- halted. It indicates that a pending interrupt is to be taken in the -- next running cycle. If C_MASKINTS is clear in the Debug Halting -- Control and Status Register, the interrupt is serviced. ISRPREEMPT : Boolean := False; -- unspecified Reserved_24_24 : HAL.Bit := 16#0#; -- SysTick exception clear-pending bit.\n Write:\n 0 = No effect.\n 1 = -- Removes the pending state from the SysTick exception.\n This bit is -- WO. On a register read its value is Unknown. PENDSTCLR : Boolean := False; -- SysTick exception set-pending bit.\n Write:\n 0 = No effect.\n 1 = -- Changes SysTick exception state to pending.\n Read:\n 0 = SysTick -- exception is not pending.\n 1 = SysTick exception is pending. PENDSTSET : Boolean := False; -- PendSV clear-pending bit.\n Write:\n 0 = No effect.\n 1 = Removes the -- pending state from the PendSV exception. PENDSVCLR : Boolean := False; -- PendSV set-pending bit.\n Write:\n 0 = No effect.\n 1 = Changes -- PendSV exception state to pending.\n Read:\n 0 = PendSV exception is -- not pending.\n 1 = PendSV exception is pending.\n Writing 1 to this -- bit is the only way to set the PendSV exception state to pending. PENDSVSET : Boolean := False; -- unspecified Reserved_29_30 : HAL.UInt2 := 16#0#; -- Setting this bit will activate an NMI. Since NMI is the highest -- priority exception, it will activate as soon as it is registered.\n -- NMI set-pending bit.\n Write:\n 0 = No effect.\n 1 = Changes NMI -- exception state to pending.\n Read:\n 0 = NMI exception is not -- pending.\n 1 = NMI exception is pending.\n Because NMI is the -- highest-priority exception, normally the processor enters the NMI\n -- exception handler as soon as it detects a write of 1 to this bit. -- Entering the handler then clears\n this bit to 0. This means a read -- of this bit by the NMI exception handler returns 1 only if the\n NMI -- signal is reasserted while the processor is executing that handler. NMIPENDSET : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for ICSR_Register use record VECTACTIVE at 0 range 0 .. 8; Reserved_9_11 at 0 range 9 .. 11; VECTPENDING at 0 range 12 .. 20; Reserved_21_21 at 0 range 21 .. 21; ISRPENDING at 0 range 22 .. 22; ISRPREEMPT at 0 range 23 .. 23; Reserved_24_24 at 0 range 24 .. 24; PENDSTCLR at 0 range 25 .. 25; PENDSTSET at 0 range 26 .. 26; PENDSVCLR at 0 range 27 .. 27; PENDSVSET at 0 range 28 .. 28; Reserved_29_30 at 0 range 29 .. 30; NMIPENDSET at 0 range 31 .. 31; end record; subtype VTOR_TBLOFF_Field is HAL.UInt24; -- The VTOR holds the vector table offset address. type VTOR_Register is record -- unspecified Reserved_0_7 : HAL.UInt8 := 16#0#; -- Bits [31:8] of the indicate the vector table offset address. TBLOFF : VTOR_TBLOFF_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for VTOR_Register use record Reserved_0_7 at 0 range 0 .. 7; TBLOFF at 0 range 8 .. 31; end record; subtype AIRCR_VECTKEY_Field is HAL.UInt16; -- Use the Application Interrupt and Reset Control Register to: determine -- data endianness, clear all active state information from debug halt -- mode, request a system reset. type AIRCR_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Clears all active state information for fixed and configurable -- exceptions. This bit: is self-clearing, can only be set by the DAP -- when the core is halted. When set: clears all active exception status -- of the processor, forces a return to Thread mode, forces an IPSR of -- 0. A debugger must re-initialize the stack. VECTCLRACTIVE : Boolean := False; -- Writing 1 to this bit causes the SYSRESETREQ signal to the outer -- system to be asserted to request a reset. The intention is to force a -- large system reset of all major components except for debug. The -- C_HALT bit in the DHCSR is cleared as a result of the system reset -- requested. The debugger does not lose contact with the device. SYSRESETREQ : Boolean := False; -- unspecified Reserved_3_14 : HAL.UInt12 := 16#0#; -- Read-only. Data endianness implemented:\n 0 = Little-endian. ENDIANESS : Boolean := False; -- Register key:\n Reads as Unknown\n On writes, write 0x05FA to -- VECTKEY, otherwise the write is ignored. VECTKEY : AIRCR_VECTKEY_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AIRCR_Register use record Reserved_0_0 at 0 range 0 .. 0; VECTCLRACTIVE at 0 range 1 .. 1; SYSRESETREQ at 0 range 2 .. 2; Reserved_3_14 at 0 range 3 .. 14; ENDIANESS at 0 range 15 .. 15; VECTKEY at 0 range 16 .. 31; end record; -- System Control Register. Use the System Control Register for -- power-management functions: signal to the system when the processor can -- enter a low power state, control how the processor enters and exits low -- power states. type SCR_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Indicates sleep-on-exit when returning from Handler mode to Thread -- mode:\n 0 = Do not sleep when returning to Thread mode.\n 1 = Enter -- sleep, or deep sleep, on return from an ISR to Thread mode.\n Setting -- this bit to 1 enables an interrupt driven application to avoid -- returning to an empty main application. SLEEPONEXIT : Boolean := False; -- Controls whether the processor uses sleep or deep sleep as its low -- power mode:\n 0 = Sleep.\n 1 = Deep sleep. SLEEPDEEP : Boolean := False; -- unspecified Reserved_3_3 : HAL.Bit := 16#0#; -- Send Event on Pending bit:\n 0 = Only enabled interrupts or events -- can wakeup the processor, disabled interrupts are excluded.\n 1 = -- Enabled events and all interrupts, including disabled interrupts, can -- wakeup the processor.\n When an event or interrupt becomes pending, -- the event signal wakes up the processor from WFE. If the\n processor -- is not waiting for an event, the event is registered and affects the -- next WFE.\n The processor also wakes up on execution of an SEV -- instruction or an external event. SEVONPEND : Boolean := False; -- unspecified Reserved_5_31 : HAL.UInt27 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SCR_Register use record Reserved_0_0 at 0 range 0 .. 0; SLEEPONEXIT at 0 range 1 .. 1; SLEEPDEEP at 0 range 2 .. 2; Reserved_3_3 at 0 range 3 .. 3; SEVONPEND at 0 range 4 .. 4; Reserved_5_31 at 0 range 5 .. 31; end record; -- The Configuration and Control Register permanently enables stack -- alignment and causes unaligned accesses to result in a Hard Fault. type CCR_Register is record -- unspecified Reserved_0_2 : HAL.UInt3; -- Read-only. Always reads as one, indicates that all unaligned accesses -- generate a HardFault. UNALIGN_TRP : Boolean; -- unspecified Reserved_4_8 : HAL.UInt5; -- Read-only. Always reads as one, indicates 8-byte stack alignment on -- exception entry. On exception entry, the processor uses bit[9] of the -- stacked PSR to indicate the stack alignment. On return from the -- exception it uses this stacked bit to restore the correct stack -- alignment. STKALIGN : Boolean; -- unspecified Reserved_10_31 : HAL.UInt22; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CCR_Register use record Reserved_0_2 at 0 range 0 .. 2; UNALIGN_TRP at 0 range 3 .. 3; Reserved_4_8 at 0 range 4 .. 8; STKALIGN at 0 range 9 .. 9; Reserved_10_31 at 0 range 10 .. 31; end record; subtype SHPR2_PRI_11_Field is HAL.UInt2; -- System handlers are a special class of exception handler that can have -- their priority set to any of the priority levels. Use the System Handler -- Priority Register 2 to set the priority of SVCall. type SHPR2_Register is record -- unspecified Reserved_0_29 : HAL.UInt30 := 16#0#; -- Priority of system handler 11, SVCall PRI_11 : SHPR2_PRI_11_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SHPR2_Register use record Reserved_0_29 at 0 range 0 .. 29; PRI_11 at 0 range 30 .. 31; end record; subtype SHPR3_PRI_14_Field is HAL.UInt2; subtype SHPR3_PRI_15_Field is HAL.UInt2; -- System handlers are a special class of exception handler that can have -- their priority set to any of the priority levels. Use the System Handler -- Priority Register 3 to set the priority of PendSV and SysTick. type SHPR3_Register is record -- unspecified Reserved_0_21 : HAL.UInt22 := 16#0#; -- Priority of system handler 14, PendSV PRI_14 : SHPR3_PRI_14_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Priority of system handler 15, SysTick PRI_15 : SHPR3_PRI_15_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SHPR3_Register use record Reserved_0_21 at 0 range 0 .. 21; PRI_14 at 0 range 22 .. 23; Reserved_24_29 at 0 range 24 .. 29; PRI_15 at 0 range 30 .. 31; end record; -- Use the System Handler Control and State Register to determine or clear -- the pending status of SVCall. type SHCSR_Register is record -- unspecified Reserved_0_14 : HAL.UInt15 := 16#0#; -- Reads as 1 if SVCall is Pending. Write 1 to set pending SVCall, write -- 0 to clear pending SVCall. SVCALLPENDED : Boolean := False; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SHCSR_Register use record Reserved_0_14 at 0 range 0 .. 14; SVCALLPENDED at 0 range 15 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype MPU_TYPE_DREGION_Field is HAL.UInt8; subtype MPU_TYPE_IREGION_Field is HAL.UInt8; -- Read the MPU Type Register to determine if the processor implements an -- MPU, and how many regions the MPU supports. type MPU_TYPE_Register is record -- Read-only. Indicates support for separate instruction and data -- address maps. Reads as 0 as ARMv6-M only supports a unified MPU. SEPARATE_k : Boolean; -- unspecified Reserved_1_7 : HAL.UInt7; -- Read-only. Number of regions supported by the MPU. DREGION : MPU_TYPE_DREGION_Field; -- Read-only. Instruction region. Reads as zero as ARMv6-M only supports -- a unified MPU. IREGION : MPU_TYPE_IREGION_Field; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MPU_TYPE_Register use record SEPARATE_k at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; DREGION at 0 range 8 .. 15; IREGION at 0 range 16 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- Use the MPU Control Register to enable and disable the MPU, and to -- control whether the default memory map is enabled as a background region -- for privileged accesses, and whether the MPU is enabled for HardFaults -- and NMIs. type MPU_CTRL_Register is record -- Enables the MPU. If the MPU is disabled, privileged and unprivileged -- accesses use the default memory map.\n 0 = MPU disabled.\n 1 = MPU -- enabled. ENABLE : Boolean := False; -- Controls the use of the MPU for HardFaults and NMIs. Setting this bit -- when ENABLE is clear results in UNPREDICTABLE behaviour.\n When the -- MPU is enabled:\n 0 = MPU is disabled during HardFault and NMI -- handlers, regardless of the value of the ENABLE bit.\n 1 = the MPU is -- enabled during HardFault and NMI handlers. HFNMIENA : Boolean := False; -- Controls whether the default memory map is enabled as a background -- region for privileged accesses. This bit is ignored when ENABLE is -- clear.\n 0 = If the MPU is enabled, disables use of the default -- memory map. Any memory access to a location not\n covered by any -- enabled region causes a fault.\n 1 = If the MPU is enabled, enables -- use of the default memory map as a background region for privileged -- software accesses.\n When enabled, the background region acts as if -- it is region number -1. Any region that is defined and enabled has -- priority over this default map. PRIVDEFENA : Boolean := False; -- unspecified Reserved_3_31 : HAL.UInt29 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MPU_CTRL_Register use record ENABLE at 0 range 0 .. 0; HFNMIENA at 0 range 1 .. 1; PRIVDEFENA at 0 range 2 .. 2; Reserved_3_31 at 0 range 3 .. 31; end record; subtype MPU_RNR_REGION_Field is HAL.UInt4; -- Use the MPU Region Number Register to select the region currently -- accessed by MPU_RBAR and MPU_RASR. type MPU_RNR_Register is record -- Indicates the MPU region referenced by the MPU_RBAR and MPU_RASR -- registers.\n The MPU supports 8 memory regions, so the permitted -- values of this field are 0-7. REGION : MPU_RNR_REGION_Field := 16#0#; -- unspecified Reserved_4_31 : HAL.UInt28 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MPU_RNR_Register use record REGION at 0 range 0 .. 3; Reserved_4_31 at 0 range 4 .. 31; end record; subtype MPU_RBAR_REGION_Field is HAL.UInt4; subtype MPU_RBAR_ADDR_Field is HAL.UInt24; -- Read the MPU Region Base Address Register to determine the base address -- of the region identified by MPU_RNR. Write to update the base address of -- said region or that of a specified region, with whose number MPU_RNR -- will also be updated. type MPU_RBAR_Register is record -- On writes, specifies the number of the region whose base address to -- update provided VALID is set written as 1. On reads, returns bits -- [3:0] of MPU_RNR. REGION : MPU_RBAR_REGION_Field := 16#0#; -- On writes, indicates whether the write must update the base address -- of the region identified by the REGION field, updating the MPU_RNR to -- indicate this new region.\n Write:\n 0 = MPU_RNR not changed, and the -- processor:\n Updates the base address for the region specified in the -- MPU_RNR.\n Ignores the value of the REGION field.\n 1 = The -- processor:\n Updates the value of the MPU_RNR to the value of the -- REGION field.\n Updates the base address for the region specified in -- the REGION field.\n Always reads as zero. VALID : Boolean := False; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Base address of the region. ADDR : MPU_RBAR_ADDR_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MPU_RBAR_Register use record REGION at 0 range 0 .. 3; VALID at 0 range 4 .. 4; Reserved_5_7 at 0 range 5 .. 7; ADDR at 0 range 8 .. 31; end record; subtype MPU_RASR_SIZE_Field is HAL.UInt5; subtype MPU_RASR_SRD_Field is HAL.UInt8; subtype MPU_RASR_ATTRS_Field is HAL.UInt16; -- Use the MPU Region Attribute and Size Register to define the size, -- access behaviour and memory type of the region identified by MPU_RNR, -- and enable that region. type MPU_RASR_Register is record -- Enables the region. ENABLE : Boolean := False; -- Indicates the region size. Region size in bytes = 2^(SIZE+1). The -- minimum permitted value is 7 (b00111) = 256Bytes SIZE : MPU_RASR_SIZE_Field := 16#0#; -- unspecified Reserved_6_7 : HAL.UInt2 := 16#0#; -- Subregion Disable. For regions of 256 bytes or larger, each bit of -- this field controls whether one of the eight equal subregions is -- enabled. SRD : MPU_RASR_SRD_Field := 16#0#; -- The MPU Region Attribute field. Use to define the region attribute -- control.\n 28 = XN: Instruction access disable bit:\n 0 = Instruction -- fetches enabled.\n 1 = Instruction fetches disabled.\n 26:24 = AP: -- Access permission field\n 18 = S: Shareable bit\n 17 = C: Cacheable -- bit\n 16 = B: Bufferable bit ATTRS : MPU_RASR_ATTRS_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MPU_RASR_Register use record ENABLE at 0 range 0 .. 0; SIZE at 0 range 1 .. 5; Reserved_6_7 at 0 range 6 .. 7; SRD at 0 range 8 .. 15; ATTRS at 0 range 16 .. 31; end record; ----------------- -- Peripherals -- ----------------- type PPB_Peripheral is record -- Use the SysTick Control and Status Register to enable the SysTick -- features. SYST_CSR : aliased SYST_CSR_Register; -- Use the SysTick Reload Value Register to specify the start value to -- load into the current value register when the counter reaches 0. It -- can be any value between 0 and 0x00FFFFFF. A start value of 0 is -- possible, but has no effect because the SysTick interrupt and -- COUNTFLAG are activated when counting from 1 to 0. The reset value of -- this register is UNKNOWN.\n To generate a multi-shot timer with a -- period of N processor clock cycles, use a RELOAD value of N-1. For -- example, if the SysTick interrupt is required every 100 clock pulses, -- set RELOAD to 99. SYST_RVR : aliased SYST_RVR_Register; -- Use the SysTick Current Value Register to find the current value in -- the register. The reset value of this register is UNKNOWN. SYST_CVR : aliased SYST_CVR_Register; -- Use the SysTick Calibration Value Register to enable software to -- scale to any required speed using divide and multiply. SYST_CALIB : aliased SYST_CALIB_Register; -- Use the Interrupt Set-Enable Register to enable interrupts and -- determine which interrupts are currently enabled.\n If a pending -- interrupt is enabled, the NVIC activates the interrupt based on its -- priority. If an interrupt is not enabled, asserting its interrupt -- signal changes the interrupt state to pending, but the NVIC never -- activates the interrupt, regardless of its priority. NVIC_ISER : aliased HAL.UInt32; -- Use the Interrupt Clear-Enable Registers to disable interrupts and -- determine which interrupts are currently enabled. NVIC_ICER : aliased HAL.UInt32; -- The NVIC_ISPR forces interrupts into the pending state, and shows -- which interrupts are pending. NVIC_ISPR : aliased HAL.UInt32; -- Use the Interrupt Clear-Pending Register to clear pending interrupts -- and determine which interrupts are currently pending. NVIC_ICPR : aliased HAL.UInt32; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest.\n Note: Writing 1 to an NVIC_ICPR bit does not affect -- the active state of the corresponding interrupt.\n These registers -- are only word-accessible NVIC_IPR0 : aliased NVIC_IPR0_Register; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest. NVIC_IPR1 : aliased NVIC_IPR1_Register; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest. NVIC_IPR2 : aliased NVIC_IPR2_Register; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest. NVIC_IPR3 : aliased NVIC_IPR3_Register; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest. NVIC_IPR4 : aliased NVIC_IPR4_Register; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest. NVIC_IPR5 : aliased NVIC_IPR5_Register; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest. NVIC_IPR6 : aliased NVIC_IPR6_Register; -- Use the Interrupt Priority Registers to assign a priority from 0 to 3 -- to each of the available interrupts. 0 is the highest priority, and 3 -- is the lowest. NVIC_IPR7 : aliased NVIC_IPR7_Register; -- Read the CPU ID Base Register to determine: the ID number of the -- processor core, the version number of the processor core, the -- implementation details of the processor core. CPUID : aliased CPUID_Register; -- Use the Interrupt Control State Register to set a pending -- Non-Maskable Interrupt (NMI), set or clear a pending PendSV, set or -- clear a pending SysTick, check for pending exceptions, check the -- vector number of the highest priority pended exception, check the -- vector number of the active exception. ICSR : aliased ICSR_Register; -- The VTOR holds the vector table offset address. VTOR : aliased VTOR_Register; -- Use the Application Interrupt and Reset Control Register to: -- determine data endianness, clear all active state information from -- debug halt mode, request a system reset. AIRCR : aliased AIRCR_Register; -- System Control Register. Use the System Control Register for -- power-management functions: signal to the system when the processor -- can enter a low power state, control how the processor enters and -- exits low power states. SCR : aliased SCR_Register; -- The Configuration and Control Register permanently enables stack -- alignment and causes unaligned accesses to result in a Hard Fault. CCR : aliased CCR_Register; -- System handlers are a special class of exception handler that can -- have their priority set to any of the priority levels. Use the System -- Handler Priority Register 2 to set the priority of SVCall. SHPR2 : aliased SHPR2_Register; -- System handlers are a special class of exception handler that can -- have their priority set to any of the priority levels. Use the System -- Handler Priority Register 3 to set the priority of PendSV and -- SysTick. SHPR3 : aliased SHPR3_Register; -- Use the System Handler Control and State Register to determine or -- clear the pending status of SVCall. SHCSR : aliased SHCSR_Register; -- Read the MPU Type Register to determine if the processor implements -- an MPU, and how many regions the MPU supports. MPU_TYPE : aliased MPU_TYPE_Register; -- Use the MPU Control Register to enable and disable the MPU, and to -- control whether the default memory map is enabled as a background -- region for privileged accesses, and whether the MPU is enabled for -- HardFaults and NMIs. MPU_CTRL : aliased MPU_CTRL_Register; -- Use the MPU Region Number Register to select the region currently -- accessed by MPU_RBAR and MPU_RASR. MPU_RNR : aliased MPU_RNR_Register; -- Read the MPU Region Base Address Register to determine the base -- address of the region identified by MPU_RNR. Write to update the base -- address of said region or that of a specified region, with whose -- number MPU_RNR will also be updated. MPU_RBAR : aliased MPU_RBAR_Register; -- Use the MPU Region Attribute and Size Register to define the size, -- access behaviour and memory type of the region identified by MPU_RNR, -- and enable that region. MPU_RASR : aliased MPU_RASR_Register; end record with Volatile; for PPB_Peripheral use record SYST_CSR at 16#E010# range 0 .. 31; SYST_RVR at 16#E014# range 0 .. 31; SYST_CVR at 16#E018# range 0 .. 31; SYST_CALIB at 16#E01C# range 0 .. 31; NVIC_ISER at 16#E100# range 0 .. 31; NVIC_ICER at 16#E180# range 0 .. 31; NVIC_ISPR at 16#E200# range 0 .. 31; NVIC_ICPR at 16#E280# range 0 .. 31; NVIC_IPR0 at 16#E400# range 0 .. 31; NVIC_IPR1 at 16#E404# range 0 .. 31; NVIC_IPR2 at 16#E408# range 0 .. 31; NVIC_IPR3 at 16#E40C# range 0 .. 31; NVIC_IPR4 at 16#E410# range 0 .. 31; NVIC_IPR5 at 16#E414# range 0 .. 31; NVIC_IPR6 at 16#E418# range 0 .. 31; NVIC_IPR7 at 16#E41C# range 0 .. 31; CPUID at 16#ED00# range 0 .. 31; ICSR at 16#ED04# range 0 .. 31; VTOR at 16#ED08# range 0 .. 31; AIRCR at 16#ED0C# range 0 .. 31; SCR at 16#ED10# range 0 .. 31; CCR at 16#ED14# range 0 .. 31; SHPR2 at 16#ED1C# range 0 .. 31; SHPR3 at 16#ED20# range 0 .. 31; SHCSR at 16#ED24# range 0 .. 31; MPU_TYPE at 16#ED90# range 0 .. 31; MPU_CTRL at 16#ED94# range 0 .. 31; MPU_RNR at 16#ED98# range 0 .. 31; MPU_RBAR at 16#ED9C# range 0 .. 31; MPU_RASR at 16#EDA0# range 0 .. 31; end record; PPB_Periph : aliased PPB_Peripheral with Import, Address => PPB_Base; end RP_SVD.PPB;
Weather.applescript
ppps/ms-weather
0
3662
do shell script "/usr/local/bin/python3 /Volumes/Server/Production\\ Resources/Scripts/ms-weather/weather.py" tell application "Adobe InDesign CC 2019" to activate
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_443.asm
ljhsiun2/medusa
9
97935
<filename>Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca.log_21829_443.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r14 push %rax push %rcx push %rdi push %rsi lea addresses_normal_ht+0x1ab43, %rax nop lfence movb (%rax), %r12b nop inc %rsi lea addresses_normal_ht+0xb6d5, %r10 nop sub %r13, %r13 mov (%r10), %edi and $11324, %r10 lea addresses_WT_ht+0x13f5b, %rax nop nop nop and $27259, %rsi mov $0x6162636465666768, %r12 movq %r12, %xmm3 movups %xmm3, (%rax) cmp %r13, %r13 lea addresses_WT_ht+0x1c980, %rsi lea addresses_WT_ht+0x3065, %rdi clflush (%rsi) nop nop sub %r12, %r12 mov $76, %rcx rep movsw sub %r10, %r10 lea addresses_A_ht+0x185d2, %rsi lea addresses_D_ht+0x112d5, %rdi dec %r12 mov $23, %rcx rep movsw nop nop cmp $48382, %r13 lea addresses_UC_ht+0xa6d5, %rsi lea addresses_D_ht+0xc2d5, %rdi nop xor $7405, %r12 mov $47, %rcx rep movsl nop nop nop sub $43492, %rdi lea addresses_UC_ht+0x13ad5, %rdi clflush (%rdi) nop nop nop nop add %rax, %rax movw $0x6162, (%rdi) nop nop nop nop dec %r14 lea addresses_WC_ht+0x17df5, %r12 xor %r13, %r13 mov $0x6162636465666768, %r10 movq %r10, (%r12) nop nop nop nop nop add $50588, %rsi lea addresses_D_ht+0x10795, %rsi lea addresses_WC_ht+0x5455, %rdi clflush (%rsi) nop nop nop cmp %r12, %r12 mov $36, %rcx rep movsq nop nop nop sub %r13, %r13 lea addresses_normal_ht+0x7cd5, %rdi nop nop dec %r12 mov (%rdi), %esi xor $15855, %r12 lea addresses_A_ht+0xfc7d, %r12 nop and $43735, %rcx movups (%r12), %xmm1 vpextrq $0, %xmm1, %rdi nop nop nop nop inc %rdi lea addresses_A_ht+0x17915, %rsi lea addresses_D_ht+0x4555, %rdi nop nop add $57627, %r13 mov $38, %rcx rep movsw nop nop nop add %rax, %rax lea addresses_normal_ht+0x4e35, %rsi nop sub %r14, %r14 mov (%rsi), %r10w nop nop nop nop inc %rax lea addresses_WT_ht+0x8815, %rsi lea addresses_WT_ht+0xd275, %rdi nop nop nop nop and %r14, %r14 mov $20, %rcx rep movsq sub %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rax pop %r14 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r8 push %rax push %rbp push %rbx // Store lea addresses_D+0x1fbd5, %r8 nop add $6582, %rbx movl $0x51525354, (%r8) nop nop nop nop dec %rbp // Store lea addresses_WT+0x1edb, %rax nop nop nop add %r14, %r14 movl $0x51525354, (%rax) nop nop nop nop nop cmp %rbx, %rbx // Store mov $0x4e3f750000000911, %rbp nop nop nop xor %rax, %rax movb $0x51, (%rbp) inc %r12 // Faulty Load lea addresses_US+0x17ed5, %rbx nop nop nop nop nop xor $36814, %r11 mov (%rbx), %r12d lea oracles, %rbx and $0xff, %r12 shlq $12, %r12 mov (%rbx,%r12,1), %r12 pop %rbx pop %rbp pop %rax pop %r8 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 1}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_US', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}} {'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_A_ht', 'congruent': 0}, 'dst': {'same': True, 'type': 'addresses_D_ht', 'congruent': 10}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}, 'dst': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 5}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 5}} {'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 */
100-natural.agda
mcmtroffaes/agda-proofs
2
4749
<filename>100-natural.agda module 100-natural where open import 010-false-true open import 020-equivalence record Natural {N : Set} (zero : N) (suc : N -> N) (_==_ : N -> N -> Set) : Set1 where -- axioms field equiv : Equivalence _==_ sucn!=zero : ∀ {r} -> suc r == zero -> False sucinjective : ∀ {r s} -> suc r == suc s -> r == s cong : ∀ {r s} -> r == s -> suc r == suc s induction : (p : N -> Set) -> p zero -> (∀ n -> p n -> p (suc n)) -> (∀ n -> p n) open Equivalence equiv public
src/day-18/adventofcode-day_18-main.adb
persan/advent-of-code-2020
0
12809
with Ada.Text_IO; use Ada.Text_IO; procedure Adventofcode.Day_18.Main is begin Put_Line ("Day-18"); end Adventofcode.Day_18.Main;
alloy4fun_models/trashltl/models/15/uEbALknvf3u7eGG5T.als
Kaixi26/org.alloytools.alloy
0
3255
open main pred iduEbALknvf3u7eGG5T_prop16 { historically some Protected } pred __repair { iduEbALknvf3u7eGG5T_prop16 } check __repair { iduEbALknvf3u7eGG5T_prop16 <=> prop16o }
test/Compiler/simple/Floats.agda
redfish64/autonomic-agda
0
8827
<reponame>redfish64/autonomic-agda module _ where open import Agda.Builtin.Float open import Common.Prelude hiding (_+_; _*_) print : Float → IO Unit print x = putStrLn (primShowFloat x) printB : Bool → IO Unit printB true = putStrLn "true" printB false = putStrLn "false" _+_ = primFloatPlus _*_ = primFloatTimes _/_ = primFloatDiv _==_ = primFloatEquality _<_ = primFloatLess NaN : Float NaN = 0.0 / 0.0 Inf : Float Inf = 1.0 / 0.0 -Inf : Float -Inf = -1.0 / 0.0 pi : Float pi = 3.141592653589793 main : IO Unit main = putStr "123.0 = " ,, print 123.0 ,, putStr "NaN = " ,, print NaN ,, putStr "Inf = " ,, print Inf ,, putStr "-Inf = " ,, print -Inf ,, putStr "-0.0 = " ,, print -0.0 ,, -- Disabled due to #1856 and #1857 -- putStr "√2 = " ,, print (primFloatTimes 2.0 (primSin (primFloatDiv pi 4.0))) ,, -- putStr "e = " ,, print (primExp 1.0) ,, putStr "NaN == NaN = " ,, printB (NaN == NaN) ,, putStr "Inf == Inf = " ,, printB (Inf == Inf) ,, putStr "NaN < -Inf = " ,, printB (NaN < -Inf) ,, putStr "NaN < -5.0 = " ,, printB (NaN < -5.0) ,, return unit
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_35_1729.asm
ljhsiun2/medusa
9
175319
<filename>Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_35_1729.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r8 push %rax push %rsi lea addresses_D_ht+0x7aa8, %rsi nop nop xor %r11, %r11 mov $0x6162636465666768, %r12 movq %r12, %xmm2 vmovups %ymm2, (%rsi) nop nop xor $39362, %rax lea addresses_WT_ht+0x1ec0a, %rsi nop nop nop nop inc %r8 mov (%rsi), %r10w nop nop xor $16605, %r8 lea addresses_A_ht+0x3e88, %rax clflush (%rax) nop nop nop add $10414, %rsi movb (%rax), %r11b xor %r12, %r12 pop %rsi pop %rax pop %r8 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r9 push %rbp push %rcx push %rdi push %rdx // Store lea addresses_UC+0xf288, %rcx nop nop nop nop nop cmp %rdx, %rdx movb $0x51, (%rcx) add $17779, %r13 // Store lea addresses_RW+0x15418, %rdx clflush (%rdx) nop nop nop xor %r13, %r13 movb $0x51, (%rdx) xor %r11, %r11 // Faulty Load lea addresses_normal+0x4a88, %rdx nop nop nop nop add %rbp, %rbp mov (%rdx), %r9w lea oracles, %rcx and $0xff, %r9 shlq $12, %r9 mov (%rcx,%r9,1), %r9 pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 10, 'same': False}} {'34': 35} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
Binding_Zstandard/zstandard-functions.ads
jrmarino/zstd-ada
13
6390
<reponame>jrmarino/zstd-ada -- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt with Zstandard.Thin_Binding; package Zstandard.Functions is package Thin renames Zstandard.Thin_Binding; ------------------ -- Data Types -- ------------------ type Compression_Level is range 1 .. 22; type File_Size is mod 2 ** 64; subtype Compression_Dictionary is Thin.ZSTD_CDict_ptr; subtype Decompression_Dictionary is Thin.ZSTD_DDict_ptr; ----------------- -- Constants -- ----------------- Fastest_Compression : constant Compression_Level := Compression_Level'First; Highest_Compression : constant Compression_Level := Compression_Level'Last; Default_Compression : constant Compression_Level := 3; -------------------- -- Identification -- -------------------- -- Returns the library version in the format "X.Y.Z", no leading zeros function Zstd_Version return String; ------------------ -- Compression -- ------------------ -- This function returns the compressed version of "source_data". Should the operation fail, -- "successful" variable will be set to False and the resulting string will contain the -- related error message. function Compress (source_data : String; successful : out Boolean; quality : Compression_Level := Default_Compression) return String; -- This function creates an output file that is a compressed version of the "source_file". -- It returns a blank string if successful and "successful" is set to True. Should the -- operation fail, "successful" is set to False and an error message is returned. -- For convenience, the size of the source and output files are also provided. function Compress_File (source_file : String; output_file : String; source_size : out File_Size; output_size : out File_Size; successful : out Boolean; quality : Compression_Level := Default_Compression) return String; -------------------- -- Decompression -- -------------------- -- This function returns the decompressed version of "source_data". Should the operation fail, -- "successful" variable will be set to False and the resulting string will contain the -- related error message. function Decompress (source_data : String; successful : out Boolean) return String; -- This function creates an output file that is a decompressed version of the "source_file". -- It returns a blank string if successful and "successful" is set to True. Should the -- operation fail, "successful" is set to False and an error message is returned. -- For convenience, the size of the source and output files are also provided. function Decompress_File (source_file : String; output_file : String; source_size : out File_Size; output_size : out File_Size; successful : out Boolean) return String; -- Helper function to dump contents of a file into a string -- Potentially useful when desirable to have a compressed copy of the file in memory function File_Contents (filename : String; filesize : Natural; nominal : out Boolean) return String; -- Helper function to create a new file with the exact value of "contents" string -- Potentially useful for writing compressed or plain text from memory function Write_Entire_File (filename : String; contents : String) return Boolean; --------------------------- -- Dictionary Handling -- --------------------------- -- Dictionaries are meant to be used to compress multiple similar files. Before compression, -- the dictionary is created by giving it a sample of the types to be compressed. function Create_Compression_Dictionary (sample : String; quality : Compression_Level := Default_Compression) return Compression_Dictionary; -- Similar to "Create_Compression_Dictionary" but the sample comes from a file -- Normally this is created by "zstd --train" command function Create_Compression_Dictionary_From_File (sample_file : String; successful : out Boolean; quality : Compression_Level := Default_Compression) return Compression_Dictionary; -- Release the compression dictionary after use. procedure Destroy_Compression_Dictionary (digest : Compression_Dictionary); -- Files compressed with dictionaries have to be decompressed using the same dictionaries -- created from the same sample data used to create the compression dictionaries. function Create_Decompression_Dictionary (sample : String) return Decompression_Dictionary; -- Similar to "Create_Decompression_Dictionary" but the sample comes from a file -- Normally this is created by "zstd --train" command function Create_Decompression_Dictionary_From_File (sample_file : String; successful : out Boolean) return Decompression_Dictionary; -- Release the decompression dictionary after use. procedure Destroy_Decompression_Dictionary (digest : Decompression_Dictionary); -------------------------------------------- -- Dictionary De/Compression Operations -- -------------------------------------------- -- This function returns the dictionary-biased compressed version of "source_data". -- Should the operation fail, "successful" variable will be set to False and the resulting -- string will contain the related error message. The compression level is pre-set during -- the creation of the "digest" dictionary. function Compress (source_data : String; digest : Compression_Dictionary; successful : out Boolean) return String; -- This function creates an output file that is a dictionary-biased compressed version of the -- "source_file". It returns a blank string if successful and "successful" is set to True. -- Should the operation fail, "successful" is set to False and an error message is returned. -- For convenience, the size of the source and output files are also provided. -- The compression level is pre-set during the creation of the "digest" dictionary. function Compress_File (source_file : String; output_file : String; digest : Compression_Dictionary; source_size : out File_Size; output_size : out File_Size; successful : out Boolean) return String; -- This function returns the decompressed version of "source_data" compressed using a -- dictionary. Should the operation fail, the "successful" variable will be set to False -- and the resulting string will contain the related error message. function Decompress (source_data : String; digest : Decompression_Dictionary; successful : out Boolean) return String; -- This function creates an output file that is a decompressed version of the "source_file" -- that was compressed using a dictionary. It returns a blank string if successful and -- "successful" is set to True. Should the operation fail, "successful" is set to False and -- an error message is returned. For convenience, the size of the source and output files -- are also provided. function Decompress_File (source_file : String; output_file : String; digest : Decompression_Dictionary; source_size : out File_Size; output_size : out File_Size; successful : out Boolean) return String; private Warn_src_file_DNE : constant String := "ERROR: Source file does not exist"; Warn_src_read_fail : constant String := "ERROR: Failed to read source file"; Warn_dst_write_fail : constant String := "ERROR: Failed to write to open output file"; Warn_compress_fail : constant String := "ERROR: Failed to compress data after reading " & "source file"; Warn_decompress_fail : constant String := "ERROR: Failed to decompress data after reading " & "source file"; Warn_way_too_big : constant String := "ERROR: Hit size limit imposed by this architecture"; Warn_orig_size_fail : constant String := "ERROR: Original size unknown"; function convert (data : Thin.IC.char_array) return String; function convert (data : String) return Thin.IC.char_array; end Zstandard.Functions;
lib/am335x_sdk/ti/csl/arch/r5/src/csl_arm_r5.asm
brandonbraun653/Apollo
2
95492
;****************************************************************************** ; @file csl_arm_r5.asm ; ; @brief ; Implementation file for the ARM R5 module CSL-FL. ; ; Contains the different control command and status query functions definitions ; ; \par ; ============================================================================ ; @n (C) Copyright 2017-2019, Texas Instruments, Inc. ; ; 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 Texas Instruments Incorporated 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. ;****************************************************************************** .text ;============================================================================== ; void CSL_armR5Dsb( void ) ;============================================================================== .global CSL_armR5Dsb CSL_armR5Dsb: DSB BX lr ;============================================================================== ; void CSL_armR5FpuEnable( uint32_t enable ) ;============================================================================== .global CSL_armR5FpuEnable CSL_armR5FpuEnable: MRC p15, #0, r1, c1, c0, #2 ; Read CPACR into r1 CMP r0, #0 BEQ armR5FpuEnable_disable ORR r1, r1, #(0xf << 20) ; Enable full access for p10 & p11 B armR5FpuEnable_00 armR5FpuEnable_disable: BIC r1, r1, #(0xf << 20) armR5FpuEnable_00: MCR p15, #0, r1, c1, c0, #2 ; Write back into CPACR ISB MOV r0, #0x40000000 ; VMSR FPEXC, r0 ; Currently causing a build error BX lr ;============================================================================== ; void CSL_armR5IntrEnableFiq( uint32_t enable ) ;============================================================================== .global CSL_armR5IntrEnableFiq CSL_armR5IntrEnableFiq: MRS r1, CPSR ; Read CPSR CMP r0, #0 BEQ armR5IntrEnableFiq_disable BIC r1, r1, #(1<<6) ; Clear FIQ mask (exception is not masked (is enabled)) B armR5IntrEnableFiq_00 armR5IntrEnableFiq_disable: ORR r1, r1, #(1<<6) ; Set FIQ mask (exception is masked (is disabled)) armR5IntrEnableFiq_00: MSR CPSR_c, r1 ; Write CPSR (bits 7:0 only) BX lr ;============================================================================== ; void CSL_armR5IntrEnableIrq( uint32_t enable ) ;============================================================================== .global CSL_armR5IntrEnableIrq CSL_armR5IntrEnableIrq: MRS r1, CPSR ; Read CPSR CMP r0, #0 BEQ armR5IntrEnableIrq_disable BIC r1, r1, #(1<<7) ; Clear IRQ mask (exception is not masked (is enabled)) B armR5IntrEnableIrq_00 armR5IntrEnableIrq_disable: ORR r1, r1, #(1<<7) ; Set IRQ mask (exception is masked (is disabled)) armR5IntrEnableIrq_00: MSR CPSR_c, r1 ; Write CPSR (bits 7:0 only) BX lr ;============================================================================== ; void CSL_armR5IntrEnableVic( uint32_t enable ) ;============================================================================== .global CSL_armR5IntrEnableVic CSL_armR5IntrEnableVic: MRC p15, #0, r1, c1, c0, #0 ; Read SCTLR CMP r0, #0 BEQ armR5IntrEnableVic_disable ORR r1, r1, #(1<<24) ; Set VE mask (VIC controller provides handler address for IRQ) B armR5IntrEnableVic_00 armR5IntrEnableVic_disable: BIC r1, r1, #(1<<24) ; Clear VE mask (exception vector address for IRQ is 0x00000018 or 0xFFFF0018) armR5IntrEnableVic_00: DSB MCR p15, #0, r1, c1, c0, #0 ; Write modified SCTLR BX lr ;============================================================================== ; void CSL_armR5CacheEnableICache( uint32_t enable ) ;============================================================================== .global CSL_armR5CacheEnableICache CSL_armR5CacheEnableICache: MRC p15, #0, r1, c1, c0, #0 ; Read SCTLR CMP r0, #0 BEQ armR5CacheEnableICaches_disable ORR r1, r1, #(1<<12) ; Set I bit (enable L1 instruction caches) MOV r2, #0 MCR p15, #0, r2, c7, c5, #0 ; Invalidate entire instruction cache B armR5CacheEnableICaches_00 armR5CacheEnableICaches_disable: BIC r1, r1, #(1<<12) ; Clear I bit (disable L1 instruction caches) armR5CacheEnableICaches_00: DSB MCR p15, #0, r1, c1, c0, #0 ; Write modified SCTLR ISB BX lr ;============================================================================== ; void CSL_armR5CacheEnableDCache( uint32_t enable ) ;============================================================================== .global CSL_armR5CacheEnableDCache CSL_armR5CacheEnableDCache: MRC p15, #0, r1, c1, c0, #0 ; Read SCTLR CMP r0, #0 BEQ armR5CacheEnableDCaches_disable ORR r1, r1, #(1<<2) ; Set C bit (enable L1 data caches) DSB MOV r2, #0 MCR p15, #0, r2, c15, c5, #0 ; Invalidate entire data cache B armR5CacheEnableDCaches_00 armR5CacheEnableDCaches_disable: BIC r1, r1, #(1<<2) ; Clear C bit (disable L1 data caches) armR5CacheEnableDCaches_00: DSB MCR p15, #0, r1, c1, c0, #0 ; Write modified SCTLR BX lr ;============================================================================== ; uint32_t CSL_armR5CacheGetIcacheLineSize(void ) ;============================================================================== .global CSL_armR5CacheGetIcacheLineSize CSL_armR5CacheGetIcacheLineSize: DMB MRC p15, #0, r0, c0, c0, #1 ; Read Cache Type Register UBFX r0, r0, #0, #4 ; Extract the iMinLine MOV r1, #1 LSL r0, r1, r0 ; Calculate the line size BX lr ;============================================================================== ; uint32_t CSL_armR5CacheGetDcacheLineSize(void ) ;============================================================================== .global CSL_armR5CacheGetDcacheLineSize CSL_armR5CacheGetDcacheLineSize: DMB MRC p15, #0, r0, c0, c0, #1 ; Read Cache Type Register UBFX r0, r0, #16, #4 ; Extract the DMinLine MOV r1, #1 LSL r0, r1, r0 ; Calculate the line size BX lr ;============================================================================== ; void CSL_armR5CacheEnableAllCache( uint32_t enable ) ;============================================================================== .global CSL_armR5CacheEnableAllCache CSL_armR5CacheEnableAllCache: PUSH {lr} BL CSL_armR5CacheEnableICache BL CSL_armR5CacheEnableDCache POP {lr} BX lr ;============================================================================== ; void CSL_armR5CacheInvalidateAllIcache( void ) ;============================================================================== .global CSL_armR5CacheInvalidateAllIcache CSL_armR5CacheInvalidateAllIcache: DMB ; Ensure all previous memory accesses are completed MOV r0, #0 MCR p15, #0, r0, c7, c5, #0 ; Invalidate I caches DSB ISB BX lr ;============================================================================== ; void CSL_armR5CacheInvalidateAllDcache( void ) ;============================================================================== .global CSL_armR5CacheInvalidateAllDcache CSL_armR5CacheInvalidateAllDcache: DMB ; Ensure all previous memory accesses are completed MOV r0, #0 MCR p15, #0, r0, c15, c5, #0 ; Invalidate D caches DSB ISB BX lr ;============================================================================== ; void CSL_armR5CacheInvalidateAllCache( void ) ;============================================================================== .global CSL_armR5CacheInvalidateAllCache CSL_armR5CacheInvalidateAllCache: PUSH {lr} BL CSL_armR5CacheInvalidateAllIcache BL CSL_armR5CacheInvalidateAllDcache POP {lr} BX lr ;============================================================================== ; void CSL_armR5CacheInvalidateIcacheMva( uint32_t address ) ;============================================================================== .global CSL_armR5CacheInvalidateIcacheMva CSL_armR5CacheInvalidateIcacheMva: DMB ; Ensure all previous memory accesses are completed MCR p15, #0, r0, c7, c5, #1 DSB BX lr ;============================================================================== ; void CSL_armR5CacheInvalidateDcacheMva( uint32_t address ) ;============================================================================== .global CSL_armR5CacheInvalidateDcacheMva CSL_armR5CacheInvalidateDcacheMva: DMB ; Ensure all previous memory accesses are completed MCR p15, #0, r0, c7, c6, #1 DSB BX lr ;============================================================================== ; void CSL_armR5CacheInvalidateDcacheSetWay( uint32_t set, uint32_t way ) ;============================================================================== .global CSL_armR5CacheInvalidateDcacheSetWay CSL_armR5CacheInvalidateDcacheSetWay: DMB ; Ensure all previous memory accesses are completed AND r1, r1, #0x3 LSL r0, #(32-9) LSR r0, #(32-9) ; set &= 0x1FF LSL r1, r1, #30 ORR r0, r1, r0, LSL #5 MCR p15, #0, r0, c7, c6, #2 DSB BX lr ;============================================================================== ; void CSL_armR5CacheCleanDcacheMva( uint32_t address ) ;============================================================================== .global CSL_armR5CacheCleanDcacheMva CSL_armR5CacheCleanDcacheMva: DMB ; Ensure all previous memory accesses are completed MCR p15, #0, r0, c7, c10, #1 DSB BX lr ;============================================================================== ; void CSL_armR5CacheCleanDcacheSetWay( uint32_t set, uint32_t way ) ;============================================================================== .global CSL_armR5CacheCleanDcacheSetWay CSL_armR5CacheCleanDcacheSetWay: DMB ; Ensure all previous memory accesses are completed AND r1, r1, #0x3 LSL r0, #(32-9) LSR r0, #(32-9) ; set &= 0x1FF LSL r1, r1, #30 ORR r0, r1, r0, LSL #5 MCR p15, #0, r0, c7, c10, #2 DSB BX lr ;============================================================================== ; void CSL_armR5CacheCleanInvalidateDcacheMva( uint32_t address ) ;============================================================================== .global CSL_armR5CacheCleanInvalidateDcacheMva CSL_armR5CacheCleanInvalidateDcacheMva: MCR p15, #0, r0, c7, c14, #1 BX lr ;============================================================================== ; void CSL_armR5CacheCleanInvalidateDcacheSetWay( uint32_t set, uint32_t way ) ;============================================================================== .global CSL_armR5CacheCleanInvalidateDcacheSetWay CSL_armR5CacheCleanInvalidateDcacheSetWay: DMB ; Ensure all previous memory accesses are completed AND r1, r1, #0x3 LSL r0, #(32-9) LSR r0, #(32-9) ; set &= 0x1FF LSL r1, r1, #30 ORR r0, r1, r0, LSL #5 MCR p15, #0, r0, c7, c14, #2 DSB BX lr ;============================================================================== ; void CSL_armR5CacheEnableForceWrThru( uint32_t enable ) ;============================================================================== .global CSL_armR5CacheEnableForceWrThru CSL_armR5CacheEnableForceWrThru: MRC p15, #0, r1, c1, c0, #1 ; Read Auxiliary Control Register CMP r0, #0 BEQ armR5CacheEnableForceWrThru_disable ORR r1, r1, #(1<<9) ; Set (enable) force Write-thru bit for write-back (WB) regions B armR5CacheEnableForceWrThru_00 armR5CacheEnableForceWrThru_disable: BIC r1, r1, #(1<<9) ; Clear (disable) force Write-thru bit for write-back (WB) regions armR5CacheEnableForceWrThru_00: MCR p15, #0, r1, c1, c0, #1 ; Write modified Auxiliary Control Register BX lr ;============================================================================== ; void CSL_armR5CacheDisableEcc( void ) ;============================================================================== .global CSL_armR5CacheDisableEcc CSL_armR5CacheDisableEcc: PUSH {lr} MOV r0, #0 BL CSL_armR5CacheEnableAllCache ; Disable instruction and data caches MRC p15, #0, r0, c1, c0, #1 ; Read Auxiliary Control register BIC r0, r0, #(0x7<<3) ; Clear CEC field ORR r0, r0, #(1<<5) ; Set CEC field to 3'b100 (disable parity checking) ORR r0, r0, #(1<<9) ; Enable Write Through Cache RAMS MCR p15, #0, r0, c1, c0, #1 ; Write Auxiliary Control register BL CSL_armR5CacheInvalidateAllCache MOV r0, #1 BL CSL_armR5CacheEnableAllCache ; Enable instruction and data caches POP {lr} BX lr ;============================================================================== ; void CSL_armR5CacheEnableAxiAccess( void ) ;============================================================================== .global CSL_armR5CacheEnableAxiAccess CSL_armR5CacheEnableAxiAccess: MRC p15, #0, r0, c1, c0, #1 ; Read Auxiliary Control register ORR r0, r0, #(1<<24) ; Set AXISCEN bit (enable AXI slave cache RAM access) MCR p15, #0, r0, c1, c0, #1 ; Write Auxiliary Control register BX lr ;============================================================================== ; uint32_t CSL_armR5ReadMpidrReg(void ) ;============================================================================== .global CSL_armR5ReadMpidrReg CSL_armR5ReadMpidrReg: DMB MRC p15, #0, r0, c0, c0, #5 ; Read MPIDR BX lr ;============================================================================== ; uintptr_t CSL_armR5GetCpsrRegVal( void ); ;============================================================================== .global CSL_armR5GetCpsrRegVal CSL_armR5GetCpsrRegVal: MRS r0, CPSR ; Read CPSR BX lr irq_fiq_set_mask .word 0xFFFFFF3F irq_fiq_clear_mask .word 0x000000C0 ;============================================================================== ; void CSL_armR5DisableIrqFiq( void ); ;============================================================================== .global CSL_armR5DisableIrqFiq CSL_armR5DisableIrqFiq: LDR r0, irq_fiq_clear_mask ; Mask for clearing IRQ and FIQ bits MRS r1, CPSR ; Read CPSR ORR r1, r1, r0 ; Clear IRQ and FIQ bits only MSR CPSR_c, r1 ; Write CPSR (bits 7:6 only) BX lr ;============================================================================== ; void CSL_armR5EnableIrqFiq( uintptr_t cookie ); ;============================================================================== .global CSL_armR5EnableIrqFiq CSL_armR5EnableIrqFiq: LDR r2, irq_fiq_set_mask ; Mask out other bits than IRQ and FIQ MRS r1, CPSR ; Read CPSR AND r1, r1, r2 LDR r2, irq_fiq_clear_mask ; Mask out other bits than IRQ and FIQ AND r0, r0, r2 ; set/clear IRQ and FIQ bits ORR r1, r1, r0 MSR CPSR_c, r1 ; Write CPSR (bits 7:6 only) BX lr .end
programs/oeis/097/A097135.asm
neoneye/loda
22
21769
<filename>programs/oeis/097/A097135.asm ; A097135: a(0) = 1; for n>0, a(n) = 3*Fibonacci(n). ; 1,3,3,6,9,15,24,39,63,102,165,267,432,699,1131,1830,2961,4791,7752,12543,20295,32838,53133,85971,139104,225075,364179,589254,953433,1542687,2496120,4038807,6534927,10573734,17108661,27682395,44791056,72473451,117264507 mov $1,1 lpb $0 sub $0,1 mov $1,$3 add $1,3 mov $3,$2 add $2,$1 lpe mov $0,$1
oeis/299/A299258.asm
neoneye/loda-programs
11
100643
; A299258: Coordination sequence for 3D uniform tiling formed by stacking parallel layers of the 4.6.12 2D tiling (cf. A072154). ; 1,5,13,25,41,62,89,121,157,197,242,293,349,409,473,542,617,697,781,869,962,1061,1165,1273,1385,1502,1625,1753,1885,2021,2162,2309,2461,2617,2777,2942,3113,3289,3469,3653,3842,4037,4237,4441,4649,4862,5081,5305,5533,5765,6002,6245,6493,6745,7001,7262,7529,7801,8077,8357,8642,8933,9229,9529,9833,10142,10457,10777,11101,11429,11762,12101,12445,12793,13145,13502,13865,14233,14605,14981,15362,15749,16141,16537,16937,17342,17753,18169,18589,19013,19442,19877,20317,20761,21209,21662,22121,22585,23053 seq $0,8137 ; Coordination sequence T1 for Zeolite Code LTA and RHO. mul $0,3 sub $0,1 add $1,$0 div $1,2 mov $0,$1
alloy4fun_models/trashltl/models/5/yKekYNe93ZeSLxDJE.als
Kaixi26/org.alloytools.alloy
0
2526
<filename>alloy4fun_models/trashltl/models/5/yKekYNe93ZeSLxDJE.als<gh_stars>0 open main pred idyKekYNe93ZeSLxDJE_prop6 { all f : File | always f in Trash since f in Trash } pred __repair { idyKekYNe93ZeSLxDJE_prop6 } check __repair { idyKekYNe93ZeSLxDJE_prop6 <=> prop6o }
oeis/070/A070353.asm
neoneye/loda-programs
11
167250
; A070353: a(n) = 3^n mod 14. ; 1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13,11,5,1,3,9,13 mov $1,$0 mov $0,3 pow $0,$1 mod $0,14
programs/oeis/141/A141759.asm
neoneye/loda
22
12020
; A141759: a(n) = 16n^2 + 32n + 15. ; 15,63,143,255,399,575,783,1023,1295,1599,1935,2303,2703,3135,3599,4095,4623,5183,5775,6399,7055,7743,8463,9215,9999,10815,11663,12543,13455,14399,15375,16383,17423,18495,19599,20735,21903,23103,24335,25599,26895,28223,29583,30975,32399,33855,35343,36863,38415,39999,41615,43263,44943,46655,48399,50175,51983,53823,55695,57599,59535,61503,63503,65535,67599,69695,71823,73983,76175,78399,80655,82943,85263,87615,89999,92415,94863,97343,99855,102399,104975,107583,110223,112895,115599,118335,121103,123903,126735,129599,132495,135423,138383,141375,144399,147455,150543,153663,156815,159999 mov $1,2 add $1,$0 mul $1,$0 mul $1,16 add $1,15 mov $0,$1
libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/l_f16_eq.asm
Frodevan/z88dk
640
169904
<filename>libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sccz80/l_f16_eq.asm SECTION code_fp_math16 PUBLIC l_f16_eq EXTERN asm_f16_compare_callee .l_f16_eq call asm_f16_compare_callee scf ret Z ccf dec hl ret
libsrc/_DEVELOPMENT/font/fzx/c/sdcc_ix/fzx_at_callee.asm
jpoikela/z88dk
640
160026
; void fzx_at_callee(struct fzx_state *fs, uint16_t x, uint16_t y) SECTION code_font SECTION code_font_fzx PUBLIC _fzx_at_callee, l0_fzx_at_callee EXTERN asm_fzx_at _fzx_at_callee: pop af pop de pop hl pop bc push af l0_fzx_at_callee: push de ex (sp),ix call asm_fzx_at pop ix ret
Lab Assessment Submission/Lab 2/task-3,-1712666642 .asm
samiurprapon/CSE331L-Section-10-Fall20-NSU
0
3401
org 100h A DB 5 DUP(7) ret
out/test_returns.adb
FardaleM/metalang
22
24300
<reponame>FardaleM/metalang with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C; use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C; procedure test_returns is type stringptr is access all char_array; function is_pair(i : in Integer) return Boolean is j : Integer; begin j := 1; if i < 10 then j := 2; if i = 0 then j := 4; return TRUE; end if; j := 3; if i = 2 then j := 4; return TRUE; end if; j := 5; end if; j := 6; if i < 20 then if i = 22 then j := 0; end if; j := 8; end if; return i rem 2 = 0; end; begin NULL; end;
code/vendor/openssl/asm/crypto/ec/x25519-x86_64.asm
thorium-cfx/fivem
5,411
241473
<gh_stars>1000+ OPTION DOTNAME .text$ SEGMENT ALIGN(256) 'CODE' PUBLIC x25519_fe51_mul ALIGN 32 x25519_fe51_mul PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe51_mul:: mov rdi,rcx mov rsi,rdx mov rdx,r8 push rbp push rbx push r12 push r13 push r14 push r15 lea rsp,QWORD PTR[((-40))+rsp] $L$fe51_mul_body:: mov rax,QWORD PTR[rsi] mov r11,QWORD PTR[rdx] mov r12,QWORD PTR[8+rdx] mov r13,QWORD PTR[16+rdx] mov rbp,QWORD PTR[24+rdx] mov r14,QWORD PTR[32+rdx] mov QWORD PTR[32+rsp],rdi mov rdi,rax mul r11 mov QWORD PTR[rsp],r11 mov rbx,rax mov rax,rdi mov rcx,rdx mul r12 mov QWORD PTR[8+rsp],r12 mov r8,rax mov rax,rdi lea r15,QWORD PTR[r14*8+r14] mov r9,rdx mul r13 mov QWORD PTR[16+rsp],r13 mov r10,rax mov rax,rdi lea rdi,QWORD PTR[r15*2+r14] mov r11,rdx mul rbp mov r12,rax mov rax,QWORD PTR[rsi] mov r13,rdx mul r14 mov r14,rax mov rax,QWORD PTR[8+rsi] mov r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[16+rsi] adc rcx,rdx mul rdi add r8,rax mov rax,QWORD PTR[24+rsi] adc r9,rdx mul rdi add r10,rax mov rax,QWORD PTR[32+rsi] adc r11,rdx mul rdi imul rdi,rbp,19 add r12,rax mov rax,QWORD PTR[8+rsi] adc r13,rdx mul rbp mov rbp,QWORD PTR[16+rsp] add r14,rax mov rax,QWORD PTR[16+rsi] adc r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[24+rsi] adc rcx,rdx mul rdi add r8,rax mov rax,QWORD PTR[32+rsi] adc r9,rdx mul rdi imul rdi,rbp,19 add r10,rax mov rax,QWORD PTR[8+rsi] adc r11,rdx mul rbp add r12,rax mov rax,QWORD PTR[16+rsi] adc r13,rdx mul rbp mov rbp,QWORD PTR[8+rsp] add r14,rax mov rax,QWORD PTR[24+rsi] adc r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[32+rsi] adc rcx,rdx mul rdi add r8,rax mov rax,QWORD PTR[8+rsi] adc r9,rdx mul rbp imul rdi,rbp,19 add r10,rax mov rax,QWORD PTR[16+rsi] adc r11,rdx mul rbp add r12,rax mov rax,QWORD PTR[24+rsi] adc r13,rdx mul rbp mov rbp,QWORD PTR[rsp] add r14,rax mov rax,QWORD PTR[32+rsi] adc r15,rdx mul rdi add rbx,rax mov rax,QWORD PTR[8+rsi] adc rcx,rdx mul rbp add r8,rax mov rax,QWORD PTR[16+rsi] adc r9,rdx mul rbp add r10,rax mov rax,QWORD PTR[24+rsi] adc r11,rdx mul rbp add r12,rax mov rax,QWORD PTR[32+rsi] adc r13,rdx mul rbp add r14,rax adc r15,rdx mov rdi,QWORD PTR[32+rsp] jmp $L$reduce51 $L$fe51_mul_epilogue:: $L$SEH_end_x25519_fe51_mul:: x25519_fe51_mul ENDP PUBLIC x25519_fe51_sqr ALIGN 32 x25519_fe51_sqr PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe51_sqr:: mov rdi,rcx mov rsi,rdx push rbp push rbx push r12 push r13 push r14 push r15 lea rsp,QWORD PTR[((-40))+rsp] $L$fe51_sqr_body:: mov rax,QWORD PTR[rsi] mov r15,QWORD PTR[16+rsi] mov rbp,QWORD PTR[32+rsi] mov QWORD PTR[32+rsp],rdi lea r14,QWORD PTR[rax*1+rax] mul rax mov rbx,rax mov rax,QWORD PTR[8+rsi] mov rcx,rdx mul r14 mov r8,rax mov rax,r15 mov QWORD PTR[rsp],r15 mov r9,rdx mul r14 mov r10,rax mov rax,QWORD PTR[24+rsi] mov r11,rdx imul rdi,rbp,19 mul r14 mov r12,rax mov rax,rbp mov r13,rdx mul r14 mov r14,rax mov rax,rbp mov r15,rdx mul rdi add r12,rax mov rax,QWORD PTR[8+rsi] adc r13,rdx mov rsi,QWORD PTR[24+rsi] lea rbp,QWORD PTR[rax*1+rax] mul rax add r10,rax mov rax,QWORD PTR[rsp] adc r11,rdx mul rbp add r12,rax mov rax,rbp adc r13,rdx mul rsi add r14,rax mov rax,rbp adc r15,rdx imul rbp,rsi,19 mul rdi add rbx,rax lea rax,QWORD PTR[rsi*1+rsi] adc rcx,rdx mul rdi add r10,rax mov rax,rsi adc r11,rdx mul rbp add r8,rax mov rax,QWORD PTR[rsp] adc r9,rdx lea rsi,QWORD PTR[rax*1+rax] mul rax add r14,rax mov rax,rbp adc r15,rdx mul rsi add rbx,rax mov rax,rsi adc rcx,rdx mul rdi add r8,rax adc r9,rdx mov rdi,QWORD PTR[32+rsp] jmp $L$reduce51 ALIGN 32 $L$reduce51:: mov rbp,07ffffffffffffh mov rdx,r10 shr r10,51 shl r11,13 and rdx,rbp or r11,r10 add r12,r11 adc r13,0 mov rax,rbx shr rbx,51 shl rcx,13 and rax,rbp or rcx,rbx add r8,rcx adc r9,0 mov rbx,r12 shr r12,51 shl r13,13 and rbx,rbp or r13,r12 add r14,r13 adc r15,0 mov rcx,r8 shr r8,51 shl r9,13 and rcx,rbp or r9,r8 add rdx,r9 mov r10,r14 shr r14,51 shl r15,13 and r10,rbp or r15,r14 lea r14,QWORD PTR[r15*8+r15] lea r15,QWORD PTR[r14*2+r15] add rax,r15 mov r8,rdx and rdx,rbp shr r8,51 add rbx,r8 mov r9,rax and rax,rbp shr r9,51 add rcx,r9 mov QWORD PTR[rdi],rax mov QWORD PTR[8+rdi],rcx mov QWORD PTR[16+rdi],rdx mov QWORD PTR[24+rdi],rbx mov QWORD PTR[32+rdi],r10 mov r15,QWORD PTR[40+rsp] mov r14,QWORD PTR[48+rsp] mov r13,QWORD PTR[56+rsp] mov r12,QWORD PTR[64+rsp] mov rbx,QWORD PTR[72+rsp] mov rbp,QWORD PTR[80+rsp] lea rsp,QWORD PTR[88+rsp] $L$fe51_sqr_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe51_sqr:: x25519_fe51_sqr ENDP PUBLIC x25519_fe51_mul121666 ALIGN 32 x25519_fe51_mul121666 PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe51_mul121666:: mov rdi,rcx mov rsi,rdx push rbp push rbx push r12 push r13 push r14 push r15 lea rsp,QWORD PTR[((-40))+rsp] $L$fe51_mul121666_body:: mov eax,121666 mul QWORD PTR[rsi] mov rbx,rax mov eax,121666 mov rcx,rdx mul QWORD PTR[8+rsi] mov r8,rax mov eax,121666 mov r9,rdx mul QWORD PTR[16+rsi] mov r10,rax mov eax,121666 mov r11,rdx mul QWORD PTR[24+rsi] mov r12,rax mov eax,121666 mov r13,rdx mul QWORD PTR[32+rsi] mov r14,rax mov r15,rdx jmp $L$reduce51 $L$fe51_mul121666_epilogue:: $L$SEH_end_x25519_fe51_mul121666:: x25519_fe51_mul121666 ENDP EXTERN OPENSSL_ia32cap_P:NEAR PUBLIC x25519_fe64_eligible ALIGN 32 x25519_fe64_eligible PROC PUBLIC mov ecx,DWORD PTR[((OPENSSL_ia32cap_P+8))] xor eax,eax and ecx,080100h cmp ecx,080100h cmove eax,ecx DB 0F3h,0C3h ;repret x25519_fe64_eligible ENDP PUBLIC x25519_fe64_mul ALIGN 32 x25519_fe64_mul PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_mul:: mov rdi,rcx mov rsi,rdx mov rdx,r8 push rbp push rbx push r12 push r13 push r14 push r15 push rdi lea rsp,QWORD PTR[((-16))+rsp] $L$fe64_mul_body:: mov rax,rdx mov rbp,QWORD PTR[rdx] mov rdx,QWORD PTR[rsi] mov rcx,QWORD PTR[8+rax] mov r14,QWORD PTR[16+rax] mov r15,QWORD PTR[24+rax] mulx rax,r8,rbp xor edi,edi mulx rbx,r9,rcx adcx r9,rax mulx rax,r10,r14 adcx r10,rbx mulx r12,r11,r15 mov rdx,QWORD PTR[8+rsi] adcx r11,rax mov QWORD PTR[rsp],r14 adcx r12,rdi mulx rbx,rax,rbp adox r9,rax adcx r10,rbx mulx rbx,rax,rcx adox r10,rax adcx r11,rbx mulx rbx,rax,r14 adox r11,rax adcx r12,rbx mulx r13,rax,r15 mov rdx,QWORD PTR[16+rsi] adox r12,rax adcx r13,rdi adox r13,rdi mulx rbx,rax,rbp adcx r10,rax adox r11,rbx mulx rbx,rax,rcx adcx r11,rax adox r12,rbx mulx rbx,rax,r14 adcx r12,rax adox r13,rbx mulx r14,rax,r15 mov rdx,QWORD PTR[24+rsi] adcx r13,rax adox r14,rdi adcx r14,rdi mulx rbx,rax,rbp adox r11,rax adcx r12,rbx mulx rbx,rax,rcx adox r12,rax adcx r13,rbx mulx rbx,rax,QWORD PTR[rsp] adox r13,rax adcx r14,rbx mulx r15,rax,r15 mov edx,38 adox r14,rax adcx r15,rdi adox r15,rdi jmp $L$reduce64 $L$fe64_mul_epilogue:: $L$SEH_end_x25519_fe64_mul:: x25519_fe64_mul ENDP PUBLIC x25519_fe64_sqr ALIGN 32 x25519_fe64_sqr PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_sqr:: mov rdi,rcx mov rsi,rdx push rbp push rbx push r12 push r13 push r14 push r15 push rdi lea rsp,QWORD PTR[((-16))+rsp] $L$fe64_sqr_body:: mov rdx,QWORD PTR[rsi] mov rcx,QWORD PTR[8+rsi] mov rbp,QWORD PTR[16+rsi] mov rsi,QWORD PTR[24+rsi] mulx r15,r8,rdx mulx rax,r9,rcx xor edi,edi mulx rbx,r10,rbp adcx r10,rax mulx r12,r11,rsi mov rdx,rcx adcx r11,rbx adcx r12,rdi mulx rbx,rax,rbp adox r11,rax adcx r12,rbx mulx r13,rax,rsi mov rdx,rbp adox r12,rax adcx r13,rdi mulx r14,rax,rsi mov rdx,rcx adox r13,rax adcx r14,rdi adox r14,rdi adcx r9,r9 adox r9,r15 adcx r10,r10 mulx rbx,rax,rdx mov rdx,rbp adcx r11,r11 adox r10,rax adcx r12,r12 adox r11,rbx mulx rbx,rax,rdx mov rdx,rsi adcx r13,r13 adox r12,rax adcx r14,r14 adox r13,rbx mulx r15,rax,rdx mov edx,38 adox r14,rax adcx r15,rdi adox r15,rdi jmp $L$reduce64 ALIGN 32 $L$reduce64:: mulx rbx,rax,r12 adcx r8,rax adox r9,rbx mulx rbx,rax,r13 adcx r9,rax adox r10,rbx mulx rbx,rax,r14 adcx r10,rax adox r11,rbx mulx r12,rax,r15 adcx r11,rax adox r12,rdi adcx r12,rdi mov rdi,QWORD PTR[16+rsp] imul r12,rdx add r8,r12 adc r9,0 adc r10,0 adc r11,0 sbb rax,rax and rax,38 add r8,rax mov QWORD PTR[8+rdi],r9 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 mov QWORD PTR[rdi],r8 mov r15,QWORD PTR[24+rsp] mov r14,QWORD PTR[32+rsp] mov r13,QWORD PTR[40+rsp] mov r12,QWORD PTR[48+rsp] mov rbx,QWORD PTR[56+rsp] mov rbp,QWORD PTR[64+rsp] lea rsp,QWORD PTR[72+rsp] $L$fe64_sqr_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_sqr:: x25519_fe64_sqr ENDP PUBLIC x25519_fe64_mul121666 ALIGN 32 x25519_fe64_mul121666 PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_mul121666:: mov rdi,rcx mov rsi,rdx $L$fe64_mul121666_body:: mov edx,121666 mulx rcx,r8,QWORD PTR[rsi] mulx rax,r9,QWORD PTR[8+rsi] add r9,rcx mulx rcx,r10,QWORD PTR[16+rsi] adc r10,rax mulx rax,r11,QWORD PTR[24+rsi] adc r11,rcx adc rax,0 imul rax,rax,38 add r8,rax adc r9,0 adc r10,0 adc r11,0 sbb rax,rax and rax,38 add r8,rax mov QWORD PTR[8+rdi],r9 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 mov QWORD PTR[rdi],r8 $L$fe64_mul121666_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_mul121666:: x25519_fe64_mul121666 ENDP PUBLIC x25519_fe64_add ALIGN 32 x25519_fe64_add PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_add:: mov rdi,rcx mov rsi,rdx mov rdx,r8 $L$fe64_add_body:: mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[8+rsi] mov r10,QWORD PTR[16+rsi] mov r11,QWORD PTR[24+rsi] add r8,QWORD PTR[rdx] adc r9,QWORD PTR[8+rdx] adc r10,QWORD PTR[16+rdx] adc r11,QWORD PTR[24+rdx] sbb rax,rax and rax,38 add r8,rax adc r9,0 adc r10,0 mov QWORD PTR[8+rdi],r9 adc r11,0 mov QWORD PTR[16+rdi],r10 sbb rax,rax mov QWORD PTR[24+rdi],r11 and rax,38 add r8,rax mov QWORD PTR[rdi],r8 $L$fe64_add_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_add:: x25519_fe64_add ENDP PUBLIC x25519_fe64_sub ALIGN 32 x25519_fe64_sub PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_sub:: mov rdi,rcx mov rsi,rdx mov rdx,r8 $L$fe64_sub_body:: mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[8+rsi] mov r10,QWORD PTR[16+rsi] mov r11,QWORD PTR[24+rsi] sub r8,QWORD PTR[rdx] sbb r9,QWORD PTR[8+rdx] sbb r10,QWORD PTR[16+rdx] sbb r11,QWORD PTR[24+rdx] sbb rax,rax and rax,38 sub r8,rax sbb r9,0 sbb r10,0 mov QWORD PTR[8+rdi],r9 sbb r11,0 mov QWORD PTR[16+rdi],r10 sbb rax,rax mov QWORD PTR[24+rdi],r11 and rax,38 sub r8,rax mov QWORD PTR[rdi],r8 $L$fe64_sub_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_sub:: x25519_fe64_sub ENDP PUBLIC x25519_fe64_tobytes ALIGN 32 x25519_fe64_tobytes PROC PUBLIC mov QWORD PTR[8+rsp],rdi ;WIN64 prologue mov QWORD PTR[16+rsp],rsi mov rax,rsp $L$SEH_begin_x25519_fe64_tobytes:: mov rdi,rcx mov rsi,rdx $L$fe64_to_body:: mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[8+rsi] mov r10,QWORD PTR[16+rsi] mov r11,QWORD PTR[24+rsi] lea rax,QWORD PTR[r11*1+r11] sar r11,63 shr rax,1 and r11,19 add r11,19 add r8,r11 adc r9,0 adc r10,0 adc rax,0 lea r11,QWORD PTR[rax*1+rax] sar rax,63 shr r11,1 not rax and rax,19 sub r8,rax sbb r9,0 sbb r10,0 sbb r11,0 mov QWORD PTR[rdi],r8 mov QWORD PTR[8+rdi],r9 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 $L$fe64_to_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_x25519_fe64_tobytes:: x25519_fe64_tobytes ENDP DB 88,50,53,53,49,57,32,112,114,105,109,105,116,105,118,101 DB 115,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82 DB 89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112 DB 114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 EXTERN __imp_RtlVirtualUnwind:NEAR ALIGN 16 short_handler PROC PRIVATE push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD PTR[120+r8] mov rbx,QWORD PTR[248+r8] mov rsi,QWORD PTR[8+r9] mov r11,QWORD PTR[56+r9] mov r10d,DWORD PTR[r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jb $L$common_seh_tail mov rax,QWORD PTR[152+r8] jmp $L$common_seh_tail short_handler ENDP ALIGN 16 full_handler PROC PRIVATE push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD PTR[120+r8] mov rbx,QWORD PTR[248+r8] mov rsi,QWORD PTR[8+r9] mov r11,QWORD PTR[56+r9] mov r10d,DWORD PTR[r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jb $L$common_seh_tail mov rax,QWORD PTR[152+r8] mov r10d,DWORD PTR[4+r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jae $L$common_seh_tail mov r10d,DWORD PTR[8+r11] lea rax,QWORD PTR[r10*1+rax] mov rbp,QWORD PTR[((-8))+rax] mov rbx,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] mov r13,QWORD PTR[((-32))+rax] mov r14,QWORD PTR[((-40))+rax] mov r15,QWORD PTR[((-48))+rax] mov QWORD PTR[144+r8],rbx mov QWORD PTR[160+r8],rbp mov QWORD PTR[216+r8],r12 mov QWORD PTR[224+r8],r13 mov QWORD PTR[232+r8],r14 mov QWORD PTR[240+r8],r15 $L$common_seh_tail:: mov rdi,QWORD PTR[8+rax] mov rsi,QWORD PTR[16+rax] mov QWORD PTR[152+r8],rax mov QWORD PTR[168+r8],rsi mov QWORD PTR[176+r8],rdi mov rdi,QWORD PTR[40+r9] mov rsi,r8 mov ecx,154 DD 0a548f3fch mov rsi,r9 xor rcx,rcx mov rdx,QWORD PTR[8+rsi] mov r8,QWORD PTR[rsi] mov r9,QWORD PTR[16+rsi] mov r10,QWORD PTR[40+rsi] lea r11,QWORD PTR[56+rsi] lea r12,QWORD PTR[24+rsi] mov QWORD PTR[32+rsp],r10 mov QWORD PTR[40+rsp],r11 mov QWORD PTR[48+rsp],r12 mov QWORD PTR[56+rsp],rcx call QWORD PTR[__imp_RtlVirtualUnwind] mov eax,1 add rsp,64 popfq pop r15 pop r14 pop r13 pop r12 pop rbp pop rbx pop rdi pop rsi DB 0F3h,0C3h ;repret full_handler ENDP .text$ ENDS .pdata SEGMENT READONLY ALIGN(4) ALIGN 4 DD imagerel $L$SEH_begin_x25519_fe51_mul DD imagerel $L$SEH_end_x25519_fe51_mul DD imagerel $L$SEH_info_x25519_fe51_mul DD imagerel $L$SEH_begin_x25519_fe51_sqr DD imagerel $L$SEH_end_x25519_fe51_sqr DD imagerel $L$SEH_info_x25519_fe51_sqr DD imagerel $L$SEH_begin_x25519_fe51_mul121666 DD imagerel $L$SEH_end_x25519_fe51_mul121666 DD imagerel $L$SEH_info_x25519_fe51_mul121666 DD imagerel $L$SEH_begin_x25519_fe64_mul DD imagerel $L$SEH_end_x25519_fe64_mul DD imagerel $L$SEH_info_x25519_fe64_mul DD imagerel $L$SEH_begin_x25519_fe64_sqr DD imagerel $L$SEH_end_x25519_fe64_sqr DD imagerel $L$SEH_info_x25519_fe64_sqr DD imagerel $L$SEH_begin_x25519_fe64_mul121666 DD imagerel $L$SEH_end_x25519_fe64_mul121666 DD imagerel $L$SEH_info_x25519_fe64_mul121666 DD imagerel $L$SEH_begin_x25519_fe64_add DD imagerel $L$SEH_end_x25519_fe64_add DD imagerel $L$SEH_info_x25519_fe64_add DD imagerel $L$SEH_begin_x25519_fe64_sub DD imagerel $L$SEH_end_x25519_fe64_sub DD imagerel $L$SEH_info_x25519_fe64_sub DD imagerel $L$SEH_begin_x25519_fe64_tobytes DD imagerel $L$SEH_end_x25519_fe64_tobytes DD imagerel $L$SEH_info_x25519_fe64_tobytes .pdata ENDS .xdata SEGMENT READONLY ALIGN(8) ALIGN 8 $L$SEH_info_x25519_fe51_mul:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe51_mul_body,imagerel $L$fe51_mul_epilogue DD 88,0 $L$SEH_info_x25519_fe51_sqr:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe51_sqr_body,imagerel $L$fe51_sqr_epilogue DD 88,0 $L$SEH_info_x25519_fe51_mul121666:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe51_mul121666_body,imagerel $L$fe51_mul121666_epilogue DD 88,0 $L$SEH_info_x25519_fe64_mul:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe64_mul_body,imagerel $L$fe64_mul_epilogue DD 72,0 $L$SEH_info_x25519_fe64_sqr:: DB 9,0,0,0 DD imagerel full_handler DD imagerel $L$fe64_sqr_body,imagerel $L$fe64_sqr_epilogue DD 72,0 $L$SEH_info_x25519_fe64_mul121666:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_mul121666_body,imagerel $L$fe64_mul121666_epilogue $L$SEH_info_x25519_fe64_add:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_add_body,imagerel $L$fe64_add_epilogue $L$SEH_info_x25519_fe64_sub:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_sub_body,imagerel $L$fe64_sub_epilogue $L$SEH_info_x25519_fe64_tobytes:: DB 9,0,0,0 DD imagerel short_handler DD imagerel $L$fe64_to_body,imagerel $L$fe64_to_epilogue .xdata ENDS END
src/asf-contexts-facelets.ads
jquorning/ada-asf
12
2776
<reponame>jquorning/ada-asf ----------------------------------------------------------------------- -- contexts-facelets -- Contexts for facelets -- Copyright (C) 2009, 2010, 2011, 2018 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Strings; with EL.Objects; with EL.Contexts; with EL.Expressions; with EL.Functions; with ASF.Components.Base; with ASF.Converters; with ASF.Validators; with Ada.Strings.Unbounded; with Ada.Containers.Vectors; limited with ASF.Views.Nodes.Facelets; package ASF.Contexts.Facelets is use ASF.Components; use Ada.Strings.Unbounded; -- ------------------------------ -- Facelet context -- ------------------------------ -- The <b>Facelet_Context</b> defines a context used exclusively when -- building the component tree from the facelet nodes. It allows to -- compose the component tree by using other facelet fragments. type Facelet_Context is abstract tagged private; type Facelet_Context_Access is access all Facelet_Context'Class; -- Get the EL context for evaluating expressions. function Get_ELContext (Context : in Facelet_Context) return EL.Contexts.ELContext_Access; -- Set the EL context for evaluating expressions. procedure Set_ELContext (Context : in out Facelet_Context; ELContext : in EL.Contexts.ELContext_Access); -- Get the function mapper associated with the EL context. function Get_Function_Mapper (Context : in Facelet_Context) return EL.Functions.Function_Mapper_Access; -- Set the attribute having given name with the value. procedure Set_Attribute (Context : in out Facelet_Context; Name : in String; Value : in EL.Objects.Object); -- Set the attribute having given name with the value. procedure Set_Attribute (Context : in out Facelet_Context; Name : in Unbounded_String; Value : in EL.Objects.Object); -- Set the attribute having given name with the expression. procedure Set_Variable (Context : in out Facelet_Context; Name : in Unbounded_String; Value : in EL.Expressions.Expression); -- Set the attribute having given name with the expression. procedure Set_Variable (Context : in out Facelet_Context; Name : in String; Value : in EL.Expressions.Expression); -- Include the facelet from the given source file. -- The included views appended to the parent component tree. procedure Include_Facelet (Context : in out Facelet_Context; Source : in String; Parent : in Base.UIComponent_Access); -- Include the definition having the given name. procedure Include_Definition (Context : in out Facelet_Context; Name : in Unbounded_String; Parent : in Base.UIComponent_Access; Found : out Boolean); -- Push into the current facelet context the <ui:define> nodes contained in -- the composition/decorate tag. procedure Push_Defines (Context : in out Facelet_Context; Node : access ASF.Views.Nodes.Facelets.Composition_Tag_Node); -- Pop from the current facelet context the <ui:define> nodes. procedure Pop_Defines (Context : in out Facelet_Context); -- Set the path to resolve relative facelet paths and get the previous path. procedure Set_Relative_Path (Context : in out Facelet_Context; Path : in String; Previous : out Unbounded_String); -- Set the path to resolve relative facelet paths. procedure Set_Relative_Path (Context : in out Facelet_Context; Path : in Unbounded_String); -- Resolve the facelet relative path function Resolve_Path (Context : Facelet_Context; Path : String) return String; -- Get a converter from a name. -- Returns the converter object or null if there is no converter. function Get_Converter (Context : in Facelet_Context; Name : in EL.Objects.Object) return ASF.Converters.Converter_Access is abstract; -- Get a validator from a name. -- Returns the validator object or null if there is no validator. function Get_Validator (Context : in Facelet_Context; Name : in EL.Objects.Object) return ASF.Validators.Validator_Access is abstract; private type Composition_Tag_Node is access all ASF.Views.Nodes.Facelets.Composition_Tag_Node'Class; package Defines_Vector is new Ada.Containers.Vectors (Index_Type => Natural, Element_Type => Composition_Tag_Node); type Facelet_Context is abstract tagged record -- The expression context; Context : EL.Contexts.ELContext_Access := null; Defines : Defines_Vector.Vector; Path : Unbounded_String; Inserts : Util.Strings.String_Set.Set; end record; end ASF.Contexts.Facelets;
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_21829_668.asm
ljhsiun2/medusa
9
9307
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r9 push %rbx push %rdi push %rdx push %rsi // Store lea addresses_A+0x14736, %r11 nop nop nop and %rdx, %rdx mov $0x5152535455565758, %rsi movq %rsi, (%r11) nop nop nop add $63909, %rdx // Store lea addresses_UC+0x1727c, %r9 sub $28364, %rsi movw $0x5152, (%r9) nop nop add $22219, %r11 // Faulty Load mov $0x1faf5d0000000576, %r14 nop nop nop nop nop and %rbx, %rbx mov (%r14), %di lea oracles, %rsi and $0xff, %rdi shlq $12, %rdi mov (%rsi,%rdi,1), %rdi pop %rsi pop %rdx pop %rdi pop %rbx pop %r9 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0}} <gen_prepare_buffer> {'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 */
routines/drawField.asm
jacobly0/Age-Of-CEmpires-I
0
17790
relocate DrawField, cursorImage, 1024 DrawField: DrawIsometricTile.copy ld b, (OFFSET_X) ; We start with the shadow registers active bit 4, b ld a, TILE_WIDTH / 2 ld c, jr_z jr z, .jump1 neg ld c, jr_nz .jump1: ld (TopRowLeftOrRight), a ld a, c ld (IncrementRowXOrNot1), a ld hl, DrawIsometricTile ld (TileDrawingRoutinePtr1), hl ld (TileDrawingRoutinePtr2), hl ld hl, TilePointersEnd - 3 ld (TilePointersSMC), hl ld hl, add_iy_sp_lea_de_iy ld (DrawTile_Clipped_Stop1), hl ld (DrawTile_Clipped_Stop2), hl ld (DrawTile_Clipped_Stop3), hl ld e, (OFFSET_Y) ld d, 10 xor a, a bit 3, e jr z, .jump2 inc d ld a, dec_c .jump2: ld (TileWhichAction), a ; Write "dec c" or "nop" ld a, d ld (TileHowManyRowsClipped), a bit 2, e ld hl, DrawTile_Clipped_Stop2 ld d, StopDrawingTile - DrawTile_Clipped_Stop2 - 2 jr z, .jump3 ld hl, DrawTile_Clipped_Stop3 ld (hl), jr_ inc hl ld (hl), StopDrawingTile - DrawTile_Clipped_Stop3 - 2 ld hl, DrawTile_Clipped_Stop1 ld d, StopDrawingTile - DrawTile_Clipped_Stop1 - 2 .jump3: ld (DrawTile_Clipped_SetJRSMC), hl ld hl, DrawTile_Clipped_SetJRStop ld (hl), jr_ inc hl ld (hl), d set 4, e ; Point to the row of the bottom right pixel ld d, lcdWidth / 2 mlt de ld a, b sub a, TILE_WIDTH * 2 - (TILE_WIDTH / 2 - 1) ; We start at column 17 (bottom right pixel), but 2 tiles to the left sbc hl, hl ld l, a add hl, de add hl, de ld de, (currDrawingBuffer) add hl, de ld (startingPosition), hl ld ix, (TopLeftYTile) lea ix, ix + 2 ; Remember the 2 columns at the left lea hl, ix ; Y * MAP_SIZE + X, point to the map data add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl ld de, (TopLeftXTile) dec de ; Remember the 2 columns at the left dec de add hl, de add hl, hl ; Each tile is 2 bytes worth ld bc, (MapDataPtr) add hl, bc ld a, AMOUNT_OF_ROWS ; Last X rows only trees/buildings exx DisplayEachRowLoopExx: exx DisplayEachRowLoop: ; Display X rows ; Registers: ; BC = length of row tile ; DE = pointer to output ; HL = pointer to tile/black tile ; A' = row index ; B' = column index ; BC' = amount of tiles to be added when changing row ; DE' = x index tile ; HL' = pointer to map data ; IX = y index tile ; IY = pointer to output ; SP = -SCREEN_WIDTH + offset startingPosition = $+2 ; Here are the shadow registers active ld iy, 0 ; Advance to the next row ld bc, (TILE_HEIGHT / 2) * lcdWidth add iy, bc ld (startingPosition), iy bit 0, a ; Check if we need to add half a tile to it jr nz, NoOffsetAtStart TopRowLeftOrRight = $+2 lea iy, iy + 0 NoOffsetAtStart: ex af, af' ld a, AMOUNT_OF_COLUMNS ld bc, (-MAP_SIZE + 1) * 2 ; How much to advance to the next row in the map DisplayTile: ; Display X tiles in a row ld b, a ; Check if we only need to display buildings (at the left/right) cp a, AMOUNT_OF_COLUMNS - 1 jr nc, TileOnlyDisplayBuilding cp a, 3 jr c, TileOnlyDisplayBuilding ld a, e ; Check out of field: DE and IX < MAP_SIZE or a, ixl add a, a sbc a, a or a, d or a, ixh jr nz, TileIsOutOfField or a, (hl) ; Tile index jp z, SkipDrawingOfTile ; Tile is part of a building, which will be overwritten later exx ; Here are the main registers active ld c, a ; Get the pointer to the tile ld b, 3 mlt bc TilePointersSMC = $+1 ld hl, TilePointersEnd - 3 ; The clipped tiles needs different pointers, so this pointer will be modified after X rows add hl, bc ld hl, (hl) cp a, TILE_TREE ; Check if it's a tile (with unit) TileDrawingRoutinePtr1 = $+1 jp c, DrawIsometricTile ; This will be modified to the clipped version after X rows sub a, TILE_BUILDING jr c, DisplayTileWithTree ; It's a tree jp DisplayBuilding ; It's a building TileIsOutOfField: xor a, a ; Reset A otherwise it might think that it was a tile with unit(s) exx ld hl, blackBuffer TileDrawingRoutinePtr2 = $+1 jp DrawIsometricTile ; This will be modified to the clipped version after X rows TileOnlyDisplayBuilding: ld a, e ; Check if out of field or a, ixl add a, a sbc a, a or a, d or a, ixh jp nz, SkipDrawingOfTile ld a, (hl) sub a, TILE_BUILDING ; Check if it's a building jp c, SkipDrawingOfTile jp DisplayBuildingExx DisplayTileWithTree: ; Inputs: ; A' = row index ; B' = column index ; HL = pointer to tree sprite ; Y coordinate: A' * 8 + 17 - tree_height ; X coordinate: B' * 32 + !(A' & 0) && ((B' & 1 << 4) ? -16 : 16) ld (BackupIY2), iy ; Backup IY, it's quite useful ld iy, iy_base TempSP3 = $+1 ld sp, 0 push hl ; Sprite struct ex af, af' ld c, a ; C = row index ex af, af' ld a, AMOUNT_OF_ROWS + 1 sub a, c ld e, a ld d, TILE_HEIGHT / 2 / 2 mlt de inc hl ld a, (hl) ld hl, 17 add hl, de add hl, de ld e, (OFFSET_Y) add hl, de ld e, a sbc hl, de push hl ; Y coordinate ld a, AMOUNT_OF_COLUMNS - 2 exx sub a, b ; B' = column index exx ld l, a ld h, TILE_WIDTH mlt hl ld e, (OFFSET_X) add hl, de bit 0, c jr nz, .jump bit 4, e ld e, TILE_WIDTH / 2 add hl, de jr z, .jump sla e sbc hl, de jr z, DontDisplayTree ; If X offset 0, and the tree is at the most left column, it's fully offscreen .jump: push hl ; X coordinate call _RLETSprite ; No need to pop DontDisplayTree: ld iy, 0 BackupIY2 = $-3 jp SkipDrawingOfTileExx DrawIsometricTileSecondPart: lddr ld c, 30 ex de, hl add hl, sp add hl, bc ex de, hl lddr inc sp inc sp ld c, 30 ex de, hl add hl, sp add hl, bc ex de, hl lddr inc sp inc sp ld c, 26 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 22 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 18 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 14 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 10 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 6 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 2 ex de, hl add hl, sp add hl, bc ex de, hl lddr cp a, TILE_UNIT_GRASS jr nc, DisplayUnits SkipDrawingOfTileExx: exx SkipDrawingOfTile: lea iy, iy + TILE_WIDTH ; Advance to next tile inc de ; Next X index in map dec ix ; Previous Y index in map ld a, b ld b, 255 ; BCU and C still holds (-MAP_SIZE + 1) * 2) add hl, bc ; Advance to the next tile in the map data dec a jp nz, DisplayTile ; Display all the tiles in the row ex af, af' IncrementRowXOrNot1 = $ jr nz, NoExtraColumnChange ; The zero flag is still set/reset from the "bit 0, a" inc de ; Advance an extra diagonal tile dec ix add hl, bc NoExtraColumnChange: ex de, hl ld c, -AMOUNT_OF_COLUMNS ; Advance to the next row tiles add hl, bc ex de, hl ld bc, (MAP_SIZE * (AMOUNT_OF_COLUMNS + 1) - AMOUNT_OF_COLUMNS) * 2 add hl, bc lea ix, ix + AMOUNT_OF_COLUMNS + 1 TileHowManyRowsClipped = $+1 ; Check if we need an extra routine to set the clipped tiles cp a, 0 dec a jp nc, DisplayEachRowLoop exx ld c, a ; Get the routine TileWhichAction = $ nop ; Can be SMC'd into a "dec c" ld b, 3 mlt bc ld hl, FieldRowActionTable add hl, bc ld hl, (hl) jp (hl) ; And jump to it DisplayUnits: ; Display them units! ld (BackupIY4), iy ;ld iy, iy_base TempSP5 = $+1 ld sp, 0 ;ld e, 5 ; Amount of units at the tile ;exx ;inc hl ;ld a, (hl) ; Unit index ;dec hl ;exx ;ld hl, UnitsPerTile FindNextUnit: ;ld c, a ;ld b, SIZEOF_UNIT_STRUCT ;mlt bc ;ld iy, (UnitsStackPtr) ;add iy, bc ;ld bc, (iy + UnitOffsetX - 1) ;ld c, a ;ld (hl), bc ;inc hl ;inc hl ;inc hl ;ld a, (iy + UnitNext) ;inc a ;jr z, DisplayUnitsAtTile ;dec a ;dec e ;jr nz, FindNextUnit DisplayUnitsAtTile: BackupIY4 = $+2 ld iy, 0 jr SkipDrawingOfTileExx SetClippedRoutine: ld hl, DrawTile_Clipped ; Set the clipped routine ld (TileDrawingRoutinePtr1), hl ld (TileDrawingRoutinePtr2), hl ld hl, (startingPosition) ; The starting position is now different ld bc, -lcdWidth * (TILE_HEIGHT - 1) - 1 ; -1 because we start at the left pixel of the top row, not the right one add hl, bc ld (startingPosition), hl ld hl, TilePointersStart - 3 ; Also use different pointers for displaying tiles ld (TilePointersSMC), hl jp DisplayEachRowLoopExx SetClippedRoutine2: DrawTile_Clipped_SetJRStop = $+1 ld hl, 0 ; Insert a JR X in the clipped tile routine DrawTile_Clipped_SetJRSMC = $+1 ld (0), hl jp DisplayEachRowLoopExx SetOnlyTreesRoutine: ld hl, SkipDrawingOfTileExx ; Normal tiles shouldn't be displayed anymore ld (TileDrawingRoutinePtr1), hl ld (TileDrawingRoutinePtr2), hl jp DisplayEachRowLoopExx StopDisplayTiles: ld de, mpShaData ; Copy routine to mpShaData ld hl, DrawScreenBorderStart ld bc, DrawScreenBorderEnd - DrawScreenBorderStart ldir ld de, (currDrawingBuffer) ; Display food, wood, stone etc placeholder ld hl, resources_offset ld bc, resources_width * resources_height ldir ld hl, blackBuffer ; Display the right and left black edge ld b, (lcdWidth * 13 + TILE_WIDTH) shr 8 jp mpShaData DrawScreenBorderStart: ld c, (lcdWidth * 13 + TILE_WIDTH) and 255 ldir ex de, hl ; Fill the edges with black; 21 pushes = 21*3=63+1 = 64 bytes, so 32 bytes on each side ld a, lcdHeight - 15 - 13 - 1 ld de, lcdWidth ; Used to advance to the next 'half-row' dec hl FillBorderLoop: add hl, de ld (hl), c ld sp, hl push bc ; Fill with black using pushes (bc = 0, writes 3 bytes at the same time) push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc dec a jr nz, FillBorderLoop ld de, lcdWidth - TILE_WIDTH + 2 add hl, de ; Clear the last row of the right edge ld sp, hl push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc push bc TempSP2 = $+1 ld sp, 0 ; Yay, we are finally done! ret DrawScreenBorderEnd: DrawTile_Clipped: ld (BackupIY), iy ld sp, lcdWidth lea de, iy ld bc, 2 ldir add iy, sp lea de, iy-2 ld c, 6 ldir add iy, sp lea de, iy-4 ld c, 10 ldir DrawTile_Clipped_Stop1 = $ add iy, sp lea de, iy-6 ld c, 14 ldir add iy, sp lea de, iy-8 ld c, 18 ldir add iy, sp lea de, iy-10 ld c, 22 ldir add iy, sp lea de, iy-12 ld c, 26 ldir DrawTile_Clipped_Stop2 = $ add iy, sp lea de, iy-14 ld c, 30 ldir add iy, sp lea de, iy-14 ld c, 30 ldir add iy, sp lea de, iy-12 ld c, 26 ldir add iy, sp lea de, iy-10 ld c, 22 ldir DrawTile_Clipped_Stop3 = $ add iy, sp lea de, iy-8 ld c, 18 ldir add iy, sp lea de, iy-6 ld c, 14 ldir add iy, sp lea de, iy-4 ld c, 10 ldir add iy, sp lea de, iy-2 ld c, 6 ldir StopDrawingTile: ld iy, 0 BackupIY = $-3 exx jp SkipDrawingOfTile end relocate relocate DrawIsometricTile, mpShaData, 64 DrawIsometricTile: ld sp, -lcdWidth - 2 lea de, iy ld bc, 2 lddr ld c, 6 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 10 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 14 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 18 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 22 ex de, hl add hl, sp add hl, bc ex de, hl lddr ld c, 26 ex de, hl add hl, sp add hl, bc ex de, hl jp DrawIsometricTileSecondPart end relocate DisplayBuildingExx: exx DisplayBuilding: ; Inputs: ; A' = row index ; B' = column index ; A = building index ; Y coordinate: A' * 8 + 17 - building_height ; X coordinate: B' * 32 + !(A' & 0) && ((B' & 1 << 4) ? -16 : 16) - (building_width - 30) / 2 ld c, a ld b, 3 mlt bc BuildingsTablePointer = $+1 ; Yay, ages! :D ld hl, BuildingsAge1 add hl, bc ld hl, (hl) ld b, (hl) ld (BackupIY3), iy ld iy, iy_base TempSP4 = $+1 ld sp, 0 push hl ; Sprite struct ex af, af' ld c, a ; C = row index ex af, af' ld a, AMOUNT_OF_ROWS + 1 sub a, c ld e, a ld d, TILE_HEIGHT / 2 / 2 mlt de inc hl ld a, (hl) ld hl, 17 add hl, de add hl, de ld e, (OFFSET_Y) add hl, de ld e, a sbc hl, de push hl ; Y coordinate ld a, AMOUNT_OF_COLUMNS - 2 exx sub a, b exx sbc hl, hl ld l, a add hl, hl add hl, hl add hl, hl add hl, hl add hl, hl ld e, (OFFSET_X) add hl, de ld a, b bit 0, c jr nz, .jump bit 4, e ld e, TILE_WIDTH / 2 add hl, de jr z, .jump sla e sbc hl, de .jump: sub a, 30 srl a ld e, a sbc hl, de push hl ; X coordinate call _RLETSprite ; No need to pop BackupIY3 = $+2 ld iy, 0 jp SkipDrawingOfTileExx
tools-src/gnu/gcc/gcc/ada/xeinfo.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
5085
------------------------------------------------------------------------------ -- -- -- GNAT SYSTEM UTILITIES -- -- -- -- X E I N F O -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 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, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Program to construct C header file a-einfo.h (C version of einfo.ads spec) -- for use by Gigi. This header file contaInF all definitions and access -- functions, but does not contain set procedures, since Gigi is not allowed -- to modify the GNAT tree) -- Input files: -- einfo.ads spec of Einfo package -- einfo.adb body of Einfo package -- Output files: -- a-einfo.h Corresponding c header file -- Note: It is assumed that the input files have been compiled without errors -- An optional argument allows the specification of an output file name to -- override the default a-einfo.h file name for the generated output file. -- Most, but not all of the functions in Einfo can be inlined in the C header. -- They are the functions identified by pragma Inline in the spec. Functions -- that cannot be inlined are simply defined in the header. with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Unbounded.Text_IO; use Ada.Strings.Unbounded.Text_IO; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Spitbol; use GNAT.Spitbol; with GNAT.Spitbol.Patterns; use GNAT.Spitbol.Patterns; with GNAT.Spitbol.Table_Boolean; use GNAT.Spitbol.Table_Boolean; procedure XEinfo is package TB renames GNAT.Spitbol.Table_Boolean; Err : exception; A : VString := Nul; B : VString := Nul; C : VString := Nul; Einfobrev : VString := Nul; Einfosrev : VString := Nul; Expr : VString := Nul; Filler : VString := Nul; Fline : VString := Nul; Formal : VString := Nul; Formaltyp : VString := Nul; FN : VString := Nul; Line : VString := Nul; N : VString := Nul; N1 : VString := Nul; N2 : VString := Nul; N3 : VString := Nul; Nam : VString := Nul; Name : VString := Nul; NewS : VString := Nul; Nextlin : VString := Nul; OldS : VString := Nul; Rtn : VString := Nul; Term : VString := Nul; XEinforev : VString := Nul; InB : File_Type; -- Used to read initial header from body InF : File_Type; -- Used to read full text of both spec and body Ofile : File_Type; -- Used to write output file wsp : Pattern := NSpan (' ' & ASCII.HT); Get_BRev : Pattern := BreakX ('$') & "$Rev" & "ision: " & Break (' ') * Einfobrev; Get_SRev : Pattern := BreakX ('$') & "$Rev" & "ision: " & Break (' ') * Einfosrev; Comment : Pattern := wsp & "--"; For_Rep : Pattern := wsp & "for"; Get_Func : Pattern := wsp * A & "function" & wsp & Break (' ') * Name; Inline : Pattern := wsp & "pragma Inline (" & Break (')') * Name; Get_Pack : Pattern := wsp & "package "; Get_Enam : Pattern := wsp & Break (',') * N & ','; Find_Fun : Pattern := wsp & "function"; F_Subtyp : Pattern := wsp * A & "subtype " & Break (' ') * N; G_Subtyp : Pattern := wsp & "subtype" & wsp & Break (' ') * NewS & wsp & "is" & wsp & Break (" ;") * OldS & wsp & ';' & wsp & Rtab (0); F_Typ : Pattern := wsp * A & "type " & Break (' ') * N & " is ("; Get_Nam : Pattern := wsp * A & Break (",)") * Nam & Len (1) * Term; Get_Styp : Pattern := wsp * A & "subtype " & Break (' ') * N; Get_N1 : Pattern := wsp & Break (' ') * N1; Get_N2 : Pattern := wsp & "-- " & Rest * N2; Get_N3 : Pattern := wsp & Break (';') * N3; Get_FN : Pattern := wsp * C & "function" & wsp & Break (" (") * FN; Is_Rturn : Pattern := BreakX ('r') & "return"; Is_Begin : Pattern := wsp & "begin"; Get_Asrt : Pattern := wsp & "pragma Assert"; Semicoln : Pattern := BreakX (';'); Get_Cmnt : Pattern := BreakX ('-') * A & "--"; Get_Expr : Pattern := wsp & "return " & Break (';') * Expr; Chek_End : Pattern := wsp & "end" & BreakX (';') & ';'; Get_B1 : Pattern := BreakX (' ') * A & " in " & Rest * B; Get_B2 : Pattern := BreakX (' ') * A & " = " & Rest * B; Get_B3 : Pattern := BreakX (' ') * A & " /= " & Rest * B; To_Paren : Pattern := wsp * Filler & '('; Get_Fml : Pattern := Break (" :") * Formal & wsp & ':' & wsp & BreakX (" );") * Formaltyp; Nxt_Fml : Pattern := wsp & "; "; Get_Rtn : Pattern := wsp & "return" & wsp & BreakX (" ;") * Rtn; Rem_Prn : Pattern := wsp & ')'; M : Match_Result; Lineno : Natural := 0; -- Line number in spec V : Natural; Ctr : Natural; Inlined : TB.Table (200); -- Inlined<N> = True for inlined function, False otherwise Lastinlined : Boolean; procedure Badfunc; -- Signal bad function in body function Getlin return VString; -- Get non-comment line (comment lines skipped, also skips FOR rep clauses) -- Fatal error (raises End_Error exception) if end of file encountered procedure Must (B : Boolean); -- Raises Err if the argument (a Match) call, returns False procedure Sethead (Line : in out VString; Term : String); -- Process function header into C ------------- -- Badfunc -- ------------- procedure Badfunc is begin Put_Line (Standard_Error, "Body for function " & FN & " does not meet requirements"); raise Err; end Badfunc; ------------- -- Getlin -- ------------- function Getlin return VString is Lin : VString; begin loop Lin := Get_Line (InF); Lineno := Lineno + 1; if Lin /= "" and then not Match (Lin, Comment) and then not Match (Lin, For_Rep) then return Lin; end if; end loop; end Getlin; ---------- -- Must -- ---------- procedure Must (B : Boolean) is begin if not B then raise Err; end if; end Must; ------------- -- Sethead -- ------------- procedure Sethead (Line : in out VString; Term : String) is Args : VString; begin Must (Match (Line, Get_Func, "")); Args := Nul; if Match (Line, To_Paren, "") then Args := Filler & '('; loop Must (Match (Line, Get_Fml, "")); Append (Args, Formaltyp & ' ' & Formal); exit when not Match (Line, Nxt_Fml); Append (Args, ","); end loop; Match (Line, Rem_Prn, ""); Append (Args, ')'); end if; Must (Match (Line, Get_Rtn)); if Present (Inlined, Name) then Put_Line (Ofile, A & "INLINE " & Rtn & ' ' & Name & Args & Term); else Put_Line (Ofile, A & Rtn & ' ' & Name & Args & Term); end if; end Sethead; -- Start of processing for XEinfo begin Anchored_Mode := True; Match ("$Revision$", "$Rev" & "ision: " & Break (' ') * XEinforev); if Argument_Count > 0 then Create (Ofile, Out_File, Argument (1)); else Create (Ofile, Out_File, "a-einfo.h"); end if; Open (InB, In_File, "einfo.adb"); Open (InF, In_File, "einfo.ads"); Lineno := 0; -- Get einfo revs and write header to output file loop Line := Get_Line (InB); if Line = "" then raise Err; end if; exit when Match (Line, Get_BRev); end loop; loop Line := Get_Line (InF); Lineno := Lineno + 1; exit when Line = ""; if Match (Line, Get_SRev) then Put_Line (Ofile, "/* Generated by xeinfo revision " & XEinforev & " using */"); Put_Line (Ofile, "/* einfo.ads revision " & Einfosrev & " */"); Put_Line (Ofile, "/* einfo.adb revision " & Einfobrev & " */"); else Match (Line, "-- S p e c ", "-- C Header File "); Match (Line, "--", "/*"); Match (Line, Rtab (2) * A & "--", M); Replace (M, A & "*/"); Put_Line (Ofile, Line); end if; end loop; Put_Line (Ofile, ""); -- Find and record pragma Inlines loop Line := Get_Line (InF); exit when Match (Line, " -- END XEINFO INLINES"); if Match (Line, Inline) then Set (Inlined, Name, True); end if; end loop; -- Skip to package line Reset (InF, In_File); Lineno := 0; loop Line := Getlin; exit when Match (Line, Get_Pack); end loop; V := 0; Line := Getlin; Must (Match (Line, wsp & "type Entity_Kind")); -- Process entity kind code definitions loop Line := Getlin; exit when not Match (Line, Get_Enam); Put_Line (Ofile, " #define " & Rpad (N, 32) & " " & V); V := V + 1; end loop; Must (Match (Line, wsp & Rest * N)); Put_Line (Ofile, " #define " & Rpad (N, 32) & ' ' & V); Line := Getlin; Must (Match (Line, wsp & ");")); Put_Line (Ofile, ""); -- Loop through subtype and type declarations loop Line := Getlin; exit when Match (Line, Find_Fun); -- Case of a subtype declaration if Match (Line, F_Subtyp) then -- Case of a subtype declaration that is an abbreviation of the -- form subtype x is y, and if so generate the appropriate typedef if Match (Line, G_Subtyp) then Put_Line (Ofile, A & "typedef " & OldS & ' ' & NewS & ';'); -- Otherwise the subtype must be declaring a subrange of Entity_Id else Must (Match (Line, Get_Styp)); Line := Getlin; Must (Match (Line, Get_N1)); loop Line := Get_Line (InF); Lineno := Lineno + 1; exit when not Match (Line, Get_N2); end loop; Must (Match (Line, Get_N3)); Put_Line (Ofile, A & "SUBTYPE (" & N & ", Entity_Kind, "); Put_Line (Ofile, A & " " & N1 & ", " & N3 & ')'); Put_Line (Ofile, ""); end if; -- Case of type declaration elsif Match (Line, F_Typ) then -- Process type declaration (must be enumeration type) Ctr := 0; Put_Line (Ofile, A & "typedef char " & N & ';'); loop Line := Getlin; Must (Match (Line, Get_Nam)); Put_Line (Ofile, A & "#define " & Rpad (Nam, 25) & Ctr); Ctr := Ctr + 1; exit when Term /= ","; end loop; Put_Line (Ofile, ""); -- Neither subtype nor type declaration else raise Err; end if; end loop; -- Process function declarations -- Note: Lastinlined used to control blank lines Put_Line (Ofile, ""); Lastinlined := True; -- Loop through function declarations while Match (Line, Get_FN) loop -- Non-inlined function if not Present (Inlined, FN) then Put_Line (Ofile, ""); Put_Line (Ofile, " #define " & FN & " einfo__" & Translate (FN, Lower_Case_Map)); -- Inlined function else if not Lastinlined then Put_Line (Ofile, ""); end if; end if; -- Merge here to output spec Sethead (Line, ";"); Lastinlined := Get (Inlined, FN); Line := Getlin; end loop; Put_Line (Ofile, ""); -- Read body to find inlined functions Close (InB); Close (InF); Open (InF, In_File, "einfo.adb"); Lineno := 0; -- Loop through input lines to find bodies of inlined functions while not End_Of_File (InF) loop Fline := Get_Line (InF); if Match (Fline, Get_FN) and then Get (Inlined, FN) then -- Here we have an inlined function if not Match (Fline, Is_Rturn) then Line := Fline; Badfunc; end if; Line := Getlin; if not Match (Line, Is_Begin) then Badfunc; end if; -- Skip past pragma Asserts loop Line := Getlin; exit when not Match (Line, Get_Asrt); -- Pragma asser found, get its continuation lines loop exit when Match (Line, Semicoln); Line := Getlin; end loop; end loop; -- Process return statement Match (Line, Get_Cmnt, M); Replace (M, A); -- Get continuations of return statemnt while not Match (Line, Semicoln) loop Nextlin := Getlin; Match (Nextlin, wsp, " "); Append (Line, Nextlin); end loop; if not Match (Line, Get_Expr) then Badfunc; end if; Line := Getlin; if not Match (Line, Chek_End) then Badfunc; end if; Match (Expr, Get_B1, M); Replace (M, "IN (" & A & ", " & B & ')'); Match (Expr, Get_B2, M); Replace (M, A & " == " & B); Match (Expr, Get_B3, M); Replace (M, A & " != " & B); Put_Line (Ofile, ""); Sethead (Fline, ""); Put_Line (Ofile, C & " { return " & Expr & "; }"); end if; end loop; Put_Line (Ofile, ""); Put_Line (Ofile, "/* End of einfo.h (C version of Einfo package specification) */"); exception when Err => Put_Line (Standard_Error, Lineno & ". " & Line); Put_Line (Standard_Error, "**** fatal error ****"); Set_Exit_Status (1); when End_Error => Put_Line (Standard_Error, "unexpected end of file"); Put_Line (Standard_Error, "**** fatal error ****"); end XEinfo;
oeis/160/A160068.asm
neoneye/loda-programs
11
82385
; A160068: Numerator of Hermite(n, 24/25). ; Submitted by <NAME> ; 1,48,1054,-69408,-7284084,-2596032,45400915464,2198714182272,-291719729560944,-35989688841645312,1554341893161645024,524479521392325361152,3802815995858998255296,-7684657653083648501025792,-430659327280723849697798016,113809861219489103982457055232,13537735725049049172991651451136,-1626385909587427719345541834985472,-365743407817488825454658601415942656,19037999390477660063451078419207872512,9600229906408287287593793547750615960576,-15138949254343711781774870188167246692352 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 mov $3,$1 mov $1,$2 mul $2,48 mul $3,-50 mul $3,$0 add $2,$3 mul $3,24 lpe mov $0,$1
src/Dimension/PartialWeakening/Model.agda
andreasabel/cubical
0
172
-- Interpretation of partial weakenings as partial finite maps. module Dimension.PartialWeakening.Model (E : Set) where import Level open import Data.Nat using (ℕ; zero; suc; _+_) open import Data.Fin using (Fin; zero; suc) open import Relation.Binary.PropositionalEquality open ≡-Reasoning open import Axiom.FunctionExtensionality open import Control.Category open import Control.Category.Functor open import Control.Kleisli open import Control.Monad using (IsMonad; module IsMonad) import Control.Monad.Error as Err open module Error = Err E using (Error; fail; return; errorIsMonad) -- open import Dimension.PartialWeakening E -- horrible names import Dimension.PartialWeakening as PW open module PWeak = PW E open IsMonad errorIsMonad hiding (return) module Kl = IsCategory (kleisliIsCategory errorIsMonad) -- Semantics given by application to a name in Fin n apply : ∀ {n m} (f : PWeak n m) (i : Fin n) → Error (Fin m) apply [] () apply (e ∷ f) zero = fail e apply (e ∷ f) (suc i) = apply f i apply (lift f) zero = return zero apply (lift f) (suc i) = suc <$> apply f i apply (weak f) i = suc <$> apply f i -- Soundness of id abstract apply-id : ∀ n (i : Fin n) → apply id i ≡ return i apply-id 0 () apply-id (suc n) zero = refl apply-id (suc n) (suc i) with (apply id i) | (apply-id n i) apply-id (suc n) (suc i) | .(return i) | refl = refl -- Lemma: one inductive step abstract lift-lift-suc : ∀ {n m l} (f : PWeak n m) {g : PWeak m l} {i : Fin n} → (ih : apply (comp f g) i ≡ apply f i >>= apply g) → apply (comp (lift f) (lift g)) (suc i) ≡ apply (lift f) (suc i) >>= apply (lift g) lift-lift-suc f {g = g} {i = i} ih = begin apply (comp (lift f) (lift g)) (suc i) ≡⟨⟩ -- definition of comp apply (lift (comp f g)) (suc i) ≡⟨⟩ -- definition of apply suc <$> apply (comp f g) i ≡⟨ cong (_<$>_ suc) ih ⟩ -- induction hypothesis suc <$> (apply f i >>= apply g) ≡⟨ map-after-bind (apply f i) ⟩ -- map commutes with bind I (apply f i >>= λ j → suc <$> apply g j) ≡⟨⟩ -- definition of apply (apply f i >>= λ j → apply (lift g) (suc j)) ≡⟨ sym (bind-after-map (apply f i)) ⟩ -- map commutes with bind II (suc <$> apply f i) >>= apply (lift g) ≡⟨⟩ -- definition of apply apply (lift f) (suc i) >>= apply (lift g) ∎ -- Soundness of comp abstract apply-comp : ∀ {n m l} (f : PWeak n m) (g : PWeak m l) (i : Fin n) → apply (comp f g) i ≡ apply f i >>= apply g apply-comp [] g () apply-comp (e ∷ f) g zero = refl apply-comp (e ∷ f) g (suc i) = apply-comp f g i apply-comp (lift f) (e ∷ g) zero = refl apply-comp (lift f) (e ∷ g) (suc i) rewrite apply-comp f g i with apply f i ... | fail e′ = refl ... | return j = refl apply-comp (lift f) (lift g) zero = refl apply-comp (lift f) (lift g) (suc i) = lift-lift-suc f (apply-comp f g i) apply-comp (lift f) (weak g) i = begin suc <$> apply (comp (lift f) g) i ≡⟨ cong (_<$>_ suc) (apply-comp (lift f) g i) ⟩ -- ind. hyp. suc <$> (apply (lift f) i >>= apply g) ≡⟨ map-after-bind (apply (lift f) i) ⟩ -- move map apply (lift f) i >>= (λ j → suc <$> apply g j) ∎ apply-comp (weak f) (e ∷ g) i rewrite apply-comp f g i = sym (bind-after-map (apply f i)) apply-comp (weak f) (lift g) i rewrite apply-comp f g i = begin suc <$> (apply f i >>= apply g) ≡⟨ map-after-bind (apply f i) ⟩ apply f i >>= (λ j → suc <$> apply g j) ≡⟨⟩ apply f i >>= (λ j → apply (lift g) (suc j)) ≡⟨ sym (bind-after-map (apply f i)) ⟩ (suc <$> apply f i) >>= apply (lift g) ∎ apply-comp (weak f) (weak g) i rewrite apply-comp (weak f) g i = map-after-bind (apply (weak f) i) -- The Kleisli category of partial finite maps Fin n → Error (Fin m) PFin : (n m : ℕ) → Set PFin n m = Fin n → Error (Fin m) SPFin = λ n m → setoid (PFin n m) pFinIsCategory : IsCategory SPFin pFinIsCategory = record { ops = record { id = return ; _⟫_ = λ f g a → f a >>= g } ; laws = record { id-first = fun-ext (bind-β _) ; id-last = fun-ext (λ a → bind-η _) ; ∘-assoc = λ f → fun-ext (λ a → bind-assoc (f a)) ; ∘-cong = λ{ refl refl → refl } } } PFIN : Category _ _ _ PFIN = record { Hom = SPFin; isCategory = pFinIsCategory } -- The evaluation functor -- ⟦_⟧ : ∀ {n m} → PWeak n m → PFin n m -- ⟦ f ⟧ = apply f applyIsFunctor : IsFunctor {C = PWEAK} {D = PFIN} (λ n → n) applyIsFunctor = record { ops = record { map = apply } ; laws = record { map-id = fun-ext (apply-id _) ; map-∘ = λ f → fun-ext (apply-comp f _) } }
agda/Logic.agda
piyush-kurur/sample-code
2
3805
<reponame>piyush-kurur/sample-code module Logic where -- The true proposition. data ⊤ : Set where obvious : ⊤ -- The proof of truth. -- The false proposition. data ⊥ : Set where -- There is nothing here so one can never prove false. -- The AND of two statments. data _∧_ (A B : Set) : Set where -- The only way to construct a proof of A ∧ B is by pairing a a -- proof of A with a proof of and B. ⟨_,_⟩ : (a : A) -- Proof of A → (b : B) -- Proof of B → A ∧ B -- Proof of A ∧ B -- The OR of two statements. data _∨_ (A B : Set) : Set where -- There are two ways of constructing a proof of A ∨ B. inl : (a : A) → A ∨ B -- From a proof of A by left introduction inr : (b : B) → A ∨ B -- From a proof of B by right introduction -- The not of statement A ¬_ : (A : Set) → Set ¬ A = A → ⊥ -- Given a proof of A one should be able to get a proof -- of ⊥. -- The statement A ↔ B are equivalent. _↔_ : (A B : Set) → Set A ↔ B = (A → B) -- If ∧ -- and (B → A) -- only if infixr 1 _∧_ infixr 1 _∨_ infixr 0 _↔_ infix 2 ¬_ -- Function composition _∘_ : {A B C : Set} → (B → C) → (A → B) → A → C (f ∘ g) x = f (g x) -- Double negation doubleNegation : ∀ {A : Set} → A → ¬ (¬ A) doubleNegation a negNegA = negNegA a {- doubleNegation' : ∀ {A : Set} → ¬ ( ¬ (¬ A)) → ¬ A -} deMorgan1 : ∀ (A B : Set) → ¬ (A ∨ B) → ¬ A ∧ ¬ B deMorgan1 A B notAorB = ⟨ notAorB ∘ inl , notAorB ∘ inr ⟩ deMorgan2 : ∀ (A B : Set) → ¬ A ∧ ¬ B → ¬ (A ∨ B) deMorgan2 A B ⟨ notA , notB ⟩ (inl a) = notA a deMorgan2 A B ⟨ notA , notB ⟩ (inr b) = notB b deMorgan : ∀ (A B : Set) → ¬ (A ∨ B) ↔ ¬ A ∧ ¬ B deMorgan A B = ⟨ deMorgan1 A B , deMorgan2 A B ⟩
gasp/source/gasp-world.ads
charlie5/playAda
0
151
<gh_stars>0 with openGL.Renderer.lean, mmi.World, mmi.Sprite, ada.Containers.Vectors, ada.Containers.Hashed_Sets, ada.Unchecked_Conversion; package gasp.World is type Item is limited new mmi.World.item with private; type View is access all item'Class; package Forge is function new_World (Name : in String; Renderer : in openGL.Renderer.lean.view) return View; end Forge; overriding procedure destroy (Self : in out Item); procedure free (Self : in out View); procedure store (Self : in out Item); procedure restore (Self : in out Item); overriding procedure evolve (Self : in out Item; By : in Duration); function Pod (Self : in Item) return mmi.Sprite.view; private use type mmi.sprite_Id; package sprite_id_Vectors is new ada.containers.Vectors (Positive, mmi.sprite_Id); function Hash is new ada.Unchecked_Conversion (mmi.sprite_Id, ada.Containers.Hash_Type); package organ_Sets is new ada.Containers.hashed_Sets (mmi.sprite_Id, Hash, "="); type Item is limited new mmi.World.item with record Counter : Natural := 0; pod_Sprite : mmi.Sprite.view; end record; end gasp.World;
examples/xtensa/glue.asm
rakati/ppci-mirror
161
80478
; boot file for xtensa qemu board section reset reset: j start1 section code ; Should be ; serial device is mapped at fd050020 align 4 thr: dd 0xfd050020 ; base of 16650 stackpointer: dd 0xd8020000 ; initial value for stack pointer global __data_load_start global __data_start global __data_end _data_load_start: dcd =__data_load_start _data_start: dcd =__data_start _data_end: dcd =__data_end start1: ; ==================== ; Load initial data! l32r a6, _data_load_start ; src pointer l32r a7, _data_start ; dst pointer l32r a8, _data_end ; dst end beq a7, a8, _load_done ; No data to load _load_loop: l32i a9, a6, 0 ; load 32 bit addi a6, a6, 4 ; update src pointer s32i a9, a7, 0 ; store 32 bit addi a7, a7, 4 ; update dst pointer bltu a7, a8, _load_loop _load_done: ; ==================== global start2 start2: l32r a1, stackpointer ; Load stack pointer global main_main global bsp_exit call0 main_main call0 bsp_exit limbo: j limbo
Library/Parse/parseDepend.asm
steakknife/pcgeos
504
2114
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: parseDepend.asm AUTHOR: <NAME>, Feb 4, 1991 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- John 2/ 4/91 Initial revision DESCRIPTION: Code to generate dependency lists. $Id: parseDepend.asm,v 1.1 97/04/05 01:27:29 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EvalCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FuncArgDependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Callback to the application to generate dependencies for a list of function arguments. CALLED BY: PopOperatorAndEval PASS: es:di = Pointer to top of operator/function stack es:bx = Pointer to top of argument stack ss:bp = Pointer to EvalParameters structure on the stack. RETURN: carry set on error al = Error code Arguments popped off the stack DESTROYED: ax PSEUDO CODE/STRATEGY: count = func.nArgs; ArgDependencies( count ); KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/21/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FuncArgDependencies proc near uses cx .enter mov cx, es:[di].OSE_data.ESOD_function.EFD_nArgs call ArgDependencies jc quit ; Quit on error ; ; Now that we've added the arguments of the function to the ; dependency list we want to add the function as well. ; mov al, ESAT_FUNCTION ; Argument type push bx ; Save argument ptr mov bx, di ; es:bx <- ptr to EvalFunctionData inc bx call AddEntryToDependencyBlock pop bx ; Restore argument ptr jc quit ; Quit on error ; ; All functions return something. A function can only return a single ; argument... Therefore it doesn't matter what we push, as long as ; it's something... ; clr cx ; No extra space mov al, mask ESAT_NUMBER ; al <- type of the token call ParserEvalPushArgument ; Push the number token quit: .leave ret FuncArgDependencies endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OpArgDependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Generate dependencies for the arguments of an operator. CALLED BY: PopOperatorAndEval PASS: es:di = Pointer to top of operator/function stack es:bx = Pointer to top of argument stack ss:bp = Pointer to EvalParameters structure on the stack. RETURN: carry set on error al = Error code Arguments popped off the stack DESTROYED: ax PSEUDO CODE/STRATEGY: count = opArgCountTable[opType]; ArgDependencies( count ); KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/21/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OpArgDependencies proc near uses cx, si .enter mov al, es:[di].OSE_data.ESOD_operator.EOD_opType cmp al, OP_RANGE_SEPARATOR je handleRangeSep cmp al, OP_RANGE_INTERSECTION je handleRangeInt clr ah mov si, ax ; si <- index into the arg-count table clr ch mov cl, cs:opArgCountTable[si] call ArgDependencies ; ; All operators (except the range-separator, handled above) produce ; a number as their result. It doesn't really matter actually, all ; that matters is that we put some result back on the argument ; stack so that evaluation can continue as it should. ; ; We can't really push a number because the fp-fixup code will choke ; after generating dependencies if it thinks we are returning a number. ; clr cx ; No extra space mov al, mask ESAT_NUMBER ; al <- type of the token call ParserEvalPushArgument ; Push the number token quit: .leave ret handleRangeSep: ; ; Ranges get handled separately since we actually want to accumulate ; them. ; call OpRangeSeparator jmp quit handleRangeInt: ; ; We also want to accumulate ranges defined by the range-intersection ; operator. ; call OpParserRangeIntersection jmp quit OpArgDependencies endp ; ; A list of the number of arguments each operator takes. ; opArgCountTable byte -1, ; OpRangeSeparator, 1, ; OpNegation, 1, ; OpPercent, 2, ; OpExponentiation, 2, ; OpMultiplication, 2, ; OpDivision, 2, ; OpModulo, 2, ; OpAddition, 2, ; OpSubtraction, 2, ; OpEqual, 2, ; OpNotEqual, 2, ; OpLessThan, 2, ; OpGreaterThan, 2, ; OpLessThanOrEqual, 2, ; OpGreaterThanOrEqual 2, ; OpStringConcat -1, ; OpParserRangeIntersection 2, ; OpNotEqualGraphic 2, ; OpDivisionGraphic 2, ; OpLessThanOrEqualGraphic 2 ; OpGreaterThanOrEqualGraphic COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ArgDependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Call the application for each argument. CALLED BY: FuncArgDependencies, OpArgDependencies PASS: es:di = Pointer to top of operator/function stack es:bx = Pointer to top of argument stack ss:bp = Pointer to EvalParameters structure on the stack. cx = # of arguments to handle RETURN: carry set on error al = Error code Arguments popped off the stack DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/21/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ArgDependencies proc near uses cx .enter EC < cmp cl, -1 > EC < ERROR_Z ARG_COUNT_IS_VERY_UNREASONABLE > tst cx ; Check for no args ; (The tst instruction clears the carry, which is what I want) jz quit ; Quit if no arguments argLoop: push bx ; Save arg stack pointer mov al, es:[bx] ; al <- the token type inc bx ; es:bx <- ptr to the data call AddEntryToDependencyBlock ; Add a single entry pop bx ; Restore arg stack pointer jc quit ; Quit if error push cx ; Save arg count mov cx, 1 ; Pop one argument call ParserEvalPopNArgs ; Pop me jesus pop cx ; Restore arg count loop argLoop ; Loop while there are args clc ; Signal: no error quit: .leave ret ArgDependencies endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AddEntryToDependencyBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add an entry to the evaluators dependency block CALLED BY: ArgDependencies PASS: es:bx = Pointer to the data which we want to add to the dependency block al = EvalStackArgumentType ss:bp = Pointer to EvalParameters RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: The evaluator, when generating dependencies, keeps a list of the dependencies in a global memory block. This block is returned to the application so that it can actually add the dependencies in whatever way it wants. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AddEntryToDependencyBlock proc near uses bx, cx, dx, di, si, ds, es .enter ; ; We may not want to do anything with name-dependencies. We check ; for that here. ; test ss:[bp].EP_flags, mask EF_NO_NAMES jz skipNoNameCheck ; Branch if we don't care cmp al, ESAT_NAME ; Check for a name je quitNoErrorNoBlock ; Branch if it's a name skipNoNameCheck: ; ; We may be only adding name dependencies... If we are we want to make ; sure that we have the right type here. ; test ss:[bp].EP_flags, mask EF_ONLY_NAMES jz skipNameCheck ; Branch if we don't care cmp al, ESAT_NAME ; We do care, check for name jne quitNoErrorNoBlock ; Branch if not a name skipNameCheck: ; ; We only want to add the dependency if it's to a name, cell, range ; or externally defined function. ; cmp al, ESAT_FUNCTION ; Check for function type jne checkDependencyType ; Branch if not a function ; ; It's a function, check for externally defined. ; cmp es:[bx].EFD_functionID, FUNCTION_ID_FIRST_EXTERNAL_FUNCTION jb quitNoErrorNoBlock ; Quit if defined internally checkDependencyType: call NeedDependency ; Check for one of those things we ; want a dependency for jnc quitNoErrorNoBlock ; Branch if not ; ; We do want to add this dependency. ; mov si, bx ; es:si <- ptr to source for data mov cl, al ; Save the token push si call GetArgumentSize ; si <- size of the argument mov dx, si ; dx <- size of the argument pop si mov bx, ss:[bp].EP_depHandle tst bx ; Check for block existing jz createDepBlock ; Branch if it doesn't gotDepBlock: call MemLock ; ds <- seg address of the block mov ds, ax ; ; ds = segment address of the block ; bx = block handle ; dx = size of the token data (not including type byte) ; cl = token ; push cx ; Save the token mov ax, ds:DB_size ; ax <- size of the block inc dx ; Allow size for the type byte add ax, dx ; ax <- new size for the block clr ch ; No allocation flags call MemReAlloc ; Make the block bigger mov ds, ax ; Reset the segment address pop cx ; Restore the token ; ; Check for error ; mov al, PSEE_TOO_MANY_DEPENDENCIES jc quitUnlock ; Quit on error ; ; The block is bigger... Update the size ; mov di, ds:DB_size ; ds:di <- ptr to place to put data segxchg ds, es ; es:di <- ptr to dest ; ds:si <- ptr to source mov al, cl ; al <- the token stosb ; Save the type of the data mov cx, dx ; cx <- size of the data dec cx ; Move data, not the token rep movsb ; Save the data add es:DB_size, dx ; Update the size of the block clc ; Signal: no error quitUnlock: call MemUnlock ; Release the block (flags preserved) quit: .leave ret quitNoErrorNoBlock: ; ; We want to quit but we have no block yet. ; clc ; Signal: no error jmp quit createDepBlock: ; ; Allocate and initialize the dependency block. ; push cx ; Save the token mov ax, size DependencyBlock mov cl, mask HF_SWAPABLE mov ch, mask HAF_LOCK ; Want the block locked call MemAlloc pop cx ; Restore the token ; ; Carry set if not enough memory ; mov ds, ax ; ds <- seg address of the block ; ; Check for allocation error. ; mov al, PSEE_TOO_MANY_DEPENDENCIES jc quit ; Quit on error ; ; Block was allocated just fine, save the handle and initialize it. ; mov ss:[bp].EP_depHandle, bx mov ds:DB_size, size DependencyBlock jmp gotDepBlock AddEntryToDependencyBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NeedDependency %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Check to see if we want a dependency for this argument type CALLED BY: AddEntryToDependencyBlock PASS: al = EvalStackArgumentType es:bx = Pointer to ParserToken...Data ss:bp = Pointer to EvalParameters on stack RETURN: carry set if we want to add a dependency carry clear otherwise DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 3/20/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ NeedDependency proc near uses ax .enter cmp al, ESAT_NAME je quit ; Carry clear if we branch cmp al, ESAT_FUNCTION je quit ; Carry clear if we branch test al, mask ESAT_RANGE ; Clears the carry jz noDependency ; ; It's a range... How amusing. Check to see if the range is in ; the legal bounds of the spreadsheet. If it's not, don't generate ; a dependency for it. ; mov ax, es:[bx].ERD_firstCell.CR_row and ax, mask CRC_VALUE cmp ax, ss:[bp].CP_maxRow ; Check for past end ja noDependency ; Branch if past end mov ax, es:[bx].ERD_lastCell.CR_row and ax, mask CRC_VALUE cmp ax, ss:[bp].CP_maxRow ; Check for past end ja noDependency ; Branch if past end mov ax, es:[bx].ERD_firstCell.CR_column and ax, mask CRC_VALUE cmp ax, ss:[bp].CP_maxColumn; Check for past end ja noDependency ; Branch if past end mov ax, es:[bx].ERD_lastCell.CR_column and ax, mask CRC_VALUE cmp ax, ss:[bp].CP_maxColumn; Check for past end ja noDependency ; Branch if past end clc ; We want the dependency jmp quit noDependency: stc ; Don't need a dependency quit: cmc ; Reverse the carry to get the return ; flag set correctly .leave ret NeedDependency endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserAddDependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add a set of dependencies from a dependency block CALLED BY: Global PASS: bx = Handle of the dependency block ss:bp = Pointer to DependencyParameters on the stack RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ParserAddDependencies proc far uses dx .enter mov dx, offset ParserAddSingleDependencyNear ; dx <- routine to call call HandleDependencyBlock .leave ret ParserAddDependencies endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserRemoveDependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove a set of dependencies from a dependency block CALLED BY: Global PASS: bx = Handle of the dependency block ss:bp = Pointer to DependencyParameters on the stack RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ParserRemoveDependencies proc far uses dx .enter mov dx, offset RemoveSingleDependency ; dx <- routine to call call HandleDependencyBlock .leave ret ParserRemoveDependencies endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleDependencyBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle a set of dependencies CALLED BY: ParserAddDependencies, ParserRemoveDependencies PASS: bx = Block handle of the dependency block ss:bp = Pointer to the DependencyParameters on the stack dx = Offset of routine to call: Add/RemoveSingleDependency RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleDependencyBlock proc near uses cx, dx, di .enter mov cx, dx ; cx <- callback for callback :-) mov di, cs ; di:dx <- callback routine mov dx, offset cs:HandleBlockCallback call ParserForeachPrecedent ; Process the list .leave ret HandleDependencyBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleBlockCallback %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Callback for ParserForeachPrecedent CALLED BY: HandleDependencyBlock via ParserForeachPrecedent PASS: dl = Type of the precedent entry es:di = Pointer to the precedent entry data ss:bp = DependencyParameters cx = Callback for callback RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/24/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleBlockCallback proc far uses ds, si, di, dx .enter segmov ds, es, si ; ds:si <- ptr to range data mov si, di ; ; dl still holds the precedent entry type. ; call GetDependencyHandler ; di <- routine to call mov dx, cx ; dx <- callback for callback call di ; Call the routine .leave ret HandleBlockCallback endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserForeachPrecedent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Run through the precedent list calling a callback. CALLED BY: Global, HandleDependencyBlock PASS: bx = Block di:dx = Routine to call RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: Callback is defined as: PASS: cx, ds, si, bp = Same as passed in dl = Type of the precedent es:di = Pointer to the precedent data RETURN: Carry set to abort al = Error code DESTROYED: nothing KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/24/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ForeachPrecParams struct FPP_callback dword ; Callback FPP_block hptr ; Block handle of precedent list ForeachPrecParams ends ParserForeachPrecedent proc far uses bx, dx, di, es .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < push ax > EC < mov ax, cs > EC < cmp ax, di > EC < pop ax > EC < je xipSafe > EC < pushdw bxsi > EC < movdw bxsi, didx > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > xipSafe:: endif ; ; Create a stack frame by pushing the passed data ; push bx ; Save the memory handle push di ; Save segment of callback push dx ; Save offset of callback ;;; ;;; We haven't set up a pointer to the stack frame so don't mess with ;;; sp until we do. ;;; ; ; Now lock the block and start processing... ; call MemLock ; es <- address of dep block mov es, ax ; ; Set up a pointer to the stack frame. ; mov bx, sp ; ss:bx <- stack frame mov di, size DependencyBlock ; es:di <- ptr to 1st dep depLoop: ; ; es:0 = dependency block ; es:di = pointer to current dependency ; es:DB_size = offset past last entry in the block ; ss:bx = ForeachPrecParams ; cmp di, es:DB_size ; Check for done je endLoop ; Branch if done ; ; Load up the appropriate information for the single dependency ; mov dl, {byte} es:[di] ; dl <- the type of the arg inc di ; Point to the data if FULL_EXECUTE_IN_PLACE push bx mov ss:[TPD_dataAX], ax mov ax, ss:[bx].FPP_callback.offset mov bx, ss:[bx].FPP_callback.segment call ProcCallFixedOrMovable pop bx else call ss:[bx].FPP_callback ; Call the callback endif jc quit ; Branch on error ; ; Advance to the next dependency entry ; dl = the type of the current entry ; push si ; Save passed si mov al, dl ; al <- type call GetArgumentSize ; si <- size of the data add di, si ; es:di <- ptr to next entry pop si ; Restore passed si jmp depLoop ; Loop to do the next one endLoop: clc ; Signal no error quit: ; ; Carry set on error ; al = error code ; mov bx, ss:[bx].FPP_block ; bx <- block handle call MemUnlock ; Release the block lahf ; Save "error" flag (carry) add sp, size ForeachPrecParams ; Restore stack frame sahf ; Restore "error" flag (carry) .leave ret ParserForeachPrecedent endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetDependencyHandler %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get the routine to handle a given dependency type CALLED BY: HandleDependencyBlock PASS: dl = EvalStackArgumentType RETURN: di = Routine to call DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 3/20/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetDependencyHandler proc near mov di, offset cs:HandleNameDependency cmp dl, ESAT_NAME je quit mov di, offset cs:HandleFunctionDependency cmp dl, ESAT_FUNCTION je quit mov di, offset cs:HandleRangeDependency test dl, mask ESAT_RANGE jnz quit ERROR ILLEGAL_DEPENDENCY_TYPE quit: ret GetDependencyHandler endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleRangeDependency %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle a dependency block entry for a range CALLED BY: HandleDependencyBlock via depHandlerTable PASS: ss:bp = DependencyParameters ds:si = Pointer to EvalRangeData dx = Callback routine to use (Add/RemoveSingleDependency) RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: By the time we get here the cells have already been adjusted for relative references. This means that we don't need to worry about sign extending the value to the full 16 bits. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleRangeDependency proc near uses bx, cx, di, si .enter ; ; Load up a bunch of registers with stuff we need. ; mov ax, ds:[si].ERD_firstCell.CR_row mov cx, ds:[si].ERD_firstCell.CR_column mov bx, ds:[si].ERD_lastCell.CR_row mov si, ds:[si].ERD_lastCell.CR_column and ax, mask CRC_VALUE ; Just the value, not the and cx, mask CRC_VALUE ; flags and bx, mask CRC_VALUE and si, mask CRC_VALUE rowLoop: ; ; ax = start row ; bx = end row ; dx = routine to call ; cmp ax, bx ; Check for done last row ja endRowLoop ; Branch if finished push cx ; Save starting column columnLoop: ; ; on-stack: starting column ; cx = start column ; si = end column ; dx = routine to call ; cmp cx, si ; Check for done last column ja endColumnLoop ; Branch if finished a row ; ; Handle a single dependency. ax/cx = the dependency. ; mov di, ax ; Save current row call dx ; Handle the dependency jc error ; Quit on error mov ax, di ; Restore current row inc cx ; Move to next column jmp columnLoop ; Loop to handle it endColumnLoop: pop cx ; Restore starting column inc ax ; Move to next row jmp rowLoop ; Loop to handle it endRowLoop: clc ; Signal: no error quit: .leave ret error: pop cx ; Restore register from stack jmp quit HandleRangeDependency endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleNameDependency %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle a dependency block entry for a name CALLED BY: HandleDependencyBlock via depHandlerTable PASS: ss:bp = DependencyParameters ds:si = Pointer to EvalNameData dx = Callback routine to use (Add/RemoveSingleDependency) RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: Call back to the application to get the row/column for the name. Handle the dependency for that row/column. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleNameDependency proc near uses cx, dx, di .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < movdw bxsi, ss:[bp].CP_callback > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif mov di, dx ; Save the routine to call in di mov cx, ds:[si].END_name ; cx <- the name token mov al, CT_NAME_TO_CELL ; Dereference the name if FULL_EXECUTE_IN_PLACE push bx mov ss:[TPD_dataBX], bx mov ss:[TPD_dataAX], ax movdw bxax, ss:[bp].CP_callback ; Call the application call ProcCallFixedOrMovable pop bx else call ss:[bp].CP_callback ; Call the application endif jc quit ; Quit on error ; ; dx/cx = Row/Column of the cell holding the name dependencies ; mov ax, dx ; ax/cx <- Row/Column of the cell call di ; Call the handling routine quit: .leave ret HandleNameDependency endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HandleFunctionDependency %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle a dependency block entry for a function CALLED BY: HandleDependencyBlock via depHandlerTable PASS: ss:bp = DependencyParameters ds:si = Pointer to EvalFunctionData dx = Callback routine to use (Add/RemoveSingleDependency) RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/28/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HandleFunctionDependency proc near uses cx, dx, di .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < movdw bxsi, ss:[bp].CP_callback > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif mov di, dx ; Save the routine to call in di mov cx, ds:[si].EFD_functionID mov al, CT_FUNCTION_TO_CELL ; Dereference the function if FULL_EXECUTE_IN_PLACE push bx mov ss:[TPD_dataBX], bx mov ss:[TPD_dataAX], ax movdw bxax, ss:[bp].CP_callback ; Call the application call ProcCallFixedOrMovable pop bx else call ss:[bp].CP_callback ; Call the application endif jc quit ; Quit on error ; ; dx/cx = Row/Column of the cell holding the name dependencies ; tst dx ; Check for no dependency required ; (clear the carry) jz quit ; Branch if none needed mov ax, dx ; ax/cx <- Row/Column of the cell call di ; Call the handling routine quit: .leave ret HandleFunctionDependency endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserAddSingleDependency %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add a single dependency to a cell CALLED BY: Global PASS: ds:si = CellFunctionParameters ax = Row of cell to add dependency to cx = Column of cell to add dependency to ss:bp = DependencyParameters RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/24/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ParserAddSingleDependency proc far call ParserAddSingleDependencyNear ret ParserAddSingleDependency endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserAddSingleDependencyNear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add a dependency to a dependency list CALLED BY: Global PASS: ax = Row of cell to add dependency to cx = Column of cell to add dependency to ss:bp = DependencyParameters RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: Lock the cell Get a pointer to the dependency list if the cell doesn't exist Call the application to create the cell endif Find the position to add the dependency if the dependency doesn't exist insert space for the dependency save the current row/cell in the dependency list endif Unlock the cell KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/22/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ParserAddSingleDependencyNear proc near uses ds, es, di, si, dx, bx .enter lockCellAgain: call LockFirstDepListBlock ; carry clear if cell doesn't exist jnc makeCellExist ; Branch to call the application tst si ; Check for no dependencies at all jz addNewEntry ; Branch if none ; ; ds:si = ptr to the dependency list ; call FindDependencyEntry ; Locate the dependency jc quitUnlock ; Quit if already exists addNewEntry: ; ; The entry wasn't found. We need to add a new one. ; ; ds:di = ptr to the start of the dependency list block ; ds:si = ptr to the place to add the new entry ; ax = Row ; cx = Column ; call AddDependencyListEntry ; ; Fill in the entry ; mov ax, ss:[bp].CP_row ; Row to add as a dependency mov ds:[si].D_row, ax mov ax, ss:[bp].CP_column ; Column to add as a dependency mov ds:[si].D_column, al quitUnlock: call UnlockDependencyList ; Release the dependency list clc ; Signal: no error quit: ; ; Carry should be set here if you want to indicate some sort of error. ; .leave ret makeCellExist: if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < movdw bxsi, ss:[bp].CP_callback > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif mov dx, ax ; Pass row in dx mov al, CT_CREATE_CELL ; al <- code ("make cell exist") if FULL_EXECUTE_IN_PLACE pushdw ss:[bp].CP_callback call PROCCALLFIXEDORMOVABLE_PASCAL else call ss:[bp].CP_callback ; Call the application to make the cell endif jc quit ; Quit if error mov ax, dx ; Restore row for re-lock jmp lockCellAgain ; Else branch to re-lock the cell ParserAddSingleDependencyNear endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UnlockDependencyList %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Unlock the dependency list. CALLED BY: ParserAddSingleDependencyNear, RemoveSingleDependency PASS: ds:si = Pointer to the dependency list item si = 0 if there is no dependency list RETURN: nothing DESTROYED: es, bx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 6/25/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ UnlockDependencyList proc near push ds, si ; Save ptr to dependency list lds si, ss:[bp].CP_cellParams mov bx, ds:[si].CFP_file ; bx <- file handle pop es, si ; Restore ptr to dependency list ; ; es:si = Pointer to dependency list ; bx = File handle. ; tst si ; Check for no dependency list jz quit ; Branch if none (carry is clear here) call DBUnlock ; Unlock block pointed at by es quit: ret UnlockDependencyList endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RemoveSingleDependency %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove a dependency from a dependency list CALLED BY: Global PASS: ax = Row of cell to add dependency to cx = Column of cell to add dependency to ss:bp = DependencyParameters RETURN: carry set on error al = Error code DESTROYED: ax PSEUDO CODE/STRATEGY: Get a pointer to the dependency list if the cell doesn't exist <<<Fatal Error>>> endif Find the position of the dependency if the dependency doesn't exist It must have been deleted before this point, quit (no error) endif Delete the entry from the dependency list if the dependency list is empty call back to the application endif KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/22/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RemoveSingleDependency proc near uses ds, di, si, dx .enter call LockFirstDepListBlock ; carry clear if cell doesn't exist ; ; Simply exit if the cell doesn't exist. This case occurs if ; a cell is referred to twice in an expression (eg. =B1+B1). ; When the first reference is encountered, B1 will be deleted ; if it doesn't have any data in it other than dependencies. ; When the second reference is encountered, B1 is already gone ; so we simply exit. Note that there are more complicated ; cases where this can occur (eg. ranges that partially overlap), ; so it isn't really practical to eliminate redundant entries ; in general. -- eca 3/3/93. ; jnc quit ; branch if cell doesn't exist tst si ; Check for any dependencies at all jz noMoreDependencies ; Branch if there are no more ; ; ds:si = ptr to the dependency list ; call FindDependencyEntry ; Locate the dependency jnc quit ; Quit if entry is already gone ; ; ds:di = ptr to the start of the dependency list block ; ds:si = ptr to the dependency to delete ; call DeleteDependencyEntry ; Delete the entry ; This unlocks the dependency block. jz noMoreDependencies ; Branch if no more dependencies clc ; Signal: no error quit: .leave ret noMoreDependencies: if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < movdw bxsi, ss:[bp].CP_callback > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif mov dx, ax ; Pass row in dx mov al, CT_EMPTY_CELL ; al <- code (cell is empty) if FULL_EXECUTE_IN_PLACE pushdw ss:[bp].CP_callback call PROCCALLFIXEDORMOVABLE_PASCAL else call ss:[bp].CP_callback ; Let application know that there are ; no more dependencies for this item. endif jmp quit RemoveSingleDependency endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LockFirstDepListBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Lock the first dependency list block. CALLED BY: ParserAddSingleDependencyNear, RemoveSingleDependency PASS: ax,cx = Row/Column of the cell to lock RETURN: carry set if the cell exists ds:si = Ptr to the dependency list ds:di = Ptr to the dependency list si = 0 if there is no dependency list DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/22/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ LockFirstDepListBlock proc near uses ax, bx, es .enter ; ; Get the dbase item for the cell (also checks to see if the cell exists) ; lds si, ss:[bp].CP_cellParams mov bx, ds:[si].CFP_file ; bx <- file handle call CellGetDBItem ; ax/di <- Group/Item of the cell jnc quit ; Quit if no cell ; ; Initialize the stack frame. ; mov ss:[bp].DP_prevIsCell, 0xff mov ss:[bp].DP_prev.segment, ax mov ss:[bp].DP_prev.offset, di call DBLock ; Lock the cell (*es:di <- cell ptr) ; ; The first dword of the cell data is the dbase item. ; mov si, es:[di] ; es:si <- ptr to cell data tst es:[si].segment ; Check for NULL segment (which means ; that no dependencies exist) jz quitNoDepsCellExists ; Branch if no dependencies ; ; OK, the cell exists and has dependencies, we need to lock the ; dependency list. ; push es, di ; Save cell ptr mov ax, es:[si].segment ; ax <- group mov di, es:[si].offset ; di <- item ; ; Save the dbase item which contains the dependency list. ; mov ss:[bp].DP_dep.segment, ax mov ss:[bp].DP_dep.offset, di ; ; Now lock down the dependency list item and return a pointer to it. ; call DBLock ; *es:di <- ptr to dependency list mov ss:[bp].DP_chunk, di ; Save chunk handle segmov ds, es, si ; *ds:si <- ptr to dependency list mov si, di mov si, ds:[si] ; ds:si <- ptr to dependency list pop es, di ; Restore cell ptr ; ; We should have: ; *es:di = Ptr to cell data ; ds:si = Ptr to dependency list ; ss:bp.DP_dep = DBase item containing the dependency list ; quitCellExists: ; ; Unlock the cell. We don't need it. ; push ds, si ; Save the ptr to the dependency list lds si, ss:[bp].CP_cellParams call CellUnlock ; Cell release thyself pop ds, si ; Restore ptr to the dependency list stc ; Signal: cell exists quit: mov di, si ; Return both registers the same .leave ret quitNoDepsCellExists: ; ; The cell exists but has no dependencies. ; clr si ; Assume no such item exists. mov ss:[bp].DP_dep.segment, si jmp quitCellExists LockFirstDepListBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FindDependencyEntry %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Find a dependency in the dependency list CALLED BY: ParserAddSingleDependencyNear, RemoveSingleDependency PASS: ss:bp = DependencyParameters on stack ds:si = Pointer to the dependency list This MUST be valid RETURN: ds:si = Pointer to the dependency entry ds:di = Pointer to the base of the dependency list block carry set if it exists DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/22/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FindDependencyEntry proc near uses ax, bx, cx, dx .enter findDependencyInThisBlock: ; ; We need to know how many entries there are in this part of the ; dependency list. This actually turns out not to be quick to compute ; since the size of each entry is 3 bytes. As a result we just figure ; the size (in bytes) of this part of the list. ; ChunkSizePtr ds, si, cx ; cx <- size of this part of the list sub cx, size DependencyListHeader mov di, si ; Save ptr to start of the block add si, size DependencyListHeader ; ; cx = # of bytes in this part of the list. ; ds:si = Pointer to first entry in this part of the list. ; ds:di = Pointer to the start of this block. ; jcxz quitNotFound ; Quit if no entries mov bx, ss:[bp].CP_row ; bx <- row to find mov dx, ss:[bp].CP_column ; dl <- column to find findLoop: ; ; cx = # of bytes left to scan. ; ds:si = Pointer to next entry to check. ; ds:di = Pointer to the start of this block. ; bx = Row to find. ; dl = Column to find. ; cmp ds:[si].D_row, bx ; Check for same row jb nextEntry ; Branch if not found ja quitNotFound ; Quit if found place for new item cmp ds:[si].D_column, dl ; Check for same column ja quitNotFound ; Quit if found place for new item je found ; Branch if the same row and column nextEntry: add si, size Dependency ; Skip to next entry sub cx, size Dependency ; This many fewer bytes jnz findLoop ; Loop while there are still entries ; ; We ran out of bytes. Check to see if there is another block we can ; move to. ; call LockNextDependencyBlock ; Lock the next block jc findDependencyInThisBlock ; ; There is no next block. We're done and we haven't found the entry. ; quitNotFound: clc ; Signal: does not exist jmp quit ; found: stc ; Signal: found quit: .leave ret FindDependencyEntry endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LockNextDependencyBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Lock the next block in the dependency list chain. CALLED BY: FindDependencyEntry PASS: ds:di = Pointer to the current dependency block. ss:bp.DP_dep = DBase item for current dependency block. RETURN: carry set if another block exists ds:si = Pointer to the new block ss:bp.DP_dep = DBase item for the new block ss:bp.DP_prev = Previous dbase item ss:bp.DP_prevIsCell cleared carry clear if no more blocks exist. ds:si unchanged ss:bp.DP_dep unchanged DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 6/25/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ LockNextDependencyBlock proc near uses ax, bx, di, es .enter tst ds:[di].DLH_next.segment ; Check for another block jz quit ; Branch if no more (carry clear) ; ; Copy the current item to the previous item. ; movdw ss:[bp].DP_prev, ss:[bp].DP_dep, ax mov ss:[bp].DP_prevIsCell, 0 ; Previous is no ; longer the cell ; ; There is another block. Unlock the current block and lock ; the new one. ; mov ax, ds:[di].segment ; ax <- group mov di, ds:[di].offset ; di <- item segmov es, ds, si ; es <- segment address of item lds si, ss:[bp].CP_cellParams ; ds:si <- cell paramters mov bx, ds:[si].CFP_file ; bx <- file handle call DBUnlock ; Unlock the item ; ; bx = File handle ; ax = Group containing the new dependencies ; di = Item containing the new dependencies ; mov ss:[bp].DP_dep.segment, ax ; Save group and item mov ss:[bp].DP_dep.offset, di call DBLock ; *es:di <- ptr to dependencies mov ss:[bp].DP_chunk, di ; Save chunk handle segmov ds, es, si ; ds:si <- ptr to dependencies mov si, ds:[di] stc ; Signal: block exists quit: ; ; Carry should be set here if a new block exists and is locked down. ; .leave ret LockNextDependencyBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AddDependencyListEntry %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Add an empty dependency list item CALLED BY: ParserAddSingleDependencyNear PASS: ds:di = Pointer to dependency list block ds:si = Pointer to place to insert new entry ss:bp.DP_dep = DBase item containing the dependency list block ax = Row of the cell cx = Column of the cell RETURN: ds:si = Place to put the dependency data DESTROYED: nothing PSEUDO CODE/STRATEGY: If (no dependencies) then Insert an empty block endif if (blockSize > maxBlockSize) then InsertBlock( block ) endif InsertSpace( block, entrySize ) KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/22/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AddDependencyListEntry proc near uses ax, bx, cx, dx, es, di .enter ; ; Set up some registers we're going to need in a few places. ; segmov es, ds, ax ; es:di <- ptr to the base of the block mov ax, si ; Save pointer to place to insert lds si, ss:[bp].CP_cellParams mov bx, ds:[si].CFP_file ; bx <- file handle mov si, ax ; Restore pointer to place to insert ; ; Check for the case of no dependencies at all. If there are none then ; we are creating the first block in this dependency list. ; tst si ; Check for has blocks jnz hasBlock ; Branch if it has a block ; ; There are no blocks. We need to insert a whole new one. ; call InsertDepListBlock ; Insert an empty block jmp addItem ; Branch to add the item hasBlock: ; ; First set up some pointers and get the file handle and chunk size. ; ChunkSizePtr es, di, cx ; cx <- old size of the block ; ; Check to make sure that the chunk isn't too large. ; cmp cx, DEPENDENCY_BLOCK_MAX_SIZE jb addItem ; ; This block has grown too large, we need to split it ; call SplitDepListBlock ; Split the dependency list block addItem: ; ; Unlock the entry. ; ; es:di = Pointer to the chunk ; es:si = Pointer to the place to insert ; ss:bp = Frame ptr ; bx = File handle ; sub si, di ; si <- offset to insert at call DBUnlock ; Release the block ; ; bx = File handle ; si = Place to insert ; ss:bp.DP_dep = the dbase item reference. ; mov ax, ss:[bp].DP_dep.segment mov di, ss:[bp].DP_dep.offset mov dx, si ; dx <- position to insert at mov cx, size Dependency ; cx <- # of bytes to insert call DBInsertAt ; Make the block larger ; ; Now that the block has been resized we need to lock it down and get ; a pointer that we can return to the caller. ; ; bx = File handle ; ax = Group ; di = Item ; dx = Position we inserted at ; call DBLock ; *es:di <- ptr to the item segmov ds, es, si ; ds:si <- ptr to the item mov si, ds:[di] add si, dx ; ds:si <- ptr to the entry .leave ret AddDependencyListEntry endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InsertDepListBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Insert a dependency list block. CALLED BY: AddDependencyListEntry PASS: bx = File handle ss:bp = DependencyParameters RETURN: es:si = Pointer to the first entry in the block es:di = Pointer to the base of the block (The block is locked, obviously) DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 6/26/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InsertDepListBlock proc near uses ax, cx .enter ; ; Lock the previous entry down. ; mov ax, ss:[bp].DP_prev.segment ; ax <- group mov di, ss:[bp].DP_prev.offset ; di <- item call DBLock ; *es:di <- ptr to data mov si, di ; *es:si <- ptr to data ; ; Allocate a new item to be the next list block. ; mov cx, size DependencyListHeader ; cx <- size for new block mov ax, DB_UNGROUPED ; No group needed thanks call DBAlloc ; ax <- group, di <- item ; ; Save the new block as the next pointer of the previous block and ; move the next pointer of the previous block to be the next pointer ; of the current block. ; mov si, es:[si] ; es:si <- ptr to prev entry push es:[si].segment, es:[si].offset ; Save the "next" link mov es:[si].segment, ax ; Save new block as "next" mov es:[si].offset, di call DBDirty ; Dirty the previous item call DBUnlock ; Release the previous item ; ; Lock down the new block. ; mov ss:[bp].DP_dep.segment, ax ; Save new blocks group/item mov ss:[bp].DP_dep.offset, di call DBLock ; *es:di <- new block mov di, es:[di] ; es:di <- new block pop es:[di].segment, es:[di].offset ; Save the "next" pointer call DBDirty ; Dirty the item mov si, di ; es:si <- ptr to place to insert add si, size DependencyListHeader .leave ret InsertDepListBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplitDepListBlock %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Split a dependency list block at a given point. CALLED BY: AddDependencyListEntry PASS: bx = File handle es:di = Pointer to the base of the block es:si = Pointer to the place to split ss:bp = DependencyParameters RETURN: es:di = Pointer to the base of the block to insert into es:si = Pointer to the place to insert DESTROYED: nothing PSEUDO CODE/STRATEGY: Divide the block into two parts. Set the pointer into the correct block. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 6/26/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplitDepListBlock proc near uses ax, cx, ds .enter sub si, di ; si <- offset to insert at push si ; Save offset to insert at mov ax, DB_UNGROUPED ; Ungrouped please ChunkSizePtr es, di, cx ; cx <- Size of current block push cx ; Save old size ; ; Compute the size for the new block: ; (Size of entries / 2) + Header size ; sub cx, size DependencyListHeader shr cx, 1 add cx, size DependencyListHeader call DBAlloc ; ax <- group, di <- item segmov ds, es ; ds:si <- ptr to current block mov si, ss:[bp].DP_chunk mov si, ds:[si] ; ; bx = File handle ; ax = Group ; di = Item ; cx = Size of new block ; ds:si = Pointer to the old block ; On Stack: ; Size of the old block ; Offset to insert at in old block ; pushdw axdi ; Save group, item call DBLock ; *es:di <- ptr to new block mov di, es:[di] ; es:di <- ptr to new block movdw es:[di].DLH_next, ds:[si].DLH_next, ax ; ; Set the "next" link for the current block to the new item. ; popdw ds:[si].DLH_next ; ; OK... The "next" links are all set up and we have: ; ds:si = Pointer to the current block ; es:di = Pointer to the new block ; cx = Size for new block ; on stack: ; Size of the old block ; Offset to insert at in old block ; sub cx, size DependencyListHeader pop ax push di ; Save ptr to base of new block sub ax, cx add si, ax ; ds:si <- ptr to bytes to copy add di, size DependencyListHeader rep movsb ; Copy the dependencies pop di ; Restore ptr to base of new block ; ; Now... We've copied the dependencies, we've set the links up. ; We need to: ; ReAlloc the original block smaller ; Dirty both blocks ; Figure which block contains the position to insert at ; Unlock the other block ; Set the pointer correctly ; ; ; Mark dirty and unlock the NEW block ; call DBDirty call DBUnlock ; ; Mark dirty and unlock the OLD block. ; segmov es, ds ; es <- segment address of old block call DBDirty ; Dirty the block before unlocking call DBUnlock ; Unlock it mov_tr cx, ax ; cx <- new size mov ax, ss:[bp].DP_dep.segment ; ax <- group mov di, ss:[bp].DP_dep.offset ; di <- item call DBReAlloc ; ReAlloc the item smaller ; into es ; ; Lock the old block again. ; mov ax, ss:[bp].DP_dep.segment ; ax <- group mov di, ss:[bp].DP_dep.offset ; di <- item call DBLock ; *es:di <- ptr to old block mov di, es:[di] ; es:di <- ptr to old block pop si ; Restore offset into the block cmp si, cx ; Check for offset too large jb quit ; Branch if offset is OK ; ; The offset is into the second block. We need to release the first one ; and lock the second one. We also need to update the stack frame. ; Luckily we have a routine to do this :-) ; push si ; Save offset segmov ds, es ; ds:di <- ptr to base of old block call LockNextDependencyBlock ; ds:si <- ptr to new block segmov es, ds ; es:di <- ptr to new block mov di, si pop si ; Restore offset sub si, cx ; Make into offset into 2nd block add si, size DependencyListHeader quit: add si, di ; Make offset into a pointer .leave ret SplitDepListBlock endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DeleteDependencyEntry %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Delete a dependency list item CALLED BY: RemoveSingleDependency PASS: ds:si = Pointer to place to delete ds:di = Pointer to the start of the dependency list block ss:bp.DP_dep = DBase item containing the dependency list block RETURN: zero flag set if there are no more entries in the dependency list. Dependency list block pointed at by ds unlocked DESTROYED: nothing PSEUDO CODE/STRATEGY: if (blockSize - entrySize == 0) then Unlink( block ) Free( block ) endif KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/22/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DeleteDependencyEntry proc near uses ax, bx, cx, dx, di, si, es .enter ; ; For DBDeleteAt we need: ; bx = File handle ; ax = Group ; di = Item ; dx = Offset to delete at ; cx = # of bytes to delete ; mov dx, si ; dx <- offset to delete at sub dx, di segmov es, ds, si ; es:di <- ptr to block lds si, ss:[bp].CP_cellParams mov bx, ds:[si].CFP_file ; bx <- file handle ; ; Check for removing this block entirely ; ChunkSizePtr es, di, cx ; cx <- old size of the block sub cx, size Dependency + size DependencyListHeader tst cx ; Check for nuking the block jnz unlockAndDelete ; Branch if we're not ; ; We are nuking the entire block. ; push es:[di].segment, es:[di].offset call DBUnlock ; Unlock the item mov ax, ss:[bp].DP_dep.segment mov di, ss:[bp].DP_dep.offset call DBFree ; Free the entry mov ax, ss:[bp].DP_prev.segment mov di, ss:[bp].DP_prev.offset call DBLock ; *es:di <- previous entry mov di, es:[di] ; es:di <- previous entry ; ; Restore the link from the nuked block into the current block. ; pop es:[di].segment, es:[di].offset call DBDirty ; Dirty the item mov ax, es:[di].segment ; ax == 0 if we've removed the tail block ; in the chain call DBUnlock ; Release the block ; ; Now we check for an empty list. We do this by checking the following: ; group/item of block we just nuked are zero (ax == 0) ; previous block is the cell ; tst ax ; Check for removed last block jnz quitNotEmpty ; Branch if we have not tst ss:[bp].DP_prevIsCell ; Check for nuked all references jz quitNotEmpty ; Branch if we haven't clr ax ; Set the zero flag (empty list) jmp quit ; Branch to quit unlockAndDelete: call DBUnlock ; Release the block ; ; bx = File handle ; dx = Offset to delete at ; mov cx, size Dependency ; cx <- # of bytes to nuke mov ax, ss:[bp].DP_dep.segment mov di, ss:[bp].DP_dep.offset call DBDeleteAt ; Resize the block smaller quitNotEmpty: or ax, -1 ; Clear the zero flag (not an empty list) quit: .leave ret DeleteDependencyEntry endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserForeachReference %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Process each reference in an expression. CALLED BY: Global PASS: es:di = Pointer to the expression cx:dx = Callback routine (Callback *must* be vfptr for XIP) ss:bp = Arguments to the callback ds:si = More arguments to the callback RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: Callback should be defined as far: PASS: es:di = Pointer to the cell reference ss:bp = Passed parameters ds:si = More passed parameters al = Type of reference: PARSER_TOKEN_CELL PARSER_TOKEN_NAME RETURN: nothing DESTROYED: nothing KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/16/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ParserForeachReferenceOLD proc far FALL_THRU ParserForeachReference ParserForeachReferenceOLD endp ParserForeachReference proc far uses ax, bx, di .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < movdw bxsi, cxdx > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif push cx ; Save the segment of the callback push dx ; Save the offset of the callback mov bx, sp ; ss:bx = ptr to the callback tokenLoop: ; ; es:di = Pointer to next token ; ds:si = Passed ds:si ; ds = Segment address of parsers dgroup ; On stack: ; Callback (far ptr) ; mov al, {byte} es:[di] ; ax <- type of the token inc di ; es:di <- ptr past the token cmp al, PARSER_TOKEN_END_OF_EXPRESSION je quit ; Branch if no more expression cmp al, PARSER_TOKEN_CELL ; Check for a cell reference je callCallback ; Branch if not a cell reference cmp al, PARSER_TOKEN_NAME ; Check for a name reference jne nextToken ; Branch if not a name reference callCallback: if FULL_EXECUTE_IN_PLACE push bx, ax mov ss:[TPD_dataBX], bx mov ss:[TPD_dataAX], ax mov ax, ss:[bx].offset mov bx, ss:[bx].segment call ProcCallFixedOrMovable pop bx, ax else call {dword} ss:[bx] ; Call the callback routine endif nextToken: call ParserPointToNextToken jmp tokenLoop ; Loop to process it quit: pop dx ; Restore passed dx pop cx ; Restore passed cx .leave ret ParserForeachReference endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserPointToNextToken %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Point at the next token in the token stream CALLED BY: ParserForeachReference, ParserForeachToken PASS: al - ParserTokenType es:di - pointing at the PT_data part of a ParserToken RETURN: es:di - updated DESTROYED: ah (cleared), cx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 11/11/93 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ParserPointToNextToken proc near uses ds, si .enter EC < cmp al, ParserTokenType > EC < ERROR_A EVAL_ILLEGAL_PARSER_TOKEN > cbw ; clr ah ; ; If the current token is PARSER_TOKEN_STRING, then add the ; string size to DI ; cmp al, PARSER_TOKEN_STRING jne afterAdd if DBCS_PCGEOS mov si, es:[di].PTSD_length shl si, 1 ; si <- string size add di, si ; di <- ptr after string else add di, es:[di].PTSD_length endif afterAdd: ; ; Add in the size of the token to get to the next one. ; NOFXIP < segmov ds, dgroup, si ; ds <- dgroup > FXIP < mov si, bx ; si = value of bx > FXIP < mov bx, handle dgroup > FXIP < call MemDerefDS ; ds = dgroup > FXIP < mov bx, si ; restore bx > mov si, ax ; si <- index into list of token mov cl, ds:parserTokenSizeTable[si] clr ch add di, cx ; Skip to next token .leave ret ParserPointToNextToken endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserForeachToken %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Process each token in an expression. CALLED BY: Global PASS: es:di = Pointer to the expression cx:dx = Callback routine (Callback *must* be vfptr for XIP) ss:bp = Arguments to the callback ds:si = More arguments to the callback RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: Callback should be defined as far: PASS: es:di = Pointer to the cell reference ss:bp = Passed parameters ds:si = More passed parameters al = Type of reference: PARSER_TOKEN_CELL PARSER_TOKEN_NAME RETURN: nothing DESTROYED: nothing KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/16/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ParserForeachTokenOLD proc far FALL_THRU ParserForeachToken ParserForeachTokenOLD endp ParserForeachToken proc far uses ax, bx, di .enter if FULL_EXECUTE_IN_PLACE ; ; Make sure the fptr passed in is valid ; EC < pushdw bxsi > EC < movdw bxsi, cxdx > EC < call ECAssertValidFarPointerXIP > EC < popdw bxsi > endif push cx ; Save the segment of the callback push dx ; Save the offset of the callback mov bx, sp ; ss:bx = ptr to the callback tokenLoop: ; ; es:di = Pointer to next token ; ds:si = Passed ds:si ; ds = Segment address of parsers dgroup ; On stack: ; Callback (far ptr) ; mov al, {byte} es:[di] ; ax <- type of the token inc di ; es:di <- ptr past the token cmp al, PARSER_TOKEN_END_OF_EXPRESSION je quit ; Branch if no more expression callCallback:: if FULL_EXECUTE_IN_PLACE push bx, ax mov ss:[TPD_dataBX], bx mov ss:[TPD_dataAX], ax mov ax, ss:[bx].offset mov bx, ss:[bx].segment call ProcCallFixedOrMovable pop bx, ax else call {dword} ss:[bx] ; Call the callback routine endif call ParserPointToNextToken jmp tokenLoop ; Loop to process it quit: pop dx ; Restore passed dx pop cx ; Restore passed cx .leave ret ParserForeachToken endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ParserRemoveDependenciesInRange (COMMENTED OUT) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove from the dependency list of a cell any references which fall in a given range. CALLED BY: Global PASS: ss:bp = Pointer to the rectangle of cells to nuke from the dependency list ax = Row cx = Column ds:si = CellFunctionParameters RETURN: carry set if the cell is devoid of dependencies DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/16/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if 0 ParserRemoveDependenciesInRange proc far uses ax, bx, cx, dx, bp, di, si, ds .enter mov bx, bp ; ss:bx <- rectangle to check sub sp, size DependencyParameters ; Allocate stack frame mov bp, sp ; ss:bp <- stack frame ; ; Fill in only the stuff we need. ; mov ss:[bp].CP_cellParams.segment, ds mov ss:[bp].CP_cellParams.offset, si call LockFirstDepListBlock ; ds:si <- dependency list ; ds:di <- dependency list ; si == 0 if no dependencies tst si ; Check for no dependencies jz noMoreDependencies ; Branch if none findInThisBlock: ; ; Check each entry to see if it is in the passed range. ; ChunkSizePtr ds, si, cx ; cx <- size of this part sub cx, size DependencyListHeader ; cx <- size w/o header mov di, si ; Save ptr to block start add si, size DependencyListHeader ; ds:si <- first entry ; ; cx = # of bytes in this part of the list ; ds:si = Pointer to first entry in this part ; ds:di = Pointer to the start of this block ; ss:bx = Pointer to the rectangle ; EC < tst cx > EC < ERROR_Z -1 > findLoop: mov ax, ds:[si].D_row ; ax <- row mov dl, ds:[si].D_column ; dl <- column call IsEntryInRange ; Check for entry in range jnc nextEntry ; Branch if it's not ; ; The entry falls inside the range. We want to delete it. ; call DeleteDependencyEntry ; Remove the dependency jz noMoreDependencies ; Branch if no more here ; ; Well... We deleted an entry. This means that we have one less entry ; to process, but we are already pointing at it... ; jmp nextEntryKeepPointer nextEntry: add si, size Dependency ; Move to next entry nextEntryKeepPointer: sub cx, size Dependency ; This many fewer bytes jnz findLoop ; Loop to process it ; ; There were no more entries in this block, check the next one. ; call LockNextDependencyBlock ; Lock next block jc findInThisBlock ; Loop to check it out ; ; There are no more dependencies at all. ; clc ; Signal: there are dependencies quit: lahf ; Save "no dependencies" flag add sp, size DependencyParameters ; Restore stack frame sahf ; Rstr "no dependencies" flag .leave ret noMoreDependencies: stc ; Signal: no more dependencies jmp quit ParserRemoveDependenciesInRange endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IsEntryInRange (COMMENTED OUT) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: See if an entry falls inside a rectangle. CALLED BY: ParserRemoveDependenciesInRange PASS: ax = Row dl = Column ss:bx = Pointer to rectangle RETURN: carry set if entry falls in the rectangle DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/16/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ IsEntryInRange proc near cmp ax, ss:[bx].R_top ; Check for above top jb outside cmp ax, ss:[bx].R_bottom ; Check for beyond bottom ja outside cmp dl, {byte} ss:[bx].R_left ; Check for below top jb outside cmp dl, {byte} ss:[bx].R_right ; Check for beyond right ja outside stc ; Signal: Cell is in range jmp quit outside: clc ; Signal: not in range quit: ret IsEntryInRange endp endif EvalCode ends
src/FLA/Algebra/LinearMap.agda
turion/functional-linear-algebra
21
11721
<reponame>turion/functional-linear-algebra {-# OPTIONS --without-K --safe #-} -- We do not parameterize this module since we do not have access to _+_ or _*_ -- for the fields that we want (real numbers) open import Level using (Level) open import Relation.Binary.PropositionalEquality hiding (Extensionality) open ≡-Reasoning open import Data.Nat using (ℕ) renaming (_+_ to _+ᴺ_) open import Data.Nat.Properties open import Data.Vec using (Vec; []; _∷_; _++_; take; drop; map; replicate) open import Data.Vec.Properties open import Function using (id) open import FLA.Algebra.Structures open import FLA.Algebra.Properties.Field open import FLA.Algebra.LinearAlgebra open import FLA.Algebra.LinearAlgebra.Properties module FLA.Algebra.LinearMap where private variable ℓ : Level A : Set ℓ m n p q : ℕ -- A linear map from one vector field to another record _⊸_ {ℓ : Level} {A : Set ℓ} ⦃ F : Field A ⦄ (m n : ℕ) : Set ℓ where field f : (Vec A m → Vec A n) -- Additivity f[u+v]≡f[u]+f[v] : (u v : Vec A m) → f (u +ⱽ v) ≡ f u +ⱽ f v -- Homogeneity f[c*v]≡c*f[v] : (c : A) → (v : Vec A m) → f (c ∘ⱽ v) ≡ c ∘ⱽ (f v) infixr 1 _⊸_ -- A convenient syntax if a particular set needs to be specified. _—_⊸_ : {ℓ : Level} (m : ℕ) (A : Set ℓ) (n : ℕ) ⦃ F : Field A ⦄ → Set ℓ m — A ⊸ n = _⊸_ {A = A} m n infixr 1 _—_⊸_ module _ ⦃ F : Field A ⦄ where open Field F open _⊸_ _·ˡᵐ_ : m ⊸ n → Vec A m → Vec A n _·ˡᵐ_ LM = f LM private +ˡᵐ-linearity : (g h : m ⊸ n) → (u v x y : Vec A m) → g ·ˡᵐ (u +ⱽ v) +ⱽ h ·ˡᵐ (x +ⱽ y) ≡ g ·ˡᵐ u +ⱽ h ·ˡᵐ x +ⱽ (g ·ˡᵐ v +ⱽ h ·ˡᵐ y) +ˡᵐ-linearity g h u v x y rewrite f[u+v]≡f[u]+f[v] g u v | f[u+v]≡f[u]+f[v] h x y | (+ⱽ-assoc (g ·ˡᵐ u) (g ·ˡᵐ v) (h ·ˡᵐ x +ⱽ h ·ˡᵐ y)) | sym (+ⱽ-assoc (g ·ˡᵐ v) (h ·ˡᵐ x) (h ·ˡᵐ y)) | +ⱽ-comm (g ·ˡᵐ v) (h ·ˡᵐ x) | (+ⱽ-assoc (h ·ˡᵐ x) (g ·ˡᵐ v) (h ·ˡᵐ y)) | sym (+ⱽ-assoc (g ·ˡᵐ u) (h ·ˡᵐ x) (g ·ˡᵐ v +ⱽ h ·ˡᵐ y)) = refl +-homogeneity : (g h : m ⊸ n) → (c : A) (u v : Vec A m) → g ·ˡᵐ (c ∘ⱽ u) +ⱽ h ·ˡᵐ (c ∘ⱽ v) ≡ c ∘ⱽ (g ·ˡᵐ u +ⱽ h ·ˡᵐ v) +-homogeneity g h c u v rewrite f[c*v]≡c*f[v] g c u | f[c*v]≡c*f[v] h c v | sym (∘ⱽ-distr-+ⱽ c (g ·ˡᵐ u) (h ·ˡᵐ v)) = refl _+ˡᵐ_ : m ⊸ n → m ⊸ n → m ⊸ n g +ˡᵐ h = record { f = λ v → g ·ˡᵐ v +ⱽ h ·ˡᵐ v ; f[u+v]≡f[u]+f[v] = λ u v → +ˡᵐ-linearity g h u v u v ; f[c*v]≡c*f[v] = λ c v → +-homogeneity g h c v v } _-ˡᵐ_ : m ⊸ n → m ⊸ n → m ⊸ n g -ˡᵐ h = record { f = λ v → g ·ˡᵐ v -ⱽ h ·ˡᵐ v ; f[u+v]≡f[u]+f[v] = f[u+v]≡f[u]+f[v]' g h ; f[c*v]≡c*f[v] = f[c*v]≡c*f[v]' g h } where f[u+v]≡f[u]+f[v]' : (g h : m ⊸ n) → (u v : Vec A m) → g ·ˡᵐ (u +ⱽ v) -ⱽ h ·ˡᵐ (u +ⱽ v) ≡ g ·ˡᵐ u -ⱽ h ·ˡᵐ u +ⱽ (g ·ˡᵐ v -ⱽ h ·ˡᵐ v) f[u+v]≡f[u]+f[v]' g h u v = begin g ·ˡᵐ (u +ⱽ v) -ⱽ h ·ˡᵐ (u +ⱽ v) ≡⟨ cong (g ·ˡᵐ (u +ⱽ v) +ⱽ_) (-ⱽ≡-1ᶠ∘ⱽ (h ·ˡᵐ (u +ⱽ v))) ⟩ g ·ˡᵐ (u +ⱽ v) +ⱽ (- 1ᶠ) ∘ⱽ (h ·ˡᵐ (u +ⱽ v)) ≡⟨ cong (λ x → g ·ˡᵐ (u +ⱽ v) +ⱽ (- 1ᶠ) ∘ⱽ x) (f[u+v]≡f[u]+f[v] h u v) ⟩ g ·ˡᵐ (u +ⱽ v) +ⱽ (- 1ᶠ) ∘ⱽ (h ·ˡᵐ u +ⱽ h ·ˡᵐ v) ≡⟨ cong (g ·ˡᵐ (u +ⱽ v) +ⱽ_) (∘ⱽ-distr-+ⱽ (- 1ᶠ) (h ·ˡᵐ u) (h ·ˡᵐ v)) ⟩ g ·ˡᵐ (u +ⱽ v) +ⱽ ((- 1ᶠ) ∘ⱽ h ·ˡᵐ u +ⱽ (- 1ᶠ) ∘ⱽ h ·ˡᵐ v) ≡⟨ cong₂ (λ x y → g ·ˡᵐ (u +ⱽ v) +ⱽ (x +ⱽ y)) (sym (f[c*v]≡c*f[v] h (- 1ᶠ) u)) (sym (f[c*v]≡c*f[v] h (- 1ᶠ) v)) ⟩ g ·ˡᵐ (u +ⱽ v) +ⱽ (h ·ˡᵐ ((- 1ᶠ) ∘ⱽ u) +ⱽ h ·ˡᵐ ((- 1ᶠ) ∘ⱽ v)) ≡⟨ cong (g ·ˡᵐ (u +ⱽ v) +ⱽ_) (sym (f[u+v]≡f[u]+f[v] h ((- 1ᶠ) ∘ⱽ u) ((- 1ᶠ) ∘ⱽ v))) ⟩ g ·ˡᵐ (u +ⱽ v) +ⱽ (h ·ˡᵐ ((- 1ᶠ) ∘ⱽ u +ⱽ (- 1ᶠ) ∘ⱽ v)) ≡⟨ +ˡᵐ-linearity g h u v ((- 1ᶠ) ∘ⱽ u) ((- 1ᶠ) ∘ⱽ v) ⟩ g ·ˡᵐ u +ⱽ h ·ˡᵐ ((- 1ᶠ) ∘ⱽ u) +ⱽ (g ·ˡᵐ v +ⱽ h ·ˡᵐ ((- 1ᶠ) ∘ⱽ v)) ≡⟨ cong₂ (λ x y → g ·ˡᵐ u +ⱽ x +ⱽ (g ·ˡᵐ v +ⱽ y)) (trans (f[c*v]≡c*f[v] h ((- 1ᶠ)) u) (sym (-ⱽ≡-1ᶠ∘ⱽ (h ·ˡᵐ u)))) (trans (f[c*v]≡c*f[v] h ((- 1ᶠ)) v) (sym (-ⱽ≡-1ᶠ∘ⱽ (h ·ˡᵐ v)))) ⟩ g ·ˡᵐ u -ⱽ h ·ˡᵐ u +ⱽ (g ·ˡᵐ v -ⱽ h ·ˡᵐ v) ∎ f[c*v]≡c*f[v]' : (g h : m ⊸ n) → (c : A) (v : Vec A m) → g ·ˡᵐ (c ∘ⱽ v) -ⱽ h ·ˡᵐ (c ∘ⱽ v) ≡ c ∘ⱽ (g ·ˡᵐ v -ⱽ h ·ˡᵐ v) f[c*v]≡c*f[v]' g h c v = begin g ·ˡᵐ (c ∘ⱽ v) -ⱽ h ·ˡᵐ (c ∘ⱽ v) ≡⟨ cong (g ·ˡᵐ (c ∘ⱽ v) +ⱽ_) (trans (-ⱽ≡-1ᶠ∘ⱽ (h ·ˡᵐ (c ∘ⱽ v))) (sym (f[c*v]≡c*f[v] h (- 1ᶠ) (c ∘ⱽ v)))) ⟩ g ·ˡᵐ (c ∘ⱽ v) +ⱽ h ·ˡᵐ ((- 1ᶠ) ∘ⱽ (c ∘ⱽ v)) ≡⟨ cong (λ x → g ·ˡᵐ (c ∘ⱽ v) +ⱽ h ·ˡᵐ x) (∘ⱽ-comm (- 1ᶠ) c v) ⟩ g ·ˡᵐ (c ∘ⱽ v) +ⱽ h ·ˡᵐ (c ∘ⱽ ((- 1ᶠ) ∘ⱽ v)) ≡⟨ +-homogeneity g h c v ((- 1ᶠ) ∘ⱽ v) ⟩ c ∘ⱽ (g ·ˡᵐ v +ⱽ h ·ˡᵐ ((- 1ᶠ) ∘ⱽ v)) ≡⟨ cong (λ x → c ∘ⱽ (g ·ˡᵐ v +ⱽ x)) (trans (f[c*v]≡c*f[v] h (- 1ᶠ) v) (sym (-ⱽ≡-1ᶠ∘ⱽ (h ·ˡᵐ v)))) ⟩ c ∘ⱽ (g ·ˡᵐ v -ⱽ h ·ˡᵐ v) ∎ _*ˡᵐ_ : n ⊸ p → m ⊸ n → m ⊸ p g *ˡᵐ h = record { f = λ v → g ·ˡᵐ (h ·ˡᵐ v) ; f[u+v]≡f[u]+f[v] = f[u+v]≡f[u]+f[v]' g h ; f[c*v]≡c*f[v] = f[c*v]≡c*f[v]' g h } where f[u+v]≡f[u]+f[v]' : (g : n ⊸ p) (h : m ⊸ n) → (u v : Vec A m) → g ·ˡᵐ (h ·ˡᵐ (u +ⱽ v)) ≡ g ·ˡᵐ (h ·ˡᵐ u) +ⱽ g ·ˡᵐ (h ·ˡᵐ v) f[u+v]≡f[u]+f[v]' g h u v rewrite f[u+v]≡f[u]+f[v] h u v | f[u+v]≡f[u]+f[v] g (f h u) (f h v) = refl f[c*v]≡c*f[v]' : (g : n ⊸ p) (h : m ⊸ n) → (c : A) (v : Vec A m) → g ·ˡᵐ (h ·ˡᵐ (c ∘ⱽ v)) ≡ c ∘ⱽ g ·ˡᵐ (h ·ˡᵐ v) f[c*v]≡c*f[v]' g h c v rewrite f[c*v]≡c*f[v] h c v | f[c*v]≡c*f[v] g c (h ·ˡᵐ v) = refl -- vertical stack forward operator _—ˡᵐ_ : p ⊸ m → p ⊸ n → p ⊸ (m +ᴺ n) T —ˡᵐ B = record { f = λ v → T ·ˡᵐ v ++ B ·ˡᵐ v ; f[u+v]≡f[u]+f[v] = f[u+v]≡f[u]+f[v]' T B ; f[c*v]≡c*f[v] = f[c*v]≡c*f[v]' T B } where f[u+v]≡f[u]+f[v]' : (T : p ⊸ m) (B : p ⊸ n) → (u v : Vec A p) → T ·ˡᵐ (u +ⱽ v) ++ B ·ˡᵐ (u +ⱽ v) ≡ (T ·ˡᵐ u ++ B ·ˡᵐ u) +ⱽ (T ·ˡᵐ v ++ B ·ˡᵐ v) f[u+v]≡f[u]+f[v]' T B u v rewrite f[u+v]≡f[u]+f[v] T u v | f[u+v]≡f[u]+f[v] B u v | +ⱽ-flip-++ (T ·ˡᵐ u) (T ·ˡᵐ v) (B ·ˡᵐ u) (B ·ˡᵐ v) = refl f[c*v]≡c*f[v]' : (T : p ⊸ m) (B : p ⊸ n) → (c : A) → (v : Vec A p) → T ·ˡᵐ (c ∘ⱽ v) ++ B ·ˡᵐ (c ∘ⱽ v) ≡ c ∘ⱽ (T ·ˡᵐ v ++ B ·ˡᵐ v) f[c*v]≡c*f[v]' T B c v rewrite f[c*v]≡c*f[v] T c v | f[c*v]≡c*f[v] B c v | ∘ⱽ-distr-++ c (T ·ˡᵐ v) (B ·ˡᵐ v) = refl -- horizontal stack forward operator _|ˡᵐ_ : m ⊸ p → n ⊸ p → (m +ᴺ n) ⊸ p _|ˡᵐ_ {m} {n} {p} T B = record { f = λ v → T ·ˡᵐ (take m v) +ⱽ B ·ˡᵐ (drop m v) ; f[u+v]≡f[u]+f[v] = f[u+v]≡f[u]+f[v]' T B ; f[c*v]≡c*f[v] = f[c*v]≡c*f[v]' T B } where f[u+v]≡f[u]+f[v]' : {m n p : ℕ} → (T : m ⊸ p) (B : n ⊸ p) → (u v : Vec A (m +ᴺ n)) → T ·ˡᵐ take m (u +ⱽ v) +ⱽ B ·ˡᵐ drop m (u +ⱽ v) ≡ T ·ˡᵐ take m u +ⱽ B ·ˡᵐ drop m u +ⱽ (T ·ˡᵐ take m v +ⱽ B ·ˡᵐ drop m v) f[u+v]≡f[u]+f[v]' {m} T B u v = begin T ·ˡᵐ (take m (u +ⱽ v)) +ⱽ B ·ˡᵐ (drop m (u +ⱽ v)) ≡⟨ cong₂ (λ x y → T ·ˡᵐ x +ⱽ B ·ˡᵐ y) (take-distr-zipWith _+_ u v) (drop-distr-zipWith _+_ u v)⟩ T ·ˡᵐ (take m u +ⱽ take m v) +ⱽ B ·ˡᵐ (drop m u +ⱽ drop m v) ≡⟨ cong₂ _+ⱽ_ (f[u+v]≡f[u]+f[v] T (take m u) (take m v)) (f[u+v]≡f[u]+f[v] B (drop m u) (drop m v)) ⟩ T ·ˡᵐ take m u +ⱽ T ·ˡᵐ take m v +ⱽ (B ·ˡᵐ drop m u +ⱽ B ·ˡᵐ drop m v) ≡⟨ sym (+ⱽ-assoc (T ·ˡᵐ take m u +ⱽ T ·ˡᵐ take m v) (B ·ˡᵐ drop m u) (B ·ˡᵐ drop m v)) ⟩ T ·ˡᵐ take m u +ⱽ T ·ˡᵐ take m v +ⱽ B ·ˡᵐ drop m u +ⱽ B ·ˡᵐ drop m v ≡⟨ cong (_+ⱽ B ·ˡᵐ drop m v) (+ⱽ-assoc (T ·ˡᵐ take m u) (T ·ˡᵐ take m v) (B ·ˡᵐ drop m u)) ⟩ T ·ˡᵐ take m u +ⱽ (T ·ˡᵐ take m v +ⱽ B ·ˡᵐ drop m u) +ⱽ B ·ˡᵐ drop m v ≡⟨ cong (λ x → (T ·ˡᵐ take m u +ⱽ x) +ⱽ B ·ˡᵐ drop m v) (+ⱽ-comm (T ·ˡᵐ take m v) (B ·ˡᵐ drop m u)) ⟩ (T ·ˡᵐ take m u +ⱽ ((B ·ˡᵐ drop m u +ⱽ T ·ˡᵐ take m v))) +ⱽ B ·ˡᵐ drop m v ≡⟨ cong (_+ⱽ B ·ˡᵐ drop m v) (sym (+ⱽ-assoc (T ·ˡᵐ take m u) (B ·ˡᵐ drop m u) (T ·ˡᵐ take m v))) ⟩ (T ·ˡᵐ take m u +ⱽ B ·ˡᵐ drop m u +ⱽ T ·ˡᵐ take m v) +ⱽ B ·ˡᵐ drop m v ≡⟨ +ⱽ-assoc (T ·ˡᵐ take m u +ⱽ B ·ˡᵐ drop m u) (T ·ˡᵐ take m v) (B ·ˡᵐ drop m v) ⟩ T ·ˡᵐ take m u +ⱽ B ·ˡᵐ drop m u +ⱽ (T ·ˡᵐ take m v +ⱽ B ·ˡᵐ drop m v) ∎ f[c*v]≡c*f[v]' : {m n p : ℕ} → (T : m ⊸ p) → (B : n ⊸ p) → (c : A) (v : Vec A (m +ᴺ n)) → T ·ˡᵐ take m (c ∘ⱽ v) +ⱽ B ·ˡᵐ drop m (c ∘ⱽ v) ≡ c ∘ⱽ (T ·ˡᵐ take m v +ⱽ B ·ˡᵐ drop m v) f[c*v]≡c*f[v]' {m} T B c v = begin T ·ˡᵐ take m (c ∘ⱽ v) +ⱽ B ·ˡᵐ drop m (c ∘ⱽ v) ≡⟨ cong₂ (λ x y → T ·ˡᵐ x +ⱽ B ·ˡᵐ y) (take-distr-map (c *_) m v) (drop-distr-map (c *_) m v) ⟩ T ·ˡᵐ (c ∘ⱽ take m v) +ⱽ B ·ˡᵐ (c ∘ⱽ drop m v) ≡⟨ cong₂ _+ⱽ_ (f[c*v]≡c*f[v] T c (take m v)) (f[c*v]≡c*f[v] B c (drop m v)) ⟩ c ∘ⱽ (T ·ˡᵐ take m v) +ⱽ c ∘ⱽ (B ·ˡᵐ drop m v) ≡⟨ sym (∘ⱽ-distr-+ⱽ c (T ·ˡᵐ take m v) (B ·ˡᵐ drop m v)) ⟩ c ∘ⱽ (T ·ˡᵐ take m v +ⱽ B ·ˡᵐ drop m v) ∎ -- block diagonal forward and adjoint operator _/ˡᵐ_ : m ⊸ n → p ⊸ q → (m +ᴺ p) ⊸ (n +ᴺ q) _/ˡᵐ_ {m} {n} {p} {q} T B = record { f = λ v → T ·ˡᵐ (take m v) ++ B ·ˡᵐ (drop m v) ; f[u+v]≡f[u]+f[v] = f[u+v]≡f[u]+f[v]' T B ; f[c*v]≡c*f[v] = f[c*v]≡c*f[v]' T B } where f[u+v]≡f[u]+f[v]' : {m n p q : ℕ} → (T : m ⊸ n) (B : p ⊸ q) → (u v : Vec A (m +ᴺ p)) → T ·ˡᵐ (take m (u +ⱽ v)) ++ B ·ˡᵐ (drop m (u +ⱽ v)) ≡ (T ·ˡᵐ (take m u) ++ B ·ˡᵐ (drop m u)) +ⱽ (T ·ˡᵐ (take m v) ++ B ·ˡᵐ (drop m v)) f[u+v]≡f[u]+f[v]' {m} T B u v = begin T ·ˡᵐ take m (u +ⱽ v) ++ B ·ˡᵐ drop m (u +ⱽ v) ≡⟨ cong₂ (λ x y → T ·ˡᵐ x ++ B ·ˡᵐ y) (take-distr-zipWith _+_ u v) (drop-distr-zipWith _+_ u v)⟩ T ·ˡᵐ (take m u +ⱽ take m v) ++ B ·ˡᵐ (drop m u +ⱽ drop m v) ≡⟨ cong₂ _++_ (f[u+v]≡f[u]+f[v] T (take m u) (take m v)) (f[u+v]≡f[u]+f[v] B (drop m u) (drop m v)) ⟩ (T ·ˡᵐ take m u +ⱽ T ·ˡᵐ take m v) ++ (B ·ˡᵐ drop m u +ⱽ B ·ˡᵐ drop m v) ≡⟨ sym (+ⱽ-flip-++ (T ·ˡᵐ take m u) (T ·ˡᵐ take m v) (B ·ˡᵐ drop m u) (B ·ˡᵐ drop m v)) ⟩ (T ·ˡᵐ take m u ++ B ·ˡᵐ drop m u) +ⱽ (T ·ˡᵐ take m v ++ B ·ˡᵐ drop m v) ∎ f[c*v]≡c*f[v]' : {m n p q : ℕ} → (T : m ⊸ n) (B : p ⊸ q) → (c : A) (v : Vec A (m +ᴺ p)) → T ·ˡᵐ (take m (c ∘ⱽ v)) ++ B ·ˡᵐ (drop m (c ∘ⱽ v)) ≡ c ∘ⱽ (T ·ˡᵐ (take m v) ++ B ·ˡᵐ (drop m v)) f[c*v]≡c*f[v]' {m} T B c v = begin T ·ˡᵐ take m (c ∘ⱽ v) ++ B ·ˡᵐ drop m (c ∘ⱽ v) ≡⟨ cong₂ (λ x y → T ·ˡᵐ x ++ B ·ˡᵐ y) (take-distr-map (c *_) m v) (drop-distr-map (c *_) m v) ⟩ T ·ˡᵐ (c ∘ⱽ take m v) ++ B ·ˡᵐ (c ∘ⱽ (drop m v)) ≡⟨ cong₂ _++_ (f[c*v]≡c*f[v] T c (take m v)) (f[c*v]≡c*f[v] B c (drop m v)) ⟩ c ∘ⱽ (T ·ˡᵐ take m v) ++ c ∘ⱽ (B ·ˡᵐ drop m v) ≡⟨ sym (∘ⱽ-distr-++ c (T ·ˡᵐ take m v) (B ·ˡᵐ drop m v)) ⟩ c ∘ⱽ (T ·ˡᵐ take m v ++ B ·ˡᵐ drop m v) ∎ -- Multiply by a constant _∘ˡᵐ_ : A → n ⊸ m → n ⊸ m c ∘ˡᵐ m = record { f = λ v → c ∘ⱽ m ·ˡᵐ v ; f[u+v]≡f[u]+f[v] = λ u v → trans (cong (c ∘ⱽ_) (f[u+v]≡f[u]+f[v] m u v)) (∘ⱽ-distr-+ⱽ c (m ·ˡᵐ u) (m ·ˡᵐ v)) ; f[c*v]≡c*f[v] = λ c₁ v → trans (cong (c ∘ⱽ_) (f[c*v]≡c*f[v] m c₁ v)) (∘ⱽ-comm c c₁ (f m v)) } -- Choose 20 since function application is assumed higher than almost anything infixr 20 _·ˡᵐ_ infixl 2 _—ˡᵐ_ infixl 3 _|ˡᵐ_ infixl 4 _/ˡᵐ_ infixl 6 _+ˡᵐ_ infixl 6 _-ˡᵐ_ infixl 7 _*ˡᵐ_ infixl 10 _∘ˡᵐ_ -- Example LinearMap values --------------------------------------------------- module _ ⦃ F : Field A ⦄ where open Field F idₗₘ : n ⊸ n idₗₘ = record { f = id ; f[u+v]≡f[u]+f[v] = λ u v → refl ; f[c*v]≡c*f[v] = λ c v → refl } diagₗₘ : Vec A n → n ⊸ n diagₗₘ d = record { f = d *ⱽ_ ; f[u+v]≡f[u]+f[v] = *ⱽ-distr-+ⱽ d ; f[c*v]≡c*f[v] = λ c v → *ⱽ∘ⱽ≡∘ⱽ*ⱽ c d v } 1ₗₘ : n ⊸ m 1ₗₘ = record { f = λ v → replicate (sum v) ; f[u+v]≡f[u]+f[v] = f[u+v]≡f[u]+f[v] ; f[c*v]≡c*f[v] = f[c*v]≡c*f[v] } where f[u+v]≡f[u]+f[v] : (u v : Vec A n) → replicate (sum (u +ⱽ v)) ≡ replicate (sum u) +ⱽ replicate (sum v) f[u+v]≡f[u]+f[v] u v = begin replicate (sum (u +ⱽ v)) ≡⟨ cong replicate (sum-distr-+ⱽ u v) ⟩ replicate ((sum u) + (sum v)) ≡⟨ replicate-distr-+ (sum u) (sum v) ⟩ replicate (sum u) +ⱽ replicate (sum v) ∎ f[c*v]≡c*f[v] : (c : A) (v : Vec A n) → replicate (sum (c ∘ⱽ v)) ≡ c ∘ⱽ replicate (sum v) f[c*v]≡c*f[v] c v = begin replicate (sum (c ∘ⱽ v)) ≡⟨ cong replicate (sum[c∘ⱽv]≡c*sum[v] c v) ⟩ replicate (c * sum v) ≡⟨ replicate[a*b]≡a∘ⱽreplicate[b] c (sum v) ⟩ c ∘ⱽ replicate (sum v) ∎ -- This could be defined as 0ᶠ ∘ˡᵐ allonesₗₘ, but then that would make -- some later proofs more difficult, since they would then have more than -- just replicate 0ᶠ to replace zerosₗₘ with. 0ₗₘ : n ⊸ m 0ₗₘ = record { f = λ v → replicate 0ᶠ ; f[u+v]≡f[u]+f[v] = λ u v → sym (trans (zipWith-replicate _+_ 0ᶠ 0ᶠ) (cong replicate 0ᶠ+0ᶠ≡0ᶠ)) ; f[c*v]≡c*f[v] = λ c v → sym (c∘ⱽ0ᶠⱽ≡0ᶠⱽ c) }
source/numerics/a-numeri.ads
ytomino/drake
33
26390
pragma License (Unrestricted); package Ada.Numerics is pragma Pure; Argument_Error : exception; Pi : constant := 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511; ["03C0"] : constant := Pi; e : constant := 2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996; end Ada.Numerics;
source/jni/u2/twist/asm.asm
Falken42/SecondReality
9
98713
<filename>source/jni/u2/twist/asm.asm code SEGMENT para public 'CODE' ASSUME cs:code .386 LOCALS PUBLIC _vram _vram dw 0,0a000h PUBLIC _sin1024 include sin1024.inc PUBLIC _setborder _setborder PROC FAR push bp mov bp,sp mov dx,3dah in al,dx mov dx,3c0h mov al,11h+32 out dx,al mov al,[bp+6] out dx,al pop bp ret _setborder ENDP PUBLIC _inittwk _inittwk PROC FAR push bp mov bp,sp push si push di push ds ;clear palette mov dx,3c8h xor al,al out dx,al inc dx mov cx,768 @@1: out dx,al loop @@1 mov dx,3d4h ;400 rows ;mov ax,00009h ;out dx,ax ;tweak mov ax,00014h out dx,ax mov ax,0e317h out dx,ax mov dx,3c4h mov ax,0604h out dx,ax ; mov dx,3c4h mov ax,0f02h out dx,ax mov ax,0a000h mov es,ax xor di,di mov cx,32768 xor ax,ax rep stosw ; pop ds pop di pop si pop bp ret _inittwk ENDP PUBLIC _setpalarea _setpalarea PROC FAR push bp mov bp,sp push si push di push ds lds si,[bp+6] mov ax,[bp+10] mov dx,3c8h out dx,al mov cx,[bp+12] mov ax,cx shl cx,1 add cx,ax inc dx rep outsb sti pop ds pop di pop si pop bp ret _setpalarea ENDP PUBLIC _leftline _leftline PROC FAR push bp mov bp,sp push si push di push ds mov ax,80 mul word ptr [bp+6] mov di,ax mov ds,cs:_vram[2] mov cx,160 mov ax,[bp+8] or ax,ax jz @@1 sub cx,ax mov bx,cx shr bx,2 add di,bx and cl,3 mov ax,0ff02h shl ah,cl mov dx,3c4h out dx,ax mov ah,[bp+10] mov ds:[di],ah inc di inc dx mov al,0fh out dx,al mov al,ah test di,1 jz @@2 mov ds:[di],ah inc di inc bx @@2: mov cx,39 sub bx,cx add bx,bx and bx,not 3 ;bx=-4*(number of words) add bx,OFFSET @@fill jmp bx zzz=80 REPT 40 zzz=zzz-2 db 89h,85h,zzz,0 ;mov ds:[di+zzz],ax ENDM @@fill: @@1: pop ds pop di pop si pop bp ret _leftline ENDP PUBLIC _rightline _rightline PROC FAR push bp mov bp,sp push si push di push ds mov ax,80 mul word ptr [bp+6] mov di,ax mov ds,cs:_vram[2] mov cx,160 mov ax,[bp+8] or ax,ax jz @@1 add cx,ax mov bx,cx shr bx,2 add di,bx and cl,3 mov ax,0f002h rol ah,cl mov dx,3c4h out dx,ax mov ah,[bp+10] mov ds:[di],ah dec di inc dx mov al,0fh out dx,al mov al,ah mov cx,bx test di,1 jnz @@2 mov ds:[di],ah dec cx @@2: sub cx,40 neg cx add cx,cx and cx,not 3 ;bx=-4*(number of words) add cx,OFFSET @@fill sub di,bx add di,41 jmp cx zzz=80 REPT 40 zzz=zzz-2 db 89h,85h,zzz,0 ;mov ds:[di+zzz],ax ENDM @@fill: @@1: pop ds pop di pop si pop bp ret _rightline ENDP testcopper PROC FAR mov dx,3c8h xor al,al out dx,al inc dx mov al,63 out dx,al out dx,al out dx,al mov cx,100 @@1: loop @@1 mov dx,3c8h xor al,al out dx,al inc dx mov al,0 out dx,al out dx,al out dx,al ret testcopper ENDP PUBLIC _initcoppers _initcoppers PROC FAR push bp mov bp,sp push si push di push ds mov bx,7 mov ax,0 mov cx,OFFSET testcopper mov dx,cs int 0fch mov bx,7 mov ax,1 mov cx,OFFSET testcopper mov dx,cs int 0fch mov bx,7 mov ax,2 mov cx,OFFSET testcopper mov dx,cs ; int 0fch pop ds pop di pop si pop bp ret _initcoppers ENDP code ENDS END
programs/oeis/021/A021147.asm
karttu/loda
0
20384
<gh_stars>0 ; A021147: Decimal expansion of 1/143. ; 0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9,9,3,0,0,6,9 mov $2,1 mov $3,4 lpb $0,1 sub $0,1 mov $1,$2 mov $2,$3 sub $3,$1 lpe mov $1,28 add $3,1 div $3,2 sub $1,$3 sub $1,26 mul $1,3
libsrc/_DEVELOPMENT/error/z80/error_eacces_mc.asm
teknoplop/z88dk
0
247038
<gh_stars>0 INCLUDE "clib_cfg.asm" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_ERROR ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; verbose mode SECTION code_clib SECTION code_error PUBLIC error_eacces_mc EXTERN __EACCES, errno_mc pop hl error_eacces_mc: ; set hl = -1 ; set carry flag ; set errno = EACCES ld l,__EACCES jp errno_mc SECTION rodata_clib SECTION rodata_error_strings IF __CLIB_OPT_ERROR & $02 defb __EACCES defm "EACCES - Permission denied" defb 0 ELSE defb __EACCES defm "EACCES" defb 0 ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SECTION code_clib SECTION code_error PUBLIC error_eacces_mc EXTERN errno_mc defc error_eacces_mc = errno_mc - 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
oeis/159/A159616.asm
neoneye/loda-programs
11
22229
; A159616: Expansion of (1-x)/(1-5*x-2*x^2+8*x^3). ; Submitted by <NAME> ; 1,4,22,110,562,2854,14514,73782,375106,1906982,9694866,49287446,250571106,1273871494,6476200114,32924174710,167382301826,850950257638,4326122494162,21993454571478,111811915784610,568437508112710,2889863735560946,14691698367753270,74690719244986562,379718083075951782,1930438266927705874,9814101746830540438,49893640603400499682,253652900375241932294,1289538969108366337330,6555851521465111553782,33329112342540354985218,169440953002765067335014,861416177527185154215250,4379329894901133065864534 add $0,3 mov $1,1 mov $4,1 lpb $0 sub $0,1 mov $2,$1 mul $3,2 mov $1,$3 sub $1,1 mul $1,2 add $4,$2 add $1,$4 mul $1,2 add $3,$2 lpe mov $0,$2 div $0,8
null_key.adb
doug16rogers/solitaire
1
13531
<filename>null_key.adb with Solitaire_Operations.Text_Representation; with Ada.Text_IO; use Ada; procedure Null_Key is Deck : Solitaire_Operations.Deck_List := Solitaire_Operations.Standard_Deck; begin -- Null_Key Output : for I in Deck'range loop Text_IO.Put (Item => Solitaire_Operations.Text_Representation.Short_Card_Name (Deck (I) ) ); end loop Output; Text_IO.New_Line; end Null_Key;
Miei-sorgenti/old/Terza lezione/intsuccessivo.asm
DigiOhhh/LabArchitettura2-2017-2018
1
1309
<filename>Miei-sorgenti/old/Terza lezione/intsuccessivo.asm # Si scriva codice assembly che: # chieda all’utente di inserire un intero (messaggio su terminale); # acquisisca un intero da terminale; # calcoli l’intero successivo; # mostri all’utente il risultato (messaggio su terminale). .data str: .asciiz "Inserisci un intero: " end: .asciiz "L'intero successivo è: " .text .globl main main: la $a0, str li $v0, 4 syscall li $v0, 5 syscall move $s0, $v0 addi $s0, $s0, 1 la $a0, end li $v0, 4 syscall move $a0, $s0 li $v0, 1 syscall
examples/ping/title_screen.asm
sgadrat/nine-gine
6
26816
title_screen_init: .( .( ; Point PPU to Background palette 0 (see http://wiki.nesdev.com/w/index.php/PPU_palettes) lda PPUSTATUS lda #$3f sta PPUADDR lda #$00 sta PPUADDR ; Write palette_data in actual ppu palettes ldx #$00 copy_palette: lda palettes_data, x sta PPUDATA inx cpx #$20 bne copy_palette ; Copy background from PRG-rom to PPU nametable lda #<nametable_data sta tmpfield1 lda #>nametable_data sta tmpfield2 jsr draw_zipped_nametable ; Start the music jsr audio_music_start rts .) palettes_data: ; Background .byt $20,$20,$0d,$0d, $20,$0d,$0d,$0d, $20,$0d,$0d,$0d, $20,$0d,$0d,$0d ; Sprites .byt $20,$0d,$00,$10, $20,$0d,$00,$10, $20,$0d,$00,$10, $20,$0d,$00,$10 nametable_data: .byt ZIPNT_ZEROS(32*7) .byt ZIPNT_ZEROS(32*7+12) .byt $04, $05, $06, $07, $08 .byt ZIPNT_ZEROS(15+12) .byt $09, $0a, $0b, $0c, $0d .byt ZIPNT_ZEROS(15+12) ; ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- ------------------- .byt $0e, $0f, $10, $11, $12 .byt ZIPNT_ZEROS(15+32*7) .byt ZIPNT_ZEROS(32*6) nametable_attributes: .byt ZIPNT_ZEROS(8*8) .byt ZIPNT_END .) title_screen_tick: .( lda controller_a_last_frame_btns bne end lda controller_a_btns beq end lda #GAME_STATE_INGAME jsr change_global_game_state end: rts .)
Cubical/Categories/Monoidal/Base.agda
howsiyu/cubical
0
10408
<reponame>howsiyu/cubical<filename>Cubical/Categories/Monoidal/Base.agda<gh_stars>0 -- Monoidal categories {-# OPTIONS --safe #-} module Cubical.Categories.Monoidal.Base where open import Cubical.Categories.Category.Base open import Cubical.Categories.Constructions.BinProduct open import Cubical.Categories.Functor.Base open import Cubical.Categories.Functor.BinProduct open import Cubical.Categories.Morphism open import Cubical.Categories.NaturalTransformation.Base open import Cubical.Foundations.Prelude module _ {ℓ ℓ' : Level} (C : Category ℓ ℓ') where open Category C private record TensorStr : Type (ℓ-max ℓ ℓ') where field ─⊗─ : Functor (C × C) C unit : ob open Functor -- Useful tensor product notation _⊗_ : ob → ob → ob x ⊗ y = ─⊗─ .F-ob (x , y) _⊗ₕ_ : ∀ {x y z w} → Hom[ x , y ] → Hom[ z , w ] → Hom[ x ⊗ z , y ⊗ w ] f ⊗ₕ g = ─⊗─ .F-hom (f , g) record StrictMonStr : Type (ℓ-max ℓ ℓ') where field tenstr : TensorStr open TensorStr tenstr public field -- Axioms - strict assoc : ∀ x y z → x ⊗ (y ⊗ z) ≡ (x ⊗ y) ⊗ z idl : ∀ x → unit ⊗ x ≡ x idr : ∀ x → x ⊗ unit ≡ x record MonoidalStr : Type (ℓ-max ℓ ℓ') where field tenstr : TensorStr open TensorStr tenstr public private -- Private names to make the axioms below look nice x⊗[y⊗z] : Functor (C × C × C) C x⊗[y⊗z] = ─⊗─ ∘F (𝟙⟨ C ⟩ ×F ─⊗─) [x⊗y]⊗z : Functor (C × C × C) C [x⊗y]⊗z = ─⊗─ ∘F (─⊗─ ×F 𝟙⟨ C ⟩) ∘F (×C-assoc C C C) x = 𝟙⟨ C ⟩ 1⊗x = ─⊗─ ∘F (rinj C C unit) x⊗1 = ─⊗─ ∘F (linj C C unit) field -- "Axioms" - up to natural isomorphism α : x⊗[y⊗z] ≅ᶜ [x⊗y]⊗z η : 1⊗x ≅ᶜ x ρ : x⊗1 ≅ᶜ x open NatIso -- More nice notations α⟨_,_,_⟩ : (x y z : ob) → Hom[ x ⊗ (y ⊗ z) , (x ⊗ y) ⊗ z ] α⟨ x , y , z ⟩ = α .trans ⟦ ( x , y , z ) ⟧ η⟨_⟩ : (x : ob) → Hom[ unit ⊗ x , x ] η⟨ x ⟩ = η .trans ⟦ x ⟧ ρ⟨_⟩ : (x : ob) → Hom[ x ⊗ unit , x ] ρ⟨ x ⟩ = ρ .trans ⟦ x ⟧ field -- Coherence conditions pentagon : ∀ w x y z → id ⊗ₕ α⟨ x , y , z ⟩ ⋆ α⟨ w , x ⊗ y , z ⟩ ⋆ α⟨ w , x , y ⟩ ⊗ₕ id ≡ α⟨ w , x , y ⊗ z ⟩ ⋆ α⟨ w ⊗ x , y , z ⟩ triangle : ∀ x y → α⟨ x , unit , y ⟩ ⋆ ρ⟨ x ⟩ ⊗ₕ id ≡ id ⊗ₕ η⟨ y ⟩ open isIso -- Inverses of α, η, ρ for convenience α⁻¹⟨_,_,_⟩ : (x y z : ob) → Hom[ (x ⊗ y) ⊗ z , x ⊗ (y ⊗ z) ] α⁻¹⟨ x , y , z ⟩ = α .nIso (x , y , z) .inv η⁻¹⟨_⟩ : (x : ob) → Hom[ x , unit ⊗ x ] η⁻¹⟨ x ⟩ = η .nIso (x) .inv ρ⁻¹⟨_⟩ : (x : ob) → Hom[ x , x ⊗ unit ] ρ⁻¹⟨ x ⟩ = ρ .nIso (x) .inv record StrictMonCategory ℓ ℓ' : Type (ℓ-suc (ℓ-max ℓ ℓ')) where field C : Category ℓ ℓ' sms : StrictMonStr C open Category C public open StrictMonStr sms public record MonoidalCategory ℓ ℓ' : Type (ℓ-suc (ℓ-max ℓ ℓ')) where field C : Category ℓ ℓ' monstr : MonoidalStr C open Category C public open MonoidalStr monstr public
lab5/header.asm
wkcn/OSLabs
73
12384
<reponame>wkcn/OSLabs BITS 16 [global _start] [extern main] _start: ;mov ax, cs ;mov ds, ax ;mov ss, ax ;mov sp, 100h - 4 call main ;发送程序结束信号,返回Shell sti int 20h ;mov ax, 0x00 ;mov es, ax ;mov ax, 0x7c00 ;mov si, ax ;mov ax, 1 ;mov [es:si], ax jmp $
01. 8051/01. Introduction/Prog4.asm
nitrece/microprocessor-laboratory
0
246886
<filename>01. 8051/01. Introduction/Prog4.asm<gh_stars>0 org 0h mov dptr, #200h mov r0, #0 mov r1, #40h loop: mov a, r0 movc a, @a+dptr jz p_end mov @r1, a inc r0 inc r1 sjmp loop p_end: org 200h db "<NAME>", 0 end
src/lib/external/MIT/musl/src/setjmp/x86_64/longjmp.asm
tenpoku1000/UEFI_FreeType_MSVC
16
81425
; @@@ _TEXT segment public longjmp align 16 longjmp proc ; int longjmp(jmp_buf, int); ; longjmp の返り値が 0 の場合、1 に変更 mov rax, rdx test rax, rax jnz skip inc rax skip: ; jmp_buf から rbx, rbp, r12, r14, r15 レジスタを復旧 mov rbx, qword ptr [rcx] mov rsi, qword ptr [rcx + 8 * 1] mov rdi, qword ptr [rcx + 8 * 2] mov rbp, qword ptr [rcx + 8 * 3] mov r12, qword ptr [rcx + 8 * 4] mov r13, qword ptr [rcx + 8 * 5] mov r14, qword ptr [rcx + 8 * 6] mov r15, qword ptr [rcx + 8 * 7] ; rsp レジスタを復旧 mov rdx, qword ptr [rcx + 8 * 8] mov rsp, rdx ; return address へ jmp mov rdx, qword ptr [rcx + 8 * 9] jmp rdx longjmp endp _TEXT ends end ; @@@
test/Fail/Issue1445-2.agda
cruhland/agda
1,989
12870
{-# OPTIONS --rewriting --confluence-check #-} open import Agda.Builtin.Bool open import Agda.Builtin.Equality open import Agda.Builtin.Equality.Rewrite module _ where data Unit : Set where unit : Unit sym : {A : Set} {x y : A} → x ≡ y → y ≡ x sym refl = refl subst : {A : Set} (P : A → Set) {x y : A} → x ≡ y → P x → P y subst P refl p = p module _ (p : false ≡ true) where block : {A : Set} → Unit → A → A block unit x = x r : ∀ u → block u false ≡ true r unit = p {-# REWRITE r #-} r′ : ∀ u → block u false ≡ true r′ u = refl lazy : false ≡ true lazy = r′ unit T : Bool → Set T true = Bool T false = Bool → Bool module _ (p : false ≡ true) where bool : (Bool → Bool) → Bool bool = subst T (lazy p) fun : Bool → (Bool → Bool) fun = subst T (sym (lazy p)) omega : Bool → Bool omega = λ x → fun x x loop : Bool loop = omega (bool omega) -- omega = λ p x → x x -- loop = λ p → <BLACKHOLE>
sommaNumeriInVettore(con puntatori).asm
edoardottt/Asm_mars_examples
21
90478
<reponame>edoardottt/Asm_mars_examples<filename>sommaNumeriInVettore(con puntatori).asm # SOMMA NUMERI IN VETTORE CON INDICI DIVISIBILI PER 3 # CON PUNTATORI .data vettore: .word 0,1,2,3,4,5,6,7,8,9 N: .word 10 .text main: la $t0,vettore # indirizzo vettore lw $t2,N sll $t3,$t2,2 # ultimo indice vettore (byte) add $t1,$t0,$t3 loop: bgt $t0,$t1,fine lw $t5,($t0) # elemento corrente add $t6,$t6,$t5 # aggiornamento somma addi $t0,$t0,12 # aggiornamento indice ( +12 byte = elementi con indici divisibili per 3) j loop fine: li $v0,1 move $a0,$t6 syscall # (18=0+3+6+9)
trabalho2/AnalisadorMarkdown/src/antlr/marktex.g4
LorhanSohaky/Compiladores2
0
1701
grammar marktex; document: configs content references?; configs: '+++++' type title author+ date header_includes? '+++++'; type: 'type' ':' document_type; document_type: ('article' | 'monography'); title: 'title' ':' STRING; author: 'author' ':' STRING; date: 'date' ':' DATE; header_includes: 'header-includes' ':' STRING; content: BODY; STRING: '"' ~('\n' | '\r' | '"')* '"' ; DATE: [0-9][0-9] '/' [0-9][0-9] '/' [0-9][0-9][0-9][0-9]; COMENTARIO: '{{' ~('\n' | '\r' )* '}}' -> skip; WS : (' ' | '\t' | '\r' | '\n' )+ -> skip; BODY: '*****' .+? '*****'; ALIAS : ('a'..'z' | 'A'..'Z' | '0'..'9' | '_')+; references: referencias+=reference+ EOF; reference: '@misc' '{' ALIAS ',' 'author' '=' STRING ',' 'title' '=' STRING ',' 'year' '=' STRING '}';
forktest.asm
avivo23/os_ass3
0
166077
_forktest: file format elf32-i386 Disassembly of section .text: 00000000 <printf>: #define N 1000 void printf(int fd, char *s, ...) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 08 sub $0x8,%esp write(fd, s, strlen(s)); 6: 83 ec 0c sub $0xc,%esp 9: ff 75 0c pushl 0xc(%ebp) c: e8 97 01 00 00 call 1a8 <strlen> 11: 83 c4 10 add $0x10,%esp 14: 83 ec 04 sub $0x4,%esp 17: 50 push %eax 18: ff 75 0c pushl 0xc(%ebp) 1b: ff 75 08 pushl 0x8(%ebp) 1e: e8 67 03 00 00 call 38a <write> 23: 83 c4 10 add $0x10,%esp } 26: 90 nop 27: c9 leave 28: c3 ret 00000029 <forktest>: void forktest(void) { 29: 55 push %ebp 2a: 89 e5 mov %esp,%ebp 2c: 83 ec 18 sub $0x18,%esp int n, pid; printf(1, "fork test\n"); 2f: 83 ec 08 sub $0x8,%esp 32: 68 0c 04 00 00 push $0x40c 37: 6a 01 push $0x1 39: e8 c2 ff ff ff call 0 <printf> 3e: 83 c4 10 add $0x10,%esp for(n=0; n<N; n++){ 41: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 48: eb 1d jmp 67 <forktest+0x3e> pid = fork(); 4a: e8 13 03 00 00 call 362 <fork> 4f: 89 45 f0 mov %eax,-0x10(%ebp) if(pid < 0) 52: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 56: 78 1a js 72 <forktest+0x49> break; if(pid == 0) 58: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 5c: 75 05 jne 63 <forktest+0x3a> exit(); 5e: e8 07 03 00 00 call 36a <exit> { int n, pid; printf(1, "fork test\n"); for(n=0; n<N; n++){ 63: 83 45 f4 01 addl $0x1,-0xc(%ebp) 67: 81 7d f4 e7 03 00 00 cmpl $0x3e7,-0xc(%ebp) 6e: 7e da jle 4a <forktest+0x21> 70: eb 01 jmp 73 <forktest+0x4a> pid = fork(); if(pid < 0) break; 72: 90 nop if(pid == 0) exit(); } if(n == N){ 73: 81 7d f4 e8 03 00 00 cmpl $0x3e8,-0xc(%ebp) 7a: 75 40 jne bc <forktest+0x93> printf(1, "fork claimed to work N times!\n", N); 7c: 83 ec 04 sub $0x4,%esp 7f: 68 e8 03 00 00 push $0x3e8 84: 68 18 04 00 00 push $0x418 89: 6a 01 push $0x1 8b: e8 70 ff ff ff call 0 <printf> 90: 83 c4 10 add $0x10,%esp exit(); 93: e8 d2 02 00 00 call 36a <exit> } for(; n > 0; n--){ if(wait() < 0){ 98: e8 d5 02 00 00 call 372 <wait> 9d: 85 c0 test %eax,%eax 9f: 79 17 jns b8 <forktest+0x8f> printf(1, "wait stopped early\n"); a1: 83 ec 08 sub $0x8,%esp a4: 68 37 04 00 00 push $0x437 a9: 6a 01 push $0x1 ab: e8 50 ff ff ff call 0 <printf> b0: 83 c4 10 add $0x10,%esp exit(); b3: e8 b2 02 00 00 call 36a <exit> if(n == N){ printf(1, "fork claimed to work N times!\n", N); exit(); } for(; n > 0; n--){ b8: 83 6d f4 01 subl $0x1,-0xc(%ebp) bc: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) c0: 7f d6 jg 98 <forktest+0x6f> printf(1, "wait stopped early\n"); exit(); } } if(wait() != -1){ c2: e8 ab 02 00 00 call 372 <wait> c7: 83 f8 ff cmp $0xffffffff,%eax ca: 74 17 je e3 <forktest+0xba> printf(1, "wait got too many\n"); cc: 83 ec 08 sub $0x8,%esp cf: 68 4b 04 00 00 push $0x44b d4: 6a 01 push $0x1 d6: e8 25 ff ff ff call 0 <printf> db: 83 c4 10 add $0x10,%esp exit(); de: e8 87 02 00 00 call 36a <exit> } printf(1, "fork test OK\n"); e3: 83 ec 08 sub $0x8,%esp e6: 68 5e 04 00 00 push $0x45e eb: 6a 01 push $0x1 ed: e8 0e ff ff ff call 0 <printf> f2: 83 c4 10 add $0x10,%esp } f5: 90 nop f6: c9 leave f7: c3 ret 000000f8 <main>: int main(void) { f8: 8d 4c 24 04 lea 0x4(%esp),%ecx fc: 83 e4 f0 and $0xfffffff0,%esp ff: ff 71 fc pushl -0x4(%ecx) 102: 55 push %ebp 103: 89 e5 mov %esp,%ebp 105: 51 push %ecx 106: 83 ec 04 sub $0x4,%esp forktest(); 109: e8 1b ff ff ff call 29 <forktest> exit(); 10e: e8 57 02 00 00 call 36a <exit> 00000113 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 113: 55 push %ebp 114: 89 e5 mov %esp,%ebp 116: 57 push %edi 117: 53 push %ebx asm volatile("cld; rep stosb" : 118: 8b 4d 08 mov 0x8(%ebp),%ecx 11b: 8b 55 10 mov 0x10(%ebp),%edx 11e: 8b 45 0c mov 0xc(%ebp),%eax 121: 89 cb mov %ecx,%ebx 123: 89 df mov %ebx,%edi 125: 89 d1 mov %edx,%ecx 127: fc cld 128: f3 aa rep stos %al,%es:(%edi) 12a: 89 ca mov %ecx,%edx 12c: 89 fb mov %edi,%ebx 12e: 89 5d 08 mov %ebx,0x8(%ebp) 131: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 134: 90 nop 135: 5b pop %ebx 136: 5f pop %edi 137: 5d pop %ebp 138: c3 ret 00000139 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 139: 55 push %ebp 13a: 89 e5 mov %esp,%ebp 13c: 83 ec 10 sub $0x10,%esp char *os; os = s; 13f: 8b 45 08 mov 0x8(%ebp),%eax 142: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 145: 90 nop 146: 8b 45 08 mov 0x8(%ebp),%eax 149: 8d 50 01 lea 0x1(%eax),%edx 14c: 89 55 08 mov %edx,0x8(%ebp) 14f: 8b 55 0c mov 0xc(%ebp),%edx 152: 8d 4a 01 lea 0x1(%edx),%ecx 155: 89 4d 0c mov %ecx,0xc(%ebp) 158: 0f b6 12 movzbl (%edx),%edx 15b: 88 10 mov %dl,(%eax) 15d: 0f b6 00 movzbl (%eax),%eax 160: 84 c0 test %al,%al 162: 75 e2 jne 146 <strcpy+0xd> ; return os; 164: 8b 45 fc mov -0x4(%ebp),%eax } 167: c9 leave 168: c3 ret 00000169 <strcmp>: int strcmp(const char *p, const char *q) { 169: 55 push %ebp 16a: 89 e5 mov %esp,%ebp while(*p && *p == *q) 16c: eb 08 jmp 176 <strcmp+0xd> p++, q++; 16e: 83 45 08 01 addl $0x1,0x8(%ebp) 172: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 176: 8b 45 08 mov 0x8(%ebp),%eax 179: 0f b6 00 movzbl (%eax),%eax 17c: 84 c0 test %al,%al 17e: 74 10 je 190 <strcmp+0x27> 180: 8b 45 08 mov 0x8(%ebp),%eax 183: 0f b6 10 movzbl (%eax),%edx 186: 8b 45 0c mov 0xc(%ebp),%eax 189: 0f b6 00 movzbl (%eax),%eax 18c: 38 c2 cmp %al,%dl 18e: 74 de je 16e <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 190: 8b 45 08 mov 0x8(%ebp),%eax 193: 0f b6 00 movzbl (%eax),%eax 196: 0f b6 d0 movzbl %al,%edx 199: 8b 45 0c mov 0xc(%ebp),%eax 19c: 0f b6 00 movzbl (%eax),%eax 19f: 0f b6 c0 movzbl %al,%eax 1a2: 29 c2 sub %eax,%edx 1a4: 89 d0 mov %edx,%eax } 1a6: 5d pop %ebp 1a7: c3 ret 000001a8 <strlen>: uint strlen(char *s) { 1a8: 55 push %ebp 1a9: 89 e5 mov %esp,%ebp 1ab: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1ae: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 1b5: eb 04 jmp 1bb <strlen+0x13> 1b7: 83 45 fc 01 addl $0x1,-0x4(%ebp) 1bb: 8b 55 fc mov -0x4(%ebp),%edx 1be: 8b 45 08 mov 0x8(%ebp),%eax 1c1: 01 d0 add %edx,%eax 1c3: 0f b6 00 movzbl (%eax),%eax 1c6: 84 c0 test %al,%al 1c8: 75 ed jne 1b7 <strlen+0xf> ; return n; 1ca: 8b 45 fc mov -0x4(%ebp),%eax } 1cd: c9 leave 1ce: c3 ret 000001cf <memset>: void* memset(void *dst, int c, uint n) { 1cf: 55 push %ebp 1d0: 89 e5 mov %esp,%ebp stosb(dst, c, n); 1d2: 8b 45 10 mov 0x10(%ebp),%eax 1d5: 50 push %eax 1d6: ff 75 0c pushl 0xc(%ebp) 1d9: ff 75 08 pushl 0x8(%ebp) 1dc: e8 32 ff ff ff call 113 <stosb> 1e1: 83 c4 0c add $0xc,%esp return dst; 1e4: 8b 45 08 mov 0x8(%ebp),%eax } 1e7: c9 leave 1e8: c3 ret 000001e9 <strchr>: char* strchr(const char *s, char c) { 1e9: 55 push %ebp 1ea: 89 e5 mov %esp,%ebp 1ec: 83 ec 04 sub $0x4,%esp 1ef: 8b 45 0c mov 0xc(%ebp),%eax 1f2: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 1f5: eb 14 jmp 20b <strchr+0x22> if(*s == c) 1f7: 8b 45 08 mov 0x8(%ebp),%eax 1fa: 0f b6 00 movzbl (%eax),%eax 1fd: 3a 45 fc cmp -0x4(%ebp),%al 200: 75 05 jne 207 <strchr+0x1e> return (char*)s; 202: 8b 45 08 mov 0x8(%ebp),%eax 205: eb 13 jmp 21a <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 207: 83 45 08 01 addl $0x1,0x8(%ebp) 20b: 8b 45 08 mov 0x8(%ebp),%eax 20e: 0f b6 00 movzbl (%eax),%eax 211: 84 c0 test %al,%al 213: 75 e2 jne 1f7 <strchr+0xe> if(*s == c) return (char*)s; return 0; 215: b8 00 00 00 00 mov $0x0,%eax } 21a: c9 leave 21b: c3 ret 0000021c <gets>: char* gets(char *buf, int max) { 21c: 55 push %ebp 21d: 89 e5 mov %esp,%ebp 21f: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 222: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 229: eb 42 jmp 26d <gets+0x51> cc = read(0, &c, 1); 22b: 83 ec 04 sub $0x4,%esp 22e: 6a 01 push $0x1 230: 8d 45 ef lea -0x11(%ebp),%eax 233: 50 push %eax 234: 6a 00 push $0x0 236: e8 47 01 00 00 call 382 <read> 23b: 83 c4 10 add $0x10,%esp 23e: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 241: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 245: 7e 33 jle 27a <gets+0x5e> break; buf[i++] = c; 247: 8b 45 f4 mov -0xc(%ebp),%eax 24a: 8d 50 01 lea 0x1(%eax),%edx 24d: 89 55 f4 mov %edx,-0xc(%ebp) 250: 89 c2 mov %eax,%edx 252: 8b 45 08 mov 0x8(%ebp),%eax 255: 01 c2 add %eax,%edx 257: 0f b6 45 ef movzbl -0x11(%ebp),%eax 25b: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 25d: 0f b6 45 ef movzbl -0x11(%ebp),%eax 261: 3c 0a cmp $0xa,%al 263: 74 16 je 27b <gets+0x5f> 265: 0f b6 45 ef movzbl -0x11(%ebp),%eax 269: 3c 0d cmp $0xd,%al 26b: 74 0e je 27b <gets+0x5f> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 26d: 8b 45 f4 mov -0xc(%ebp),%eax 270: 83 c0 01 add $0x1,%eax 273: 3b 45 0c cmp 0xc(%ebp),%eax 276: 7c b3 jl 22b <gets+0xf> 278: eb 01 jmp 27b <gets+0x5f> cc = read(0, &c, 1); if(cc < 1) break; 27a: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 27b: 8b 55 f4 mov -0xc(%ebp),%edx 27e: 8b 45 08 mov 0x8(%ebp),%eax 281: 01 d0 add %edx,%eax 283: c6 00 00 movb $0x0,(%eax) return buf; 286: 8b 45 08 mov 0x8(%ebp),%eax } 289: c9 leave 28a: c3 ret 0000028b <stat>: int stat(char *n, struct stat *st) { 28b: 55 push %ebp 28c: 89 e5 mov %esp,%ebp 28e: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 291: 83 ec 08 sub $0x8,%esp 294: 6a 00 push $0x0 296: ff 75 08 pushl 0x8(%ebp) 299: e8 0c 01 00 00 call 3aa <open> 29e: 83 c4 10 add $0x10,%esp 2a1: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 2a4: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 2a8: 79 07 jns 2b1 <stat+0x26> return -1; 2aa: b8 ff ff ff ff mov $0xffffffff,%eax 2af: eb 25 jmp 2d6 <stat+0x4b> r = fstat(fd, st); 2b1: 83 ec 08 sub $0x8,%esp 2b4: ff 75 0c pushl 0xc(%ebp) 2b7: ff 75 f4 pushl -0xc(%ebp) 2ba: e8 03 01 00 00 call 3c2 <fstat> 2bf: 83 c4 10 add $0x10,%esp 2c2: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 2c5: 83 ec 0c sub $0xc,%esp 2c8: ff 75 f4 pushl -0xc(%ebp) 2cb: e8 c2 00 00 00 call 392 <close> 2d0: 83 c4 10 add $0x10,%esp return r; 2d3: 8b 45 f0 mov -0x10(%ebp),%eax } 2d6: c9 leave 2d7: c3 ret 000002d8 <atoi>: int atoi(const char *s) { 2d8: 55 push %ebp 2d9: 89 e5 mov %esp,%ebp 2db: 83 ec 10 sub $0x10,%esp int n; n = 0; 2de: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 2e5: eb 25 jmp 30c <atoi+0x34> n = n*10 + *s++ - '0'; 2e7: 8b 55 fc mov -0x4(%ebp),%edx 2ea: 89 d0 mov %edx,%eax 2ec: c1 e0 02 shl $0x2,%eax 2ef: 01 d0 add %edx,%eax 2f1: 01 c0 add %eax,%eax 2f3: 89 c1 mov %eax,%ecx 2f5: 8b 45 08 mov 0x8(%ebp),%eax 2f8: 8d 50 01 lea 0x1(%eax),%edx 2fb: 89 55 08 mov %edx,0x8(%ebp) 2fe: 0f b6 00 movzbl (%eax),%eax 301: 0f be c0 movsbl %al,%eax 304: 01 c8 add %ecx,%eax 306: 83 e8 30 sub $0x30,%eax 309: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 30c: 8b 45 08 mov 0x8(%ebp),%eax 30f: 0f b6 00 movzbl (%eax),%eax 312: 3c 2f cmp $0x2f,%al 314: 7e 0a jle 320 <atoi+0x48> 316: 8b 45 08 mov 0x8(%ebp),%eax 319: 0f b6 00 movzbl (%eax),%eax 31c: 3c 39 cmp $0x39,%al 31e: 7e c7 jle 2e7 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 320: 8b 45 fc mov -0x4(%ebp),%eax } 323: c9 leave 324: c3 ret 00000325 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 325: 55 push %ebp 326: 89 e5 mov %esp,%ebp 328: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 32b: 8b 45 08 mov 0x8(%ebp),%eax 32e: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 331: 8b 45 0c mov 0xc(%ebp),%eax 334: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 337: eb 17 jmp 350 <memmove+0x2b> *dst++ = *src++; 339: 8b 45 fc mov -0x4(%ebp),%eax 33c: 8d 50 01 lea 0x1(%eax),%edx 33f: 89 55 fc mov %edx,-0x4(%ebp) 342: 8b 55 f8 mov -0x8(%ebp),%edx 345: 8d 4a 01 lea 0x1(%edx),%ecx 348: 89 4d f8 mov %ecx,-0x8(%ebp) 34b: 0f b6 12 movzbl (%edx),%edx 34e: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 350: 8b 45 10 mov 0x10(%ebp),%eax 353: 8d 50 ff lea -0x1(%eax),%edx 356: 89 55 10 mov %edx,0x10(%ebp) 359: 85 c0 test %eax,%eax 35b: 7f dc jg 339 <memmove+0x14> *dst++ = *src++; return vdst; 35d: 8b 45 08 mov 0x8(%ebp),%eax } 360: c9 leave 361: c3 ret 00000362 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 362: b8 01 00 00 00 mov $0x1,%eax 367: cd 40 int $0x40 369: c3 ret 0000036a <exit>: SYSCALL(exit) 36a: b8 02 00 00 00 mov $0x2,%eax 36f: cd 40 int $0x40 371: c3 ret 00000372 <wait>: SYSCALL(wait) 372: b8 03 00 00 00 mov $0x3,%eax 377: cd 40 int $0x40 379: c3 ret 0000037a <pipe>: SYSCALL(pipe) 37a: b8 04 00 00 00 mov $0x4,%eax 37f: cd 40 int $0x40 381: c3 ret 00000382 <read>: SYSCALL(read) 382: b8 05 00 00 00 mov $0x5,%eax 387: cd 40 int $0x40 389: c3 ret 0000038a <write>: SYSCALL(write) 38a: b8 10 00 00 00 mov $0x10,%eax 38f: cd 40 int $0x40 391: c3 ret 00000392 <close>: SYSCALL(close) 392: b8 15 00 00 00 mov $0x15,%eax 397: cd 40 int $0x40 399: c3 ret 0000039a <kill>: SYSCALL(kill) 39a: b8 06 00 00 00 mov $0x6,%eax 39f: cd 40 int $0x40 3a1: c3 ret 000003a2 <exec>: SYSCALL(exec) 3a2: b8 07 00 00 00 mov $0x7,%eax 3a7: cd 40 int $0x40 3a9: c3 ret 000003aa <open>: SYSCALL(open) 3aa: b8 0f 00 00 00 mov $0xf,%eax 3af: cd 40 int $0x40 3b1: c3 ret 000003b2 <mknod>: SYSCALL(mknod) 3b2: b8 11 00 00 00 mov $0x11,%eax 3b7: cd 40 int $0x40 3b9: c3 ret 000003ba <unlink>: SYSCALL(unlink) 3ba: b8 12 00 00 00 mov $0x12,%eax 3bf: cd 40 int $0x40 3c1: c3 ret 000003c2 <fstat>: SYSCALL(fstat) 3c2: b8 08 00 00 00 mov $0x8,%eax 3c7: cd 40 int $0x40 3c9: c3 ret 000003ca <link>: SYSCALL(link) 3ca: b8 13 00 00 00 mov $0x13,%eax 3cf: cd 40 int $0x40 3d1: c3 ret 000003d2 <mkdir>: SYSCALL(mkdir) 3d2: b8 14 00 00 00 mov $0x14,%eax 3d7: cd 40 int $0x40 3d9: c3 ret 000003da <chdir>: SYSCALL(chdir) 3da: b8 09 00 00 00 mov $0x9,%eax 3df: cd 40 int $0x40 3e1: c3 ret 000003e2 <dup>: SYSCALL(dup) 3e2: b8 0a 00 00 00 mov $0xa,%eax 3e7: cd 40 int $0x40 3e9: c3 ret 000003ea <getpid>: SYSCALL(getpid) 3ea: b8 0b 00 00 00 mov $0xb,%eax 3ef: cd 40 int $0x40 3f1: c3 ret 000003f2 <sbrk>: SYSCALL(sbrk) 3f2: b8 0c 00 00 00 mov $0xc,%eax 3f7: cd 40 int $0x40 3f9: c3 ret 000003fa <sleep>: SYSCALL(sleep) 3fa: b8 0d 00 00 00 mov $0xd,%eax 3ff: cd 40 int $0x40 401: c3 ret 00000402 <uptime>: SYSCALL(uptime) 402: b8 0e 00 00 00 mov $0xe,%eax 407: cd 40 int $0x40 409: c3 ret
kernel.asm
Willnoble83/SysProg-Assessment2
0
28028
kernel: file format elf32-i386 Disassembly of section .text: 80100000 <multiboot_header>: 80100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh 80100006: 00 00 add %al,(%eax) 80100008: fe 4f 52 decb 0x52(%edi) 8010000b: e4 .byte 0xe4 8010000c <entry>: # Entering xv6 on boot processor, with paging off. .globl entry entry: # Turn on page size extension for 4Mbyte pages movl %cr4, %eax 8010000c: 0f 20 e0 mov %cr4,%eax orl $(CR4_PSE), %eax 8010000f: 83 c8 10 or $0x10,%eax movl %eax, %cr4 80100012: 0f 22 e0 mov %eax,%cr4 # Set page directory movl $(V2P_WO(entrypgdir)), %eax 80100015: b8 00 b0 10 00 mov $0x10b000,%eax movl %eax, %cr3 8010001a: 0f 22 d8 mov %eax,%cr3 # Turn on paging. movl %cr0, %eax 8010001d: 0f 20 c0 mov %cr0,%eax orl $(CR0_PG|CR0_WP), %eax 80100020: 0d 00 00 01 80 or $0x80010000,%eax movl %eax, %cr0 80100025: 0f 22 c0 mov %eax,%cr0 # Set up the stack pointer. movl $(stack + KSTACKSIZE), %esp 80100028: bc c0 d5 10 80 mov $0x8010d5c0,%esp # Jump to main(), and switch to executing at # high addresses. The indirect call is needed because # the assembler produces a PC-relative instruction # for a direct jump. mov $main, %eax 8010002d: b8 70 39 10 80 mov $0x80103970,%eax jmp *%eax 80100032: ff e0 jmp *%eax 80100034: 66 90 xchg %ax,%ax 80100036: 66 90 xchg %ax,%ax 80100038: 66 90 xchg %ax,%ax 8010003a: 66 90 xchg %ax,%ax 8010003c: 66 90 xchg %ax,%ax 8010003e: 66 90 xchg %ax,%ax 80100040 <binit>: // Linked list of all buffers, through prev/next. // head.next is most recently used. struct buf head; } bcache; void binit(void) { 80100040: 55 push %ebp 80100041: 89 e5 mov %esp,%ebp 80100043: 53 push %ebx initlock(&bcache.lock, "bcache"); // Create linked list of buffers bcache.head.prev = &bcache.head; bcache.head.next = &bcache.head; for (b = bcache.buf; b < bcache.buf + NBUF; b++) { 80100044: bb f4 d5 10 80 mov $0x8010d5f4,%ebx void binit(void) { 80100049: 83 ec 0c sub $0xc,%esp initlock(&bcache.lock, "bcache"); 8010004c: 68 20 7b 10 80 push $0x80107b20 80100051: 68 c0 d5 10 80 push $0x8010d5c0 80100056: e8 a5 4c 00 00 call 80104d00 <initlock> bcache.head.prev = &bcache.head; 8010005b: c7 05 0c 1d 11 80 bc movl $0x80111cbc,0x80111d0c 80100062: 1c 11 80 bcache.head.next = &bcache.head; 80100065: c7 05 10 1d 11 80 bc movl $0x80111cbc,0x80111d10 8010006c: 1c 11 80 8010006f: 83 c4 10 add $0x10,%esp 80100072: ba bc 1c 11 80 mov $0x80111cbc,%edx 80100077: eb 09 jmp 80100082 <binit+0x42> 80100079: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100080: 89 c3 mov %eax,%ebx b->next = bcache.head.next; b->prev = &bcache.head; initsleeplock(&b->lock, "buffer"); 80100082: 8d 43 0c lea 0xc(%ebx),%eax 80100085: 83 ec 08 sub $0x8,%esp b->next = bcache.head.next; 80100088: 89 53 54 mov %edx,0x54(%ebx) b->prev = &bcache.head; 8010008b: c7 43 50 bc 1c 11 80 movl $0x80111cbc,0x50(%ebx) initsleeplock(&b->lock, "buffer"); 80100092: 68 27 7b 10 80 push $0x80107b27 80100097: 50 push %eax 80100098: e8 33 4b 00 00 call 80104bd0 <initsleeplock> bcache.head.next->prev = b; 8010009d: a1 10 1d 11 80 mov 0x80111d10,%eax for (b = bcache.buf; b < bcache.buf + NBUF; b++) { 801000a2: 83 c4 10 add $0x10,%esp 801000a5: 89 da mov %ebx,%edx bcache.head.next->prev = b; 801000a7: 89 58 50 mov %ebx,0x50(%eax) for (b = bcache.buf; b < bcache.buf + NBUF; b++) { 801000aa: 8d 83 5c 02 00 00 lea 0x25c(%ebx),%eax bcache.head.next = b; 801000b0: 89 1d 10 1d 11 80 mov %ebx,0x80111d10 for (b = bcache.buf; b < bcache.buf + NBUF; b++) { 801000b6: 3d bc 1c 11 80 cmp $0x80111cbc,%eax 801000bb: 72 c3 jb 80100080 <binit+0x40> } } 801000bd: 8b 5d fc mov -0x4(%ebp),%ebx 801000c0: c9 leave 801000c1: c3 ret 801000c2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801000c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801000d0 <bread>: panic("bget: no buffers"); } // Return a locked buf with the contents of the indicated block. struct buf*bread(uint dev, uint blockno) { 801000d0: 55 push %ebp 801000d1: 89 e5 mov %esp,%ebp 801000d3: 57 push %edi 801000d4: 56 push %esi 801000d5: 53 push %ebx 801000d6: 83 ec 18 sub $0x18,%esp 801000d9: 8b 75 08 mov 0x8(%ebp),%esi 801000dc: 8b 7d 0c mov 0xc(%ebp),%edi acquire(&bcache.lock); 801000df: 68 c0 d5 10 80 push $0x8010d5c0 801000e4: e8 57 4d 00 00 call 80104e40 <acquire> for (b = bcache.head.next; b != &bcache.head; b = b->next) { 801000e9: 8b 1d 10 1d 11 80 mov 0x80111d10,%ebx 801000ef: 83 c4 10 add $0x10,%esp 801000f2: 81 fb bc 1c 11 80 cmp $0x80111cbc,%ebx 801000f8: 75 11 jne 8010010b <bread+0x3b> 801000fa: eb 24 jmp 80100120 <bread+0x50> 801000fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100100: 8b 5b 54 mov 0x54(%ebx),%ebx 80100103: 81 fb bc 1c 11 80 cmp $0x80111cbc,%ebx 80100109: 74 15 je 80100120 <bread+0x50> if (b->dev == dev && b->blockno == blockno) { 8010010b: 3b 73 04 cmp 0x4(%ebx),%esi 8010010e: 75 f0 jne 80100100 <bread+0x30> 80100110: 3b 7b 08 cmp 0x8(%ebx),%edi 80100113: 75 eb jne 80100100 <bread+0x30> b->refcnt++; 80100115: 83 43 4c 01 addl $0x1,0x4c(%ebx) 80100119: eb 3f jmp 8010015a <bread+0x8a> 8010011b: 90 nop 8010011c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for (b = bcache.head.prev; b != &bcache.head; b = b->prev) { 80100120: 8b 1d 0c 1d 11 80 mov 0x80111d0c,%ebx 80100126: 81 fb bc 1c 11 80 cmp $0x80111cbc,%ebx 8010012c: 75 0d jne 8010013b <bread+0x6b> 8010012e: eb 60 jmp 80100190 <bread+0xc0> 80100130: 8b 5b 50 mov 0x50(%ebx),%ebx 80100133: 81 fb bc 1c 11 80 cmp $0x80111cbc,%ebx 80100139: 74 55 je 80100190 <bread+0xc0> if (b->refcnt == 0 && (b->flags & B_DIRTY) == 0) { 8010013b: 8b 43 4c mov 0x4c(%ebx),%eax 8010013e: 85 c0 test %eax,%eax 80100140: 75 ee jne 80100130 <bread+0x60> 80100142: f6 03 04 testb $0x4,(%ebx) 80100145: 75 e9 jne 80100130 <bread+0x60> b->dev = dev; 80100147: 89 73 04 mov %esi,0x4(%ebx) b->blockno = blockno; 8010014a: 89 7b 08 mov %edi,0x8(%ebx) b->flags = 0; 8010014d: c7 03 00 00 00 00 movl $0x0,(%ebx) b->refcnt = 1; 80100153: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) release(&bcache.lock); 8010015a: 83 ec 0c sub $0xc,%esp 8010015d: 68 c0 d5 10 80 push $0x8010d5c0 80100162: e8 99 4d 00 00 call 80104f00 <release> acquiresleep(&b->lock); 80100167: 8d 43 0c lea 0xc(%ebx),%eax 8010016a: 89 04 24 mov %eax,(%esp) 8010016d: e8 9e 4a 00 00 call 80104c10 <acquiresleep> 80100172: 83 c4 10 add $0x10,%esp struct buf *b; b = bget(dev, blockno); if ((b->flags & B_VALID) == 0) { 80100175: f6 03 02 testb $0x2,(%ebx) 80100178: 75 0c jne 80100186 <bread+0xb6> iderw(b); 8010017a: 83 ec 0c sub $0xc,%esp 8010017d: 53 push %ebx 8010017e: e8 6d 2a 00 00 call 80102bf0 <iderw> 80100183: 83 c4 10 add $0x10,%esp } return b; } 80100186: 8d 65 f4 lea -0xc(%ebp),%esp 80100189: 89 d8 mov %ebx,%eax 8010018b: 5b pop %ebx 8010018c: 5e pop %esi 8010018d: 5f pop %edi 8010018e: 5d pop %ebp 8010018f: c3 ret panic("bget: no buffers"); 80100190: 83 ec 0c sub $0xc,%esp 80100193: 68 2e 7b 10 80 push $0x80107b2e 80100198: e8 43 03 00 00 call 801004e0 <panic> 8010019d: 8d 76 00 lea 0x0(%esi),%esi 801001a0 <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 801001a0: 55 push %ebp 801001a1: 89 e5 mov %esp,%ebp 801001a3: 53 push %ebx 801001a4: 83 ec 10 sub $0x10,%esp 801001a7: 8b 5d 08 mov 0x8(%ebp),%ebx if (!holdingsleep(&b->lock)) { 801001aa: 8d 43 0c lea 0xc(%ebx),%eax 801001ad: 50 push %eax 801001ae: e8 fd 4a 00 00 call 80104cb0 <holdingsleep> 801001b3: 83 c4 10 add $0x10,%esp 801001b6: 85 c0 test %eax,%eax 801001b8: 74 0f je 801001c9 <bwrite+0x29> panic("bwrite"); } b->flags |= B_DIRTY; 801001ba: 83 0b 04 orl $0x4,(%ebx) iderw(b); 801001bd: 89 5d 08 mov %ebx,0x8(%ebp) } 801001c0: 8b 5d fc mov -0x4(%ebp),%ebx 801001c3: c9 leave iderw(b); 801001c4: e9 27 2a 00 00 jmp 80102bf0 <iderw> panic("bwrite"); 801001c9: 83 ec 0c sub $0xc,%esp 801001cc: 68 3f 7b 10 80 push $0x80107b3f 801001d1: e8 0a 03 00 00 call 801004e0 <panic> 801001d6: 8d 76 00 lea 0x0(%esi),%esi 801001d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801001e0 <brelse>: // Release a locked buffer. // Move to the head of the MRU list. void brelse(struct buf *b) { 801001e0: 55 push %ebp 801001e1: 89 e5 mov %esp,%ebp 801001e3: 56 push %esi 801001e4: 53 push %ebx 801001e5: 8b 5d 08 mov 0x8(%ebp),%ebx if (!holdingsleep(&b->lock)) { 801001e8: 83 ec 0c sub $0xc,%esp 801001eb: 8d 73 0c lea 0xc(%ebx),%esi 801001ee: 56 push %esi 801001ef: e8 bc 4a 00 00 call 80104cb0 <holdingsleep> 801001f4: 83 c4 10 add $0x10,%esp 801001f7: 85 c0 test %eax,%eax 801001f9: 74 66 je 80100261 <brelse+0x81> panic("brelse"); } releasesleep(&b->lock); 801001fb: 83 ec 0c sub $0xc,%esp 801001fe: 56 push %esi 801001ff: e8 6c 4a 00 00 call 80104c70 <releasesleep> acquire(&bcache.lock); 80100204: c7 04 24 c0 d5 10 80 movl $0x8010d5c0,(%esp) 8010020b: e8 30 4c 00 00 call 80104e40 <acquire> b->refcnt--; 80100210: 8b 43 4c mov 0x4c(%ebx),%eax if (b->refcnt == 0) { 80100213: 83 c4 10 add $0x10,%esp b->refcnt--; 80100216: 83 e8 01 sub $0x1,%eax if (b->refcnt == 0) { 80100219: 85 c0 test %eax,%eax b->refcnt--; 8010021b: 89 43 4c mov %eax,0x4c(%ebx) if (b->refcnt == 0) { 8010021e: 75 2f jne 8010024f <brelse+0x6f> // no one is waiting for it. b->next->prev = b->prev; 80100220: 8b 43 54 mov 0x54(%ebx),%eax 80100223: 8b 53 50 mov 0x50(%ebx),%edx 80100226: 89 50 50 mov %edx,0x50(%eax) b->prev->next = b->next; 80100229: 8b 43 50 mov 0x50(%ebx),%eax 8010022c: 8b 53 54 mov 0x54(%ebx),%edx 8010022f: 89 50 54 mov %edx,0x54(%eax) b->next = bcache.head.next; 80100232: a1 10 1d 11 80 mov 0x80111d10,%eax b->prev = &bcache.head; 80100237: c7 43 50 bc 1c 11 80 movl $0x80111cbc,0x50(%ebx) b->next = bcache.head.next; 8010023e: 89 43 54 mov %eax,0x54(%ebx) bcache.head.next->prev = b; 80100241: a1 10 1d 11 80 mov 0x80111d10,%eax 80100246: 89 58 50 mov %ebx,0x50(%eax) bcache.head.next = b; 80100249: 89 1d 10 1d 11 80 mov %ebx,0x80111d10 } release(&bcache.lock); 8010024f: c7 45 08 c0 d5 10 80 movl $0x8010d5c0,0x8(%ebp) } 80100256: 8d 65 f8 lea -0x8(%ebp),%esp 80100259: 5b pop %ebx 8010025a: 5e pop %esi 8010025b: 5d pop %ebp release(&bcache.lock); 8010025c: e9 9f 4c 00 00 jmp 80104f00 <release> panic("brelse"); 80100261: 83 ec 0c sub $0xc,%esp 80100264: 68 46 7b 10 80 push $0x80107b46 80100269: e8 72 02 00 00 call 801004e0 <panic> 8010026e: 66 90 xchg %ax,%ax 80100270 <writeVideoRegisters>: } // Write the specified values to the VGA registers static void writeVideoRegisters(uchar* regs) { 80100270: 55 push %ebp "d" (port), "0" (addr), "1" (cnt) : "memory", "cc"); } static inline void outb(ushort port, uchar data) { asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100271: ba c2 03 00 00 mov $0x3c2,%edx 80100276: 89 e5 mov %esp,%ebp 80100278: 57 push %edi 80100279: 56 push %esi 8010027a: 53 push %ebx 8010027b: 89 c3 mov %eax,%ebx 8010027d: 0f b6 00 movzbl (%eax),%eax 80100280: ee out %al,(%dx) /* write MISCELLANEOUS reg */ outb(VGA_MISC_WRITE, *regs); regs++; /* write SEQUENCER regs */ for (i = 0; i < VGA_NUM_SEQ_REGS; i++) 80100281: 31 c9 xor %ecx,%ecx 80100283: bf c4 03 00 00 mov $0x3c4,%edi 80100288: be c5 03 00 00 mov $0x3c5,%esi 8010028d: 89 c8 mov %ecx,%eax 8010028f: 89 fa mov %edi,%edx 80100291: ee out %al,(%dx) 80100292: 0f b6 44 0b 01 movzbl 0x1(%ebx,%ecx,1),%eax 80100297: 89 f2 mov %esi,%edx 80100299: ee out %al,(%dx) 8010029a: 83 c1 01 add $0x1,%ecx 8010029d: 83 f9 05 cmp $0x5,%ecx 801002a0: 75 eb jne 8010028d <writeVideoRegisters+0x1d> 801002a2: be d4 03 00 00 mov $0x3d4,%esi 801002a7: b8 03 00 00 00 mov $0x3,%eax 801002ac: 89 f2 mov %esi,%edx 801002ae: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801002af: b9 d5 03 00 00 mov $0x3d5,%ecx 801002b4: 89 ca mov %ecx,%edx 801002b6: ec in (%dx),%al outb(VGA_SEQ_DATA, *regs); regs++; } /* Unlock CRTC registers */ outb(VGA_CRTC_INDEX, 0x03); outb(VGA_CRTC_DATA, inb(VGA_CRTC_DATA) | 0x80); 801002b7: 83 c8 80 or $0xffffff80,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801002ba: ee out %al,(%dx) 801002bb: b8 11 00 00 00 mov $0x11,%eax 801002c0: 89 f2 mov %esi,%edx 801002c2: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801002c3: 89 ca mov %ecx,%edx 801002c5: ec in (%dx),%al asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801002c6: 83 e0 7f and $0x7f,%eax 801002c9: ee out %al,(%dx) outb(VGA_CRTC_INDEX, 0x11); outb(VGA_CRTC_DATA, inb(VGA_CRTC_DATA) & ~0x80); /* Make sure they remain unlocked */ regs[0x03] |= 0x80; 801002ca: 80 4b 09 80 orb $0x80,0x9(%ebx) regs[0x11] &= ~0x80; 801002ce: 80 63 17 7f andb $0x7f,0x17(%ebx) /* write CRTC regs */ for (i = 0; i < VGA_NUM_CRTC_REGS; i++) 801002d2: 31 c9 xor %ecx,%ecx 801002d4: bf d4 03 00 00 mov $0x3d4,%edi 801002d9: be d5 03 00 00 mov $0x3d5,%esi 801002de: 66 90 xchg %ax,%ax 801002e0: 89 c8 mov %ecx,%eax 801002e2: 89 fa mov %edi,%edx 801002e4: ee out %al,(%dx) 801002e5: 89 f2 mov %esi,%edx 801002e7: 0f b6 44 0b 06 movzbl 0x6(%ebx,%ecx,1),%eax 801002ec: ee out %al,(%dx) 801002ed: 83 c1 01 add $0x1,%ecx 801002f0: 83 f9 19 cmp $0x19,%ecx 801002f3: 75 eb jne 801002e0 <writeVideoRegisters+0x70> outb(VGA_CRTC_INDEX, i); outb(VGA_CRTC_DATA, *regs); regs++; } /* write GRAPHICS CONTROLLER regs */ for (i = 0; i < VGA_NUM_GC_REGS; i++) 801002f5: 31 c9 xor %ecx,%ecx 801002f7: bf ce 03 00 00 mov $0x3ce,%edi 801002fc: be cf 03 00 00 mov $0x3cf,%esi 80100301: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100308: 89 c8 mov %ecx,%eax 8010030a: 89 fa mov %edi,%edx 8010030c: ee out %al,(%dx) 8010030d: 0f b6 44 0b 1f movzbl 0x1f(%ebx,%ecx,1),%eax 80100312: 89 f2 mov %esi,%edx 80100314: ee out %al,(%dx) 80100315: 83 c1 01 add $0x1,%ecx 80100318: 83 f9 09 cmp $0x9,%ecx 8010031b: 75 eb jne 80100308 <writeVideoRegisters+0x98> outb(VGA_GC_INDEX, i); outb(VGA_GC_DATA, *regs); regs++; } /* write ATTRIBUTE CONTROLLER regs */ for (i = 0; i < VGA_NUM_AC_REGS; i++) 8010031d: 31 c9 xor %ecx,%ecx asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010031f: bf da 03 00 00 mov $0x3da,%edi asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100324: be c0 03 00 00 mov $0x3c0,%esi 80100329: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100330: 89 fa mov %edi,%edx 80100332: ec in (%dx),%al asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100333: 89 c8 mov %ecx,%eax 80100335: 89 f2 mov %esi,%edx 80100337: ee out %al,(%dx) 80100338: 0f b6 44 0b 28 movzbl 0x28(%ebx,%ecx,1),%eax 8010033d: ee out %al,(%dx) 8010033e: 83 c1 01 add $0x1,%ecx 80100341: 83 f9 15 cmp $0x15,%ecx 80100344: 75 ea jne 80100330 <writeVideoRegisters+0xc0> asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100346: 89 fa mov %edi,%edx 80100348: ec in (%dx),%al asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100349: b8 20 00 00 00 mov $0x20,%eax 8010034e: 89 f2 mov %esi,%edx 80100350: ee out %al,(%dx) regs++; } /* lock 16-color palette and unblank display */ (void)inb(VGA_INSTAT_READ); outb(VGA_AC_INDEX, 0x20); } 80100351: 5b pop %ebx 80100352: 5e pop %esi 80100353: 5f pop %edi 80100354: 5d pop %ebp 80100355: c3 ret 80100356: 8d 76 00 lea 0x0(%esi),%esi 80100359: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100360 <consoleread>: int consoleread(struct inode *ip, char *dst, int n) { 80100360: 55 push %ebp 80100361: 89 e5 mov %esp,%ebp 80100363: 57 push %edi 80100364: 56 push %esi 80100365: 53 push %ebx 80100366: 83 ec 28 sub $0x28,%esp 80100369: 8b 7d 08 mov 0x8(%ebp),%edi 8010036c: 8b 75 0c mov 0xc(%ebp),%esi iunlock(ip); 8010036f: 57 push %edi 80100370: e8 bb 1e 00 00 call 80102230 <iunlock> acquire(&cons.lock); 80100375: c7 04 24 20 c5 10 80 movl $0x8010c520,(%esp) 8010037c: e8 bf 4a 00 00 call 80104e40 <acquire> while (n > 0) { 80100381: 8b 5d 10 mov 0x10(%ebp),%ebx 80100384: 83 c4 10 add $0x10,%esp 80100387: 31 c0 xor %eax,%eax 80100389: 85 db test %ebx,%ebx 8010038b: 0f 8e a1 00 00 00 jle 80100432 <consoleread+0xd2> while (input.r == input.w) { 80100391: 8b 15 80 27 11 80 mov 0x80112780,%edx 80100397: 39 15 84 27 11 80 cmp %edx,0x80112784 8010039d: 74 2c je 801003cb <consoleread+0x6b> 8010039f: eb 5f jmp 80100400 <consoleread+0xa0> 801003a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(&input.r, &cons.lock); 801003a8: 83 ec 08 sub $0x8,%esp 801003ab: 68 20 c5 10 80 push $0x8010c520 801003b0: 68 80 27 11 80 push $0x80112780 801003b5: e8 c6 44 00 00 call 80104880 <sleep> while (input.r == input.w) { 801003ba: 8b 15 80 27 11 80 mov 0x80112780,%edx 801003c0: 83 c4 10 add $0x10,%esp 801003c3: 3b 15 84 27 11 80 cmp 0x80112784,%edx 801003c9: 75 35 jne 80100400 <consoleread+0xa0> if (myproc()->killed) { 801003cb: e8 10 3f 00 00 call 801042e0 <myproc> 801003d0: 8b 40 24 mov 0x24(%eax),%eax 801003d3: 85 c0 test %eax,%eax 801003d5: 74 d1 je 801003a8 <consoleread+0x48> release(&cons.lock); 801003d7: 83 ec 0c sub $0xc,%esp 801003da: 68 20 c5 10 80 push $0x8010c520 801003df: e8 1c 4b 00 00 call 80104f00 <release> ilock(ip); 801003e4: 89 3c 24 mov %edi,(%esp) 801003e7: e8 64 1d 00 00 call 80102150 <ilock> return -1; 801003ec: 83 c4 10 add $0x10,%esp } 801003ef: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801003f2: b8 ff ff ff ff mov $0xffffffff,%eax } 801003f7: 5b pop %ebx 801003f8: 5e pop %esi 801003f9: 5f pop %edi 801003fa: 5d pop %ebp 801003fb: c3 ret 801003fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = input.buf[input.r++ % INPUT_BUF]; 80100400: 8d 42 01 lea 0x1(%edx),%eax 80100403: a3 80 27 11 80 mov %eax,0x80112780 80100408: 89 d0 mov %edx,%eax 8010040a: 83 e0 7f and $0x7f,%eax 8010040d: 0f be 80 00 27 11 80 movsbl -0x7feed900(%eax),%eax if (c == C('D')) { // EOF 80100414: 83 f8 04 cmp $0x4,%eax 80100417: 74 3f je 80100458 <consoleread+0xf8> *dst++ = c; 80100419: 83 c6 01 add $0x1,%esi --n; 8010041c: 83 eb 01 sub $0x1,%ebx if (c == '\n') { 8010041f: 83 f8 0a cmp $0xa,%eax *dst++ = c; 80100422: 88 46 ff mov %al,-0x1(%esi) if (c == '\n') { 80100425: 74 43 je 8010046a <consoleread+0x10a> while (n > 0) { 80100427: 85 db test %ebx,%ebx 80100429: 0f 85 62 ff ff ff jne 80100391 <consoleread+0x31> 8010042f: 8b 45 10 mov 0x10(%ebp),%eax release(&cons.lock); 80100432: 83 ec 0c sub $0xc,%esp 80100435: 89 45 e4 mov %eax,-0x1c(%ebp) 80100438: 68 20 c5 10 80 push $0x8010c520 8010043d: e8 be 4a 00 00 call 80104f00 <release> ilock(ip); 80100442: 89 3c 24 mov %edi,(%esp) 80100445: e8 06 1d 00 00 call 80102150 <ilock> return target - n; 8010044a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010044d: 83 c4 10 add $0x10,%esp } 80100450: 8d 65 f4 lea -0xc(%ebp),%esp 80100453: 5b pop %ebx 80100454: 5e pop %esi 80100455: 5f pop %edi 80100456: 5d pop %ebp 80100457: c3 ret 80100458: 8b 45 10 mov 0x10(%ebp),%eax 8010045b: 29 d8 sub %ebx,%eax if (n < target) { 8010045d: 3b 5d 10 cmp 0x10(%ebp),%ebx 80100460: 73 d0 jae 80100432 <consoleread+0xd2> input.r--; 80100462: 89 15 80 27 11 80 mov %edx,0x80112780 80100468: eb c8 jmp 80100432 <consoleread+0xd2> 8010046a: 8b 45 10 mov 0x10(%ebp),%eax 8010046d: 29 d8 sub %ebx,%eax 8010046f: eb c1 jmp 80100432 <consoleread+0xd2> 80100471: eb 0d jmp 80100480 <snapshotTextTake.part.0> 80100473: 90 nop 80100474: 90 nop 80100475: 90 nop 80100476: 90 nop 80100477: 90 nop 80100478: 90 nop 80100479: 90 nop 8010047a: 90 nop 8010047b: 90 nop 8010047c: 90 nop 8010047d: 90 nop 8010047e: 90 nop 8010047f: 90 nop 80100480 <snapshotTextTake.part.0>: outb(CRTPORT, 14); outb(CRTPORT + 1, pos >> 8); outb(CRTPORT, 15); outb(CRTPORT + 1, pos); } void snapshotTextTake() 80100480: 55 push %ebp 80100481: ba 00 80 0b 80 mov $0x800b8000,%edx // Declare some variables int i; ushort* crtRegister = VGA_0x03_MEMORY; //Loop through the register and take all the values for (i = 0; i < 2000; i++) 80100486: 31 c0 xor %eax,%eax void snapshotTextTake() 80100488: 89 e5 mov %esp,%ebp 8010048a: 56 push %esi 8010048b: 53 push %ebx 8010048c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi { consoleSnapshot.registerCopy[i] = crtRegister[i]; 80100490: 0f b7 0a movzwl (%edx),%ecx for (i = 0; i < 2000; i++) 80100493: 83 c0 01 add $0x1,%eax 80100496: 83 c2 02 add $0x2,%edx consoleSnapshot.registerCopy[i] = crtRegister[i]; 80100499: 88 88 23 1f 11 80 mov %cl,-0x7feee0dd(%eax) for (i = 0; i < 2000; i++) 8010049f: 3d d0 07 00 00 cmp $0x7d0,%eax 801004a4: 75 ea jne 80100490 <snapshotTextTake.part.0+0x10> 801004a6: be d4 03 00 00 mov $0x3d4,%esi 801004ab: b8 0e 00 00 00 mov $0xe,%eax 801004b0: 89 f2 mov %esi,%edx 801004b2: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801004b3: b9 d5 03 00 00 mov $0x3d5,%ecx 801004b8: 89 ca mov %ecx,%edx 801004ba: ec in (%dx),%al int TempPos; // Cursor position: col + 80*row. //Take cursor position from os outb(0x3d4, 14); TempPos = inb(0x3d4 + 1) << 8; 801004bb: 0f b6 c0 movzbl %al,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801004be: 89 f2 mov %esi,%edx 801004c0: c1 e0 08 shl $0x8,%eax 801004c3: 89 c3 mov %eax,%ebx 801004c5: b8 0f 00 00 00 mov $0xf,%eax 801004ca: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801004cb: 89 ca mov %ecx,%edx 801004cd: ec in (%dx),%al outb(0x3d4, 15); TempPos |= inb(0x3d4 + 1); 801004ce: 0f b6 c0 movzbl %al,%eax 801004d1: 09 d8 or %ebx,%eax 801004d3: a3 20 1f 11 80 mov %eax,0x80111f20 //Store the position in our snapshot consoleSnapshot.cursorPos = TempPos; } } 801004d8: 5b pop %ebx 801004d9: 5e pop %esi 801004da: 5d pop %ebp 801004db: c3 ret 801004dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801004e0 <panic>: void panic(char *s) { 801004e0: 55 push %ebp 801004e1: 89 e5 mov %esp,%ebp 801004e3: 56 push %esi 801004e4: 53 push %ebx 801004e5: 83 ec 30 sub $0x30,%esp static inline void loadgs(ushort v) { asm volatile ("movw %0, %%gs" : : "r" (v)); } static inline void cli(void) { asm volatile ("cli"); 801004e8: fa cli cons.locking = 0; 801004e9: c7 05 54 c5 10 80 00 movl $0x0,0x8010c554 801004f0: 00 00 00 getcallerpcs(&s, pcs); 801004f3: 8d 5d d0 lea -0x30(%ebp),%ebx 801004f6: 8d 75 f8 lea -0x8(%ebp),%esi cprintf("lapicid %d: panic: ", lapicid()); 801004f9: e8 02 2d 00 00 call 80103200 <lapicid> 801004fe: 83 ec 08 sub $0x8,%esp 80100501: 50 push %eax 80100502: 68 4d 7b 10 80 push $0x80107b4d 80100507: e8 54 03 00 00 call 80100860 <cprintf> cprintf(s); 8010050c: 58 pop %eax 8010050d: ff 75 08 pushl 0x8(%ebp) 80100510: e8 4b 03 00 00 call 80100860 <cprintf> cprintf("\n"); 80100515: c7 04 24 47 85 10 80 movl $0x80108547,(%esp) 8010051c: e8 3f 03 00 00 call 80100860 <cprintf> getcallerpcs(&s, pcs); 80100521: 5a pop %edx 80100522: 8d 45 08 lea 0x8(%ebp),%eax 80100525: 59 pop %ecx 80100526: 53 push %ebx 80100527: 50 push %eax 80100528: e8 f3 47 00 00 call 80104d20 <getcallerpcs> 8010052d: 83 c4 10 add $0x10,%esp cprintf(" %p", pcs[i]); 80100530: 83 ec 08 sub $0x8,%esp 80100533: ff 33 pushl (%ebx) 80100535: 83 c3 04 add $0x4,%ebx 80100538: 68 61 7b 10 80 push $0x80107b61 8010053d: e8 1e 03 00 00 call 80100860 <cprintf> for (i = 0; i < 10; i++) { 80100542: 83 c4 10 add $0x10,%esp 80100545: 39 f3 cmp %esi,%ebx 80100547: 75 e7 jne 80100530 <panic+0x50> panicked = 1; // freeze other CPU 80100549: c7 05 58 c5 10 80 01 movl $0x1,0x8010c558 80100550: 00 00 00 80100553: eb fe jmp 80100553 <panic+0x73> 80100555: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100559: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100560 <consputc>: if (panicked) { 80100560: 8b 0d 58 c5 10 80 mov 0x8010c558,%ecx 80100566: 85 c9 test %ecx,%ecx 80100568: 74 06 je 80100570 <consputc+0x10> 8010056a: fa cli 8010056b: eb fe jmp 8010056b <consputc+0xb> 8010056d: 8d 76 00 lea 0x0(%esi),%esi void consputc(int c) { 80100570: 55 push %ebp 80100571: 89 e5 mov %esp,%ebp 80100573: 57 push %edi 80100574: 56 push %esi 80100575: 53 push %ebx 80100576: 89 c6 mov %eax,%esi 80100578: 83 ec 0c sub $0xc,%esp if (c == BACKSPACE) { 8010057b: 3d 00 01 00 00 cmp $0x100,%eax 80100580: 0f 84 82 00 00 00 je 80100608 <consputc+0xa8> uartputc(c); 80100586: 83 ec 0c sub $0xc,%esp 80100589: 50 push %eax 8010058a: e8 81 61 00 00 call 80106710 <uartputc> 8010058f: 83 c4 10 add $0x10,%esp asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100592: bb d4 03 00 00 mov $0x3d4,%ebx 80100597: b8 0e 00 00 00 mov $0xe,%eax 8010059c: 89 da mov %ebx,%edx 8010059e: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010059f: b9 d5 03 00 00 mov $0x3d5,%ecx 801005a4: 89 ca mov %ecx,%edx 801005a6: ec in (%dx),%al 801005a7: 89 c7 mov %eax,%edi asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801005a9: 89 da mov %ebx,%edx 801005ab: b8 0f 00 00 00 mov $0xf,%eax 801005b0: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801005b1: 89 ca mov %ecx,%edx 801005b3: ec in (%dx),%al if(currentvgamode ==0x03) //If we are in text, go to the usual execution 801005b4: 83 3d c0 a0 10 80 03 cmpl $0x3,0x8010a0c0 801005bb: 0f b6 d8 movzbl %al,%ebx 801005be: 0f 84 e2 00 00 00 je 801006a6 <consputc+0x146> if (c == '\n') { //If character is a new line 801005c4: 83 fe 0a cmp $0xa,%esi 801005c7: 8b 0d 20 1f 11 80 mov 0x80111f20,%ecx 801005cd: 0f 84 ba 00 00 00 je 8010068d <consputc+0x12d> else if (c == BACKSPACE) { //If character is a backspace 801005d3: 81 fe 00 01 00 00 cmp $0x100,%esi 801005d9: 74 57 je 80100632 <consputc+0xd2> consoleSnapshot.registerCopy[consoleSnapshot.cursorPos] = (c & 0xff) | 0x0700; // black on white 801005db: 89 f0 mov %esi,%eax consoleSnapshot.cursorPos++; 801005dd: 83 c1 01 add $0x1,%ecx consoleSnapshot.registerCopy[consoleSnapshot.cursorPos] = (c & 0xff) | 0x0700; // black on white 801005e0: 88 81 23 1f 11 80 mov %al,-0x7feee0dd(%ecx) consoleSnapshot.cursorPos++; 801005e6: 89 0d 20 1f 11 80 mov %ecx,0x80111f20 if (consoleSnapshot.cursorPos < 0 || consoleSnapshot.cursorPos > 25 * 80) { 801005ec: 81 f9 d0 07 00 00 cmp $0x7d0,%ecx 801005f2: 0f 87 88 00 00 00 ja 80100680 <consputc+0x120> if ((consoleSnapshot.cursorPos / 80) >= 24) { // Scroll up. 801005f8: 81 f9 7f 07 00 00 cmp $0x77f,%ecx 801005fe: 7f 41 jg 80100641 <consputc+0xe1> } 80100600: 8d 65 f4 lea -0xc(%ebp),%esp 80100603: 5b pop %ebx 80100604: 5e pop %esi 80100605: 5f pop %edi 80100606: 5d pop %ebp 80100607: c3 ret uartputc('\b'); 80100608: 83 ec 0c sub $0xc,%esp 8010060b: 6a 08 push $0x8 8010060d: e8 fe 60 00 00 call 80106710 <uartputc> uartputc(' '); 80100612: c7 04 24 20 00 00 00 movl $0x20,(%esp) 80100619: e8 f2 60 00 00 call 80106710 <uartputc> uartputc('\b'); 8010061e: c7 04 24 08 00 00 00 movl $0x8,(%esp) 80100625: e8 e6 60 00 00 call 80106710 <uartputc> 8010062a: 83 c4 10 add $0x10,%esp 8010062d: e9 60 ff ff ff jmp 80100592 <consputc+0x32> if (consoleSnapshot.cursorPos > 0) { 80100632: 85 c9 test %ecx,%ecx 80100634: 7e b6 jle 801005ec <consputc+0x8c> --consoleSnapshot.cursorPos; 80100636: 83 e9 01 sub $0x1,%ecx 80100639: 89 0d 20 1f 11 80 mov %ecx,0x80111f20 8010063f: eb ab jmp 801005ec <consputc+0x8c> memmove(consoleSnapshot.registerCopy, consoleSnapshot.registerCopy + 80, sizeof(consoleSnapshot.registerCopy[0]) * 23 * 80); 80100641: 50 push %eax 80100642: 68 30 07 00 00 push $0x730 80100647: 68 74 1f 11 80 push $0x80111f74 8010064c: 68 24 1f 11 80 push $0x80111f24 80100651: e8 aa 49 00 00 call 80105000 <memmove> consoleSnapshot.cursorPos -= 80; 80100656: a1 20 1f 11 80 mov 0x80111f20,%eax memset(consoleSnapshot.registerCopy + consoleSnapshot.cursorPos, 0, sizeof(consoleSnapshot.registerCopy[0]) * (24 * 80 - consoleSnapshot.cursorPos)); 8010065b: ba 80 07 00 00 mov $0x780,%edx 80100660: 83 c4 0c add $0xc,%esp consoleSnapshot.cursorPos -= 80; 80100663: 83 e8 50 sub $0x50,%eax memset(consoleSnapshot.registerCopy + consoleSnapshot.cursorPos, 0, sizeof(consoleSnapshot.registerCopy[0]) * (24 * 80 - consoleSnapshot.cursorPos)); 80100666: 29 c2 sub %eax,%edx consoleSnapshot.cursorPos -= 80; 80100668: a3 20 1f 11 80 mov %eax,0x80111f20 memset(consoleSnapshot.registerCopy + consoleSnapshot.cursorPos, 0, sizeof(consoleSnapshot.registerCopy[0]) * (24 * 80 - consoleSnapshot.cursorPos)); 8010066d: 05 24 1f 11 80 add $0x80111f24,%eax 80100672: 52 push %edx 80100673: 6a 00 push $0x0 80100675: 50 push %eax 80100676: e8 d5 48 00 00 call 80104f50 <memset> 8010067b: 83 c4 10 add $0x10,%esp } 8010067e: eb 80 jmp 80100600 <consputc+0xa0> panic("pos under/overflow"); 80100680: 83 ec 0c sub $0xc,%esp 80100683: 68 65 7b 10 80 push $0x80107b65 80100688: e8 53 fe ff ff call 801004e0 <panic> consoleSnapshot.cursorPos += 80 - consoleSnapshot.cursorPos % 80; 8010068d: 89 c8 mov %ecx,%eax 8010068f: bb 50 00 00 00 mov $0x50,%ebx 80100694: 99 cltd 80100695: f7 fb idiv %ebx 80100697: 29 d3 sub %edx,%ebx 80100699: 01 d9 add %ebx,%ecx 8010069b: 89 0d 20 1f 11 80 mov %ecx,0x80111f20 801006a1: e9 46 ff ff ff jmp 801005ec <consputc+0x8c> pos = inb(CRTPORT + 1) << 8; 801006a6: 89 f8 mov %edi,%eax 801006a8: 0f b6 c0 movzbl %al,%eax 801006ab: c1 e0 08 shl $0x8,%eax pos |= inb(CRTPORT + 1); 801006ae: 09 c3 or %eax,%ebx if (c == '\n') { 801006b0: 83 fe 0a cmp $0xa,%esi 801006b3: 0f 84 a9 00 00 00 je 80100762 <consputc+0x202> else if (c == BACKSPACE) { 801006b9: 81 fe 00 01 00 00 cmp $0x100,%esi 801006bf: 0f 84 91 00 00 00 je 80100756 <consputc+0x1f6> crt[pos++] = (c & 0xff) | 0x0700; // black on white 801006c5: 89 f0 mov %esi,%eax 801006c7: 0f b6 c0 movzbl %al,%eax 801006ca: 80 cc 07 or $0x7,%ah 801006cd: 66 89 84 1b 00 80 0b mov %ax,-0x7ff48000(%ebx,%ebx,1) 801006d4: 80 801006d5: 83 c3 01 add $0x1,%ebx if (pos < 0 || pos > 25 * 80) { 801006d8: 81 fb d0 07 00 00 cmp $0x7d0,%ebx 801006de: 7f a0 jg 80100680 <consputc+0x120> if ((pos / 80) >= 24) { // Scroll up. 801006e0: 81 fb 7f 07 00 00 cmp $0x77f,%ebx 801006e6: 7e 38 jle 80100720 <consputc+0x1c0> memmove(crt, crt + 80, sizeof(crt[0]) * 23 * 80); 801006e8: 52 push %edx 801006e9: 68 60 0e 00 00 push $0xe60 pos -= 80; 801006ee: 83 eb 50 sub $0x50,%ebx memmove(crt, crt + 80, sizeof(crt[0]) * 23 * 80); 801006f1: 68 a0 80 0b 80 push $0x800b80a0 801006f6: 68 00 80 0b 80 push $0x800b8000 801006fb: e8 00 49 00 00 call 80105000 <memmove> memset(crt + pos, 0, sizeof(crt[0]) * (24 * 80 - pos)); 80100700: b8 80 07 00 00 mov $0x780,%eax 80100705: 83 c4 0c add $0xc,%esp 80100708: 29 d8 sub %ebx,%eax 8010070a: 01 c0 add %eax,%eax 8010070c: 50 push %eax 8010070d: 8d 04 1b lea (%ebx,%ebx,1),%eax 80100710: 6a 00 push $0x0 80100712: 2d 00 80 f4 7f sub $0x7ff48000,%eax 80100717: 50 push %eax 80100718: e8 33 48 00 00 call 80104f50 <memset> 8010071d: 83 c4 10 add $0x10,%esp asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100720: be d4 03 00 00 mov $0x3d4,%esi 80100725: b8 0e 00 00 00 mov $0xe,%eax 8010072a: 89 f2 mov %esi,%edx 8010072c: ee out %al,(%dx) 8010072d: b9 d5 03 00 00 mov $0x3d5,%ecx outb(CRTPORT + 1, pos >> 8); 80100732: 89 d8 mov %ebx,%eax 80100734: c1 f8 08 sar $0x8,%eax 80100737: 89 ca mov %ecx,%edx 80100739: ee out %al,(%dx) 8010073a: b8 0f 00 00 00 mov $0xf,%eax 8010073f: 89 f2 mov %esi,%edx 80100741: ee out %al,(%dx) 80100742: 89 d8 mov %ebx,%eax 80100744: 89 ca mov %ecx,%edx 80100746: ee out %al,(%dx) crt[pos] = ' ' | 0x0700; 80100747: 66 c7 84 1b 00 80 0b movw $0x720,-0x7ff48000(%ebx,%ebx,1) 8010074e: 80 20 07 80100751: e9 aa fe ff ff jmp 80100600 <consputc+0xa0> if (pos > 0) { 80100756: 85 db test %ebx,%ebx 80100758: 74 c6 je 80100720 <consputc+0x1c0> --pos; 8010075a: 83 eb 01 sub $0x1,%ebx 8010075d: e9 76 ff ff ff jmp 801006d8 <consputc+0x178> pos += 80 - pos % 80; 80100762: 89 d8 mov %ebx,%eax 80100764: b9 50 00 00 00 mov $0x50,%ecx 80100769: 99 cltd 8010076a: f7 f9 idiv %ecx 8010076c: 29 d1 sub %edx,%ecx 8010076e: 01 cb add %ecx,%ebx 80100770: e9 63 ff ff ff jmp 801006d8 <consputc+0x178> 80100775: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100780 <printint>: static void printint(int xx, int base, int sign) { 80100780: 55 push %ebp 80100781: 89 e5 mov %esp,%ebp 80100783: 57 push %edi 80100784: 56 push %esi 80100785: 53 push %ebx 80100786: 89 d3 mov %edx,%ebx 80100788: 83 ec 2c sub $0x2c,%esp if (sign && (sign = xx < 0)) { 8010078b: 85 c9 test %ecx,%ecx static void printint(int xx, int base, int sign) { 8010078d: 89 4d d4 mov %ecx,-0x2c(%ebp) if (sign && (sign = xx < 0)) { 80100790: 74 04 je 80100796 <printint+0x16> 80100792: 85 c0 test %eax,%eax 80100794: 78 5a js 801007f0 <printint+0x70> x = xx; 80100796: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) i = 0; 8010079d: 31 c9 xor %ecx,%ecx 8010079f: 8d 75 d7 lea -0x29(%ebp),%esi 801007a2: eb 06 jmp 801007aa <printint+0x2a> 801007a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi buf[i++] = digits[x % base]; 801007a8: 89 f9 mov %edi,%ecx 801007aa: 31 d2 xor %edx,%edx 801007ac: 8d 79 01 lea 0x1(%ecx),%edi 801007af: f7 f3 div %ebx 801007b1: 0f b6 92 c0 7b 10 80 movzbl -0x7fef8440(%edx),%edx while ((x /= base) != 0); 801007b8: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 801007ba: 88 14 3e mov %dl,(%esi,%edi,1) while ((x /= base) != 0); 801007bd: 75 e9 jne 801007a8 <printint+0x28> if (sign) { 801007bf: 8b 45 d4 mov -0x2c(%ebp),%eax 801007c2: 85 c0 test %eax,%eax 801007c4: 74 08 je 801007ce <printint+0x4e> buf[i++] = '-'; 801007c6: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 801007cb: 8d 79 02 lea 0x2(%ecx),%edi 801007ce: 8d 5c 3d d7 lea -0x29(%ebp,%edi,1),%ebx 801007d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi consputc(buf[i]); 801007d8: 0f be 03 movsbl (%ebx),%eax 801007db: 83 eb 01 sub $0x1,%ebx 801007de: e8 7d fd ff ff call 80100560 <consputc> while (--i >= 0) { 801007e3: 39 f3 cmp %esi,%ebx 801007e5: 75 f1 jne 801007d8 <printint+0x58> } 801007e7: 83 c4 2c add $0x2c,%esp 801007ea: 5b pop %ebx 801007eb: 5e pop %esi 801007ec: 5f pop %edi 801007ed: 5d pop %ebp 801007ee: c3 ret 801007ef: 90 nop x = -xx; 801007f0: f7 d8 neg %eax 801007f2: eb a9 jmp 8010079d <printint+0x1d> 801007f4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801007fa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80100800 <consolewrite>: int consolewrite(struct inode *ip, char *buf, int n) { 80100800: 55 push %ebp 80100801: 89 e5 mov %esp,%ebp 80100803: 57 push %edi 80100804: 56 push %esi 80100805: 53 push %ebx 80100806: 83 ec 18 sub $0x18,%esp 80100809: 8b 75 10 mov 0x10(%ebp),%esi iunlock(ip); 8010080c: ff 75 08 pushl 0x8(%ebp) 8010080f: e8 1c 1a 00 00 call 80102230 <iunlock> acquire(&cons.lock); 80100814: c7 04 24 20 c5 10 80 movl $0x8010c520,(%esp) 8010081b: e8 20 46 00 00 call 80104e40 <acquire> for (i = 0; i < n; i++) { 80100820: 83 c4 10 add $0x10,%esp 80100823: 85 f6 test %esi,%esi 80100825: 7e 18 jle 8010083f <consolewrite+0x3f> 80100827: 8b 7d 0c mov 0xc(%ebp),%edi 8010082a: 8d 1c 37 lea (%edi,%esi,1),%ebx 8010082d: 8d 76 00 lea 0x0(%esi),%esi consputc(buf[i] & 0xff); 80100830: 0f b6 07 movzbl (%edi),%eax 80100833: 83 c7 01 add $0x1,%edi 80100836: e8 25 fd ff ff call 80100560 <consputc> for (i = 0; i < n; i++) { 8010083b: 39 fb cmp %edi,%ebx 8010083d: 75 f1 jne 80100830 <consolewrite+0x30> release(&cons.lock); 8010083f: 83 ec 0c sub $0xc,%esp 80100842: 68 20 c5 10 80 push $0x8010c520 80100847: e8 b4 46 00 00 call 80104f00 <release> ilock(ip); 8010084c: 58 pop %eax 8010084d: ff 75 08 pushl 0x8(%ebp) 80100850: e8 fb 18 00 00 call 80102150 <ilock> } 80100855: 8d 65 f4 lea -0xc(%ebp),%esp 80100858: 89 f0 mov %esi,%eax 8010085a: 5b pop %ebx 8010085b: 5e pop %esi 8010085c: 5f pop %edi 8010085d: 5d pop %ebp 8010085e: c3 ret 8010085f: 90 nop 80100860 <cprintf>: void cprintf(char *fmt, ...) { 80100860: 55 push %ebp 80100861: 89 e5 mov %esp,%ebp 80100863: 57 push %edi 80100864: 56 push %esi 80100865: 53 push %ebx 80100866: 83 ec 1c sub $0x1c,%esp locking = cons.locking; 80100869: a1 54 c5 10 80 mov 0x8010c554,%eax if (locking) { 8010086e: 85 c0 test %eax,%eax locking = cons.locking; 80100870: 89 45 dc mov %eax,-0x24(%ebp) if (locking) { 80100873: 0f 85 6f 01 00 00 jne 801009e8 <cprintf+0x188> if (fmt == 0) { 80100879: 8b 45 08 mov 0x8(%ebp),%eax 8010087c: 85 c0 test %eax,%eax 8010087e: 89 c7 mov %eax,%edi 80100880: 0f 84 77 01 00 00 je 801009fd <cprintf+0x19d> for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 80100886: 0f b6 00 movzbl (%eax),%eax argp = (uint*)(void*)(&fmt + 1); 80100889: 8d 4d 0c lea 0xc(%ebp),%ecx for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 8010088c: 31 db xor %ebx,%ebx argp = (uint*)(void*)(&fmt + 1); 8010088e: 89 4d e4 mov %ecx,-0x1c(%ebp) for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 80100891: 85 c0 test %eax,%eax 80100893: 75 56 jne 801008eb <cprintf+0x8b> 80100895: eb 79 jmp 80100910 <cprintf+0xb0> 80100897: 89 f6 mov %esi,%esi 80100899: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi c = fmt[++i] & 0xff; 801008a0: 0f b6 16 movzbl (%esi),%edx if (c == 0) { 801008a3: 85 d2 test %edx,%edx 801008a5: 74 69 je 80100910 <cprintf+0xb0> 801008a7: 83 c3 02 add $0x2,%ebx switch (c) { 801008aa: 83 fa 70 cmp $0x70,%edx 801008ad: 8d 34 1f lea (%edi,%ebx,1),%esi 801008b0: 0f 84 84 00 00 00 je 8010093a <cprintf+0xda> 801008b6: 7f 78 jg 80100930 <cprintf+0xd0> 801008b8: 83 fa 25 cmp $0x25,%edx 801008bb: 0f 84 ff 00 00 00 je 801009c0 <cprintf+0x160> 801008c1: 83 fa 64 cmp $0x64,%edx 801008c4: 0f 85 8e 00 00 00 jne 80100958 <cprintf+0xf8> printint(*argp++, 10, 1); 801008ca: 8b 45 e4 mov -0x1c(%ebp),%eax 801008cd: ba 0a 00 00 00 mov $0xa,%edx 801008d2: 8d 48 04 lea 0x4(%eax),%ecx 801008d5: 8b 00 mov (%eax),%eax 801008d7: 89 4d e4 mov %ecx,-0x1c(%ebp) 801008da: b9 01 00 00 00 mov $0x1,%ecx 801008df: e8 9c fe ff ff call 80100780 <printint> for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 801008e4: 0f b6 06 movzbl (%esi),%eax 801008e7: 85 c0 test %eax,%eax 801008e9: 74 25 je 80100910 <cprintf+0xb0> 801008eb: 8d 53 01 lea 0x1(%ebx),%edx if (c != '%') { 801008ee: 83 f8 25 cmp $0x25,%eax 801008f1: 8d 34 17 lea (%edi,%edx,1),%esi 801008f4: 74 aa je 801008a0 <cprintf+0x40> 801008f6: 89 55 e0 mov %edx,-0x20(%ebp) consputc(c); 801008f9: e8 62 fc ff ff call 80100560 <consputc> for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 801008fe: 0f b6 06 movzbl (%esi),%eax continue; 80100901: 8b 55 e0 mov -0x20(%ebp),%edx 80100904: 89 d3 mov %edx,%ebx for (i = 0; (c = fmt[i] & 0xff) != 0; i++) { 80100906: 85 c0 test %eax,%eax 80100908: 75 e1 jne 801008eb <cprintf+0x8b> 8010090a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if (locking) { 80100910: 8b 45 dc mov -0x24(%ebp),%eax 80100913: 85 c0 test %eax,%eax 80100915: 74 10 je 80100927 <cprintf+0xc7> release(&cons.lock); 80100917: 83 ec 0c sub $0xc,%esp 8010091a: 68 20 c5 10 80 push $0x8010c520 8010091f: e8 dc 45 00 00 call 80104f00 <release> 80100924: 83 c4 10 add $0x10,%esp } 80100927: 8d 65 f4 lea -0xc(%ebp),%esp 8010092a: 5b pop %ebx 8010092b: 5e pop %esi 8010092c: 5f pop %edi 8010092d: 5d pop %ebp 8010092e: c3 ret 8010092f: 90 nop switch (c) { 80100930: 83 fa 73 cmp $0x73,%edx 80100933: 74 43 je 80100978 <cprintf+0x118> 80100935: 83 fa 78 cmp $0x78,%edx 80100938: 75 1e jne 80100958 <cprintf+0xf8> printint(*argp++, 16, 0); 8010093a: 8b 45 e4 mov -0x1c(%ebp),%eax 8010093d: ba 10 00 00 00 mov $0x10,%edx 80100942: 8d 48 04 lea 0x4(%eax),%ecx 80100945: 8b 00 mov (%eax),%eax 80100947: 89 4d e4 mov %ecx,-0x1c(%ebp) 8010094a: 31 c9 xor %ecx,%ecx 8010094c: e8 2f fe ff ff call 80100780 <printint> break; 80100951: eb 91 jmp 801008e4 <cprintf+0x84> 80100953: 90 nop 80100954: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi consputc('%'); 80100958: b8 25 00 00 00 mov $0x25,%eax 8010095d: 89 55 e0 mov %edx,-0x20(%ebp) 80100960: e8 fb fb ff ff call 80100560 <consputc> consputc(c); 80100965: 8b 55 e0 mov -0x20(%ebp),%edx 80100968: 89 d0 mov %edx,%eax 8010096a: e8 f1 fb ff ff call 80100560 <consputc> break; 8010096f: e9 70 ff ff ff jmp 801008e4 <cprintf+0x84> 80100974: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if ((s = (char*)*argp++) == 0) { 80100978: 8b 45 e4 mov -0x1c(%ebp),%eax 8010097b: 8b 10 mov (%eax),%edx 8010097d: 8d 48 04 lea 0x4(%eax),%ecx 80100980: 89 4d e0 mov %ecx,-0x20(%ebp) 80100983: 85 d2 test %edx,%edx 80100985: 74 49 je 801009d0 <cprintf+0x170> for (; *s; s++) { 80100987: 0f be 02 movsbl (%edx),%eax if ((s = (char*)*argp++) == 0) { 8010098a: 89 4d e4 mov %ecx,-0x1c(%ebp) for (; *s; s++) { 8010098d: 84 c0 test %al,%al 8010098f: 0f 84 4f ff ff ff je 801008e4 <cprintf+0x84> 80100995: 89 5d e4 mov %ebx,-0x1c(%ebp) 80100998: 89 d3 mov %edx,%ebx 8010099a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801009a0: 83 c3 01 add $0x1,%ebx consputc(*s); 801009a3: e8 b8 fb ff ff call 80100560 <consputc> for (; *s; s++) { 801009a8: 0f be 03 movsbl (%ebx),%eax 801009ab: 84 c0 test %al,%al 801009ad: 75 f1 jne 801009a0 <cprintf+0x140> if ((s = (char*)*argp++) == 0) { 801009af: 8b 45 e0 mov -0x20(%ebp),%eax 801009b2: 8b 5d e4 mov -0x1c(%ebp),%ebx 801009b5: 89 45 e4 mov %eax,-0x1c(%ebp) 801009b8: e9 27 ff ff ff jmp 801008e4 <cprintf+0x84> 801009bd: 8d 76 00 lea 0x0(%esi),%esi consputc('%'); 801009c0: b8 25 00 00 00 mov $0x25,%eax 801009c5: e8 96 fb ff ff call 80100560 <consputc> break; 801009ca: e9 15 ff ff ff jmp 801008e4 <cprintf+0x84> 801009cf: 90 nop s = "(null)"; 801009d0: ba 78 7b 10 80 mov $0x80107b78,%edx for (; *s; s++) { 801009d5: 89 5d e4 mov %ebx,-0x1c(%ebp) 801009d8: b8 28 00 00 00 mov $0x28,%eax 801009dd: 89 d3 mov %edx,%ebx 801009df: eb bf jmp 801009a0 <cprintf+0x140> 801009e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi acquire(&cons.lock); 801009e8: 83 ec 0c sub $0xc,%esp 801009eb: 68 20 c5 10 80 push $0x8010c520 801009f0: e8 4b 44 00 00 call 80104e40 <acquire> 801009f5: 83 c4 10 add $0x10,%esp 801009f8: e9 7c fe ff ff jmp 80100879 <cprintf+0x19> panic("null fmt"); 801009fd: 83 ec 0c sub $0xc,%esp 80100a00: 68 7f 7b 10 80 push $0x80107b7f 80100a05: e8 d6 fa ff ff call 801004e0 <panic> 80100a0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100a10 <consoleget>: int consoleget(void) { 80100a10: 55 push %ebp 80100a11: 89 e5 mov %esp,%ebp 80100a13: 83 ec 24 sub $0x24,%esp acquire(&cons.lock); 80100a16: 68 20 c5 10 80 push $0x8010c520 80100a1b: e8 20 44 00 00 call 80104e40 <acquire> while ((c = kbdgetc()) <= 0) { 80100a20: 83 c4 10 add $0x10,%esp 80100a23: eb 05 jmp 80100a2a <consoleget+0x1a> 80100a25: 8d 76 00 lea 0x0(%esi),%esi if (c == 0) { 80100a28: 74 26 je 80100a50 <consoleget+0x40> while ((c = kbdgetc()) <= 0) { 80100a2a: e8 d1 25 00 00 call 80103000 <kbdgetc> 80100a2f: 83 f8 00 cmp $0x0,%eax 80100a32: 7e f4 jle 80100a28 <consoleget+0x18> release(&cons.lock); 80100a34: 83 ec 0c sub $0xc,%esp 80100a37: 89 45 f4 mov %eax,-0xc(%ebp) 80100a3a: 68 20 c5 10 80 push $0x8010c520 80100a3f: e8 bc 44 00 00 call 80104f00 <release> } 80100a44: 8b 45 f4 mov -0xc(%ebp),%eax 80100a47: c9 leave 80100a48: c3 ret 80100a49: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi c = kbdgetc(); 80100a50: e8 ab 25 00 00 call 80103000 <kbdgetc> 80100a55: eb d3 jmp 80100a2a <consoleget+0x1a> 80100a57: 89 f6 mov %esi,%esi 80100a59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100a60 <consoleintr>: void consoleintr(int (*getc)(void)) { 80100a60: 55 push %ebp 80100a61: 89 e5 mov %esp,%ebp 80100a63: 57 push %edi 80100a64: 56 push %esi 80100a65: 53 push %ebx int c, doprocdump = 0; 80100a66: 31 f6 xor %esi,%esi void consoleintr(int (*getc)(void)) { 80100a68: 83 ec 18 sub $0x18,%esp 80100a6b: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&cons.lock); 80100a6e: 68 20 c5 10 80 push $0x8010c520 80100a73: e8 c8 43 00 00 call 80104e40 <acquire> while ((c = getc()) >= 0) { 80100a78: 83 c4 10 add $0x10,%esp 80100a7b: 90 nop 80100a7c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100a80: ff d3 call *%ebx 80100a82: 85 c0 test %eax,%eax 80100a84: 89 c7 mov %eax,%edi 80100a86: 78 48 js 80100ad0 <consoleintr+0x70> switch (c) { 80100a88: 83 ff 10 cmp $0x10,%edi 80100a8b: 0f 84 e7 00 00 00 je 80100b78 <consoleintr+0x118> 80100a91: 7e 5d jle 80100af0 <consoleintr+0x90> 80100a93: 83 ff 15 cmp $0x15,%edi 80100a96: 0f 84 ec 00 00 00 je 80100b88 <consoleintr+0x128> 80100a9c: 83 ff 7f cmp $0x7f,%edi 80100a9f: 75 54 jne 80100af5 <consoleintr+0x95> if (input.e != input.w) { 80100aa1: a1 88 27 11 80 mov 0x80112788,%eax 80100aa6: 3b 05 84 27 11 80 cmp 0x80112784,%eax 80100aac: 74 d2 je 80100a80 <consoleintr+0x20> input.e--; 80100aae: 83 e8 01 sub $0x1,%eax 80100ab1: a3 88 27 11 80 mov %eax,0x80112788 consputc(BACKSPACE); 80100ab6: b8 00 01 00 00 mov $0x100,%eax 80100abb: e8 a0 fa ff ff call 80100560 <consputc> while ((c = getc()) >= 0) { 80100ac0: ff d3 call *%ebx 80100ac2: 85 c0 test %eax,%eax 80100ac4: 89 c7 mov %eax,%edi 80100ac6: 79 c0 jns 80100a88 <consoleintr+0x28> 80100ac8: 90 nop 80100ac9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi release(&cons.lock); 80100ad0: 83 ec 0c sub $0xc,%esp 80100ad3: 68 20 c5 10 80 push $0x8010c520 80100ad8: e8 23 44 00 00 call 80104f00 <release> if (doprocdump) { 80100add: 83 c4 10 add $0x10,%esp 80100ae0: 85 f6 test %esi,%esi 80100ae2: 0f 85 f8 00 00 00 jne 80100be0 <consoleintr+0x180> } 80100ae8: 8d 65 f4 lea -0xc(%ebp),%esp 80100aeb: 5b pop %ebx 80100aec: 5e pop %esi 80100aed: 5f pop %edi 80100aee: 5d pop %ebp 80100aef: c3 ret switch (c) { 80100af0: 83 ff 08 cmp $0x8,%edi 80100af3: 74 ac je 80100aa1 <consoleintr+0x41> if (c != 0 && input.e - input.r < INPUT_BUF) { 80100af5: 85 ff test %edi,%edi 80100af7: 74 87 je 80100a80 <consoleintr+0x20> 80100af9: a1 88 27 11 80 mov 0x80112788,%eax 80100afe: 89 c2 mov %eax,%edx 80100b00: 2b 15 80 27 11 80 sub 0x80112780,%edx 80100b06: 83 fa 7f cmp $0x7f,%edx 80100b09: 0f 87 71 ff ff ff ja 80100a80 <consoleintr+0x20> 80100b0f: 8d 50 01 lea 0x1(%eax),%edx 80100b12: 83 e0 7f and $0x7f,%eax c = (c == '\r') ? '\n' : c; 80100b15: 83 ff 0d cmp $0xd,%edi input.buf[input.e++ % INPUT_BUF] = c; 80100b18: 89 15 88 27 11 80 mov %edx,0x80112788 c = (c == '\r') ? '\n' : c; 80100b1e: 0f 84 cc 00 00 00 je 80100bf0 <consoleintr+0x190> input.buf[input.e++ % INPUT_BUF] = c; 80100b24: 89 f9 mov %edi,%ecx 80100b26: 88 88 00 27 11 80 mov %cl,-0x7feed900(%eax) consputc(c); 80100b2c: 89 f8 mov %edi,%eax 80100b2e: e8 2d fa ff ff call 80100560 <consputc> if (c == '\n' || c == C('D') || input.e == input.r + INPUT_BUF) { 80100b33: 83 ff 0a cmp $0xa,%edi 80100b36: 0f 84 c5 00 00 00 je 80100c01 <consoleintr+0x1a1> 80100b3c: 83 ff 04 cmp $0x4,%edi 80100b3f: 0f 84 bc 00 00 00 je 80100c01 <consoleintr+0x1a1> 80100b45: a1 80 27 11 80 mov 0x80112780,%eax 80100b4a: 83 e8 80 sub $0xffffff80,%eax 80100b4d: 39 05 88 27 11 80 cmp %eax,0x80112788 80100b53: 0f 85 27 ff ff ff jne 80100a80 <consoleintr+0x20> wakeup(&input.r); 80100b59: 83 ec 0c sub $0xc,%esp input.w = input.e; 80100b5c: a3 84 27 11 80 mov %eax,0x80112784 wakeup(&input.r); 80100b61: 68 80 27 11 80 push $0x80112780 80100b66: e8 c5 3e 00 00 call 80104a30 <wakeup> 80100b6b: 83 c4 10 add $0x10,%esp 80100b6e: e9 0d ff ff ff jmp 80100a80 <consoleintr+0x20> 80100b73: 90 nop 80100b74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi doprocdump = 1; 80100b78: be 01 00 00 00 mov $0x1,%esi 80100b7d: e9 fe fe ff ff jmp 80100a80 <consoleintr+0x20> 80100b82: 8d b6 00 00 00 00 lea 0x0(%esi),%esi while (input.e != input.w && 80100b88: a1 88 27 11 80 mov 0x80112788,%eax 80100b8d: 39 05 84 27 11 80 cmp %eax,0x80112784 80100b93: 75 2b jne 80100bc0 <consoleintr+0x160> 80100b95: e9 e6 fe ff ff jmp 80100a80 <consoleintr+0x20> 80100b9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi input.e--; 80100ba0: a3 88 27 11 80 mov %eax,0x80112788 consputc(BACKSPACE); 80100ba5: b8 00 01 00 00 mov $0x100,%eax 80100baa: e8 b1 f9 ff ff call 80100560 <consputc> while (input.e != input.w && 80100baf: a1 88 27 11 80 mov 0x80112788,%eax 80100bb4: 3b 05 84 27 11 80 cmp 0x80112784,%eax 80100bba: 0f 84 c0 fe ff ff je 80100a80 <consoleintr+0x20> input.buf[(input.e - 1) % INPUT_BUF] != '\n') { 80100bc0: 83 e8 01 sub $0x1,%eax 80100bc3: 89 c2 mov %eax,%edx 80100bc5: 83 e2 7f and $0x7f,%edx while (input.e != input.w && 80100bc8: 80 ba 00 27 11 80 0a cmpb $0xa,-0x7feed900(%edx) 80100bcf: 75 cf jne 80100ba0 <consoleintr+0x140> 80100bd1: e9 aa fe ff ff jmp 80100a80 <consoleintr+0x20> 80100bd6: 8d 76 00 lea 0x0(%esi),%esi 80100bd9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } 80100be0: 8d 65 f4 lea -0xc(%ebp),%esp 80100be3: 5b pop %ebx 80100be4: 5e pop %esi 80100be5: 5f pop %edi 80100be6: 5d pop %ebp procdump(); // now call procdump() wo. cons.lock held 80100be7: e9 24 3f 00 00 jmp 80104b10 <procdump> 80100bec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi input.buf[input.e++ % INPUT_BUF] = c; 80100bf0: c6 80 00 27 11 80 0a movb $0xa,-0x7feed900(%eax) consputc(c); 80100bf7: b8 0a 00 00 00 mov $0xa,%eax 80100bfc: e8 5f f9 ff ff call 80100560 <consputc> 80100c01: a1 88 27 11 80 mov 0x80112788,%eax 80100c06: e9 4e ff ff ff jmp 80100b59 <consoleintr+0xf9> 80100c0b: 90 nop 80100c0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100c10 <consoleinit>: void consoleinit(void) { 80100c10: 55 push %ebp 80100c11: 89 e5 mov %esp,%ebp 80100c13: 83 ec 10 sub $0x10,%esp initlock(&cons.lock, "console"); 80100c16: 68 88 7b 10 80 push $0x80107b88 80100c1b: 68 20 c5 10 80 push $0x8010c520 80100c20: e8 db 40 00 00 call 80104d00 <initlock> ioapicenable(IRQ_KBD, 0); 80100c25: 58 pop %eax 80100c26: 5a pop %edx 80100c27: 6a 00 push $0x0 80100c29: 6a 01 push $0x1 devsw[CONSOLE].write = consolewrite; 80100c2b: c7 05 4c 31 11 80 00 movl $0x80100800,0x8011314c 80100c32: 08 10 80 devsw[CONSOLE].read = consoleread; 80100c35: c7 05 48 31 11 80 60 movl $0x80100360,0x80113148 80100c3c: 03 10 80 cons.locking = 1; 80100c3f: c7 05 54 c5 10 80 01 movl $0x1,0x8010c554 80100c46: 00 00 00 ioapicenable(IRQ_KBD, 0); 80100c49: e8 52 21 00 00 call 80102da0 <ioapicenable> } 80100c4e: 83 c4 10 add $0x10,%esp 80100c51: c9 leave 80100c52: c3 ret 80100c53: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100c60 <consolevgaplane>: void consolevgaplane(uchar plane) { 80100c60: 55 push %ebp 80100c61: b8 04 00 00 00 mov $0x4,%eax 80100c66: ba ce 03 00 00 mov $0x3ce,%edx 80100c6b: 89 e5 mov %esp,%ebp plane &= 3; 80100c6d: 0f b6 4d 08 movzbl 0x8(%ebp),%ecx 80100c71: 83 e1 03 and $0x3,%ecx 80100c74: ee out %al,(%dx) 80100c75: ba cf 03 00 00 mov $0x3cf,%edx 80100c7a: 89 c8 mov %ecx,%eax 80100c7c: ee out %al,(%dx) 80100c7d: b8 02 00 00 00 mov $0x2,%eax 80100c82: ba c4 03 00 00 mov $0x3c4,%edx 80100c87: ee out %al,(%dx) planeMask = 1 << plane; 80100c88: b8 01 00 00 00 mov $0x1,%eax 80100c8d: ba c5 03 00 00 mov $0x3c5,%edx 80100c92: d3 e0 shl %cl,%eax 80100c94: ee out %al,(%dx) } 80100c95: 5d pop %ebp 80100c96: c3 ret 80100c97: 89 f6 mov %esi,%esi 80100c99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100ca0 <snapshotWrite>: { 80100ca0: 55 push %ebp 80100ca1: 89 e5 mov %esp,%ebp } 80100ca3: 5d pop %ebp 80100ca4: c3 ret 80100ca5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100ca9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100cb0 <snapshotTextRestore>: { 80100cb0: 55 push %ebp 80100cb1: b9 00 80 0b 80 mov $0x800b8000,%ecx for (i = 0; i < 2000; i++) //Loop through the entire register values in our snapshot 80100cb6: 31 c0 xor %eax,%eax { 80100cb8: 89 e5 mov %esp,%ebp 80100cba: 56 push %esi 80100cbb: 53 push %ebx 80100cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi crt[i] = (consoleSnapshot.registerCopy[i] & 0xff) | 0x0700; 80100cc0: 0f b6 90 24 1f 11 80 movzbl -0x7feee0dc(%eax),%edx for (i = 0; i < 2000; i++) //Loop through the entire register values in our snapshot 80100cc7: 83 c0 01 add $0x1,%eax 80100cca: 83 c1 02 add $0x2,%ecx crt[i] = (consoleSnapshot.registerCopy[i] & 0xff) | 0x0700; 80100ccd: 80 ce 07 or $0x7,%dh 80100cd0: 66 89 51 fe mov %dx,-0x2(%ecx) for (i = 0; i < 2000; i++) //Loop through the entire register values in our snapshot 80100cd4: 3d d0 07 00 00 cmp $0x7d0,%eax 80100cd9: 75 e5 jne 80100cc0 <snapshotTextRestore+0x10> 80100cdb: be d4 03 00 00 mov $0x3d4,%esi int pos = consoleSnapshot.cursorPos; 80100ce0: 8b 0d 20 1f 11 80 mov 0x80111f20,%ecx 80100ce6: b8 0e 00 00 00 mov $0xe,%eax 80100ceb: 89 f2 mov %esi,%edx 80100ced: ee out %al,(%dx) 80100cee: bb d5 03 00 00 mov $0x3d5,%ebx outb(CRTPORT + 1, pos >> 8); 80100cf3: 89 c8 mov %ecx,%eax 80100cf5: c1 f8 08 sar $0x8,%eax 80100cf8: 89 da mov %ebx,%edx 80100cfa: ee out %al,(%dx) 80100cfb: b8 0f 00 00 00 mov $0xf,%eax 80100d00: 89 f2 mov %esi,%edx 80100d02: ee out %al,(%dx) 80100d03: 89 c8 mov %ecx,%eax 80100d05: 89 da mov %ebx,%edx 80100d07: ee out %al,(%dx) } 80100d08: 5b pop %ebx 80100d09: 5e pop %esi 80100d0a: 5d pop %ebp 80100d0b: c3 ret 80100d0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80100d10 <snapshotTextTake>: if(currentvgamode==0x03) //Only take the snapshot if we are in 0x03 80100d10: 83 3d c0 a0 10 80 03 cmpl $0x3,0x8010a0c0 { 80100d17: 55 push %ebp 80100d18: 89 e5 mov %esp,%ebp if(currentvgamode==0x03) //Only take the snapshot if we are in 0x03 80100d1a: 74 04 je 80100d20 <snapshotTextTake+0x10> } 80100d1c: 5d pop %ebp 80100d1d: c3 ret 80100d1e: 66 90 xchg %ax,%ax 80100d20: 5d pop %ebp 80100d21: e9 5a f7 ff ff jmp 80100480 <snapshotTextTake.part.0> 80100d26: 8d 76 00 lea 0x0(%esi),%esi 80100d29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80100d30 <writeFont>: void writeFont(uchar * fontBuffer, unsigned int fontHeight) { 80100d30: 55 push %ebp 80100d31: b8 02 00 00 00 mov $0x2,%eax 80100d36: ba c4 03 00 00 mov $0x3c4,%edx 80100d3b: 89 e5 mov %esp,%ebp 80100d3d: 57 push %edi 80100d3e: 56 push %esi 80100d3f: 53 push %ebx 80100d40: 83 ec 1c sub $0x1c,%esp 80100d43: 8b 5d 08 mov 0x8(%ebp),%ebx 80100d46: 8b 75 0c mov 0xc(%ebp),%esi 80100d49: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100d4a: ba c5 03 00 00 mov $0x3c5,%edx 80100d4f: ec in (%dx),%al asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100d50: ba c4 03 00 00 mov $0x3c4,%edx asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100d55: 88 45 e7 mov %al,-0x19(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100d58: b8 04 00 00 00 mov $0x4,%eax 80100d5d: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100d5e: ba c5 03 00 00 mov $0x3c5,%edx 80100d63: ec in (%dx),%al outb(VGA_SEQ_INDEX, 2); seq2 = inb(VGA_SEQ_DATA); outb(VGA_SEQ_INDEX, 4); seq4 = inb(VGA_SEQ_DATA); outb(VGA_SEQ_DATA, seq4 | 0x04); 80100d64: 89 c1 mov %eax,%ecx 80100d66: 88 45 e6 mov %al,-0x1a(%ebp) 80100d69: 83 c9 04 or $0x4,%ecx 80100d6c: 89 c8 mov %ecx,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100d6e: ee out %al,(%dx) 80100d6f: bf ce 03 00 00 mov $0x3ce,%edi 80100d74: b8 04 00 00 00 mov $0x4,%eax 80100d79: 89 fa mov %edi,%edx 80100d7b: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100d7c: b9 cf 03 00 00 mov $0x3cf,%ecx 80100d81: 89 ca mov %ecx,%edx 80100d83: ec in (%dx),%al 80100d84: 88 45 e5 mov %al,-0x1b(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100d87: 89 fa mov %edi,%edx 80100d89: b8 05 00 00 00 mov $0x5,%eax 80100d8e: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100d8f: 89 ca mov %ecx,%edx 80100d91: ec in (%dx),%al 80100d92: 88 45 e4 mov %al,-0x1c(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100d95: 83 e0 ef and $0xffffffef,%eax 80100d98: ee out %al,(%dx) 80100d99: b8 06 00 00 00 mov $0x6,%eax 80100d9e: 89 fa mov %edi,%edx 80100da0: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100da1: 89 ca mov %ecx,%edx 80100da3: ec in (%dx),%al 80100da4: 88 45 e3 mov %al,-0x1d(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80100da7: 83 e0 fd and $0xfffffffd,%eax 80100daa: ee out %al,(%dx) 80100dab: b8 04 00 00 00 mov $0x4,%eax 80100db0: 89 fa mov %edi,%edx 80100db2: ee out %al,(%dx) 80100db3: b8 02 00 00 00 mov $0x2,%eax 80100db8: 89 ca mov %ecx,%edx 80100dba: ee out %al,(%dx) 80100dbb: ba c4 03 00 00 mov $0x3c4,%edx 80100dc0: ee out %al,(%dx) 80100dc1: b8 04 00 00 00 mov $0x4,%eax 80100dc6: ba c5 03 00 00 mov $0x3c5,%edx 80100dcb: ee out %al,(%dx) gc6 = inb(VGA_GC_DATA); outb(VGA_GC_DATA, gc6 & ~0x02); consolevgaplane(2); // Write font to video memory fontBase = (uchar*)P2V(0xB8000); 80100dcc: bf 00 80 0b 80 mov $0x800b8000,%edi 80100dd1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for (i = 0; i < 256; i++) { memmove((ushort*)fontBase, fontBuffer, fontHeight); 80100dd8: 83 ec 04 sub $0x4,%esp 80100ddb: 56 push %esi 80100ddc: 53 push %ebx fontBase += 32; fontBuffer += fontHeight; 80100ddd: 01 f3 add %esi,%ebx memmove((ushort*)fontBase, fontBuffer, fontHeight); 80100ddf: 57 push %edi fontBase += 32; 80100de0: 83 c7 20 add $0x20,%edi memmove((ushort*)fontBase, fontBuffer, fontHeight); 80100de3: e8 18 42 00 00 call 80105000 <memmove> for (i = 0; i < 256; i++) 80100de8: 83 c4 10 add $0x10,%esp 80100deb: 81 ff 00 a0 0b 80 cmp $0x800ba000,%edi 80100df1: 75 e5 jne 80100dd8 <writeFont+0xa8> 80100df3: be c4 03 00 00 mov $0x3c4,%esi 80100df8: b8 02 00 00 00 mov $0x2,%eax 80100dfd: 89 f2 mov %esi,%edx 80100dff: ee out %al,(%dx) 80100e00: bb c5 03 00 00 mov $0x3c5,%ebx 80100e05: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 80100e09: 89 da mov %ebx,%edx 80100e0b: ee out %al,(%dx) 80100e0c: b9 04 00 00 00 mov $0x4,%ecx 80100e11: 89 f2 mov %esi,%edx 80100e13: 89 c8 mov %ecx,%eax 80100e15: ee out %al,(%dx) 80100e16: 0f b6 45 e6 movzbl -0x1a(%ebp),%eax 80100e1a: 89 da mov %ebx,%edx 80100e1c: ee out %al,(%dx) 80100e1d: bb ce 03 00 00 mov $0x3ce,%ebx 80100e22: 89 c8 mov %ecx,%eax 80100e24: 89 da mov %ebx,%edx 80100e26: ee out %al,(%dx) 80100e27: b9 cf 03 00 00 mov $0x3cf,%ecx 80100e2c: 0f b6 45 e5 movzbl -0x1b(%ebp),%eax 80100e30: 89 ca mov %ecx,%edx 80100e32: ee out %al,(%dx) 80100e33: b8 05 00 00 00 mov $0x5,%eax 80100e38: 89 da mov %ebx,%edx 80100e3a: ee out %al,(%dx) 80100e3b: 0f b6 45 e4 movzbl -0x1c(%ebp),%eax 80100e3f: 89 ca mov %ecx,%edx 80100e41: ee out %al,(%dx) 80100e42: b8 06 00 00 00 mov $0x6,%eax 80100e47: 89 da mov %ebx,%edx 80100e49: ee out %al,(%dx) 80100e4a: 0f b6 45 e3 movzbl -0x1d(%ebp),%eax 80100e4e: 89 ca mov %ecx,%edx 80100e50: ee out %al,(%dx) outb(VGA_GC_DATA, gc4); outb(VGA_GC_INDEX, 5); outb(VGA_GC_DATA, gc5); outb(VGA_GC_INDEX, 6); outb(VGA_GC_DATA, gc6); } 80100e51: 8d 65 f4 lea -0xc(%ebp),%esp 80100e54: 5b pop %ebx 80100e55: 5e pop %esi 80100e56: 5f pop %edi 80100e57: 5d pop %ebp 80100e58: c3 ret 80100e59: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100e60 <consolevgamode>: * Currently, only these modes are supported: * 0x03: 80x25 text mode. * 0x12: 640x480x16 graphics mode. * 0x13: 320x200x256 graphics mode. */ int consolevgamode(int vgamode) { 80100e60: 55 push %ebp 80100e61: 89 e5 mov %esp,%ebp 80100e63: 56 push %esi 80100e64: 53 push %ebx 80100e65: 8b 45 08 mov 0x8(%ebp),%eax //acquire(&cons.lock); int errorcode = -1; switch (vgamode) 80100e68: 83 f8 12 cmp $0x12,%eax 80100e6b: 0f 84 cf 00 00 00 je 80100f40 <consolevgamode+0xe0> 80100e71: 83 f8 13 cmp $0x13,%eax 80100e74: 0f 84 96 00 00 00 je 80100f10 <consolevgamode+0xb0> 80100e7a: 83 f8 03 cmp $0x3,%eax 80100e7d: 74 0c je 80100e8b <consolevgamode+0x2b> } //release(&cons.lock); return errorcode; } 80100e7f: 8d 65 f8 lea -0x8(%ebp),%esp int errorcode = -1; 80100e82: b8 ff ff ff ff mov $0xffffffff,%eax } 80100e87: 5b pop %ebx 80100e88: 5e pop %esi 80100e89: 5d pop %ebp 80100e8a: c3 ret writeVideoRegisters(registers_80x25_text); 80100e8b: b8 80 a0 10 80 mov $0x8010a080,%eax 80100e90: e8 db f3 ff ff call 80100270 <writeVideoRegisters> writeFont(font_8x16, 16); 80100e95: 83 ec 08 sub $0x8,%esp 80100e98: 6a 10 push $0x10 80100e9a: 68 00 90 10 80 push $0x80109000 80100e9f: e8 8c fe ff ff call 80100d30 <writeFont> 80100ea4: 83 c4 10 add $0x10,%esp 80100ea7: b9 00 80 0b 80 mov $0x800b8000,%ecx for (i = 0; i < 2000; i++) //Loop through the entire register values in our snapshot 80100eac: 31 c0 xor %eax,%eax 80100eae: 66 90 xchg %ax,%ax crt[i] = (consoleSnapshot.registerCopy[i] & 0xff) | 0x0700; 80100eb0: 0f b6 90 24 1f 11 80 movzbl -0x7feee0dc(%eax),%edx for (i = 0; i < 2000; i++) //Loop through the entire register values in our snapshot 80100eb7: 83 c0 01 add $0x1,%eax 80100eba: 83 c1 02 add $0x2,%ecx crt[i] = (consoleSnapshot.registerCopy[i] & 0xff) | 0x0700; 80100ebd: 80 ce 07 or $0x7,%dh 80100ec0: 66 89 51 fe mov %dx,-0x2(%ecx) for (i = 0; i < 2000; i++) //Loop through the entire register values in our snapshot 80100ec4: 3d d0 07 00 00 cmp $0x7d0,%eax 80100ec9: 75 e5 jne 80100eb0 <consolevgamode+0x50> 80100ecb: be d4 03 00 00 mov $0x3d4,%esi int pos = consoleSnapshot.cursorPos; 80100ed0: 8b 0d 20 1f 11 80 mov 0x80111f20,%ecx 80100ed6: b8 0e 00 00 00 mov $0xe,%eax 80100edb: 89 f2 mov %esi,%edx 80100edd: ee out %al,(%dx) 80100ede: bb d5 03 00 00 mov $0x3d5,%ebx outb(CRTPORT + 1, pos >> 8); 80100ee3: 89 c8 mov %ecx,%eax 80100ee5: c1 f8 08 sar $0x8,%eax 80100ee8: 89 da mov %ebx,%edx 80100eea: ee out %al,(%dx) 80100eeb: b8 0f 00 00 00 mov $0xf,%eax 80100ef0: 89 f2 mov %esi,%edx 80100ef2: ee out %al,(%dx) 80100ef3: 89 c8 mov %ecx,%eax 80100ef5: 89 da mov %ebx,%edx 80100ef7: ee out %al,(%dx) currentvgamode = 0x03; 80100ef8: c7 05 c0 a0 10 80 03 movl $0x3,0x8010a0c0 80100eff: 00 00 00 } 80100f02: 8d 65 f8 lea -0x8(%ebp),%esp errorcode = 0; 80100f05: 31 c0 xor %eax,%eax } 80100f07: 5b pop %ebx 80100f08: 5e pop %esi 80100f09: 5d pop %ebp 80100f0a: c3 ret 80100f0b: 90 nop 80100f0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if(currentvgamode==0x03) //Only take the snapshot if we are in 0x03 80100f10: 83 3d c0 a0 10 80 03 cmpl $0x3,0x8010a0c0 80100f17: 74 54 je 80100f6d <consolevgamode+0x10d> writeVideoRegisters(registers_320x200x256); 80100f19: b8 40 a0 10 80 mov $0x8010a040,%eax 80100f1e: e8 4d f3 ff ff call 80100270 <writeVideoRegisters> currentvgamode = 0x13; 80100f23: c7 05 c0 a0 10 80 13 movl $0x13,0x8010a0c0 80100f2a: 00 00 00 } 80100f2d: 8d 65 f8 lea -0x8(%ebp),%esp errorcode = 0; 80100f30: 31 c0 xor %eax,%eax } 80100f32: 5b pop %ebx 80100f33: 5e pop %esi 80100f34: 5d pop %ebp 80100f35: c3 ret 80100f36: 8d 76 00 lea 0x0(%esi),%esi 80100f39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if(currentvgamode==0x03) //Only take the snapshot if we are in 0x03 80100f40: 83 3d c0 a0 10 80 03 cmpl $0x3,0x8010a0c0 80100f47: 74 1d je 80100f66 <consolevgamode+0x106> writeVideoRegisters(registers_640x480x16); 80100f49: b8 00 a0 10 80 mov $0x8010a000,%eax 80100f4e: e8 1d f3 ff ff call 80100270 <writeVideoRegisters> currentvgamode = 0x12; 80100f53: c7 05 c0 a0 10 80 12 movl $0x12,0x8010a0c0 80100f5a: 00 00 00 } 80100f5d: 8d 65 f8 lea -0x8(%ebp),%esp errorcode = 0; 80100f60: 31 c0 xor %eax,%eax } 80100f62: 5b pop %ebx 80100f63: 5e pop %esi 80100f64: 5d pop %ebp 80100f65: c3 ret 80100f66: e8 15 f5 ff ff call 80100480 <snapshotTextTake.part.0> 80100f6b: eb dc jmp 80100f49 <consolevgamode+0xe9> 80100f6d: e8 0e f5 ff ff call 80100480 <snapshotTextTake.part.0> 80100f72: eb a5 jmp 80100f19 <consolevgamode+0xb9> 80100f74: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80100f7a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80100f80 <consolevgabuffer>: * http://www.osdever.net/FreeVGA/vga/vgamem.htm will give you more insight into what is going on. * * Returns a pointer to the virtual address (NOT the physical address) associated with the current * video plane. */ uchar* consolevgabuffer() { 80100f80: 55 push %ebp 80100f81: b8 06 00 00 00 mov $0x6,%eax 80100f86: ba ce 03 00 00 mov $0x3ce,%edx 80100f8b: 89 e5 mov %esp,%ebp 80100f8d: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80100f8e: ba cf 03 00 00 mov $0x3cf,%edx 80100f93: ec in (%dx),%al 80100f94: 89 c2 mov %eax,%edx 80100f96: b8 00 00 0b 80 mov $0x800b0000,%eax uchar plane; outb(VGA_GC_INDEX, 6); plane = inb(VGA_GC_DATA); plane >>= 2; 80100f9b: c0 ea 02 shr $0x2,%dl plane &= 3; 80100f9e: 83 e2 03 and $0x3,%edx switch (plane) 80100fa1: 80 fa 02 cmp $0x2,%dl 80100fa4: 74 10 je 80100fb6 <consolevgabuffer+0x36> { case 0: case 1: base = (uchar*)P2V(0xA0000); 80100fa6: 80 fa 03 cmp $0x3,%dl 80100fa9: b8 00 80 0b 80 mov $0x800b8000,%eax 80100fae: ba 00 00 0a 80 mov $0x800a0000,%edx 80100fb3: 0f 45 c2 cmovne %edx,%eax base = (uchar*)P2V(0xB8000); break; } return base; } 80100fb6: 5d pop %ebp 80100fb7: c3 ret 80100fb8: 90 nop 80100fb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100fc0 <binaryStuff>: //Function to find the binary value from an x_position - Used for setting pixels int binaryStuff(int x_pos) { 80100fc0: 55 push %ebp 80100fc1: 89 e5 mov %esp,%ebp 80100fc3: 8b 45 08 mov 0x8(%ebp),%eax switch (x_pos % 8) 80100fc6: 89 c1 mov %eax,%ecx 80100fc8: c1 f9 1f sar $0x1f,%ecx 80100fcb: c1 e9 1d shr $0x1d,%ecx 80100fce: 8d 14 08 lea (%eax,%ecx,1),%edx 80100fd1: b8 ff ff ff ff mov $0xffffffff,%eax 80100fd6: 83 e2 07 and $0x7,%edx 80100fd9: 29 ca sub %ecx,%edx 80100fdb: 83 fa 07 cmp $0x7,%edx 80100fde: 77 07 ja 80100fe7 <binaryStuff+0x27> 80100fe0: 8b 04 95 a0 7b 10 80 mov -0x7fef8460(,%edx,4),%eax return 2; case 7: return 1; } return -1; } 80100fe7: 5d pop %ebp 80100fe8: c3 ret 80100fe9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80100ff0 <setpixel>: //int pos_x, int pos_y, int VGA_COLOR int setpixel(int pos_x, int pos_y, int VGA_COLOR) { 80100ff0: 55 push %ebp 80100ff1: 89 e5 mov %esp,%ebp 80100ff3: 57 push %edi 80100ff4: 56 push %esi 80100ff5: 53 push %ebx 80100ff6: 83 ec 2c sub $0x2c,%esp if (currentvgamode == 0x13) // Memory location of pixel = A0000 + 320 * y + x 80100ff9: 8b 15 c0 a0 10 80 mov 0x8010a0c0,%edx { 80100fff: 8b 45 10 mov 0x10(%ebp),%eax if (currentvgamode == 0x13) // Memory location of pixel = A0000 + 320 * y + x 80101002: 83 fa 13 cmp $0x13,%edx 80101005: 0f 84 25 03 00 00 je 80101330 <setpixel+0x340> { memset(VGA_0x13_MEMORY + VGA_0x13_WIDTH * pos_y + pos_x, VGA_COLOR, 1); } else if (currentvgamode == 0x12) //640x480 (307200) 8010100b: 83 fa 12 cmp $0x12,%edx 8010100e: 74 10 je 80101020 <setpixel+0x30> else // Don't draw anything if we aren't in a drawing mode { return 0; } return 0; } 80101010: 8d 65 f4 lea -0xc(%ebp),%esp 80101013: 31 c0 xor %eax,%eax 80101015: 5b pop %ebx 80101016: 5e pop %esi 80101017: 5f pop %edi 80101018: 5d pop %ebp 80101019: c3 ret 8010101a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi switch (x_pos % 8) 80101020: 8b 4d 08 mov 0x8(%ebp),%ecx 80101023: 8b 55 08 mov 0x8(%ebp),%edx 80101026: bb ff ff ff ff mov $0xffffffff,%ebx 8010102b: c1 f9 1f sar $0x1f,%ecx 8010102e: c1 e9 1d shr $0x1d,%ecx 80101031: 01 ca add %ecx,%edx 80101033: 83 e2 07 and $0x7,%edx 80101036: 29 ca sub %ecx,%edx 80101038: 83 fa 07 cmp $0x7,%edx 8010103b: 0f 86 17 02 00 00 jbe 80101258 <setpixel+0x268> if ((colourAsInt-8) >= 0) 80101041: 83 f8 07 cmp $0x7,%eax bool BIT3 = false, BIT2 = false, BIT1 = false, BIT0 = false; 80101044: c6 45 d6 00 movb $0x0,-0x2a(%ebp) if ((colourAsInt-8) >= 0) 80101048: 7e 07 jle 80101051 <setpixel+0x61> colourAsInt -= 8; 8010104a: 83 e8 08 sub $0x8,%eax BIT0 = true;//Plane 0; // Set Least significant bit 8010104d: c6 45 d6 01 movb $0x1,-0x2a(%ebp) if ((colourAsInt-4) >= 0) 80101051: 83 f8 03 cmp $0x3,%eax bool BIT3 = false, BIT2 = false, BIT1 = false, BIT0 = false; 80101054: c6 45 d7 00 movb $0x0,-0x29(%ebp) if ((colourAsInt-4) >= 0) 80101058: 7e 07 jle 80101061 <setpixel+0x71> colourAsInt -= 4; 8010105a: 83 e8 04 sub $0x4,%eax BIT1 = true;// Plane 1; 8010105d: c6 45 d7 01 movb $0x1,-0x29(%ebp) if ((colourAsInt-2) >= 0) 80101061: 83 f8 01 cmp $0x1,%eax 80101064: 0f 8e 0e 02 00 00 jle 80101278 <setpixel+0x288> 8010106a: 8b 7d 0c mov 0xc(%ebp),%edi 8010106d: 8d 14 bf lea (%edi,%edi,4),%edx 80101070: 8d 7d e4 lea -0x1c(%ebp),%edi 80101073: c1 e2 07 shl $0x7,%edx 80101076: 03 55 08 add 0x8(%ebp),%edx 80101079: 8d 4a 07 lea 0x7(%edx),%ecx 8010107c: 85 d2 test %edx,%edx 8010107e: 0f 48 d1 cmovs %ecx,%edx 80101081: c1 fa 03 sar $0x3,%edx if ((colourAsInt-1) >= 0) 80101084: 83 f8 02 cmp $0x2,%eax 80101087: 89 55 d0 mov %edx,-0x30(%ebp) 8010108a: 0f 85 d0 02 00 00 jne 80101360 <setpixel+0x370> asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80101090: be ce 03 00 00 mov $0x3ce,%esi 80101095: b8 04 00 00 00 mov $0x4,%eax 8010109a: 89 f2 mov %esi,%edx 8010109c: ee out %al,(%dx) 8010109d: b9 cf 03 00 00 mov $0x3cf,%ecx 801010a2: b8 01 00 00 00 mov $0x1,%eax 801010a7: 89 ca mov %ecx,%edx 801010a9: ee out %al,(%dx) 801010aa: b8 02 00 00 00 mov $0x2,%eax 801010af: ba c4 03 00 00 mov $0x3c4,%edx 801010b4: ee out %al,(%dx) 801010b5: ba c5 03 00 00 mov $0x3c5,%edx 801010ba: ee out %al,(%dx) 801010bb: b8 06 00 00 00 mov $0x6,%eax 801010c0: 89 f2 mov %esi,%edx 801010c2: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801010c3: 89 ca mov %ecx,%edx 801010c5: ec in (%dx),%al plane >>= 2; 801010c6: c0 e8 02 shr $0x2,%al base = (uchar*)P2V(0xB0000); 801010c9: be 00 00 0b 80 mov $0x800b0000,%esi plane &= 3; 801010ce: 83 e0 03 and $0x3,%eax switch (plane) 801010d1: 3c 02 cmp $0x2,%al 801010d3: 74 0f je 801010e4 <setpixel+0xf4> base = (uchar*)P2V(0xA0000); 801010d5: 3c 03 cmp $0x3,%al 801010d7: be 00 80 0b 80 mov $0x800b8000,%esi 801010dc: b8 00 00 0a 80 mov $0x800a0000,%eax 801010e1: 0f 45 f0 cmovne %eax,%esi targetByte = memoryPointer + ((640 * pos_y + pos_x) /8); 801010e4: 03 75 d0 add -0x30(%ebp),%esi memmove(ptrByteFromMemory, targetByte, 8); 801010e7: 83 ec 04 sub $0x4,%esp 801010ea: 6a 08 push $0x8 801010ec: 56 push %esi 801010ed: 57 push %edi 801010ee: e8 0d 3f 00 00 call 80105000 <memmove> byteFromMemory += BitAddition; 801010f3: 8b 45 e4 mov -0x1c(%ebp),%eax memset(targetByte, byteFromMemory, 1); 801010f6: 83 c4 0c add $0xc,%esp 801010f9: 6a 01 push $0x1 byteFromMemory += BitAddition; 801010fb: 01 d8 add %ebx,%eax memset(targetByte, byteFromMemory, 1); 801010fd: 50 push %eax 801010fe: 56 push %esi byteFromMemory += BitAddition; 801010ff: 89 45 e4 mov %eax,-0x1c(%ebp) memset(targetByte, byteFromMemory, 1); 80101102: e8 49 3e 00 00 call 80104f50 <memset> 80101107: 83 c4 10 add $0x10,%esp if (BIT1) 8010110a: 80 7d d7 00 cmpb $0x0,-0x29(%ebp) 8010110e: 0f 84 95 00 00 00 je 801011a9 <setpixel+0x1b9> asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80101114: bf 04 00 00 00 mov $0x4,%edi 80101119: be ce 03 00 00 mov $0x3ce,%esi 8010111e: 89 f8 mov %edi,%eax 80101120: 89 f2 mov %esi,%edx 80101122: ee out %al,(%dx) 80101123: b9 cf 03 00 00 mov $0x3cf,%ecx 80101128: b8 02 00 00 00 mov $0x2,%eax 8010112d: 89 ca mov %ecx,%edx 8010112f: ee out %al,(%dx) 80101130: ba c4 03 00 00 mov $0x3c4,%edx 80101135: ee out %al,(%dx) 80101136: ba c5 03 00 00 mov $0x3c5,%edx 8010113b: 89 f8 mov %edi,%eax 8010113d: ee out %al,(%dx) 8010113e: b8 06 00 00 00 mov $0x6,%eax 80101143: 89 f2 mov %esi,%edx 80101145: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80101146: 89 ca mov %ecx,%edx 80101148: ec in (%dx),%al plane >>= 2; 80101149: c0 e8 02 shr $0x2,%al base = (uchar*)P2V(0xB0000); 8010114c: ba 00 00 0b 80 mov $0x800b0000,%edx plane &= 3; 80101151: 83 e0 03 and $0x3,%eax switch (plane) 80101154: 3c 02 cmp $0x2,%al 80101156: 74 11 je 80101169 <setpixel+0x179> base = (uchar*)P2V(0xA0000); 80101158: 3c 03 cmp $0x3,%al 8010115a: be 00 80 0b 80 mov $0x800b8000,%esi 8010115f: b8 00 00 0a 80 mov $0x800a0000,%eax 80101164: 0f 44 c6 cmove %esi,%eax 80101167: 89 c2 mov %eax,%edx targetByte = memoryPointer + ((640 * pos_y + pos_x) /8); 80101169: 8b 45 0c mov 0xc(%ebp),%eax 8010116c: 8d 04 80 lea (%eax,%eax,4),%eax 8010116f: c1 e0 07 shl $0x7,%eax 80101172: 03 45 08 add 0x8(%ebp),%eax 80101175: 8d 70 07 lea 0x7(%eax),%esi 80101178: 85 c0 test %eax,%eax 8010117a: 0f 48 c6 cmovs %esi,%eax memmove(ptrByteFromMemory, targetByte, 8); 8010117d: 83 ec 04 sub $0x4,%esp targetByte = memoryPointer + ((640 * pos_y + pos_x) /8); 80101180: c1 f8 03 sar $0x3,%eax memmove(ptrByteFromMemory, targetByte, 8); 80101183: 6a 08 push $0x8 targetByte = memoryPointer + ((640 * pos_y + pos_x) /8); 80101185: 8d 34 02 lea (%edx,%eax,1),%esi memmove(ptrByteFromMemory, targetByte, 8); 80101188: 8d 45 e4 lea -0x1c(%ebp),%eax 8010118b: 56 push %esi 8010118c: 50 push %eax 8010118d: e8 6e 3e 00 00 call 80105000 <memmove> byteFromMemory += BitAddition; 80101192: 8b 45 e4 mov -0x1c(%ebp),%eax memset(targetByte, byteFromMemory, 1); 80101195: 83 c4 0c add $0xc,%esp 80101198: 6a 01 push $0x1 byteFromMemory += BitAddition; 8010119a: 01 d8 add %ebx,%eax memset(targetByte, byteFromMemory, 1); 8010119c: 50 push %eax 8010119d: 56 push %esi byteFromMemory += BitAddition; 8010119e: 89 45 e4 mov %eax,-0x1c(%ebp) memset(targetByte, byteFromMemory, 1); 801011a1: e8 aa 3d 00 00 call 80104f50 <memset> 801011a6: 83 c4 10 add $0x10,%esp if (BIT0) 801011a9: 80 7d d6 00 cmpb $0x0,-0x2a(%ebp) 801011ad: 0f 84 5d fe ff ff je 80101010 <setpixel+0x20> asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801011b3: be ce 03 00 00 mov $0x3ce,%esi 801011b8: b8 04 00 00 00 mov $0x4,%eax 801011bd: 89 f2 mov %esi,%edx 801011bf: ee out %al,(%dx) 801011c0: b9 cf 03 00 00 mov $0x3cf,%ecx 801011c5: b8 03 00 00 00 mov $0x3,%eax 801011ca: 89 ca mov %ecx,%edx 801011cc: ee out %al,(%dx) 801011cd: b8 02 00 00 00 mov $0x2,%eax 801011d2: ba c4 03 00 00 mov $0x3c4,%edx 801011d7: ee out %al,(%dx) 801011d8: b8 08 00 00 00 mov $0x8,%eax 801011dd: ba c5 03 00 00 mov $0x3c5,%edx 801011e2: ee out %al,(%dx) 801011e3: b8 06 00 00 00 mov $0x6,%eax 801011e8: 89 f2 mov %esi,%edx 801011ea: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801011eb: 89 ca mov %ecx,%edx 801011ed: ec in (%dx),%al plane >>= 2; 801011ee: c0 e8 02 shr $0x2,%al base = (uchar*)P2V(0xB0000); 801011f1: ba 00 00 0b 80 mov $0x800b0000,%edx plane &= 3; 801011f6: 83 e0 03 and $0x3,%eax switch (plane) 801011f9: 3c 02 cmp $0x2,%al 801011fb: 74 0f je 8010120c <setpixel+0x21c> base = (uchar*)P2V(0xA0000); 801011fd: 3c 03 cmp $0x3,%al 801011ff: ba 00 80 0b 80 mov $0x800b8000,%edx 80101204: b8 00 00 0a 80 mov $0x800a0000,%eax 80101209: 0f 45 d0 cmovne %eax,%edx targetByte = memoryPointer + ((640 * pos_y + pos_x) /8); 8010120c: 8b 45 0c mov 0xc(%ebp),%eax 8010120f: 8d 04 80 lea (%eax,%eax,4),%eax 80101212: c1 e0 07 shl $0x7,%eax 80101215: 03 45 08 add 0x8(%ebp),%eax 80101218: 8d 48 07 lea 0x7(%eax),%ecx 8010121b: 85 c0 test %eax,%eax 8010121d: 0f 48 c1 cmovs %ecx,%eax memmove(ptrByteFromMemory, targetByte, 8); 80101220: 83 ec 04 sub $0x4,%esp targetByte = memoryPointer + ((640 * pos_y + pos_x) /8); 80101223: c1 f8 03 sar $0x3,%eax memmove(ptrByteFromMemory, targetByte, 8); 80101226: 6a 08 push $0x8 targetByte = memoryPointer + ((640 * pos_y + pos_x) /8); 80101228: 8d 34 02 lea (%edx,%eax,1),%esi memmove(ptrByteFromMemory, targetByte, 8); 8010122b: 8d 45 e4 lea -0x1c(%ebp),%eax 8010122e: 56 push %esi 8010122f: 50 push %eax 80101230: e8 cb 3d 00 00 call 80105000 <memmove> byteFromMemory += BitAddition; 80101235: 03 5d e4 add -0x1c(%ebp),%ebx memset(targetByte, byteFromMemory, 1); 80101238: 83 c4 0c add $0xc,%esp 8010123b: 6a 01 push $0x1 8010123d: 53 push %ebx 8010123e: 56 push %esi byteFromMemory += BitAddition; 8010123f: 89 5d e4 mov %ebx,-0x1c(%ebp) memset(targetByte, byteFromMemory, 1); 80101242: e8 09 3d 00 00 call 80104f50 <memset> 80101247: 83 c4 10 add $0x10,%esp } 8010124a: 8d 65 f4 lea -0xc(%ebp),%esp 8010124d: 31 c0 xor %eax,%eax 8010124f: 5b pop %ebx 80101250: 5e pop %esi 80101251: 5f pop %edi 80101252: 5d pop %ebp 80101253: c3 ret 80101254: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if ((colourAsInt-8) >= 0) 80101258: 83 f8 07 cmp $0x7,%eax 8010125b: 8b 1c 95 a0 7b 10 80 mov -0x7fef8460(,%edx,4),%ebx bool BIT3 = false, BIT2 = false, BIT1 = false, BIT0 = false; 80101262: c6 45 d6 00 movb $0x0,-0x2a(%ebp) if ((colourAsInt-8) >= 0) 80101266: 0f 8e e5 fd ff ff jle 80101051 <setpixel+0x61> 8010126c: e9 d9 fd ff ff jmp 8010104a <setpixel+0x5a> 80101271: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if ((colourAsInt-1) >= 0) 80101278: 0f 85 8c fe ff ff jne 8010110a <setpixel+0x11a> 8010127e: 8b 45 0c mov 0xc(%ebp),%eax bool BIT3 = false, BIT2 = false, BIT1 = false, BIT0 = false; 80101281: c6 45 d5 00 movb $0x0,-0x2b(%ebp) 80101285: 8d 04 80 lea (%eax,%eax,4),%eax 80101288: c1 e0 07 shl $0x7,%eax 8010128b: 03 45 08 add 0x8(%ebp),%eax 8010128e: 8d 50 07 lea 0x7(%eax),%edx 80101291: 85 c0 test %eax,%eax 80101293: 0f 48 c2 cmovs %edx,%eax 80101296: c1 f8 03 sar $0x3,%eax 80101299: 89 45 d0 mov %eax,-0x30(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 8010129c: bf ce 03 00 00 mov $0x3ce,%edi 801012a1: b8 04 00 00 00 mov $0x4,%eax 801012a6: 89 fa mov %edi,%edx 801012a8: ee out %al,(%dx) 801012a9: b9 cf 03 00 00 mov $0x3cf,%ecx 801012ae: 31 c0 xor %eax,%eax 801012b0: 89 ca mov %ecx,%edx 801012b2: ee out %al,(%dx) 801012b3: b8 02 00 00 00 mov $0x2,%eax 801012b8: ba c4 03 00 00 mov $0x3c4,%edx 801012bd: ee out %al,(%dx) 801012be: b8 01 00 00 00 mov $0x1,%eax 801012c3: ba c5 03 00 00 mov $0x3c5,%edx 801012c8: ee out %al,(%dx) 801012c9: b8 06 00 00 00 mov $0x6,%eax 801012ce: 89 fa mov %edi,%edx 801012d0: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801012d1: 89 ca mov %ecx,%edx 801012d3: ec in (%dx),%al plane >>= 2; 801012d4: c0 e8 02 shr $0x2,%al base = (uchar*)P2V(0xB0000); 801012d7: ba 00 00 0b 80 mov $0x800b0000,%edx plane &= 3; 801012dc: 83 e0 03 and $0x3,%eax switch (plane) 801012df: 3c 02 cmp $0x2,%al 801012e1: 74 0f je 801012f2 <setpixel+0x302> base = (uchar*)P2V(0xA0000); 801012e3: 3c 03 cmp $0x3,%al 801012e5: ba 00 80 0b 80 mov $0x800b8000,%edx 801012ea: b8 00 00 0a 80 mov $0x800a0000,%eax 801012ef: 0f 45 d0 cmovne %eax,%edx targetByte = memoryPointer + (640 * pos_y + pos_x) /8; 801012f2: 8b 45 d0 mov -0x30(%ebp),%eax memmove(ptrByteFromMemory, targetByte, 8); 801012f5: 8d 7d e4 lea -0x1c(%ebp),%edi 801012f8: 83 ec 04 sub $0x4,%esp 801012fb: 6a 08 push $0x8 targetByte = memoryPointer + (640 * pos_y + pos_x) /8; 801012fd: 8d 34 02 lea (%edx,%eax,1),%esi memmove(ptrByteFromMemory, targetByte, 8); 80101300: 56 push %esi 80101301: 57 push %edi 80101302: e8 f9 3c 00 00 call 80105000 <memmove> byteFromMemory += BitAddition; 80101307: 8b 45 e4 mov -0x1c(%ebp),%eax memset(targetByte, byteFromMemory, 1); 8010130a: 83 c4 0c add $0xc,%esp 8010130d: 6a 01 push $0x1 byteFromMemory += BitAddition; 8010130f: 01 d8 add %ebx,%eax memset(targetByte, byteFromMemory, 1); 80101311: 50 push %eax 80101312: 56 push %esi byteFromMemory += BitAddition; 80101313: 89 45 e4 mov %eax,-0x1c(%ebp) memset(targetByte, byteFromMemory, 1); 80101316: e8 35 3c 00 00 call 80104f50 <memset> if (BIT2) 8010131b: 83 c4 10 add $0x10,%esp 8010131e: 80 7d d5 00 cmpb $0x0,-0x2b(%ebp) 80101322: 0f 84 e2 fd ff ff je 8010110a <setpixel+0x11a> 80101328: e9 63 fd ff ff jmp 80101090 <setpixel+0xa0> 8010132d: 8d 76 00 lea 0x0(%esi),%esi memset(VGA_0x13_MEMORY + VGA_0x13_WIDTH * pos_y + pos_x, VGA_COLOR, 1); 80101330: 83 ec 04 sub $0x4,%esp 80101333: 8b 5d 08 mov 0x8(%ebp),%ebx 80101336: 6a 01 push $0x1 80101338: 50 push %eax 80101339: 8b 45 0c mov 0xc(%ebp),%eax 8010133c: 8d 04 80 lea (%eax,%eax,4),%eax 8010133f: c1 e0 06 shl $0x6,%eax 80101342: 8d 84 03 00 00 0a 80 lea -0x7ff60000(%ebx,%eax,1),%eax 80101349: 50 push %eax 8010134a: e8 01 3c 00 00 call 80104f50 <memset> 8010134f: 83 c4 10 add $0x10,%esp } 80101352: 8d 65 f4 lea -0xc(%ebp),%esp 80101355: 31 c0 xor %eax,%eax 80101357: 5b pop %ebx 80101358: 5e pop %esi 80101359: 5f pop %edi 8010135a: 5d pop %ebp 8010135b: c3 ret 8010135c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi BIT2 = true;//Plane 2; 80101360: c6 45 d5 01 movb $0x1,-0x2b(%ebp) 80101364: e9 33 ff ff ff jmp 8010129c <setpixel+0x2ac> 80101369: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101370 <zeroFillScreen13h>: //Set the screen to black if we are in 13h void zeroFillScreen13h() { 80101370: 55 push %ebp 80101371: b8 00 00 0a 80 mov $0x800a0000,%eax 80101376: 89 e5 mov %esp,%ebp 80101378: 90 nop 80101379: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ushort* memoryPointer = VGA_0x13_MEMORY; for (i = 0; i < 64000; i++) //Loop through the entire register { memoryPointer[i] = (0); 80101380: 31 d2 xor %edx,%edx 80101382: 83 c0 02 add $0x2,%eax 80101385: 66 89 50 fe mov %dx,-0x2(%eax) for (i = 0; i < 64000; i++) //Loop through the entire register 80101389: 3d 00 f4 0b 80 cmp $0x800bf400,%eax 8010138e: 75 f0 jne 80101380 <zeroFillScreen13h+0x10> } } 80101390: 5d pop %ebp 80101391: c3 ret 80101392: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101399: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801013a0 <zeroFillScreen12h>: //Set the screen to black if we are in 12h. void zeroFillScreen12h() { 801013a0: 55 push %ebp 801013a1: 89 e5 mov %esp,%ebp 801013a3: 57 push %edi 801013a4: 56 push %esi 801013a5: 53 push %ebx 801013a6: 83 ec 1c sub $0x1c,%esp unsigned int pos_X, pos_Y; unsigned int planeNo; uchar* memoryPointer; for (planeNo = 0; planeNo < 4; planeNo++) 801013a9: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801013b0: b8 04 00 00 00 mov $0x4,%eax 801013b5: ba ce 03 00 00 mov $0x3ce,%edx 801013ba: ee out %al,(%dx) 801013bb: 8b 4d e0 mov -0x20(%ebp),%ecx 801013be: bb cf 03 00 00 mov $0x3cf,%ebx 801013c3: 89 da mov %ebx,%edx 801013c5: 89 c8 mov %ecx,%eax 801013c7: ee out %al,(%dx) 801013c8: b8 02 00 00 00 mov $0x2,%eax 801013cd: ba c4 03 00 00 mov $0x3c4,%edx 801013d2: ee out %al,(%dx) planeMask = 1 << plane; 801013d3: b8 01 00 00 00 mov $0x1,%eax 801013d8: ba c5 03 00 00 mov $0x3c5,%edx 801013dd: d3 e0 shl %cl,%eax 801013df: ee out %al,(%dx) 801013e0: b8 06 00 00 00 mov $0x6,%eax 801013e5: ba ce 03 00 00 mov $0x3ce,%edx 801013ea: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801013eb: 89 da mov %ebx,%edx 801013ed: ec in (%dx),%al plane >>= 2; 801013ee: c0 e8 02 shr $0x2,%al base = (uchar*)P2V(0xB0000); 801013f1: be 00 00 0b 80 mov $0x800b0000,%esi plane &= 3; 801013f6: 83 e0 03 and $0x3,%eax switch (plane) 801013f9: 3c 02 cmp $0x2,%al 801013fb: 74 0f je 8010140c <zeroFillScreen12h+0x6c> base = (uchar*)P2V(0xA0000); 801013fd: 3c 03 cmp $0x3,%al 801013ff: be 00 80 0b 80 mov $0x800b8000,%esi 80101404: b8 00 00 0a 80 mov $0x800a0000,%eax 80101409: 0f 45 f0 cmovne %eax,%esi 8010140c: 8d 86 80 02 00 00 lea 0x280(%esi),%eax 80101412: 89 45 e4 mov %eax,-0x1c(%ebp) 80101415: 8d 76 00 lea 0x0(%esi),%esi 80101418: 8d 9e 00 b0 04 00 lea 0x4b000(%esi),%ebx base = (uchar*)P2V(0xB0000); 8010141e: 89 f7 mov %esi,%edi for (pos_Y = 0; pos_Y < 480; pos_Y++) //480 - Loop through every Y value on each row { memset(memoryPointer + (640) * pos_Y +pos_X, 0, 1); //pass in 255 (0xFF) to fill the entire byte 80101420: 83 ec 04 sub $0x4,%esp 80101423: 6a 01 push $0x1 80101425: 6a 00 push $0x0 80101427: 57 push %edi 80101428: 81 c7 80 02 00 00 add $0x280,%edi 8010142e: e8 1d 3b 00 00 call 80104f50 <memset> for (pos_Y = 0; pos_Y < 480; pos_Y++) //480 - Loop through every Y value on each row 80101433: 83 c4 10 add $0x10,%esp 80101436: 39 fb cmp %edi,%ebx 80101438: 75 e6 jne 80101420 <zeroFillScreen12h+0x80> 8010143a: 83 c6 01 add $0x1,%esi for (pos_X = 0; pos_X < 640; pos_X++) // 640 - Loop through every x value 8010143d: 3b 75 e4 cmp -0x1c(%ebp),%esi 80101440: 75 d6 jne 80101418 <zeroFillScreen12h+0x78> for (planeNo = 0; planeNo < 4; planeNo++) 80101442: 83 45 e0 01 addl $0x1,-0x20(%ebp) 80101446: 8b 45 e0 mov -0x20(%ebp),%eax 80101449: 83 f8 04 cmp $0x4,%eax 8010144c: 0f 85 5e ff ff ff jne 801013b0 <zeroFillScreen12h+0x10> } } } } 80101452: 8d 65 f4 lea -0xc(%ebp),%esp 80101455: 5b pop %ebx 80101456: 5e pop %esi 80101457: 5f pop %edi 80101458: 5d pop %ebp 80101459: c3 ret 8010145a: 66 90 xchg %ax,%ax 8010145c: 66 90 xchg %ax,%ax 8010145e: 66 90 xchg %ax,%ax 80101460 <cleanupexec>: #include "proc.h" #include "defs.h" #include "x86.h" #include "elf.h" void cleanupexec(pde_t * pgdir, struct inode *ip) { 80101460: 55 push %ebp 80101461: 89 e5 mov %esp,%ebp 80101463: 53 push %ebx 80101464: 83 ec 04 sub $0x4,%esp 80101467: 8b 45 08 mov 0x8(%ebp),%eax 8010146a: 8b 5d 0c mov 0xc(%ebp),%ebx if (pgdir) { 8010146d: 85 c0 test %eax,%eax 8010146f: 74 0c je 8010147d <cleanupexec+0x1d> freevm(pgdir); 80101471: 83 ec 0c sub $0xc,%esp 80101474: 50 push %eax 80101475: e8 66 63 00 00 call 801077e0 <freevm> 8010147a: 83 c4 10 add $0x10,%esp } if (ip) { 8010147d: 85 db test %ebx,%ebx 8010147f: 74 1f je 801014a0 <cleanupexec+0x40> iunlockput(ip); 80101481: 83 ec 0c sub $0xc,%esp 80101484: 53 push %ebx 80101485: e8 56 0f 00 00 call 801023e0 <iunlockput> end_op(); 8010148a: 83 c4 10 add $0x10,%esp } } 8010148d: 8b 5d fc mov -0x4(%ebp),%ebx 80101490: c9 leave end_op(); 80101491: e9 4a 22 00 00 jmp 801036e0 <end_op> 80101496: 8d 76 00 lea 0x0(%esi),%esi 80101499: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi } 801014a0: 8b 5d fc mov -0x4(%ebp),%ebx 801014a3: c9 leave 801014a4: c3 ret 801014a5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801014a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801014b0 <exec>: int exec(char *path, char **argv) { 801014b0: 55 push %ebp 801014b1: 89 e5 mov %esp,%ebp 801014b3: 57 push %edi 801014b4: 56 push %esi 801014b5: 53 push %ebx 801014b6: 81 ec 0c 01 00 00 sub $0x10c,%esp uint argc, sz, sp, ustack[3 + MAXARG + 1]; struct elfhdr elf; struct inode *ip; struct proghdr ph; pde_t *pgdir, *oldpgdir; struct proc *curproc = myproc(); 801014bc: e8 1f 2e 00 00 call 801042e0 <myproc> 801014c1: 89 85 ec fe ff ff mov %eax,-0x114(%ebp) begin_op(); 801014c7: e8 a4 21 00 00 call 80103670 <begin_op> if ((ip = namei(path)) == 0) { 801014cc: 83 ec 0c sub $0xc,%esp 801014cf: ff 75 08 pushl 0x8(%ebp) 801014d2: e8 d9 14 00 00 call 801029b0 <namei> 801014d7: 83 c4 10 add $0x10,%esp 801014da: 85 c0 test %eax,%eax 801014dc: 0f 84 2e 03 00 00 je 80101810 <exec+0x360> end_op(); cprintf("exec: fail\n"); return -1; } ilock(ip); 801014e2: 83 ec 0c sub $0xc,%esp 801014e5: 89 c6 mov %eax,%esi 801014e7: 50 push %eax 801014e8: e8 63 0c 00 00 call 80102150 <ilock> pgdir = 0; // Check ELF header if (readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf)) { 801014ed: 8d 85 24 ff ff ff lea -0xdc(%ebp),%eax 801014f3: 6a 34 push $0x34 801014f5: 6a 00 push $0x0 801014f7: 50 push %eax 801014f8: 56 push %esi 801014f9: e8 32 0f 00 00 call 80102430 <readi> 801014fe: 83 c4 20 add $0x20,%esp 80101501: 83 f8 34 cmp $0x34,%eax 80101504: 0f 85 c0 02 00 00 jne 801017ca <exec+0x31a> cleanupexec(pgdir, ip); return -1; } if (elf.magic != ELF_MAGIC) { 8010150a: 81 bd 24 ff ff ff 7f cmpl $0x464c457f,-0xdc(%ebp) 80101511: 45 4c 46 80101514: 0f 85 b0 02 00 00 jne 801017ca <exec+0x31a> cleanupexec(pgdir, ip); return -1; } if ((pgdir = setupkvm()) == 0) { 8010151a: e8 41 63 00 00 call 80107860 <setupkvm> 8010151f: 85 c0 test %eax,%eax 80101521: 89 85 f4 fe ff ff mov %eax,-0x10c(%ebp) 80101527: 0f 84 9d 02 00 00 je 801017ca <exec+0x31a> cleanupexec(pgdir, ip); return -1; } // Load program into memory. sz = 0; 8010152d: 31 ff xor %edi,%edi for (i = 0, off = elf.phoff; i < elf.phnum; i++, off += sizeof(ph)) { 8010152f: 66 83 bd 50 ff ff ff cmpw $0x0,-0xb0(%ebp) 80101536: 00 80101537: 8b 85 40 ff ff ff mov -0xc0(%ebp),%eax 8010153d: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80101543: 0f 84 99 02 00 00 je 801017e2 <exec+0x332> 80101549: 31 db xor %ebx,%ebx 8010154b: eb 7d jmp 801015ca <exec+0x11a> 8010154d: 8d 76 00 lea 0x0(%esi),%esi if (readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) { cleanupexec(pgdir, ip); return -1; } if (ph.type != ELF_PROG_LOAD) { 80101550: 83 bd 04 ff ff ff 01 cmpl $0x1,-0xfc(%ebp) 80101557: 75 63 jne 801015bc <exec+0x10c> continue; } if (ph.memsz < ph.filesz) { 80101559: 8b 85 18 ff ff ff mov -0xe8(%ebp),%eax 8010155f: 3b 85 14 ff ff ff cmp -0xec(%ebp),%eax 80101565: 0f 82 86 00 00 00 jb 801015f1 <exec+0x141> 8010156b: 03 85 0c ff ff ff add -0xf4(%ebp),%eax 80101571: 72 7e jb 801015f1 <exec+0x141> } if (ph.vaddr + ph.memsz < ph.vaddr) { cleanupexec(pgdir, ip); return -1; } if ((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0) { 80101573: 83 ec 04 sub $0x4,%esp 80101576: 50 push %eax 80101577: 57 push %edi 80101578: ff b5 f4 fe ff ff pushl -0x10c(%ebp) 8010157e: e8 fd 60 00 00 call 80107680 <allocuvm> 80101583: 83 c4 10 add $0x10,%esp 80101586: 85 c0 test %eax,%eax 80101588: 89 c7 mov %eax,%edi 8010158a: 74 65 je 801015f1 <exec+0x141> cleanupexec(pgdir, ip); return -1; } if (ph.vaddr % PGSIZE != 0) { 8010158c: 8b 85 0c ff ff ff mov -0xf4(%ebp),%eax 80101592: a9 ff 0f 00 00 test $0xfff,%eax 80101597: 75 58 jne 801015f1 <exec+0x141> cleanupexec(pgdir, ip); return -1; } if (loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) { 80101599: 83 ec 0c sub $0xc,%esp 8010159c: ff b5 14 ff ff ff pushl -0xec(%ebp) 801015a2: ff b5 08 ff ff ff pushl -0xf8(%ebp) 801015a8: 56 push %esi 801015a9: 50 push %eax 801015aa: ff b5 f4 fe ff ff pushl -0x10c(%ebp) 801015b0: e8 0b 60 00 00 call 801075c0 <loaduvm> 801015b5: 83 c4 20 add $0x20,%esp 801015b8: 85 c0 test %eax,%eax 801015ba: 78 35 js 801015f1 <exec+0x141> for (i = 0, off = elf.phoff; i < elf.phnum; i++, off += sizeof(ph)) { 801015bc: 0f b7 85 50 ff ff ff movzwl -0xb0(%ebp),%eax 801015c3: 83 c3 01 add $0x1,%ebx 801015c6: 39 d8 cmp %ebx,%eax 801015c8: 7e 46 jle 80101610 <exec+0x160> if (readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) { 801015ca: 89 d8 mov %ebx,%eax 801015cc: 6a 20 push $0x20 801015ce: c1 e0 05 shl $0x5,%eax 801015d1: 03 85 f0 fe ff ff add -0x110(%ebp),%eax 801015d7: 50 push %eax 801015d8: 8d 85 04 ff ff ff lea -0xfc(%ebp),%eax 801015de: 50 push %eax 801015df: 56 push %esi 801015e0: e8 4b 0e 00 00 call 80102430 <readi> 801015e5: 83 c4 10 add $0x10,%esp 801015e8: 83 f8 20 cmp $0x20,%eax 801015eb: 0f 84 5f ff ff ff je 80101550 <exec+0xa0> cleanupexec(pgdir, ip); 801015f1: 83 ec 08 sub $0x8,%esp 801015f4: 56 push %esi 801015f5: ff b5 f4 fe ff ff pushl -0x10c(%ebp) 801015fb: e8 60 fe ff ff call 80101460 <cleanupexec> return -1; 80101600: 83 c4 10 add $0x10,%esp 80101603: b8 ff ff ff ff mov $0xffffffff,%eax curproc->tf->eip = elf.entry; // main curproc->tf->esp = sp; switchuvm(curproc); freevm(oldpgdir); return 0; } 80101608: 8d 65 f4 lea -0xc(%ebp),%esp 8010160b: 5b pop %ebx 8010160c: 5e pop %esi 8010160d: 5f pop %edi 8010160e: 5d pop %ebp 8010160f: c3 ret 80101610: 81 c7 ff 0f 00 00 add $0xfff,%edi 80101616: 81 e7 00 f0 ff ff and $0xfffff000,%edi 8010161c: 8d 9f 00 20 00 00 lea 0x2000(%edi),%ebx iunlockput(ip); 80101622: 83 ec 0c sub $0xc,%esp 80101625: 56 push %esi 80101626: e8 b5 0d 00 00 call 801023e0 <iunlockput> end_op(); 8010162b: e8 b0 20 00 00 call 801036e0 <end_op> if ((sz = allocuvm(pgdir, sz, sz + 2 * PGSIZE)) == 0) { 80101630: 83 c4 0c add $0xc,%esp 80101633: 53 push %ebx 80101634: 57 push %edi 80101635: ff b5 f4 fe ff ff pushl -0x10c(%ebp) 8010163b: e8 40 60 00 00 call 80107680 <allocuvm> 80101640: 83 c4 10 add $0x10,%esp 80101643: 85 c0 test %eax,%eax 80101645: 89 c7 mov %eax,%edi 80101647: 0f 84 8c 00 00 00 je 801016d9 <exec+0x229> clearpteu(pgdir, (char*)(sz - 2 * PGSIZE)); 8010164d: 8d 80 00 e0 ff ff lea -0x2000(%eax),%eax 80101653: 83 ec 08 sub $0x8,%esp for (argc = 0; argv[argc]; argc++) { 80101656: 31 f6 xor %esi,%esi 80101658: 89 fb mov %edi,%ebx clearpteu(pgdir, (char*)(sz - 2 * PGSIZE)); 8010165a: 50 push %eax 8010165b: ff b5 f4 fe ff ff pushl -0x10c(%ebp) 80101661: e8 9a 62 00 00 call 80107900 <clearpteu> for (argc = 0; argv[argc]; argc++) { 80101666: 8b 45 0c mov 0xc(%ebp),%eax 80101669: 83 c4 10 add $0x10,%esp 8010166c: 8b 08 mov (%eax),%ecx 8010166e: 85 c9 test %ecx,%ecx 80101670: 0f 84 76 01 00 00 je 801017ec <exec+0x33c> 80101676: 89 bd f0 fe ff ff mov %edi,-0x110(%ebp) 8010167c: 8b 7d 0c mov 0xc(%ebp),%edi 8010167f: eb 25 jmp 801016a6 <exec+0x1f6> 80101681: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80101688: 8d 46 01 lea 0x1(%esi),%eax ustack[3 + argc] = sp; 8010168b: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 80101691: 89 9c b5 64 ff ff ff mov %ebx,-0x9c(%ebp,%esi,4) for (argc = 0; argv[argc]; argc++) { 80101698: 8b 0c 87 mov (%edi,%eax,4),%ecx 8010169b: 85 c9 test %ecx,%ecx 8010169d: 74 5a je 801016f9 <exec+0x249> if (argc >= MAXARG) { 8010169f: 83 f8 20 cmp $0x20,%eax 801016a2: 74 35 je 801016d9 <exec+0x229> 801016a4: 89 c6 mov %eax,%esi sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 801016a6: 83 ec 0c sub $0xc,%esp 801016a9: 51 push %ecx 801016aa: e8 c1 3a 00 00 call 80105170 <strlen> 801016af: f7 d0 not %eax 801016b1: 01 c3 add %eax,%ebx if (copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) { 801016b3: 58 pop %eax 801016b4: ff 34 b7 pushl (%edi,%esi,4) sp = (sp - (strlen(argv[argc]) + 1)) & ~3; 801016b7: 83 e3 fc and $0xfffffffc,%ebx if (copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0) { 801016ba: e8 b1 3a 00 00 call 80105170 <strlen> 801016bf: 83 c0 01 add $0x1,%eax 801016c2: 50 push %eax 801016c3: ff 34 b7 pushl (%edi,%esi,4) 801016c6: 53 push %ebx 801016c7: ff b5 f4 fe ff ff pushl -0x10c(%ebp) 801016cd: e8 ae 63 00 00 call 80107a80 <copyout> 801016d2: 83 c4 20 add $0x20,%esp 801016d5: 85 c0 test %eax,%eax 801016d7: 79 af jns 80101688 <exec+0x1d8> cleanupexec(pgdir, ip); 801016d9: 83 ec 08 sub $0x8,%esp 801016dc: 6a 00 push $0x0 801016de: ff b5 f4 fe ff ff pushl -0x10c(%ebp) 801016e4: e8 77 fd ff ff call 80101460 <cleanupexec> return -1; 801016e9: 83 c4 10 add $0x10,%esp } 801016ec: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801016ef: b8 ff ff ff ff mov $0xffffffff,%eax } 801016f4: 5b pop %ebx 801016f5: 5e pop %esi 801016f6: 5f pop %edi 801016f7: 5d pop %ebp 801016f8: c3 ret 801016f9: 8b bd f0 fe ff ff mov -0x110(%ebp),%edi 801016ff: 89 85 f0 fe ff ff mov %eax,-0x110(%ebp) 80101705: 8d 46 04 lea 0x4(%esi),%eax 80101708: 8d 34 b5 08 00 00 00 lea 0x8(,%esi,4),%esi 8010170f: 8d 4e 0c lea 0xc(%esi),%ecx ustack[3 + argc] = 0; 80101712: c7 84 85 58 ff ff ff movl $0x0,-0xa8(%ebp,%eax,4) 80101719: 00 00 00 00 ustack[1] = argc; 8010171d: 8b 85 f0 fe ff ff mov -0x110(%ebp),%eax if (copyout(pgdir, sp, ustack, (3 + argc + 1) * 4) < 0) { 80101723: 51 push %ecx 80101724: 52 push %edx ustack[0] = 0xffffffff; // fake return PC 80101725: c7 85 58 ff ff ff ff movl $0xffffffff,-0xa8(%ebp) 8010172c: ff ff ff ustack[1] = argc; 8010172f: 89 85 5c ff ff ff mov %eax,-0xa4(%ebp) ustack[2] = sp - (argc + 1) * 4; // argv pointer 80101735: 89 d8 mov %ebx,%eax sp -= (3 + argc + 1) * 4; 80101737: 29 cb sub %ecx,%ebx if (copyout(pgdir, sp, ustack, (3 + argc + 1) * 4) < 0) { 80101739: 53 push %ebx 8010173a: ff b5 f4 fe ff ff pushl -0x10c(%ebp) ustack[2] = sp - (argc + 1) * 4; // argv pointer 80101740: 29 f0 sub %esi,%eax 80101742: 89 85 60 ff ff ff mov %eax,-0xa0(%ebp) if (copyout(pgdir, sp, ustack, (3 + argc + 1) * 4) < 0) { 80101748: e8 33 63 00 00 call 80107a80 <copyout> 8010174d: 83 c4 10 add $0x10,%esp 80101750: 85 c0 test %eax,%eax 80101752: 78 85 js 801016d9 <exec+0x229> for (last = s = path; *s; s++) { 80101754: 8b 45 08 mov 0x8(%ebp),%eax 80101757: 8b 55 08 mov 0x8(%ebp),%edx 8010175a: 8b 4d 08 mov 0x8(%ebp),%ecx 8010175d: 0f b6 00 movzbl (%eax),%eax 80101760: 84 c0 test %al,%al 80101762: 74 13 je 80101777 <exec+0x2c7> 80101764: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101768: 83 c1 01 add $0x1,%ecx 8010176b: 3c 2f cmp $0x2f,%al 8010176d: 0f b6 01 movzbl (%ecx),%eax 80101770: 0f 44 d1 cmove %ecx,%edx 80101773: 84 c0 test %al,%al 80101775: 75 f1 jne 80101768 <exec+0x2b8> safestrcpy(curproc->name, last, sizeof(curproc->name)); 80101777: 8b b5 ec fe ff ff mov -0x114(%ebp),%esi 8010177d: 83 ec 04 sub $0x4,%esp 80101780: 6a 10 push $0x10 80101782: 52 push %edx 80101783: 8d 46 6c lea 0x6c(%esi),%eax 80101786: 50 push %eax 80101787: e8 a4 39 00 00 call 80105130 <safestrcpy> curproc->pgdir = pgdir; 8010178c: 8b 8d f4 fe ff ff mov -0x10c(%ebp),%ecx oldpgdir = curproc->pgdir; 80101792: 89 f0 mov %esi,%eax 80101794: 8b 76 04 mov 0x4(%esi),%esi curproc->sz = sz; 80101797: 89 38 mov %edi,(%eax) curproc->pgdir = pgdir; 80101799: 89 48 04 mov %ecx,0x4(%eax) curproc->tf->eip = elf.entry; // main 8010179c: 89 c1 mov %eax,%ecx 8010179e: 8b 95 3c ff ff ff mov -0xc4(%ebp),%edx 801017a4: 8b 40 18 mov 0x18(%eax),%eax 801017a7: 89 50 38 mov %edx,0x38(%eax) curproc->tf->esp = sp; 801017aa: 8b 41 18 mov 0x18(%ecx),%eax 801017ad: 89 58 44 mov %ebx,0x44(%eax) switchuvm(curproc); 801017b0: 89 0c 24 mov %ecx,(%esp) 801017b3: e8 78 5c 00 00 call 80107430 <switchuvm> freevm(oldpgdir); 801017b8: 89 34 24 mov %esi,(%esp) 801017bb: e8 20 60 00 00 call 801077e0 <freevm> return 0; 801017c0: 83 c4 10 add $0x10,%esp 801017c3: 31 c0 xor %eax,%eax 801017c5: e9 3e fe ff ff jmp 80101608 <exec+0x158> cleanupexec(pgdir, ip); 801017ca: 83 ec 08 sub $0x8,%esp 801017cd: 56 push %esi 801017ce: 6a 00 push $0x0 801017d0: e8 8b fc ff ff call 80101460 <cleanupexec> return -1; 801017d5: 83 c4 10 add $0x10,%esp 801017d8: b8 ff ff ff ff mov $0xffffffff,%eax 801017dd: e9 26 fe ff ff jmp 80101608 <exec+0x158> for (i = 0, off = elf.phoff; i < elf.phnum; i++, off += sizeof(ph)) { 801017e2: bb 00 20 00 00 mov $0x2000,%ebx 801017e7: e9 36 fe ff ff jmp 80101622 <exec+0x172> for (argc = 0; argv[argc]; argc++) { 801017ec: b9 10 00 00 00 mov $0x10,%ecx 801017f1: be 04 00 00 00 mov $0x4,%esi 801017f6: b8 03 00 00 00 mov $0x3,%eax 801017fb: c7 85 f0 fe ff ff 00 movl $0x0,-0x110(%ebp) 80101802: 00 00 00 80101805: 8d 95 58 ff ff ff lea -0xa8(%ebp),%edx 8010180b: e9 02 ff ff ff jmp 80101712 <exec+0x262> end_op(); 80101810: e8 cb 1e 00 00 call 801036e0 <end_op> cprintf("exec: fail\n"); 80101815: 83 ec 0c sub $0xc,%esp 80101818: 68 d1 7b 10 80 push $0x80107bd1 8010181d: e8 3e f0 ff ff call 80100860 <cprintf> return -1; 80101822: 83 c4 10 add $0x10,%esp 80101825: b8 ff ff ff ff mov $0xffffffff,%eax 8010182a: e9 d9 fd ff ff jmp 80101608 <exec+0x158> 8010182f: 90 nop 80101830 <fileinit>: struct { struct spinlock lock; struct file file[NFILE]; } ftable; void fileinit(void) { 80101830: 55 push %ebp 80101831: 89 e5 mov %esp,%ebp 80101833: 83 ec 10 sub $0x10,%esp initlock(&ftable.lock, "ftable"); 80101836: 68 dd 7b 10 80 push $0x80107bdd 8010183b: 68 a0 27 11 80 push $0x801127a0 80101840: e8 bb 34 00 00 call 80104d00 <initlock> } 80101845: 83 c4 10 add $0x10,%esp 80101848: c9 leave 80101849: c3 ret 8010184a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101850 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 80101850: 55 push %ebp 80101851: 89 e5 mov %esp,%ebp 80101853: 53 push %ebx struct file *f; acquire(&ftable.lock); for (f = ftable.file; f < ftable.file + NFILE; f++) { 80101854: bb d4 27 11 80 mov $0x801127d4,%ebx struct file* filealloc(void) { 80101859: 83 ec 10 sub $0x10,%esp acquire(&ftable.lock); 8010185c: 68 a0 27 11 80 push $0x801127a0 80101861: e8 da 35 00 00 call 80104e40 <acquire> 80101866: 83 c4 10 add $0x10,%esp 80101869: eb 10 jmp 8010187b <filealloc+0x2b> 8010186b: 90 nop 8010186c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for (f = ftable.file; f < ftable.file + NFILE; f++) { 80101870: 83 c3 18 add $0x18,%ebx 80101873: 81 fb 34 31 11 80 cmp $0x80113134,%ebx 80101879: 73 25 jae 801018a0 <filealloc+0x50> if (f->ref == 0) { 8010187b: 8b 43 04 mov 0x4(%ebx),%eax 8010187e: 85 c0 test %eax,%eax 80101880: 75 ee jne 80101870 <filealloc+0x20> f->ref = 1; release(&ftable.lock); 80101882: 83 ec 0c sub $0xc,%esp f->ref = 1; 80101885: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) release(&ftable.lock); 8010188c: 68 a0 27 11 80 push $0x801127a0 80101891: e8 6a 36 00 00 call 80104f00 <release> return f; } } release(&ftable.lock); return 0; } 80101896: 89 d8 mov %ebx,%eax return f; 80101898: 83 c4 10 add $0x10,%esp } 8010189b: 8b 5d fc mov -0x4(%ebp),%ebx 8010189e: c9 leave 8010189f: c3 ret release(&ftable.lock); 801018a0: 83 ec 0c sub $0xc,%esp return 0; 801018a3: 31 db xor %ebx,%ebx release(&ftable.lock); 801018a5: 68 a0 27 11 80 push $0x801127a0 801018aa: e8 51 36 00 00 call 80104f00 <release> } 801018af: 89 d8 mov %ebx,%eax return 0; 801018b1: 83 c4 10 add $0x10,%esp } 801018b4: 8b 5d fc mov -0x4(%ebp),%ebx 801018b7: c9 leave 801018b8: c3 ret 801018b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801018c0 <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 801018c0: 55 push %ebp 801018c1: 89 e5 mov %esp,%ebp 801018c3: 53 push %ebx 801018c4: 83 ec 10 sub $0x10,%esp 801018c7: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ftable.lock); 801018ca: 68 a0 27 11 80 push $0x801127a0 801018cf: e8 6c 35 00 00 call 80104e40 <acquire> if (f->ref < 1) { 801018d4: 8b 43 04 mov 0x4(%ebx),%eax 801018d7: 83 c4 10 add $0x10,%esp 801018da: 85 c0 test %eax,%eax 801018dc: 7e 1a jle 801018f8 <filedup+0x38> panic("filedup"); } f->ref++; 801018de: 83 c0 01 add $0x1,%eax release(&ftable.lock); 801018e1: 83 ec 0c sub $0xc,%esp f->ref++; 801018e4: 89 43 04 mov %eax,0x4(%ebx) release(&ftable.lock); 801018e7: 68 a0 27 11 80 push $0x801127a0 801018ec: e8 0f 36 00 00 call 80104f00 <release> return f; } 801018f1: 89 d8 mov %ebx,%eax 801018f3: 8b 5d fc mov -0x4(%ebp),%ebx 801018f6: c9 leave 801018f7: c3 ret panic("filedup"); 801018f8: 83 ec 0c sub $0xc,%esp 801018fb: 68 e4 7b 10 80 push $0x80107be4 80101900: e8 db eb ff ff call 801004e0 <panic> 80101905: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101909: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101910 <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 80101910: 55 push %ebp 80101911: 89 e5 mov %esp,%ebp 80101913: 57 push %edi 80101914: 56 push %esi 80101915: 53 push %ebx 80101916: 83 ec 28 sub $0x28,%esp 80101919: 8b 5d 08 mov 0x8(%ebp),%ebx struct file ff; acquire(&ftable.lock); 8010191c: 68 a0 27 11 80 push $0x801127a0 80101921: e8 1a 35 00 00 call 80104e40 <acquire> if (f->ref < 1) { 80101926: 8b 43 04 mov 0x4(%ebx),%eax 80101929: 83 c4 10 add $0x10,%esp 8010192c: 85 c0 test %eax,%eax 8010192e: 0f 8e 9b 00 00 00 jle 801019cf <fileclose+0xbf> panic("fileclose"); } if (--f->ref > 0) { 80101934: 83 e8 01 sub $0x1,%eax 80101937: 85 c0 test %eax,%eax 80101939: 89 43 04 mov %eax,0x4(%ebx) 8010193c: 74 1a je 80101958 <fileclose+0x48> release(&ftable.lock); 8010193e: c7 45 08 a0 27 11 80 movl $0x801127a0,0x8(%ebp) else if (ff.type == FD_INODE) { begin_op(); iput(ff.ip); end_op(); } } 80101945: 8d 65 f4 lea -0xc(%ebp),%esp 80101948: 5b pop %ebx 80101949: 5e pop %esi 8010194a: 5f pop %edi 8010194b: 5d pop %ebp release(&ftable.lock); 8010194c: e9 af 35 00 00 jmp 80104f00 <release> 80101951: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ff = *f; 80101958: 0f b6 43 09 movzbl 0x9(%ebx),%eax 8010195c: 8b 3b mov (%ebx),%edi release(&ftable.lock); 8010195e: 83 ec 0c sub $0xc,%esp ff = *f; 80101961: 8b 73 0c mov 0xc(%ebx),%esi f->type = FD_NONE; 80101964: c7 03 00 00 00 00 movl $0x0,(%ebx) ff = *f; 8010196a: 88 45 e7 mov %al,-0x19(%ebp) 8010196d: 8b 43 10 mov 0x10(%ebx),%eax release(&ftable.lock); 80101970: 68 a0 27 11 80 push $0x801127a0 ff = *f; 80101975: 89 45 e0 mov %eax,-0x20(%ebp) release(&ftable.lock); 80101978: e8 83 35 00 00 call 80104f00 <release> if (ff.type == FD_PIPE) { 8010197d: 83 c4 10 add $0x10,%esp 80101980: 83 ff 01 cmp $0x1,%edi 80101983: 74 13 je 80101998 <fileclose+0x88> else if (ff.type == FD_INODE) { 80101985: 83 ff 02 cmp $0x2,%edi 80101988: 74 26 je 801019b0 <fileclose+0xa0> } 8010198a: 8d 65 f4 lea -0xc(%ebp),%esp 8010198d: 5b pop %ebx 8010198e: 5e pop %esi 8010198f: 5f pop %edi 80101990: 5d pop %ebp 80101991: c3 ret 80101992: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pipeclose(ff.pipe, ff.writable); 80101998: 0f be 5d e7 movsbl -0x19(%ebp),%ebx 8010199c: 83 ec 08 sub $0x8,%esp 8010199f: 53 push %ebx 801019a0: 56 push %esi 801019a1: e8 9a 24 00 00 call 80103e40 <pipeclose> 801019a6: 83 c4 10 add $0x10,%esp 801019a9: eb df jmp 8010198a <fileclose+0x7a> 801019ab: 90 nop 801019ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi begin_op(); 801019b0: e8 bb 1c 00 00 call 80103670 <begin_op> iput(ff.ip); 801019b5: 83 ec 0c sub $0xc,%esp 801019b8: ff 75 e0 pushl -0x20(%ebp) 801019bb: e8 c0 08 00 00 call 80102280 <iput> end_op(); 801019c0: 83 c4 10 add $0x10,%esp } 801019c3: 8d 65 f4 lea -0xc(%ebp),%esp 801019c6: 5b pop %ebx 801019c7: 5e pop %esi 801019c8: 5f pop %edi 801019c9: 5d pop %ebp end_op(); 801019ca: e9 11 1d 00 00 jmp 801036e0 <end_op> panic("fileclose"); 801019cf: 83 ec 0c sub $0xc,%esp 801019d2: 68 ec 7b 10 80 push $0x80107bec 801019d7: e8 04 eb ff ff call 801004e0 <panic> 801019dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801019e0 <filestat>: // Get metadata about file f. int filestat(struct file *f, struct stat *st) { 801019e0: 55 push %ebp 801019e1: 89 e5 mov %esp,%ebp 801019e3: 53 push %ebx 801019e4: 83 ec 04 sub $0x4,%esp 801019e7: 8b 5d 08 mov 0x8(%ebp),%ebx if (f->type == FD_INODE) { 801019ea: 83 3b 02 cmpl $0x2,(%ebx) 801019ed: 75 31 jne 80101a20 <filestat+0x40> ilock(f->ip); 801019ef: 83 ec 0c sub $0xc,%esp 801019f2: ff 73 10 pushl 0x10(%ebx) 801019f5: e8 56 07 00 00 call 80102150 <ilock> stati(f->ip, st); 801019fa: 58 pop %eax 801019fb: 5a pop %edx 801019fc: ff 75 0c pushl 0xc(%ebp) 801019ff: ff 73 10 pushl 0x10(%ebx) 80101a02: e8 f9 09 00 00 call 80102400 <stati> iunlock(f->ip); 80101a07: 59 pop %ecx 80101a08: ff 73 10 pushl 0x10(%ebx) 80101a0b: e8 20 08 00 00 call 80102230 <iunlock> return 0; 80101a10: 83 c4 10 add $0x10,%esp 80101a13: 31 c0 xor %eax,%eax } return -1; } 80101a15: 8b 5d fc mov -0x4(%ebp),%ebx 80101a18: c9 leave 80101a19: c3 ret 80101a1a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80101a20: b8 ff ff ff ff mov $0xffffffff,%eax 80101a25: eb ee jmp 80101a15 <filestat+0x35> 80101a27: 89 f6 mov %esi,%esi 80101a29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101a30 <fileread>: // Read from file f. int fileread(struct file *f, char *addr, int n) { 80101a30: 55 push %ebp 80101a31: 89 e5 mov %esp,%ebp 80101a33: 57 push %edi 80101a34: 56 push %esi 80101a35: 53 push %ebx 80101a36: 83 ec 0c sub $0xc,%esp 80101a39: 8b 5d 08 mov 0x8(%ebp),%ebx 80101a3c: 8b 75 0c mov 0xc(%ebp),%esi 80101a3f: 8b 7d 10 mov 0x10(%ebp),%edi int r; if (f->readable == 0) { 80101a42: 80 7b 08 00 cmpb $0x0,0x8(%ebx) 80101a46: 74 60 je 80101aa8 <fileread+0x78> return -1; } if (f->type == FD_PIPE) { 80101a48: 8b 03 mov (%ebx),%eax 80101a4a: 83 f8 01 cmp $0x1,%eax 80101a4d: 74 41 je 80101a90 <fileread+0x60> return piperead(f->pipe, addr, n); } if (f->type == FD_INODE) { 80101a4f: 83 f8 02 cmp $0x2,%eax 80101a52: 75 5b jne 80101aaf <fileread+0x7f> ilock(f->ip); 80101a54: 83 ec 0c sub $0xc,%esp 80101a57: ff 73 10 pushl 0x10(%ebx) 80101a5a: e8 f1 06 00 00 call 80102150 <ilock> if ((r = readi(f->ip, addr, f->off, n)) > 0) { 80101a5f: 57 push %edi 80101a60: ff 73 14 pushl 0x14(%ebx) 80101a63: 56 push %esi 80101a64: ff 73 10 pushl 0x10(%ebx) 80101a67: e8 c4 09 00 00 call 80102430 <readi> 80101a6c: 83 c4 20 add $0x20,%esp 80101a6f: 85 c0 test %eax,%eax 80101a71: 89 c6 mov %eax,%esi 80101a73: 7e 03 jle 80101a78 <fileread+0x48> f->off += r; 80101a75: 01 43 14 add %eax,0x14(%ebx) } iunlock(f->ip); 80101a78: 83 ec 0c sub $0xc,%esp 80101a7b: ff 73 10 pushl 0x10(%ebx) 80101a7e: e8 ad 07 00 00 call 80102230 <iunlock> return r; 80101a83: 83 c4 10 add $0x10,%esp } panic("fileread"); } 80101a86: 8d 65 f4 lea -0xc(%ebp),%esp 80101a89: 89 f0 mov %esi,%eax 80101a8b: 5b pop %ebx 80101a8c: 5e pop %esi 80101a8d: 5f pop %edi 80101a8e: 5d pop %ebp 80101a8f: c3 ret return piperead(f->pipe, addr, n); 80101a90: 8b 43 0c mov 0xc(%ebx),%eax 80101a93: 89 45 08 mov %eax,0x8(%ebp) } 80101a96: 8d 65 f4 lea -0xc(%ebp),%esp 80101a99: 5b pop %ebx 80101a9a: 5e pop %esi 80101a9b: 5f pop %edi 80101a9c: 5d pop %ebp return piperead(f->pipe, addr, n); 80101a9d: e9 4e 25 00 00 jmp 80103ff0 <piperead> 80101aa2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return -1; 80101aa8: be ff ff ff ff mov $0xffffffff,%esi 80101aad: eb d7 jmp 80101a86 <fileread+0x56> panic("fileread"); 80101aaf: 83 ec 0c sub $0xc,%esp 80101ab2: 68 f6 7b 10 80 push $0x80107bf6 80101ab7: e8 24 ea ff ff call 801004e0 <panic> 80101abc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101ac0 <filewrite>: // Write to file f. int filewrite(struct file *f, char *addr, int n) { 80101ac0: 55 push %ebp 80101ac1: 89 e5 mov %esp,%ebp 80101ac3: 57 push %edi 80101ac4: 56 push %esi 80101ac5: 53 push %ebx 80101ac6: 83 ec 1c sub $0x1c,%esp 80101ac9: 8b 75 08 mov 0x8(%ebp),%esi 80101acc: 8b 45 0c mov 0xc(%ebp),%eax int r; if (f->writable == 0) { 80101acf: 80 7e 09 00 cmpb $0x0,0x9(%esi) int filewrite(struct file *f, char *addr, int n) { 80101ad3: 89 45 dc mov %eax,-0x24(%ebp) 80101ad6: 8b 45 10 mov 0x10(%ebp),%eax 80101ad9: 89 45 e4 mov %eax,-0x1c(%ebp) if (f->writable == 0) { 80101adc: 0f 84 aa 00 00 00 je 80101b8c <filewrite+0xcc> return -1; } if (f->type == FD_PIPE) { 80101ae2: 8b 06 mov (%esi),%eax 80101ae4: 83 f8 01 cmp $0x1,%eax 80101ae7: 0f 84 c3 00 00 00 je 80101bb0 <filewrite+0xf0> return pipewrite(f->pipe, addr, n); } if (f->type == FD_INODE) { 80101aed: 83 f8 02 cmp $0x2,%eax 80101af0: 0f 85 d9 00 00 00 jne 80101bcf <filewrite+0x10f> // and 2 blocks of slop for non-aligned writes. // this really belongs lower down, since writei() // might be writing a device like the console. int max = ((MAXOPBLOCKS - 1 - 1 - 2) / 2) * 512; int i = 0; while (i < n) { 80101af6: 8b 45 e4 mov -0x1c(%ebp),%eax int i = 0; 80101af9: 31 ff xor %edi,%edi while (i < n) { 80101afb: 85 c0 test %eax,%eax 80101afd: 7f 34 jg 80101b33 <filewrite+0x73> 80101aff: e9 9c 00 00 00 jmp 80101ba0 <filewrite+0xe0> 80101b04: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } begin_op(); ilock(f->ip); if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) { f->off += r; 80101b08: 01 46 14 add %eax,0x14(%esi) } iunlock(f->ip); 80101b0b: 83 ec 0c sub $0xc,%esp 80101b0e: ff 76 10 pushl 0x10(%esi) f->off += r; 80101b11: 89 45 e0 mov %eax,-0x20(%ebp) iunlock(f->ip); 80101b14: e8 17 07 00 00 call 80102230 <iunlock> end_op(); 80101b19: e8 c2 1b 00 00 call 801036e0 <end_op> 80101b1e: 8b 45 e0 mov -0x20(%ebp),%eax 80101b21: 83 c4 10 add $0x10,%esp if (r < 0) { break; } if (r != n1) { 80101b24: 39 c3 cmp %eax,%ebx 80101b26: 0f 85 96 00 00 00 jne 80101bc2 <filewrite+0x102> panic("short filewrite"); } i += r; 80101b2c: 01 df add %ebx,%edi while (i < n) { 80101b2e: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101b31: 7e 6d jle 80101ba0 <filewrite+0xe0> int n1 = n - i; 80101b33: 8b 5d e4 mov -0x1c(%ebp),%ebx 80101b36: b8 00 06 00 00 mov $0x600,%eax 80101b3b: 29 fb sub %edi,%ebx 80101b3d: 81 fb 00 06 00 00 cmp $0x600,%ebx 80101b43: 0f 4f d8 cmovg %eax,%ebx begin_op(); 80101b46: e8 25 1b 00 00 call 80103670 <begin_op> ilock(f->ip); 80101b4b: 83 ec 0c sub $0xc,%esp 80101b4e: ff 76 10 pushl 0x10(%esi) 80101b51: e8 fa 05 00 00 call 80102150 <ilock> if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) { 80101b56: 8b 45 dc mov -0x24(%ebp),%eax 80101b59: 53 push %ebx 80101b5a: ff 76 14 pushl 0x14(%esi) 80101b5d: 01 f8 add %edi,%eax 80101b5f: 50 push %eax 80101b60: ff 76 10 pushl 0x10(%esi) 80101b63: e8 c8 09 00 00 call 80102530 <writei> 80101b68: 83 c4 20 add $0x20,%esp 80101b6b: 85 c0 test %eax,%eax 80101b6d: 7f 99 jg 80101b08 <filewrite+0x48> iunlock(f->ip); 80101b6f: 83 ec 0c sub $0xc,%esp 80101b72: ff 76 10 pushl 0x10(%esi) 80101b75: 89 45 e0 mov %eax,-0x20(%ebp) 80101b78: e8 b3 06 00 00 call 80102230 <iunlock> end_op(); 80101b7d: e8 5e 1b 00 00 call 801036e0 <end_op> if (r < 0) { 80101b82: 8b 45 e0 mov -0x20(%ebp),%eax 80101b85: 83 c4 10 add $0x10,%esp 80101b88: 85 c0 test %eax,%eax 80101b8a: 74 98 je 80101b24 <filewrite+0x64> } return i == n ? n : -1; } panic("filewrite"); } 80101b8c: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80101b8f: bf ff ff ff ff mov $0xffffffff,%edi } 80101b94: 89 f8 mov %edi,%eax 80101b96: 5b pop %ebx 80101b97: 5e pop %esi 80101b98: 5f pop %edi 80101b99: 5d pop %ebp 80101b9a: c3 ret 80101b9b: 90 nop 80101b9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return i == n ? n : -1; 80101ba0: 39 7d e4 cmp %edi,-0x1c(%ebp) 80101ba3: 75 e7 jne 80101b8c <filewrite+0xcc> } 80101ba5: 8d 65 f4 lea -0xc(%ebp),%esp 80101ba8: 89 f8 mov %edi,%eax 80101baa: 5b pop %ebx 80101bab: 5e pop %esi 80101bac: 5f pop %edi 80101bad: 5d pop %ebp 80101bae: c3 ret 80101baf: 90 nop return pipewrite(f->pipe, addr, n); 80101bb0: 8b 46 0c mov 0xc(%esi),%eax 80101bb3: 89 45 08 mov %eax,0x8(%ebp) } 80101bb6: 8d 65 f4 lea -0xc(%ebp),%esp 80101bb9: 5b pop %ebx 80101bba: 5e pop %esi 80101bbb: 5f pop %edi 80101bbc: 5d pop %ebp return pipewrite(f->pipe, addr, n); 80101bbd: e9 1e 23 00 00 jmp 80103ee0 <pipewrite> panic("short filewrite"); 80101bc2: 83 ec 0c sub $0xc,%esp 80101bc5: 68 ff 7b 10 80 push $0x80107bff 80101bca: e8 11 e9 ff ff call 801004e0 <panic> panic("filewrite"); 80101bcf: 83 ec 0c sub $0xc,%esp 80101bd2: 68 05 7c 10 80 push $0x80107c05 80101bd7: e8 04 e9 ff ff call 801004e0 <panic> 80101bdc: 66 90 xchg %ax,%ax 80101bde: 66 90 xchg %ax,%ax 80101be0 <bfree>: } panic("balloc: out of blocks"); } // Free a disk block. static void bfree(int dev, uint b) { 80101be0: 55 push %ebp 80101be1: 89 e5 mov %esp,%ebp 80101be3: 56 push %esi 80101be4: 53 push %ebx 80101be5: 89 d3 mov %edx,%ebx struct buf *bp; int bi, m; bp = bread(dev, BBLOCK(b, sb)); 80101be7: c1 ea 0c shr $0xc,%edx 80101bea: 03 15 b8 31 11 80 add 0x801131b8,%edx 80101bf0: 83 ec 08 sub $0x8,%esp 80101bf3: 52 push %edx 80101bf4: 50 push %eax 80101bf5: e8 d6 e4 ff ff call 801000d0 <bread> bi = b % BPB; m = 1 << (bi % 8); 80101bfa: 89 d9 mov %ebx,%ecx if ((bp->data[bi / 8] & m) == 0) { 80101bfc: c1 fb 03 sar $0x3,%ebx m = 1 << (bi % 8); 80101bff: ba 01 00 00 00 mov $0x1,%edx 80101c04: 83 e1 07 and $0x7,%ecx if ((bp->data[bi / 8] & m) == 0) { 80101c07: 81 e3 ff 01 00 00 and $0x1ff,%ebx 80101c0d: 83 c4 10 add $0x10,%esp m = 1 << (bi % 8); 80101c10: d3 e2 shl %cl,%edx if ((bp->data[bi / 8] & m) == 0) { 80101c12: 0f b6 4c 18 5c movzbl 0x5c(%eax,%ebx,1),%ecx 80101c17: 85 d1 test %edx,%ecx 80101c19: 74 25 je 80101c40 <bfree+0x60> panic("freeing free block"); } bp->data[bi / 8] &= ~m; 80101c1b: f7 d2 not %edx 80101c1d: 89 c6 mov %eax,%esi log_write(bp); 80101c1f: 83 ec 0c sub $0xc,%esp bp->data[bi / 8] &= ~m; 80101c22: 21 ca and %ecx,%edx 80101c24: 88 54 1e 5c mov %dl,0x5c(%esi,%ebx,1) log_write(bp); 80101c28: 56 push %esi 80101c29: e8 12 1c 00 00 call 80103840 <log_write> brelse(bp); 80101c2e: 89 34 24 mov %esi,(%esp) 80101c31: e8 aa e5 ff ff call 801001e0 <brelse> } 80101c36: 83 c4 10 add $0x10,%esp 80101c39: 8d 65 f8 lea -0x8(%ebp),%esp 80101c3c: 5b pop %ebx 80101c3d: 5e pop %esi 80101c3e: 5d pop %ebp 80101c3f: c3 ret panic("freeing free block"); 80101c40: 83 ec 0c sub $0xc,%esp 80101c43: 68 0f 7c 10 80 push $0x80107c0f 80101c48: e8 93 e8 ff ff call 801004e0 <panic> 80101c4d: 8d 76 00 lea 0x0(%esi),%esi 80101c50 <balloc>: static uint balloc(uint dev) { 80101c50: 55 push %ebp 80101c51: 89 e5 mov %esp,%ebp 80101c53: 57 push %edi 80101c54: 56 push %esi 80101c55: 53 push %ebx 80101c56: 83 ec 1c sub $0x1c,%esp for (b = 0; b < sb.size; b += BPB) { 80101c59: 8b 0d a0 31 11 80 mov 0x801131a0,%ecx static uint balloc(uint dev) { 80101c5f: 89 45 d8 mov %eax,-0x28(%ebp) for (b = 0; b < sb.size; b += BPB) { 80101c62: 85 c9 test %ecx,%ecx 80101c64: 0f 84 87 00 00 00 je 80101cf1 <balloc+0xa1> 80101c6a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) bp = bread(dev, BBLOCK(b, sb)); 80101c71: 8b 75 dc mov -0x24(%ebp),%esi 80101c74: 83 ec 08 sub $0x8,%esp 80101c77: 89 f0 mov %esi,%eax 80101c79: c1 f8 0c sar $0xc,%eax 80101c7c: 03 05 b8 31 11 80 add 0x801131b8,%eax 80101c82: 50 push %eax 80101c83: ff 75 d8 pushl -0x28(%ebp) 80101c86: e8 45 e4 ff ff call 801000d0 <bread> 80101c8b: 89 45 e4 mov %eax,-0x1c(%ebp) for (bi = 0; bi < BPB && b + bi < sb.size; bi++) { 80101c8e: a1 a0 31 11 80 mov 0x801131a0,%eax 80101c93: 83 c4 10 add $0x10,%esp 80101c96: 89 45 e0 mov %eax,-0x20(%ebp) 80101c99: 31 c0 xor %eax,%eax 80101c9b: eb 2f jmp 80101ccc <balloc+0x7c> 80101c9d: 8d 76 00 lea 0x0(%esi),%esi m = 1 << (bi % 8); 80101ca0: 89 c1 mov %eax,%ecx if ((bp->data[bi / 8] & m) == 0) { // Is block free? 80101ca2: 8b 55 e4 mov -0x1c(%ebp),%edx m = 1 << (bi % 8); 80101ca5: bb 01 00 00 00 mov $0x1,%ebx 80101caa: 83 e1 07 and $0x7,%ecx 80101cad: d3 e3 shl %cl,%ebx if ((bp->data[bi / 8] & m) == 0) { // Is block free? 80101caf: 89 c1 mov %eax,%ecx 80101cb1: c1 f9 03 sar $0x3,%ecx 80101cb4: 0f b6 7c 0a 5c movzbl 0x5c(%edx,%ecx,1),%edi 80101cb9: 85 df test %ebx,%edi 80101cbb: 89 fa mov %edi,%edx 80101cbd: 74 41 je 80101d00 <balloc+0xb0> for (bi = 0; bi < BPB && b + bi < sb.size; bi++) { 80101cbf: 83 c0 01 add $0x1,%eax 80101cc2: 83 c6 01 add $0x1,%esi 80101cc5: 3d 00 10 00 00 cmp $0x1000,%eax 80101cca: 74 05 je 80101cd1 <balloc+0x81> 80101ccc: 39 75 e0 cmp %esi,-0x20(%ebp) 80101ccf: 77 cf ja 80101ca0 <balloc+0x50> brelse(bp); 80101cd1: 83 ec 0c sub $0xc,%esp 80101cd4: ff 75 e4 pushl -0x1c(%ebp) 80101cd7: e8 04 e5 ff ff call 801001e0 <brelse> for (b = 0; b < sb.size; b += BPB) { 80101cdc: 81 45 dc 00 10 00 00 addl $0x1000,-0x24(%ebp) 80101ce3: 83 c4 10 add $0x10,%esp 80101ce6: 8b 45 dc mov -0x24(%ebp),%eax 80101ce9: 39 05 a0 31 11 80 cmp %eax,0x801131a0 80101cef: 77 80 ja 80101c71 <balloc+0x21> panic("balloc: out of blocks"); 80101cf1: 83 ec 0c sub $0xc,%esp 80101cf4: 68 22 7c 10 80 push $0x80107c22 80101cf9: e8 e2 e7 ff ff call 801004e0 <panic> 80101cfe: 66 90 xchg %ax,%ax bp->data[bi / 8] |= m; // Mark block in use. 80101d00: 8b 7d e4 mov -0x1c(%ebp),%edi log_write(bp); 80101d03: 83 ec 0c sub $0xc,%esp bp->data[bi / 8] |= m; // Mark block in use. 80101d06: 09 da or %ebx,%edx 80101d08: 88 54 0f 5c mov %dl,0x5c(%edi,%ecx,1) log_write(bp); 80101d0c: 57 push %edi 80101d0d: e8 2e 1b 00 00 call 80103840 <log_write> brelse(bp); 80101d12: 89 3c 24 mov %edi,(%esp) 80101d15: e8 c6 e4 ff ff call 801001e0 <brelse> bp = bread(dev, bno); 80101d1a: 58 pop %eax 80101d1b: 5a pop %edx 80101d1c: 56 push %esi 80101d1d: ff 75 d8 pushl -0x28(%ebp) 80101d20: e8 ab e3 ff ff call 801000d0 <bread> 80101d25: 89 c3 mov %eax,%ebx memset(bp->data, 0, BSIZE); 80101d27: 8d 40 5c lea 0x5c(%eax),%eax 80101d2a: 83 c4 0c add $0xc,%esp 80101d2d: 68 00 02 00 00 push $0x200 80101d32: 6a 00 push $0x0 80101d34: 50 push %eax 80101d35: e8 16 32 00 00 call 80104f50 <memset> log_write(bp); 80101d3a: 89 1c 24 mov %ebx,(%esp) 80101d3d: e8 fe 1a 00 00 call 80103840 <log_write> brelse(bp); 80101d42: 89 1c 24 mov %ebx,(%esp) 80101d45: e8 96 e4 ff ff call 801001e0 <brelse> } 80101d4a: 8d 65 f4 lea -0xc(%ebp),%esp 80101d4d: 89 f0 mov %esi,%eax 80101d4f: 5b pop %ebx 80101d50: 5e pop %esi 80101d51: 5f pop %edi 80101d52: 5d pop %ebp 80101d53: c3 ret 80101d54: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80101d5a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80101d60 <iget>: } // Find the inode with number inum on device dev // and return the in-memory copy. Does not lock // the inode and does not read it from disk. static struct inode* iget(uint dev, uint inum) { 80101d60: 55 push %ebp 80101d61: 89 e5 mov %esp,%ebp 80101d63: 57 push %edi 80101d64: 56 push %esi 80101d65: 53 push %ebx 80101d66: 89 c7 mov %eax,%edi struct inode *ip, *empty; acquire(&icache.lock); // Is the inode already cached? empty = 0; 80101d68: 31 f6 xor %esi,%esi for (ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++) { 80101d6a: bb f4 31 11 80 mov $0x801131f4,%ebx static struct inode* iget(uint dev, uint inum) { 80101d6f: 83 ec 28 sub $0x28,%esp 80101d72: 89 55 e4 mov %edx,-0x1c(%ebp) acquire(&icache.lock); 80101d75: 68 c0 31 11 80 push $0x801131c0 80101d7a: e8 c1 30 00 00 call 80104e40 <acquire> 80101d7f: 83 c4 10 add $0x10,%esp for (ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++) { 80101d82: 8b 55 e4 mov -0x1c(%ebp),%edx 80101d85: eb 17 jmp 80101d9e <iget+0x3e> 80101d87: 89 f6 mov %esi,%esi 80101d89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101d90: 81 c3 90 00 00 00 add $0x90,%ebx 80101d96: 81 fb 14 4e 11 80 cmp $0x80114e14,%ebx 80101d9c: 73 22 jae 80101dc0 <iget+0x60> if (ip->ref > 0 && ip->dev == dev && ip->inum == inum) { 80101d9e: 8b 4b 08 mov 0x8(%ebx),%ecx 80101da1: 85 c9 test %ecx,%ecx 80101da3: 7e 04 jle 80101da9 <iget+0x49> 80101da5: 39 3b cmp %edi,(%ebx) 80101da7: 74 4f je 80101df8 <iget+0x98> ip->ref++; release(&icache.lock); return ip; } if (empty == 0 && ip->ref == 0) { // Remember empty slot. 80101da9: 85 f6 test %esi,%esi 80101dab: 75 e3 jne 80101d90 <iget+0x30> 80101dad: 85 c9 test %ecx,%ecx 80101daf: 0f 44 f3 cmove %ebx,%esi for (ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++) { 80101db2: 81 c3 90 00 00 00 add $0x90,%ebx 80101db8: 81 fb 14 4e 11 80 cmp $0x80114e14,%ebx 80101dbe: 72 de jb 80101d9e <iget+0x3e> empty = ip; } } // Recycle an inode cache entry. if (empty == 0) { 80101dc0: 85 f6 test %esi,%esi 80101dc2: 74 5b je 80101e1f <iget+0xbf> ip = empty; ip->dev = dev; ip->inum = inum; ip->ref = 1; ip->valid = 0; release(&icache.lock); 80101dc4: 83 ec 0c sub $0xc,%esp ip->dev = dev; 80101dc7: 89 3e mov %edi,(%esi) ip->inum = inum; 80101dc9: 89 56 04 mov %edx,0x4(%esi) ip->ref = 1; 80101dcc: c7 46 08 01 00 00 00 movl $0x1,0x8(%esi) ip->valid = 0; 80101dd3: c7 46 4c 00 00 00 00 movl $0x0,0x4c(%esi) release(&icache.lock); 80101dda: 68 c0 31 11 80 push $0x801131c0 80101ddf: e8 1c 31 00 00 call 80104f00 <release> return ip; 80101de4: 83 c4 10 add $0x10,%esp } 80101de7: 8d 65 f4 lea -0xc(%ebp),%esp 80101dea: 89 f0 mov %esi,%eax 80101dec: 5b pop %ebx 80101ded: 5e pop %esi 80101dee: 5f pop %edi 80101def: 5d pop %ebp 80101df0: c3 ret 80101df1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if (ip->ref > 0 && ip->dev == dev && ip->inum == inum) { 80101df8: 39 53 04 cmp %edx,0x4(%ebx) 80101dfb: 75 ac jne 80101da9 <iget+0x49> release(&icache.lock); 80101dfd: 83 ec 0c sub $0xc,%esp ip->ref++; 80101e00: 83 c1 01 add $0x1,%ecx return ip; 80101e03: 89 de mov %ebx,%esi release(&icache.lock); 80101e05: 68 c0 31 11 80 push $0x801131c0 ip->ref++; 80101e0a: 89 4b 08 mov %ecx,0x8(%ebx) release(&icache.lock); 80101e0d: e8 ee 30 00 00 call 80104f00 <release> return ip; 80101e12: 83 c4 10 add $0x10,%esp } 80101e15: 8d 65 f4 lea -0xc(%ebp),%esp 80101e18: 89 f0 mov %esi,%eax 80101e1a: 5b pop %ebx 80101e1b: 5e pop %esi 80101e1c: 5f pop %edi 80101e1d: 5d pop %ebp 80101e1e: c3 ret panic("iget: no inodes"); 80101e1f: 83 ec 0c sub $0xc,%esp 80101e22: 68 38 7c 10 80 push $0x80107c38 80101e27: e8 b4 e6 ff ff call 801004e0 <panic> 80101e2c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101e30 <bmap>: // are listed in ip->addrs[]. The next NINDIRECT blocks are // listed in block ip->addrs[NDIRECT]. // Return the disk block address of the nth block in inode ip. // If there is no such block, bmap allocates one. static uint bmap(struct inode *ip, uint bn) { 80101e30: 55 push %ebp 80101e31: 89 e5 mov %esp,%ebp 80101e33: 57 push %edi 80101e34: 56 push %esi 80101e35: 53 push %ebx 80101e36: 89 c6 mov %eax,%esi 80101e38: 83 ec 1c sub $0x1c,%esp uint addr, *a; struct buf *bp; if (bn < NDIRECT) { 80101e3b: 83 fa 0b cmp $0xb,%edx 80101e3e: 77 18 ja 80101e58 <bmap+0x28> 80101e40: 8d 3c 90 lea (%eax,%edx,4),%edi if ((addr = ip->addrs[bn]) == 0) { 80101e43: 8b 5f 5c mov 0x5c(%edi),%ebx 80101e46: 85 db test %ebx,%ebx 80101e48: 74 76 je 80101ec0 <bmap+0x90> brelse(bp); return addr; } panic("bmap: out of range"); } 80101e4a: 8d 65 f4 lea -0xc(%ebp),%esp 80101e4d: 89 d8 mov %ebx,%eax 80101e4f: 5b pop %ebx 80101e50: 5e pop %esi 80101e51: 5f pop %edi 80101e52: 5d pop %ebp 80101e53: c3 ret 80101e54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bn -= NDIRECT; 80101e58: 8d 5a f4 lea -0xc(%edx),%ebx if (bn < NINDIRECT) { 80101e5b: 83 fb 7f cmp $0x7f,%ebx 80101e5e: 0f 87 90 00 00 00 ja 80101ef4 <bmap+0xc4> if ((addr = ip->addrs[NDIRECT]) == 0) { 80101e64: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx 80101e6a: 8b 00 mov (%eax),%eax 80101e6c: 85 d2 test %edx,%edx 80101e6e: 74 70 je 80101ee0 <bmap+0xb0> bp = bread(ip->dev, addr); 80101e70: 83 ec 08 sub $0x8,%esp 80101e73: 52 push %edx 80101e74: 50 push %eax 80101e75: e8 56 e2 ff ff call 801000d0 <bread> if ((addr = a[bn]) == 0) { 80101e7a: 8d 54 98 5c lea 0x5c(%eax,%ebx,4),%edx 80101e7e: 83 c4 10 add $0x10,%esp bp = bread(ip->dev, addr); 80101e81: 89 c7 mov %eax,%edi if ((addr = a[bn]) == 0) { 80101e83: 8b 1a mov (%edx),%ebx 80101e85: 85 db test %ebx,%ebx 80101e87: 75 1d jne 80101ea6 <bmap+0x76> a[bn] = addr = balloc(ip->dev); 80101e89: 8b 06 mov (%esi),%eax 80101e8b: 89 55 e4 mov %edx,-0x1c(%ebp) 80101e8e: e8 bd fd ff ff call 80101c50 <balloc> 80101e93: 8b 55 e4 mov -0x1c(%ebp),%edx log_write(bp); 80101e96: 83 ec 0c sub $0xc,%esp a[bn] = addr = balloc(ip->dev); 80101e99: 89 c3 mov %eax,%ebx 80101e9b: 89 02 mov %eax,(%edx) log_write(bp); 80101e9d: 57 push %edi 80101e9e: e8 9d 19 00 00 call 80103840 <log_write> 80101ea3: 83 c4 10 add $0x10,%esp brelse(bp); 80101ea6: 83 ec 0c sub $0xc,%esp 80101ea9: 57 push %edi 80101eaa: e8 31 e3 ff ff call 801001e0 <brelse> 80101eaf: 83 c4 10 add $0x10,%esp } 80101eb2: 8d 65 f4 lea -0xc(%ebp),%esp 80101eb5: 89 d8 mov %ebx,%eax 80101eb7: 5b pop %ebx 80101eb8: 5e pop %esi 80101eb9: 5f pop %edi 80101eba: 5d pop %ebp 80101ebb: c3 ret 80101ebc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ip->addrs[bn] = addr = balloc(ip->dev); 80101ec0: 8b 00 mov (%eax),%eax 80101ec2: e8 89 fd ff ff call 80101c50 <balloc> 80101ec7: 89 47 5c mov %eax,0x5c(%edi) } 80101eca: 8d 65 f4 lea -0xc(%ebp),%esp ip->addrs[bn] = addr = balloc(ip->dev); 80101ecd: 89 c3 mov %eax,%ebx } 80101ecf: 89 d8 mov %ebx,%eax 80101ed1: 5b pop %ebx 80101ed2: 5e pop %esi 80101ed3: 5f pop %edi 80101ed4: 5d pop %ebp 80101ed5: c3 ret 80101ed6: 8d 76 00 lea 0x0(%esi),%esi 80101ed9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80101ee0: e8 6b fd ff ff call 80101c50 <balloc> 80101ee5: 89 c2 mov %eax,%edx 80101ee7: 89 86 8c 00 00 00 mov %eax,0x8c(%esi) 80101eed: 8b 06 mov (%esi),%eax 80101eef: e9 7c ff ff ff jmp 80101e70 <bmap+0x40> panic("bmap: out of range"); 80101ef4: 83 ec 0c sub $0xc,%esp 80101ef7: 68 48 7c 10 80 push $0x80107c48 80101efc: e8 df e5 ff ff call 801004e0 <panic> 80101f01: eb 0d jmp 80101f10 <readsb> 80101f03: 90 nop 80101f04: 90 nop 80101f05: 90 nop 80101f06: 90 nop 80101f07: 90 nop 80101f08: 90 nop 80101f09: 90 nop 80101f0a: 90 nop 80101f0b: 90 nop 80101f0c: 90 nop 80101f0d: 90 nop 80101f0e: 90 nop 80101f0f: 90 nop 80101f10 <readsb>: void readsb(int dev, struct superblock *sb) { 80101f10: 55 push %ebp 80101f11: 89 e5 mov %esp,%ebp 80101f13: 56 push %esi 80101f14: 53 push %ebx 80101f15: 8b 75 0c mov 0xc(%ebp),%esi bp = bread(dev, 1); 80101f18: 83 ec 08 sub $0x8,%esp 80101f1b: 6a 01 push $0x1 80101f1d: ff 75 08 pushl 0x8(%ebp) 80101f20: e8 ab e1 ff ff call 801000d0 <bread> 80101f25: 89 c3 mov %eax,%ebx memmove(sb, bp->data, sizeof(*sb)); 80101f27: 8d 40 5c lea 0x5c(%eax),%eax 80101f2a: 83 c4 0c add $0xc,%esp 80101f2d: 6a 1c push $0x1c 80101f2f: 50 push %eax 80101f30: 56 push %esi 80101f31: e8 ca 30 00 00 call 80105000 <memmove> brelse(bp); 80101f36: 89 5d 08 mov %ebx,0x8(%ebp) 80101f39: 83 c4 10 add $0x10,%esp } 80101f3c: 8d 65 f8 lea -0x8(%ebp),%esp 80101f3f: 5b pop %ebx 80101f40: 5e pop %esi 80101f41: 5d pop %ebp brelse(bp); 80101f42: e9 99 e2 ff ff jmp 801001e0 <brelse> 80101f47: 89 f6 mov %esi,%esi 80101f49: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80101f50 <iinit>: void iinit(int dev) { 80101f50: 55 push %ebp 80101f51: 89 e5 mov %esp,%ebp 80101f53: 53 push %ebx 80101f54: bb 00 32 11 80 mov $0x80113200,%ebx 80101f59: 83 ec 0c sub $0xc,%esp initlock(&icache.lock, "icache"); 80101f5c: 68 5b 7c 10 80 push $0x80107c5b 80101f61: 68 c0 31 11 80 push $0x801131c0 80101f66: e8 95 2d 00 00 call 80104d00 <initlock> 80101f6b: 83 c4 10 add $0x10,%esp 80101f6e: 66 90 xchg %ax,%ax initsleeplock(&icache.inode[i].lock, "inode"); 80101f70: 83 ec 08 sub $0x8,%esp 80101f73: 68 62 7c 10 80 push $0x80107c62 80101f78: 53 push %ebx 80101f79: 81 c3 90 00 00 00 add $0x90,%ebx 80101f7f: e8 4c 2c 00 00 call 80104bd0 <initsleeplock> for (i = 0; i < NINODE; i++) { 80101f84: 83 c4 10 add $0x10,%esp 80101f87: 81 fb 20 4e 11 80 cmp $0x80114e20,%ebx 80101f8d: 75 e1 jne 80101f70 <iinit+0x20> readsb(dev, &sb); 80101f8f: 83 ec 08 sub $0x8,%esp 80101f92: 68 a0 31 11 80 push $0x801131a0 80101f97: ff 75 08 pushl 0x8(%ebp) 80101f9a: e8 71 ff ff ff call 80101f10 <readsb> cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\ 80101f9f: ff 35 b8 31 11 80 pushl 0x801131b8 80101fa5: ff 35 b4 31 11 80 pushl 0x801131b4 80101fab: ff 35 b0 31 11 80 pushl 0x801131b0 80101fb1: ff 35 ac 31 11 80 pushl 0x801131ac 80101fb7: ff 35 a8 31 11 80 pushl 0x801131a8 80101fbd: ff 35 a4 31 11 80 pushl 0x801131a4 80101fc3: ff 35 a0 31 11 80 pushl 0x801131a0 80101fc9: 68 c8 7c 10 80 push $0x80107cc8 80101fce: e8 8d e8 ff ff call 80100860 <cprintf> } 80101fd3: 83 c4 30 add $0x30,%esp 80101fd6: 8b 5d fc mov -0x4(%ebp),%ebx 80101fd9: c9 leave 80101fda: c3 ret 80101fdb: 90 nop 80101fdc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80101fe0 <ialloc>: struct inode* ialloc(uint dev, short type) { 80101fe0: 55 push %ebp 80101fe1: 89 e5 mov %esp,%ebp 80101fe3: 57 push %edi 80101fe4: 56 push %esi 80101fe5: 53 push %ebx 80101fe6: 83 ec 1c sub $0x1c,%esp for (inum = 1; inum < sb.ninodes; inum++) { 80101fe9: 83 3d a8 31 11 80 01 cmpl $0x1,0x801131a8 struct inode* ialloc(uint dev, short type) { 80101ff0: 8b 45 0c mov 0xc(%ebp),%eax 80101ff3: 8b 75 08 mov 0x8(%ebp),%esi 80101ff6: 89 45 e4 mov %eax,-0x1c(%ebp) for (inum = 1; inum < sb.ninodes; inum++) { 80101ff9: 0f 86 91 00 00 00 jbe 80102090 <ialloc+0xb0> 80101fff: bb 01 00 00 00 mov $0x1,%ebx 80102004: eb 21 jmp 80102027 <ialloc+0x47> 80102006: 8d 76 00 lea 0x0(%esi),%esi 80102009: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi brelse(bp); 80102010: 83 ec 0c sub $0xc,%esp for (inum = 1; inum < sb.ninodes; inum++) { 80102013: 83 c3 01 add $0x1,%ebx brelse(bp); 80102016: 57 push %edi 80102017: e8 c4 e1 ff ff call 801001e0 <brelse> for (inum = 1; inum < sb.ninodes; inum++) { 8010201c: 83 c4 10 add $0x10,%esp 8010201f: 39 1d a8 31 11 80 cmp %ebx,0x801131a8 80102025: 76 69 jbe 80102090 <ialloc+0xb0> bp = bread(dev, IBLOCK(inum, sb)); 80102027: 89 d8 mov %ebx,%eax 80102029: 83 ec 08 sub $0x8,%esp 8010202c: c1 e8 03 shr $0x3,%eax 8010202f: 03 05 b4 31 11 80 add 0x801131b4,%eax 80102035: 50 push %eax 80102036: 56 push %esi 80102037: e8 94 e0 ff ff call 801000d0 <bread> 8010203c: 89 c7 mov %eax,%edi dip = (struct dinode*)bp->data + inum % IPB; 8010203e: 89 d8 mov %ebx,%eax if (dip->type == 0) { // a free inode 80102040: 83 c4 10 add $0x10,%esp dip = (struct dinode*)bp->data + inum % IPB; 80102043: 83 e0 07 and $0x7,%eax 80102046: c1 e0 06 shl $0x6,%eax 80102049: 8d 4c 07 5c lea 0x5c(%edi,%eax,1),%ecx if (dip->type == 0) { // a free inode 8010204d: 66 83 39 00 cmpw $0x0,(%ecx) 80102051: 75 bd jne 80102010 <ialloc+0x30> memset(dip, 0, sizeof(*dip)); 80102053: 83 ec 04 sub $0x4,%esp 80102056: 89 4d e0 mov %ecx,-0x20(%ebp) 80102059: 6a 40 push $0x40 8010205b: 6a 00 push $0x0 8010205d: 51 push %ecx 8010205e: e8 ed 2e 00 00 call 80104f50 <memset> dip->type = type; 80102063: 0f b7 45 e4 movzwl -0x1c(%ebp),%eax 80102067: 8b 4d e0 mov -0x20(%ebp),%ecx 8010206a: 66 89 01 mov %ax,(%ecx) log_write(bp); // mark it allocated on the disk 8010206d: 89 3c 24 mov %edi,(%esp) 80102070: e8 cb 17 00 00 call 80103840 <log_write> brelse(bp); 80102075: 89 3c 24 mov %edi,(%esp) 80102078: e8 63 e1 ff ff call 801001e0 <brelse> return iget(dev, inum); 8010207d: 83 c4 10 add $0x10,%esp } 80102080: 8d 65 f4 lea -0xc(%ebp),%esp return iget(dev, inum); 80102083: 89 da mov %ebx,%edx 80102085: 89 f0 mov %esi,%eax } 80102087: 5b pop %ebx 80102088: 5e pop %esi 80102089: 5f pop %edi 8010208a: 5d pop %ebp return iget(dev, inum); 8010208b: e9 d0 fc ff ff jmp 80101d60 <iget> panic("ialloc: no inodes"); 80102090: 83 ec 0c sub $0xc,%esp 80102093: 68 68 7c 10 80 push $0x80107c68 80102098: e8 43 e4 ff ff call 801004e0 <panic> 8010209d: 8d 76 00 lea 0x0(%esi),%esi 801020a0 <iupdate>: void iupdate(struct inode *ip) { 801020a0: 55 push %ebp 801020a1: 89 e5 mov %esp,%ebp 801020a3: 56 push %esi 801020a4: 53 push %ebx 801020a5: 8b 5d 08 mov 0x8(%ebp),%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801020a8: 83 ec 08 sub $0x8,%esp 801020ab: 8b 43 04 mov 0x4(%ebx),%eax memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801020ae: 83 c3 5c add $0x5c,%ebx bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 801020b1: c1 e8 03 shr $0x3,%eax 801020b4: 03 05 b4 31 11 80 add 0x801131b4,%eax 801020ba: 50 push %eax 801020bb: ff 73 a4 pushl -0x5c(%ebx) 801020be: e8 0d e0 ff ff call 801000d0 <bread> 801020c3: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum % IPB; 801020c5: 8b 43 a8 mov -0x58(%ebx),%eax dip->type = ip->type; 801020c8: 0f b7 53 f4 movzwl -0xc(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801020cc: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum % IPB; 801020cf: 83 e0 07 and $0x7,%eax 801020d2: c1 e0 06 shl $0x6,%eax 801020d5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax dip->type = ip->type; 801020d9: 66 89 10 mov %dx,(%eax) dip->major = ip->major; 801020dc: 0f b7 53 f6 movzwl -0xa(%ebx),%edx memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801020e0: 83 c0 0c add $0xc,%eax dip->major = ip->major; 801020e3: 66 89 50 f6 mov %dx,-0xa(%eax) dip->minor = ip->minor; 801020e7: 0f b7 53 f8 movzwl -0x8(%ebx),%edx 801020eb: 66 89 50 f8 mov %dx,-0x8(%eax) dip->nlink = ip->nlink; 801020ef: 0f b7 53 fa movzwl -0x6(%ebx),%edx 801020f3: 66 89 50 fa mov %dx,-0x6(%eax) dip->size = ip->size; 801020f7: 8b 53 fc mov -0x4(%ebx),%edx 801020fa: 89 50 fc mov %edx,-0x4(%eax) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 801020fd: 6a 34 push $0x34 801020ff: 53 push %ebx 80102100: 50 push %eax 80102101: e8 fa 2e 00 00 call 80105000 <memmove> log_write(bp); 80102106: 89 34 24 mov %esi,(%esp) 80102109: e8 32 17 00 00 call 80103840 <log_write> brelse(bp); 8010210e: 89 75 08 mov %esi,0x8(%ebp) 80102111: 83 c4 10 add $0x10,%esp } 80102114: 8d 65 f8 lea -0x8(%ebp),%esp 80102117: 5b pop %ebx 80102118: 5e pop %esi 80102119: 5d pop %ebp brelse(bp); 8010211a: e9 c1 e0 ff ff jmp 801001e0 <brelse> 8010211f: 90 nop 80102120 <idup>: struct inode* idup(struct inode *ip) { 80102120: 55 push %ebp 80102121: 89 e5 mov %esp,%ebp 80102123: 53 push %ebx 80102124: 83 ec 10 sub $0x10,%esp 80102127: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&icache.lock); 8010212a: 68 c0 31 11 80 push $0x801131c0 8010212f: e8 0c 2d 00 00 call 80104e40 <acquire> ip->ref++; 80102134: 83 43 08 01 addl $0x1,0x8(%ebx) release(&icache.lock); 80102138: c7 04 24 c0 31 11 80 movl $0x801131c0,(%esp) 8010213f: e8 bc 2d 00 00 call 80104f00 <release> } 80102144: 89 d8 mov %ebx,%eax 80102146: 8b 5d fc mov -0x4(%ebp),%ebx 80102149: c9 leave 8010214a: c3 ret 8010214b: 90 nop 8010214c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102150 <ilock>: void ilock(struct inode *ip) { 80102150: 55 push %ebp 80102151: 89 e5 mov %esp,%ebp 80102153: 56 push %esi 80102154: 53 push %ebx 80102155: 8b 5d 08 mov 0x8(%ebp),%ebx if (ip == 0 || ip->ref < 1) { 80102158: 85 db test %ebx,%ebx 8010215a: 0f 84 b7 00 00 00 je 80102217 <ilock+0xc7> 80102160: 8b 53 08 mov 0x8(%ebx),%edx 80102163: 85 d2 test %edx,%edx 80102165: 0f 8e ac 00 00 00 jle 80102217 <ilock+0xc7> acquiresleep(&ip->lock); 8010216b: 8d 43 0c lea 0xc(%ebx),%eax 8010216e: 83 ec 0c sub $0xc,%esp 80102171: 50 push %eax 80102172: e8 99 2a 00 00 call 80104c10 <acquiresleep> if (ip->valid == 0) { 80102177: 8b 43 4c mov 0x4c(%ebx),%eax 8010217a: 83 c4 10 add $0x10,%esp 8010217d: 85 c0 test %eax,%eax 8010217f: 74 0f je 80102190 <ilock+0x40> } 80102181: 8d 65 f8 lea -0x8(%ebp),%esp 80102184: 5b pop %ebx 80102185: 5e pop %esi 80102186: 5d pop %ebp 80102187: c3 ret 80102188: 90 nop 80102189: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80102190: 8b 43 04 mov 0x4(%ebx),%eax 80102193: 83 ec 08 sub $0x8,%esp 80102196: c1 e8 03 shr $0x3,%eax 80102199: 03 05 b4 31 11 80 add 0x801131b4,%eax 8010219f: 50 push %eax 801021a0: ff 33 pushl (%ebx) 801021a2: e8 29 df ff ff call 801000d0 <bread> 801021a7: 89 c6 mov %eax,%esi dip = (struct dinode*)bp->data + ip->inum % IPB; 801021a9: 8b 43 04 mov 0x4(%ebx),%eax memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801021ac: 83 c4 0c add $0xc,%esp dip = (struct dinode*)bp->data + ip->inum % IPB; 801021af: 83 e0 07 and $0x7,%eax 801021b2: c1 e0 06 shl $0x6,%eax 801021b5: 8d 44 06 5c lea 0x5c(%esi,%eax,1),%eax ip->type = dip->type; 801021b9: 0f b7 10 movzwl (%eax),%edx memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801021bc: 83 c0 0c add $0xc,%eax ip->type = dip->type; 801021bf: 66 89 53 50 mov %dx,0x50(%ebx) ip->major = dip->major; 801021c3: 0f b7 50 f6 movzwl -0xa(%eax),%edx 801021c7: 66 89 53 52 mov %dx,0x52(%ebx) ip->minor = dip->minor; 801021cb: 0f b7 50 f8 movzwl -0x8(%eax),%edx 801021cf: 66 89 53 54 mov %dx,0x54(%ebx) ip->nlink = dip->nlink; 801021d3: 0f b7 50 fa movzwl -0x6(%eax),%edx 801021d7: 66 89 53 56 mov %dx,0x56(%ebx) ip->size = dip->size; 801021db: 8b 50 fc mov -0x4(%eax),%edx 801021de: 89 53 58 mov %edx,0x58(%ebx) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 801021e1: 6a 34 push $0x34 801021e3: 50 push %eax 801021e4: 8d 43 5c lea 0x5c(%ebx),%eax 801021e7: 50 push %eax 801021e8: e8 13 2e 00 00 call 80105000 <memmove> brelse(bp); 801021ed: 89 34 24 mov %esi,(%esp) 801021f0: e8 eb df ff ff call 801001e0 <brelse> if (ip->type == 0) { 801021f5: 83 c4 10 add $0x10,%esp 801021f8: 66 83 7b 50 00 cmpw $0x0,0x50(%ebx) ip->valid = 1; 801021fd: c7 43 4c 01 00 00 00 movl $0x1,0x4c(%ebx) if (ip->type == 0) { 80102204: 0f 85 77 ff ff ff jne 80102181 <ilock+0x31> panic("ilock: no type"); 8010220a: 83 ec 0c sub $0xc,%esp 8010220d: 68 80 7c 10 80 push $0x80107c80 80102212: e8 c9 e2 ff ff call 801004e0 <panic> panic("ilock"); 80102217: 83 ec 0c sub $0xc,%esp 8010221a: 68 7a 7c 10 80 push $0x80107c7a 8010221f: e8 bc e2 ff ff call 801004e0 <panic> 80102224: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010222a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80102230 <iunlock>: void iunlock(struct inode *ip) { 80102230: 55 push %ebp 80102231: 89 e5 mov %esp,%ebp 80102233: 56 push %esi 80102234: 53 push %ebx 80102235: 8b 5d 08 mov 0x8(%ebp),%ebx if (ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) { 80102238: 85 db test %ebx,%ebx 8010223a: 74 28 je 80102264 <iunlock+0x34> 8010223c: 8d 73 0c lea 0xc(%ebx),%esi 8010223f: 83 ec 0c sub $0xc,%esp 80102242: 56 push %esi 80102243: e8 68 2a 00 00 call 80104cb0 <holdingsleep> 80102248: 83 c4 10 add $0x10,%esp 8010224b: 85 c0 test %eax,%eax 8010224d: 74 15 je 80102264 <iunlock+0x34> 8010224f: 8b 43 08 mov 0x8(%ebx),%eax 80102252: 85 c0 test %eax,%eax 80102254: 7e 0e jle 80102264 <iunlock+0x34> releasesleep(&ip->lock); 80102256: 89 75 08 mov %esi,0x8(%ebp) } 80102259: 8d 65 f8 lea -0x8(%ebp),%esp 8010225c: 5b pop %ebx 8010225d: 5e pop %esi 8010225e: 5d pop %ebp releasesleep(&ip->lock); 8010225f: e9 0c 2a 00 00 jmp 80104c70 <releasesleep> panic("iunlock"); 80102264: 83 ec 0c sub $0xc,%esp 80102267: 68 8f 7c 10 80 push $0x80107c8f 8010226c: e8 6f e2 ff ff call 801004e0 <panic> 80102271: eb 0d jmp 80102280 <iput> 80102273: 90 nop 80102274: 90 nop 80102275: 90 nop 80102276: 90 nop 80102277: 90 nop 80102278: 90 nop 80102279: 90 nop 8010227a: 90 nop 8010227b: 90 nop 8010227c: 90 nop 8010227d: 90 nop 8010227e: 90 nop 8010227f: 90 nop 80102280 <iput>: void iput(struct inode *ip) { 80102280: 55 push %ebp 80102281: 89 e5 mov %esp,%ebp 80102283: 57 push %edi 80102284: 56 push %esi 80102285: 53 push %ebx 80102286: 83 ec 28 sub $0x28,%esp 80102289: 8b 5d 08 mov 0x8(%ebp),%ebx acquiresleep(&ip->lock); 8010228c: 8d 7b 0c lea 0xc(%ebx),%edi 8010228f: 57 push %edi 80102290: e8 7b 29 00 00 call 80104c10 <acquiresleep> if (ip->valid && ip->nlink == 0) { 80102295: 8b 53 4c mov 0x4c(%ebx),%edx 80102298: 83 c4 10 add $0x10,%esp 8010229b: 85 d2 test %edx,%edx 8010229d: 74 07 je 801022a6 <iput+0x26> 8010229f: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 801022a4: 74 32 je 801022d8 <iput+0x58> releasesleep(&ip->lock); 801022a6: 83 ec 0c sub $0xc,%esp 801022a9: 57 push %edi 801022aa: e8 c1 29 00 00 call 80104c70 <releasesleep> acquire(&icache.lock); 801022af: c7 04 24 c0 31 11 80 movl $0x801131c0,(%esp) 801022b6: e8 85 2b 00 00 call 80104e40 <acquire> ip->ref--; 801022bb: 83 6b 08 01 subl $0x1,0x8(%ebx) release(&icache.lock); 801022bf: 83 c4 10 add $0x10,%esp 801022c2: c7 45 08 c0 31 11 80 movl $0x801131c0,0x8(%ebp) } 801022c9: 8d 65 f4 lea -0xc(%ebp),%esp 801022cc: 5b pop %ebx 801022cd: 5e pop %esi 801022ce: 5f pop %edi 801022cf: 5d pop %ebp release(&icache.lock); 801022d0: e9 2b 2c 00 00 jmp 80104f00 <release> 801022d5: 8d 76 00 lea 0x0(%esi),%esi acquire(&icache.lock); 801022d8: 83 ec 0c sub $0xc,%esp 801022db: 68 c0 31 11 80 push $0x801131c0 801022e0: e8 5b 2b 00 00 call 80104e40 <acquire> int r = ip->ref; 801022e5: 8b 73 08 mov 0x8(%ebx),%esi release(&icache.lock); 801022e8: c7 04 24 c0 31 11 80 movl $0x801131c0,(%esp) 801022ef: e8 0c 2c 00 00 call 80104f00 <release> if (r == 1) { 801022f4: 83 c4 10 add $0x10,%esp 801022f7: 83 fe 01 cmp $0x1,%esi 801022fa: 75 aa jne 801022a6 <iput+0x26> 801022fc: 8d 8b 8c 00 00 00 lea 0x8c(%ebx),%ecx 80102302: 89 7d e4 mov %edi,-0x1c(%ebp) 80102305: 8d 73 5c lea 0x5c(%ebx),%esi 80102308: 89 cf mov %ecx,%edi 8010230a: eb 0b jmp 80102317 <iput+0x97> 8010230c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102310: 83 c6 04 add $0x4,%esi static void itrunc(struct inode *ip) { int i, j; struct buf *bp; uint *a; for (i = 0; i < NDIRECT; i++) { 80102313: 39 fe cmp %edi,%esi 80102315: 74 19 je 80102330 <iput+0xb0> if (ip->addrs[i]) { 80102317: 8b 16 mov (%esi),%edx 80102319: 85 d2 test %edx,%edx 8010231b: 74 f3 je 80102310 <iput+0x90> bfree(ip->dev, ip->addrs[i]); 8010231d: 8b 03 mov (%ebx),%eax 8010231f: e8 bc f8 ff ff call 80101be0 <bfree> ip->addrs[i] = 0; 80102324: c7 06 00 00 00 00 movl $0x0,(%esi) 8010232a: eb e4 jmp 80102310 <iput+0x90> 8010232c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } if (ip->addrs[NDIRECT]) { 80102330: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 80102336: 8b 7d e4 mov -0x1c(%ebp),%edi 80102339: 85 c0 test %eax,%eax 8010233b: 75 33 jne 80102370 <iput+0xf0> bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; iupdate(ip); 8010233d: 83 ec 0c sub $0xc,%esp ip->size = 0; 80102340: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) iupdate(ip); 80102347: 53 push %ebx 80102348: e8 53 fd ff ff call 801020a0 <iupdate> ip->type = 0; 8010234d: 31 c0 xor %eax,%eax 8010234f: 66 89 43 50 mov %ax,0x50(%ebx) iupdate(ip); 80102353: 89 1c 24 mov %ebx,(%esp) 80102356: e8 45 fd ff ff call 801020a0 <iupdate> ip->valid = 0; 8010235b: c7 43 4c 00 00 00 00 movl $0x0,0x4c(%ebx) 80102362: 83 c4 10 add $0x10,%esp 80102365: e9 3c ff ff ff jmp 801022a6 <iput+0x26> 8010236a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi bp = bread(ip->dev, ip->addrs[NDIRECT]); 80102370: 83 ec 08 sub $0x8,%esp 80102373: 50 push %eax 80102374: ff 33 pushl (%ebx) 80102376: e8 55 dd ff ff call 801000d0 <bread> 8010237b: 8d 88 5c 02 00 00 lea 0x25c(%eax),%ecx 80102381: 89 7d e0 mov %edi,-0x20(%ebp) 80102384: 89 45 e4 mov %eax,-0x1c(%ebp) a = (uint*)bp->data; 80102387: 8d 70 5c lea 0x5c(%eax),%esi 8010238a: 83 c4 10 add $0x10,%esp 8010238d: 89 cf mov %ecx,%edi 8010238f: eb 0e jmp 8010239f <iput+0x11f> 80102391: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102398: 83 c6 04 add $0x4,%esi for (j = 0; j < NINDIRECT; j++) { 8010239b: 39 fe cmp %edi,%esi 8010239d: 74 0f je 801023ae <iput+0x12e> if (a[j]) { 8010239f: 8b 16 mov (%esi),%edx 801023a1: 85 d2 test %edx,%edx 801023a3: 74 f3 je 80102398 <iput+0x118> bfree(ip->dev, a[j]); 801023a5: 8b 03 mov (%ebx),%eax 801023a7: e8 34 f8 ff ff call 80101be0 <bfree> 801023ac: eb ea jmp 80102398 <iput+0x118> brelse(bp); 801023ae: 83 ec 0c sub $0xc,%esp 801023b1: ff 75 e4 pushl -0x1c(%ebp) 801023b4: 8b 7d e0 mov -0x20(%ebp),%edi 801023b7: e8 24 de ff ff call 801001e0 <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 801023bc: 8b 93 8c 00 00 00 mov 0x8c(%ebx),%edx 801023c2: 8b 03 mov (%ebx),%eax 801023c4: e8 17 f8 ff ff call 80101be0 <bfree> ip->addrs[NDIRECT] = 0; 801023c9: c7 83 8c 00 00 00 00 movl $0x0,0x8c(%ebx) 801023d0: 00 00 00 801023d3: 83 c4 10 add $0x10,%esp 801023d6: e9 62 ff ff ff jmp 8010233d <iput+0xbd> 801023db: 90 nop 801023dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801023e0 <iunlockput>: void iunlockput(struct inode *ip) { 801023e0: 55 push %ebp 801023e1: 89 e5 mov %esp,%ebp 801023e3: 53 push %ebx 801023e4: 83 ec 10 sub $0x10,%esp 801023e7: 8b 5d 08 mov 0x8(%ebp),%ebx iunlock(ip); 801023ea: 53 push %ebx 801023eb: e8 40 fe ff ff call 80102230 <iunlock> iput(ip); 801023f0: 89 5d 08 mov %ebx,0x8(%ebp) 801023f3: 83 c4 10 add $0x10,%esp } 801023f6: 8b 5d fc mov -0x4(%ebp),%ebx 801023f9: c9 leave iput(ip); 801023fa: e9 81 fe ff ff jmp 80102280 <iput> 801023ff: 90 nop 80102400 <stati>: } // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80102400: 55 push %ebp 80102401: 89 e5 mov %esp,%ebp 80102403: 8b 55 08 mov 0x8(%ebp),%edx 80102406: 8b 45 0c mov 0xc(%ebp),%eax st->dev = ip->dev; 80102409: 8b 0a mov (%edx),%ecx 8010240b: 89 48 04 mov %ecx,0x4(%eax) st->ino = ip->inum; 8010240e: 8b 4a 04 mov 0x4(%edx),%ecx 80102411: 89 48 08 mov %ecx,0x8(%eax) st->type = ip->type; 80102414: 0f b7 4a 50 movzwl 0x50(%edx),%ecx 80102418: 66 89 08 mov %cx,(%eax) st->nlink = ip->nlink; 8010241b: 0f b7 4a 56 movzwl 0x56(%edx),%ecx 8010241f: 66 89 48 0c mov %cx,0xc(%eax) st->size = ip->size; 80102423: 8b 52 58 mov 0x58(%edx),%edx 80102426: 89 50 10 mov %edx,0x10(%eax) } 80102429: 5d pop %ebp 8010242a: c3 ret 8010242b: 90 nop 8010242c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102430 <readi>: // Read data from inode. // Caller must hold ip->lock. int readi(struct inode *ip, char *dst, uint off, uint n) { 80102430: 55 push %ebp 80102431: 89 e5 mov %esp,%ebp 80102433: 57 push %edi 80102434: 56 push %esi 80102435: 53 push %ebx 80102436: 83 ec 1c sub $0x1c,%esp 80102439: 8b 45 08 mov 0x8(%ebp),%eax 8010243c: 8b 75 0c mov 0xc(%ebp),%esi 8010243f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if (ip->type == T_DEV) { 80102442: 66 83 78 50 03 cmpw $0x3,0x50(%eax) int readi(struct inode *ip, char *dst, uint off, uint n) { 80102447: 89 75 e0 mov %esi,-0x20(%ebp) 8010244a: 89 45 d8 mov %eax,-0x28(%ebp) 8010244d: 8b 75 10 mov 0x10(%ebp),%esi 80102450: 89 7d e4 mov %edi,-0x1c(%ebp) if (ip->type == T_DEV) { 80102453: 0f 84 a7 00 00 00 je 80102500 <readi+0xd0> return -1; } return devsw[ip->major].read(ip, dst, n); } if (off > ip->size || off + n < off) { 80102459: 8b 45 d8 mov -0x28(%ebp),%eax 8010245c: 8b 40 58 mov 0x58(%eax),%eax 8010245f: 39 c6 cmp %eax,%esi 80102461: 0f 87 ba 00 00 00 ja 80102521 <readi+0xf1> 80102467: 8b 7d e4 mov -0x1c(%ebp),%edi 8010246a: 89 f9 mov %edi,%ecx 8010246c: 01 f1 add %esi,%ecx 8010246e: 0f 82 ad 00 00 00 jb 80102521 <readi+0xf1> return -1; } if (off + n > ip->size) { n = ip->size - off; 80102474: 89 c2 mov %eax,%edx 80102476: 29 f2 sub %esi,%edx 80102478: 39 c8 cmp %ecx,%eax 8010247a: 0f 43 d7 cmovae %edi,%edx } for (tot = 0; tot < n; tot += m, off += m, dst += m) { 8010247d: 31 ff xor %edi,%edi 8010247f: 85 d2 test %edx,%edx n = ip->size - off; 80102481: 89 55 e4 mov %edx,-0x1c(%ebp) for (tot = 0; tot < n; tot += m, off += m, dst += m) { 80102484: 74 6c je 801024f2 <readi+0xc2> 80102486: 8d 76 00 lea 0x0(%esi),%esi 80102489: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi bp = bread(ip->dev, bmap(ip, off / BSIZE)); 80102490: 8b 5d d8 mov -0x28(%ebp),%ebx 80102493: 89 f2 mov %esi,%edx 80102495: c1 ea 09 shr $0x9,%edx 80102498: 89 d8 mov %ebx,%eax 8010249a: e8 91 f9 ff ff call 80101e30 <bmap> 8010249f: 83 ec 08 sub $0x8,%esp 801024a2: 50 push %eax 801024a3: ff 33 pushl (%ebx) 801024a5: e8 26 dc ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off % BSIZE); 801024aa: 8b 5d e4 mov -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off / BSIZE)); 801024ad: 89 c2 mov %eax,%edx m = min(n - tot, BSIZE - off % BSIZE); 801024af: 89 f0 mov %esi,%eax 801024b1: 25 ff 01 00 00 and $0x1ff,%eax 801024b6: b9 00 02 00 00 mov $0x200,%ecx 801024bb: 83 c4 0c add $0xc,%esp 801024be: 29 c1 sub %eax,%ecx memmove(dst, bp->data + off % BSIZE, m); 801024c0: 8d 44 02 5c lea 0x5c(%edx,%eax,1),%eax 801024c4: 89 55 dc mov %edx,-0x24(%ebp) m = min(n - tot, BSIZE - off % BSIZE); 801024c7: 29 fb sub %edi,%ebx 801024c9: 39 d9 cmp %ebx,%ecx 801024cb: 0f 46 d9 cmovbe %ecx,%ebx memmove(dst, bp->data + off % BSIZE, m); 801024ce: 53 push %ebx 801024cf: 50 push %eax for (tot = 0; tot < n; tot += m, off += m, dst += m) { 801024d0: 01 df add %ebx,%edi memmove(dst, bp->data + off % BSIZE, m); 801024d2: ff 75 e0 pushl -0x20(%ebp) for (tot = 0; tot < n; tot += m, off += m, dst += m) { 801024d5: 01 de add %ebx,%esi memmove(dst, bp->data + off % BSIZE, m); 801024d7: e8 24 2b 00 00 call 80105000 <memmove> brelse(bp); 801024dc: 8b 55 dc mov -0x24(%ebp),%edx 801024df: 89 14 24 mov %edx,(%esp) 801024e2: e8 f9 dc ff ff call 801001e0 <brelse> for (tot = 0; tot < n; tot += m, off += m, dst += m) { 801024e7: 01 5d e0 add %ebx,-0x20(%ebp) 801024ea: 83 c4 10 add $0x10,%esp 801024ed: 39 7d e4 cmp %edi,-0x1c(%ebp) 801024f0: 77 9e ja 80102490 <readi+0x60> } return n; 801024f2: 8b 45 e4 mov -0x1c(%ebp),%eax } 801024f5: 8d 65 f4 lea -0xc(%ebp),%esp 801024f8: 5b pop %ebx 801024f9: 5e pop %esi 801024fa: 5f pop %edi 801024fb: 5d pop %ebp 801024fc: c3 ret 801024fd: 8d 76 00 lea 0x0(%esi),%esi if (ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) { 80102500: 0f bf 40 52 movswl 0x52(%eax),%eax 80102504: 66 83 f8 09 cmp $0x9,%ax 80102508: 77 17 ja 80102521 <readi+0xf1> 8010250a: 8b 04 c5 40 31 11 80 mov -0x7feecec0(,%eax,8),%eax 80102511: 85 c0 test %eax,%eax 80102513: 74 0c je 80102521 <readi+0xf1> return devsw[ip->major].read(ip, dst, n); 80102515: 89 7d 10 mov %edi,0x10(%ebp) } 80102518: 8d 65 f4 lea -0xc(%ebp),%esp 8010251b: 5b pop %ebx 8010251c: 5e pop %esi 8010251d: 5f pop %edi 8010251e: 5d pop %ebp return devsw[ip->major].read(ip, dst, n); 8010251f: ff e0 jmp *%eax return -1; 80102521: b8 ff ff ff ff mov $0xffffffff,%eax 80102526: eb cd jmp 801024f5 <readi+0xc5> 80102528: 90 nop 80102529: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102530 <writei>: // Write data to inode. // Caller must hold ip->lock. int writei(struct inode *ip, char *src, uint off, uint n) { 80102530: 55 push %ebp 80102531: 89 e5 mov %esp,%ebp 80102533: 57 push %edi 80102534: 56 push %esi 80102535: 53 push %ebx 80102536: 83 ec 1c sub $0x1c,%esp 80102539: 8b 45 08 mov 0x8(%ebp),%eax 8010253c: 8b 75 0c mov 0xc(%ebp),%esi 8010253f: 8b 7d 14 mov 0x14(%ebp),%edi uint tot, m; struct buf *bp; if (ip->type == T_DEV) { 80102542: 66 83 78 50 03 cmpw $0x3,0x50(%eax) int writei(struct inode *ip, char *src, uint off, uint n) { 80102547: 89 75 dc mov %esi,-0x24(%ebp) 8010254a: 89 45 d8 mov %eax,-0x28(%ebp) 8010254d: 8b 75 10 mov 0x10(%ebp),%esi 80102550: 89 7d e0 mov %edi,-0x20(%ebp) if (ip->type == T_DEV) { 80102553: 0f 84 b7 00 00 00 je 80102610 <writei+0xe0> return -1; } return devsw[ip->major].write(ip, src, n); } if (off > ip->size || off + n < off) { 80102559: 8b 45 d8 mov -0x28(%ebp),%eax 8010255c: 39 70 58 cmp %esi,0x58(%eax) 8010255f: 0f 82 eb 00 00 00 jb 80102650 <writei+0x120> 80102565: 8b 7d e0 mov -0x20(%ebp),%edi 80102568: 31 d2 xor %edx,%edx 8010256a: 89 f8 mov %edi,%eax 8010256c: 01 f0 add %esi,%eax 8010256e: 0f 92 c2 setb %dl return -1; } if (off + n > MAXFILE * BSIZE) { 80102571: 3d 00 18 01 00 cmp $0x11800,%eax 80102576: 0f 87 d4 00 00 00 ja 80102650 <writei+0x120> 8010257c: 85 d2 test %edx,%edx 8010257e: 0f 85 cc 00 00 00 jne 80102650 <writei+0x120> return -1; } for (tot = 0; tot < n; tot += m, off += m, src += m) { 80102584: 85 ff test %edi,%edi 80102586: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 8010258d: 74 72 je 80102601 <writei+0xd1> 8010258f: 90 nop bp = bread(ip->dev, bmap(ip, off / BSIZE)); 80102590: 8b 7d d8 mov -0x28(%ebp),%edi 80102593: 89 f2 mov %esi,%edx 80102595: c1 ea 09 shr $0x9,%edx 80102598: 89 f8 mov %edi,%eax 8010259a: e8 91 f8 ff ff call 80101e30 <bmap> 8010259f: 83 ec 08 sub $0x8,%esp 801025a2: 50 push %eax 801025a3: ff 37 pushl (%edi) 801025a5: e8 26 db ff ff call 801000d0 <bread> m = min(n - tot, BSIZE - off % BSIZE); 801025aa: 8b 5d e0 mov -0x20(%ebp),%ebx 801025ad: 2b 5d e4 sub -0x1c(%ebp),%ebx bp = bread(ip->dev, bmap(ip, off / BSIZE)); 801025b0: 89 c7 mov %eax,%edi m = min(n - tot, BSIZE - off % BSIZE); 801025b2: 89 f0 mov %esi,%eax 801025b4: b9 00 02 00 00 mov $0x200,%ecx 801025b9: 83 c4 0c add $0xc,%esp 801025bc: 25 ff 01 00 00 and $0x1ff,%eax 801025c1: 29 c1 sub %eax,%ecx memmove(bp->data + off % BSIZE, src, m); 801025c3: 8d 44 07 5c lea 0x5c(%edi,%eax,1),%eax m = min(n - tot, BSIZE - off % BSIZE); 801025c7: 39 d9 cmp %ebx,%ecx 801025c9: 0f 46 d9 cmovbe %ecx,%ebx memmove(bp->data + off % BSIZE, src, m); 801025cc: 53 push %ebx 801025cd: ff 75 dc pushl -0x24(%ebp) for (tot = 0; tot < n; tot += m, off += m, src += m) { 801025d0: 01 de add %ebx,%esi memmove(bp->data + off % BSIZE, src, m); 801025d2: 50 push %eax 801025d3: e8 28 2a 00 00 call 80105000 <memmove> log_write(bp); 801025d8: 89 3c 24 mov %edi,(%esp) 801025db: e8 60 12 00 00 call 80103840 <log_write> brelse(bp); 801025e0: 89 3c 24 mov %edi,(%esp) 801025e3: e8 f8 db ff ff call 801001e0 <brelse> for (tot = 0; tot < n; tot += m, off += m, src += m) { 801025e8: 01 5d e4 add %ebx,-0x1c(%ebp) 801025eb: 01 5d dc add %ebx,-0x24(%ebp) 801025ee: 83 c4 10 add $0x10,%esp 801025f1: 8b 45 e4 mov -0x1c(%ebp),%eax 801025f4: 39 45 e0 cmp %eax,-0x20(%ebp) 801025f7: 77 97 ja 80102590 <writei+0x60> } if (n > 0 && off > ip->size) { 801025f9: 8b 45 d8 mov -0x28(%ebp),%eax 801025fc: 3b 70 58 cmp 0x58(%eax),%esi 801025ff: 77 37 ja 80102638 <writei+0x108> ip->size = off; iupdate(ip); } return n; 80102601: 8b 45 e0 mov -0x20(%ebp),%eax } 80102604: 8d 65 f4 lea -0xc(%ebp),%esp 80102607: 5b pop %ebx 80102608: 5e pop %esi 80102609: 5f pop %edi 8010260a: 5d pop %ebp 8010260b: c3 ret 8010260c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) { 80102610: 0f bf 40 52 movswl 0x52(%eax),%eax 80102614: 66 83 f8 09 cmp $0x9,%ax 80102618: 77 36 ja 80102650 <writei+0x120> 8010261a: 8b 04 c5 44 31 11 80 mov -0x7feecebc(,%eax,8),%eax 80102621: 85 c0 test %eax,%eax 80102623: 74 2b je 80102650 <writei+0x120> return devsw[ip->major].write(ip, src, n); 80102625: 89 7d 10 mov %edi,0x10(%ebp) } 80102628: 8d 65 f4 lea -0xc(%ebp),%esp 8010262b: 5b pop %ebx 8010262c: 5e pop %esi 8010262d: 5f pop %edi 8010262e: 5d pop %ebp return devsw[ip->major].write(ip, src, n); 8010262f: ff e0 jmp *%eax 80102631: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi ip->size = off; 80102638: 8b 45 d8 mov -0x28(%ebp),%eax iupdate(ip); 8010263b: 83 ec 0c sub $0xc,%esp ip->size = off; 8010263e: 89 70 58 mov %esi,0x58(%eax) iupdate(ip); 80102641: 50 push %eax 80102642: e8 59 fa ff ff call 801020a0 <iupdate> 80102647: 83 c4 10 add $0x10,%esp 8010264a: eb b5 jmp 80102601 <writei+0xd1> 8010264c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80102650: b8 ff ff ff ff mov $0xffffffff,%eax 80102655: eb ad jmp 80102604 <writei+0xd4> 80102657: 89 f6 mov %esi,%esi 80102659: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102660 <namecmp>: // Directories int namecmp(const char *s, const char *t) { 80102660: 55 push %ebp 80102661: 89 e5 mov %esp,%ebp 80102663: 83 ec 0c sub $0xc,%esp return strncmp(s, t, DIRSIZ); 80102666: 6a 0e push $0xe 80102668: ff 75 0c pushl 0xc(%ebp) 8010266b: ff 75 08 pushl 0x8(%ebp) 8010266e: e8 fd 29 00 00 call 80105070 <strncmp> } 80102673: c9 leave 80102674: c3 ret 80102675: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102679: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102680 <dirlookup>: // Look for a directory entry in a directory. // If found, set *poff to byte offset of entry. struct inode* dirlookup(struct inode *dp, char *name, uint *poff) { 80102680: 55 push %ebp 80102681: 89 e5 mov %esp,%ebp 80102683: 57 push %edi 80102684: 56 push %esi 80102685: 53 push %ebx 80102686: 83 ec 1c sub $0x1c,%esp 80102689: 8b 5d 08 mov 0x8(%ebp),%ebx uint off, inum; struct dirent de; if (dp->type != T_DIR) { 8010268c: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80102691: 0f 85 85 00 00 00 jne 8010271c <dirlookup+0x9c> panic("dirlookup not DIR"); } for (off = 0; off < dp->size; off += sizeof(de)) { 80102697: 8b 53 58 mov 0x58(%ebx),%edx 8010269a: 31 ff xor %edi,%edi 8010269c: 8d 75 d8 lea -0x28(%ebp),%esi 8010269f: 85 d2 test %edx,%edx 801026a1: 74 3e je 801026e1 <dirlookup+0x61> 801026a3: 90 nop 801026a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) { 801026a8: 6a 10 push $0x10 801026aa: 57 push %edi 801026ab: 56 push %esi 801026ac: 53 push %ebx 801026ad: e8 7e fd ff ff call 80102430 <readi> 801026b2: 83 c4 10 add $0x10,%esp 801026b5: 83 f8 10 cmp $0x10,%eax 801026b8: 75 55 jne 8010270f <dirlookup+0x8f> panic("dirlookup read"); } if (de.inum == 0) { 801026ba: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 801026bf: 74 18 je 801026d9 <dirlookup+0x59> return strncmp(s, t, DIRSIZ); 801026c1: 8d 45 da lea -0x26(%ebp),%eax 801026c4: 83 ec 04 sub $0x4,%esp 801026c7: 6a 0e push $0xe 801026c9: 50 push %eax 801026ca: ff 75 0c pushl 0xc(%ebp) 801026cd: e8 9e 29 00 00 call 80105070 <strncmp> continue; } if (namecmp(name, de.name) == 0) { 801026d2: 83 c4 10 add $0x10,%esp 801026d5: 85 c0 test %eax,%eax 801026d7: 74 17 je 801026f0 <dirlookup+0x70> for (off = 0; off < dp->size; off += sizeof(de)) { 801026d9: 83 c7 10 add $0x10,%edi 801026dc: 3b 7b 58 cmp 0x58(%ebx),%edi 801026df: 72 c7 jb 801026a8 <dirlookup+0x28> return iget(dp->dev, inum); } } return 0; } 801026e1: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 801026e4: 31 c0 xor %eax,%eax } 801026e6: 5b pop %ebx 801026e7: 5e pop %esi 801026e8: 5f pop %edi 801026e9: 5d pop %ebp 801026ea: c3 ret 801026eb: 90 nop 801026ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (poff) { 801026f0: 8b 45 10 mov 0x10(%ebp),%eax 801026f3: 85 c0 test %eax,%eax 801026f5: 74 05 je 801026fc <dirlookup+0x7c> *poff = off; 801026f7: 8b 45 10 mov 0x10(%ebp),%eax 801026fa: 89 38 mov %edi,(%eax) inum = de.inum; 801026fc: 0f b7 55 d8 movzwl -0x28(%ebp),%edx return iget(dp->dev, inum); 80102700: 8b 03 mov (%ebx),%eax 80102702: e8 59 f6 ff ff call 80101d60 <iget> } 80102707: 8d 65 f4 lea -0xc(%ebp),%esp 8010270a: 5b pop %ebx 8010270b: 5e pop %esi 8010270c: 5f pop %edi 8010270d: 5d pop %ebp 8010270e: c3 ret panic("dirlookup read"); 8010270f: 83 ec 0c sub $0xc,%esp 80102712: 68 a9 7c 10 80 push $0x80107ca9 80102717: e8 c4 dd ff ff call 801004e0 <panic> panic("dirlookup not DIR"); 8010271c: 83 ec 0c sub $0xc,%esp 8010271f: 68 97 7c 10 80 push $0x80107c97 80102724: e8 b7 dd ff ff call 801004e0 <panic> 80102729: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102730 <namex>: // Look up and return the inode for a path name. // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80102730: 55 push %ebp 80102731: 89 e5 mov %esp,%ebp 80102733: 57 push %edi 80102734: 56 push %esi 80102735: 53 push %ebx 80102736: 89 cf mov %ecx,%edi 80102738: 89 c3 mov %eax,%ebx 8010273a: 83 ec 1c sub $0x1c,%esp struct inode *ip, *next; if (*path == '/') { 8010273d: 80 38 2f cmpb $0x2f,(%eax) static struct inode* namex(char *path, int nameiparent, char *name) { 80102740: 89 55 e0 mov %edx,-0x20(%ebp) if (*path == '/') { 80102743: 0f 84 67 01 00 00 je 801028b0 <namex+0x180> ip = iget(ROOTDEV, ROOTINO); } else { ip = idup(myproc()->cwd); 80102749: e8 92 1b 00 00 call 801042e0 <myproc> acquire(&icache.lock); 8010274e: 83 ec 0c sub $0xc,%esp ip = idup(myproc()->cwd); 80102751: 8b 70 68 mov 0x68(%eax),%esi acquire(&icache.lock); 80102754: 68 c0 31 11 80 push $0x801131c0 80102759: e8 e2 26 00 00 call 80104e40 <acquire> ip->ref++; 8010275e: 83 46 08 01 addl $0x1,0x8(%esi) release(&icache.lock); 80102762: c7 04 24 c0 31 11 80 movl $0x801131c0,(%esp) 80102769: e8 92 27 00 00 call 80104f00 <release> 8010276e: 83 c4 10 add $0x10,%esp 80102771: eb 08 jmp 8010277b <namex+0x4b> 80102773: 90 nop 80102774: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi path++; 80102778: 83 c3 01 add $0x1,%ebx while (*path == '/') { 8010277b: 0f b6 03 movzbl (%ebx),%eax 8010277e: 3c 2f cmp $0x2f,%al 80102780: 74 f6 je 80102778 <namex+0x48> if (*path == 0) { 80102782: 84 c0 test %al,%al 80102784: 0f 84 ee 00 00 00 je 80102878 <namex+0x148> while (*path != '/' && *path != 0) { 8010278a: 0f b6 03 movzbl (%ebx),%eax 8010278d: 3c 2f cmp $0x2f,%al 8010278f: 0f 84 b3 00 00 00 je 80102848 <namex+0x118> 80102795: 84 c0 test %al,%al 80102797: 89 da mov %ebx,%edx 80102799: 75 09 jne 801027a4 <namex+0x74> 8010279b: e9 a8 00 00 00 jmp 80102848 <namex+0x118> 801027a0: 84 c0 test %al,%al 801027a2: 74 0a je 801027ae <namex+0x7e> path++; 801027a4: 83 c2 01 add $0x1,%edx while (*path != '/' && *path != 0) { 801027a7: 0f b6 02 movzbl (%edx),%eax 801027aa: 3c 2f cmp $0x2f,%al 801027ac: 75 f2 jne 801027a0 <namex+0x70> 801027ae: 89 d1 mov %edx,%ecx 801027b0: 29 d9 sub %ebx,%ecx if (len >= DIRSIZ) { 801027b2: 83 f9 0d cmp $0xd,%ecx 801027b5: 0f 8e 91 00 00 00 jle 8010284c <namex+0x11c> memmove(name, s, DIRSIZ); 801027bb: 83 ec 04 sub $0x4,%esp 801027be: 89 55 e4 mov %edx,-0x1c(%ebp) 801027c1: 6a 0e push $0xe 801027c3: 53 push %ebx 801027c4: 57 push %edi 801027c5: e8 36 28 00 00 call 80105000 <memmove> path++; 801027ca: 8b 55 e4 mov -0x1c(%ebp),%edx memmove(name, s, DIRSIZ); 801027cd: 83 c4 10 add $0x10,%esp path++; 801027d0: 89 d3 mov %edx,%ebx while (*path == '/') { 801027d2: 80 3a 2f cmpb $0x2f,(%edx) 801027d5: 75 11 jne 801027e8 <namex+0xb8> 801027d7: 89 f6 mov %esi,%esi 801027d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi path++; 801027e0: 83 c3 01 add $0x1,%ebx while (*path == '/') { 801027e3: 80 3b 2f cmpb $0x2f,(%ebx) 801027e6: 74 f8 je 801027e0 <namex+0xb0> } while ((path = skipelem(path, name)) != 0) { ilock(ip); 801027e8: 83 ec 0c sub $0xc,%esp 801027eb: 56 push %esi 801027ec: e8 5f f9 ff ff call 80102150 <ilock> if (ip->type != T_DIR) { 801027f1: 83 c4 10 add $0x10,%esp 801027f4: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 801027f9: 0f 85 91 00 00 00 jne 80102890 <namex+0x160> iunlockput(ip); return 0; } if (nameiparent && *path == '\0') { 801027ff: 8b 55 e0 mov -0x20(%ebp),%edx 80102802: 85 d2 test %edx,%edx 80102804: 74 09 je 8010280f <namex+0xdf> 80102806: 80 3b 00 cmpb $0x0,(%ebx) 80102809: 0f 84 b7 00 00 00 je 801028c6 <namex+0x196> // Stop one level early. iunlock(ip); return ip; } if ((next = dirlookup(ip, name, 0)) == 0) { 8010280f: 83 ec 04 sub $0x4,%esp 80102812: 6a 00 push $0x0 80102814: 57 push %edi 80102815: 56 push %esi 80102816: e8 65 fe ff ff call 80102680 <dirlookup> 8010281b: 83 c4 10 add $0x10,%esp 8010281e: 85 c0 test %eax,%eax 80102820: 74 6e je 80102890 <namex+0x160> iunlock(ip); 80102822: 83 ec 0c sub $0xc,%esp 80102825: 89 45 e4 mov %eax,-0x1c(%ebp) 80102828: 56 push %esi 80102829: e8 02 fa ff ff call 80102230 <iunlock> iput(ip); 8010282e: 89 34 24 mov %esi,(%esp) 80102831: e8 4a fa ff ff call 80102280 <iput> 80102836: 8b 45 e4 mov -0x1c(%ebp),%eax 80102839: 83 c4 10 add $0x10,%esp 8010283c: 89 c6 mov %eax,%esi 8010283e: e9 38 ff ff ff jmp 8010277b <namex+0x4b> 80102843: 90 nop 80102844: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while (*path != '/' && *path != 0) { 80102848: 89 da mov %ebx,%edx 8010284a: 31 c9 xor %ecx,%ecx memmove(name, s, len); 8010284c: 83 ec 04 sub $0x4,%esp 8010284f: 89 55 dc mov %edx,-0x24(%ebp) 80102852: 89 4d e4 mov %ecx,-0x1c(%ebp) 80102855: 51 push %ecx 80102856: 53 push %ebx 80102857: 57 push %edi 80102858: e8 a3 27 00 00 call 80105000 <memmove> name[len] = 0; 8010285d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80102860: 8b 55 dc mov -0x24(%ebp),%edx 80102863: 83 c4 10 add $0x10,%esp 80102866: c6 04 0f 00 movb $0x0,(%edi,%ecx,1) 8010286a: 89 d3 mov %edx,%ebx 8010286c: e9 61 ff ff ff jmp 801027d2 <namex+0xa2> 80102871: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return 0; } iunlockput(ip); ip = next; } if (nameiparent) { 80102878: 8b 45 e0 mov -0x20(%ebp),%eax 8010287b: 85 c0 test %eax,%eax 8010287d: 75 5d jne 801028dc <namex+0x1ac> iput(ip); return 0; } return ip; } 8010287f: 8d 65 f4 lea -0xc(%ebp),%esp 80102882: 89 f0 mov %esi,%eax 80102884: 5b pop %ebx 80102885: 5e pop %esi 80102886: 5f pop %edi 80102887: 5d pop %ebp 80102888: c3 ret 80102889: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi iunlock(ip); 80102890: 83 ec 0c sub $0xc,%esp 80102893: 56 push %esi 80102894: e8 97 f9 ff ff call 80102230 <iunlock> iput(ip); 80102899: 89 34 24 mov %esi,(%esp) return 0; 8010289c: 31 f6 xor %esi,%esi iput(ip); 8010289e: e8 dd f9 ff ff call 80102280 <iput> return 0; 801028a3: 83 c4 10 add $0x10,%esp } 801028a6: 8d 65 f4 lea -0xc(%ebp),%esp 801028a9: 89 f0 mov %esi,%eax 801028ab: 5b pop %ebx 801028ac: 5e pop %esi 801028ad: 5f pop %edi 801028ae: 5d pop %ebp 801028af: c3 ret ip = iget(ROOTDEV, ROOTINO); 801028b0: ba 01 00 00 00 mov $0x1,%edx 801028b5: b8 01 00 00 00 mov $0x1,%eax 801028ba: e8 a1 f4 ff ff call 80101d60 <iget> 801028bf: 89 c6 mov %eax,%esi 801028c1: e9 b5 fe ff ff jmp 8010277b <namex+0x4b> iunlock(ip); 801028c6: 83 ec 0c sub $0xc,%esp 801028c9: 56 push %esi 801028ca: e8 61 f9 ff ff call 80102230 <iunlock> return ip; 801028cf: 83 c4 10 add $0x10,%esp } 801028d2: 8d 65 f4 lea -0xc(%ebp),%esp 801028d5: 89 f0 mov %esi,%eax 801028d7: 5b pop %ebx 801028d8: 5e pop %esi 801028d9: 5f pop %edi 801028da: 5d pop %ebp 801028db: c3 ret iput(ip); 801028dc: 83 ec 0c sub $0xc,%esp 801028df: 56 push %esi return 0; 801028e0: 31 f6 xor %esi,%esi iput(ip); 801028e2: e8 99 f9 ff ff call 80102280 <iput> return 0; 801028e7: 83 c4 10 add $0x10,%esp 801028ea: eb 93 jmp 8010287f <namex+0x14f> 801028ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801028f0 <dirlink>: int dirlink(struct inode *dp, char *name, uint inum) { 801028f0: 55 push %ebp 801028f1: 89 e5 mov %esp,%ebp 801028f3: 57 push %edi 801028f4: 56 push %esi 801028f5: 53 push %ebx 801028f6: 83 ec 20 sub $0x20,%esp 801028f9: 8b 5d 08 mov 0x8(%ebp),%ebx if ((ip = dirlookup(dp, name, 0)) != 0) { 801028fc: 6a 00 push $0x0 801028fe: ff 75 0c pushl 0xc(%ebp) 80102901: 53 push %ebx 80102902: e8 79 fd ff ff call 80102680 <dirlookup> 80102907: 83 c4 10 add $0x10,%esp 8010290a: 85 c0 test %eax,%eax 8010290c: 75 67 jne 80102975 <dirlink+0x85> for (off = 0; off < dp->size; off += sizeof(de)) { 8010290e: 8b 7b 58 mov 0x58(%ebx),%edi 80102911: 8d 75 d8 lea -0x28(%ebp),%esi 80102914: 85 ff test %edi,%edi 80102916: 74 29 je 80102941 <dirlink+0x51> 80102918: 31 ff xor %edi,%edi 8010291a: 8d 75 d8 lea -0x28(%ebp),%esi 8010291d: eb 09 jmp 80102928 <dirlink+0x38> 8010291f: 90 nop 80102920: 83 c7 10 add $0x10,%edi 80102923: 3b 7b 58 cmp 0x58(%ebx),%edi 80102926: 73 19 jae 80102941 <dirlink+0x51> if (readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) { 80102928: 6a 10 push $0x10 8010292a: 57 push %edi 8010292b: 56 push %esi 8010292c: 53 push %ebx 8010292d: e8 fe fa ff ff call 80102430 <readi> 80102932: 83 c4 10 add $0x10,%esp 80102935: 83 f8 10 cmp $0x10,%eax 80102938: 75 4e jne 80102988 <dirlink+0x98> if (de.inum == 0) { 8010293a: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 8010293f: 75 df jne 80102920 <dirlink+0x30> strncpy(de.name, name, DIRSIZ); 80102941: 8d 45 da lea -0x26(%ebp),%eax 80102944: 83 ec 04 sub $0x4,%esp 80102947: 6a 0e push $0xe 80102949: ff 75 0c pushl 0xc(%ebp) 8010294c: 50 push %eax 8010294d: e8 7e 27 00 00 call 801050d0 <strncpy> de.inum = inum; 80102952: 8b 45 10 mov 0x10(%ebp),%eax if (writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) { 80102955: 6a 10 push $0x10 80102957: 57 push %edi 80102958: 56 push %esi 80102959: 53 push %ebx de.inum = inum; 8010295a: 66 89 45 d8 mov %ax,-0x28(%ebp) if (writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) { 8010295e: e8 cd fb ff ff call 80102530 <writei> 80102963: 83 c4 20 add $0x20,%esp 80102966: 83 f8 10 cmp $0x10,%eax 80102969: 75 2a jne 80102995 <dirlink+0xa5> return 0; 8010296b: 31 c0 xor %eax,%eax } 8010296d: 8d 65 f4 lea -0xc(%ebp),%esp 80102970: 5b pop %ebx 80102971: 5e pop %esi 80102972: 5f pop %edi 80102973: 5d pop %ebp 80102974: c3 ret iput(ip); 80102975: 83 ec 0c sub $0xc,%esp 80102978: 50 push %eax 80102979: e8 02 f9 ff ff call 80102280 <iput> return -1; 8010297e: 83 c4 10 add $0x10,%esp 80102981: b8 ff ff ff ff mov $0xffffffff,%eax 80102986: eb e5 jmp 8010296d <dirlink+0x7d> panic("dirlink read"); 80102988: 83 ec 0c sub $0xc,%esp 8010298b: 68 b8 7c 10 80 push $0x80107cb8 80102990: e8 4b db ff ff call 801004e0 <panic> panic("dirlink"); 80102995: 83 ec 0c sub $0xc,%esp 80102998: 68 de 82 10 80 push $0x801082de 8010299d: e8 3e db ff ff call 801004e0 <panic> 801029a2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801029a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801029b0 <namei>: struct inode* namei(char *path) { 801029b0: 55 push %ebp char name[DIRSIZ]; return namex(path, 0, name); 801029b1: 31 d2 xor %edx,%edx struct inode* namei(char *path) { 801029b3: 89 e5 mov %esp,%ebp 801029b5: 83 ec 18 sub $0x18,%esp return namex(path, 0, name); 801029b8: 8b 45 08 mov 0x8(%ebp),%eax 801029bb: 8d 4d ea lea -0x16(%ebp),%ecx 801029be: e8 6d fd ff ff call 80102730 <namex> } 801029c3: c9 leave 801029c4: c3 ret 801029c5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801029c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801029d0 <nameiparent>: struct inode*nameiparent(char *path, char *name) { 801029d0: 55 push %ebp return namex(path, 1, name); 801029d1: ba 01 00 00 00 mov $0x1,%edx struct inode*nameiparent(char *path, char *name) { 801029d6: 89 e5 mov %esp,%ebp return namex(path, 1, name); 801029d8: 8b 4d 0c mov 0xc(%ebp),%ecx 801029db: 8b 45 08 mov 0x8(%ebp),%eax } 801029de: 5d pop %ebp return namex(path, 1, name); 801029df: e9 4c fd ff ff jmp 80102730 <namex> 801029e4: 66 90 xchg %ax,%ax 801029e6: 66 90 xchg %ax,%ax 801029e8: 66 90 xchg %ax,%ax 801029ea: 66 90 xchg %ax,%ax 801029ec: 66 90 xchg %ax,%ax 801029ee: 66 90 xchg %ax,%ax 801029f0 <idestart>: // Switch back to disk 0. outb(0x1f6, 0xe0 | (0 << 4)); } // Start the request for b. Caller must hold idelock. static void idestart(struct buf *b) { 801029f0: 55 push %ebp 801029f1: 89 e5 mov %esp,%ebp 801029f3: 57 push %edi 801029f4: 56 push %esi 801029f5: 53 push %ebx 801029f6: 83 ec 0c sub $0xc,%esp if (b == 0) { 801029f9: 85 c0 test %eax,%eax 801029fb: 0f 84 b4 00 00 00 je 80102ab5 <idestart+0xc5> panic("idestart"); } if (b->blockno >= FSSIZE) { 80102a01: 8b 58 08 mov 0x8(%eax),%ebx 80102a04: 89 c6 mov %eax,%esi 80102a06: 81 fb e7 03 00 00 cmp $0x3e7,%ebx 80102a0c: 0f 87 96 00 00 00 ja 80102aa8 <idestart+0xb8> 80102a12: b9 f7 01 00 00 mov $0x1f7,%ecx 80102a17: 89 f6 mov %esi,%esi 80102a19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102a20: 89 ca mov %ecx,%edx 80102a22: ec in (%dx),%al while (((r = inb(0x1f7)) & (IDE_BSY | IDE_DRDY)) != IDE_DRDY) { 80102a23: 83 e0 c0 and $0xffffffc0,%eax 80102a26: 3c 40 cmp $0x40,%al 80102a28: 75 f6 jne 80102a20 <idestart+0x30> asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80102a2a: 31 ff xor %edi,%edi 80102a2c: ba f6 03 00 00 mov $0x3f6,%edx 80102a31: 89 f8 mov %edi,%eax 80102a33: ee out %al,(%dx) 80102a34: b8 01 00 00 00 mov $0x1,%eax 80102a39: ba f2 01 00 00 mov $0x1f2,%edx 80102a3e: ee out %al,(%dx) 80102a3f: ba f3 01 00 00 mov $0x1f3,%edx 80102a44: 89 d8 mov %ebx,%eax 80102a46: ee out %al,(%dx) idewait(0); outb(0x3f6, 0); // generate interrupt outb(0x1f2, sector_per_block); // number of sectors outb(0x1f3, sector & 0xff); outb(0x1f4, (sector >> 8) & 0xff); 80102a47: 89 d8 mov %ebx,%eax 80102a49: ba f4 01 00 00 mov $0x1f4,%edx 80102a4e: c1 f8 08 sar $0x8,%eax 80102a51: ee out %al,(%dx) 80102a52: ba f5 01 00 00 mov $0x1f5,%edx 80102a57: 89 f8 mov %edi,%eax 80102a59: ee out %al,(%dx) outb(0x1f5, (sector >> 16) & 0xff); outb(0x1f6, 0xe0 | ((b->dev & 1) << 4) | ((sector >> 24) & 0x0f)); 80102a5a: 0f b6 46 04 movzbl 0x4(%esi),%eax 80102a5e: ba f6 01 00 00 mov $0x1f6,%edx 80102a63: c1 e0 04 shl $0x4,%eax 80102a66: 83 e0 10 and $0x10,%eax 80102a69: 83 c8 e0 or $0xffffffe0,%eax 80102a6c: ee out %al,(%dx) if (b->flags & B_DIRTY) { 80102a6d: f6 06 04 testb $0x4,(%esi) 80102a70: 75 16 jne 80102a88 <idestart+0x98> 80102a72: b8 20 00 00 00 mov $0x20,%eax 80102a77: 89 ca mov %ecx,%edx 80102a79: ee out %al,(%dx) outsl(0x1f0, b->data, BSIZE / 4); } else { outb(0x1f7, read_cmd); } } 80102a7a: 8d 65 f4 lea -0xc(%ebp),%esp 80102a7d: 5b pop %ebx 80102a7e: 5e pop %esi 80102a7f: 5f pop %edi 80102a80: 5d pop %ebp 80102a81: c3 ret 80102a82: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102a88: b8 30 00 00 00 mov $0x30,%eax 80102a8d: 89 ca mov %ecx,%edx 80102a8f: ee out %al,(%dx) asm volatile ("cld; rep outsl" : 80102a90: b9 80 00 00 00 mov $0x80,%ecx outsl(0x1f0, b->data, BSIZE / 4); 80102a95: 83 c6 5c add $0x5c,%esi 80102a98: ba f0 01 00 00 mov $0x1f0,%edx 80102a9d: fc cld 80102a9e: f3 6f rep outsl %ds:(%esi),(%dx) } 80102aa0: 8d 65 f4 lea -0xc(%ebp),%esp 80102aa3: 5b pop %ebx 80102aa4: 5e pop %esi 80102aa5: 5f pop %edi 80102aa6: 5d pop %ebp 80102aa7: c3 ret panic("incorrect blockno"); 80102aa8: 83 ec 0c sub $0xc,%esp 80102aab: 68 24 7d 10 80 push $0x80107d24 80102ab0: e8 2b da ff ff call 801004e0 <panic> panic("idestart"); 80102ab5: 83 ec 0c sub $0xc,%esp 80102ab8: 68 1b 7d 10 80 push $0x80107d1b 80102abd: e8 1e da ff ff call 801004e0 <panic> 80102ac2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80102ac9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102ad0 <ideinit>: void ideinit(void) { 80102ad0: 55 push %ebp 80102ad1: 89 e5 mov %esp,%ebp 80102ad3: 83 ec 10 sub $0x10,%esp initlock(&idelock, "ide"); 80102ad6: 68 36 7d 10 80 push $0x80107d36 80102adb: 68 80 c5 10 80 push $0x8010c580 80102ae0: e8 1b 22 00 00 call 80104d00 <initlock> ioapicenable(IRQ_IDE, ncpu - 1); 80102ae5: 58 pop %eax 80102ae6: a1 e0 54 11 80 mov 0x801154e0,%eax 80102aeb: 5a pop %edx 80102aec: 83 e8 01 sub $0x1,%eax 80102aef: 50 push %eax 80102af0: 6a 0e push $0xe 80102af2: e8 a9 02 00 00 call 80102da0 <ioapicenable> 80102af7: 83 c4 10 add $0x10,%esp asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80102afa: ba f7 01 00 00 mov $0x1f7,%edx 80102aff: 90 nop 80102b00: ec in (%dx),%al while (((r = inb(0x1f7)) & (IDE_BSY | IDE_DRDY)) != IDE_DRDY) { 80102b01: 83 e0 c0 and $0xffffffc0,%eax 80102b04: 3c 40 cmp $0x40,%al 80102b06: 75 f8 jne 80102b00 <ideinit+0x30> asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80102b08: b8 f0 ff ff ff mov $0xfffffff0,%eax 80102b0d: ba f6 01 00 00 mov $0x1f6,%edx 80102b12: ee out %al,(%dx) 80102b13: b9 e8 03 00 00 mov $0x3e8,%ecx asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80102b18: ba f7 01 00 00 mov $0x1f7,%edx 80102b1d: eb 06 jmp 80102b25 <ideinit+0x55> 80102b1f: 90 nop for (i = 0; i < 1000; i++) { 80102b20: 83 e9 01 sub $0x1,%ecx 80102b23: 74 0f je 80102b34 <ideinit+0x64> 80102b25: ec in (%dx),%al if (inb(0x1f7) != 0) { 80102b26: 84 c0 test %al,%al 80102b28: 74 f6 je 80102b20 <ideinit+0x50> havedisk1 = 1; 80102b2a: c7 05 60 c5 10 80 01 movl $0x1,0x8010c560 80102b31: 00 00 00 asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80102b34: b8 e0 ff ff ff mov $0xffffffe0,%eax 80102b39: ba f6 01 00 00 mov $0x1f6,%edx 80102b3e: ee out %al,(%dx) } 80102b3f: c9 leave 80102b40: c3 ret 80102b41: eb 0d jmp 80102b50 <ideintr> 80102b43: 90 nop 80102b44: 90 nop 80102b45: 90 nop 80102b46: 90 nop 80102b47: 90 nop 80102b48: 90 nop 80102b49: 90 nop 80102b4a: 90 nop 80102b4b: 90 nop 80102b4c: 90 nop 80102b4d: 90 nop 80102b4e: 90 nop 80102b4f: 90 nop 80102b50 <ideintr>: // Interrupt handler. void ideintr(void) { 80102b50: 55 push %ebp 80102b51: 89 e5 mov %esp,%ebp 80102b53: 57 push %edi 80102b54: 56 push %esi 80102b55: 53 push %ebx 80102b56: 83 ec 18 sub $0x18,%esp struct buf *b; // First queued buffer is the active request. acquire(&idelock); 80102b59: 68 80 c5 10 80 push $0x8010c580 80102b5e: e8 dd 22 00 00 call 80104e40 <acquire> if ((b = idequeue) == 0) { 80102b63: 8b 1d 64 c5 10 80 mov 0x8010c564,%ebx 80102b69: 83 c4 10 add $0x10,%esp 80102b6c: 85 db test %ebx,%ebx 80102b6e: 74 67 je 80102bd7 <ideintr+0x87> release(&idelock); return; } idequeue = b->qnext; 80102b70: 8b 43 58 mov 0x58(%ebx),%eax 80102b73: a3 64 c5 10 80 mov %eax,0x8010c564 // Read data if needed. if (!(b->flags & B_DIRTY) && idewait(1) >= 0) { 80102b78: 8b 3b mov (%ebx),%edi 80102b7a: f7 c7 04 00 00 00 test $0x4,%edi 80102b80: 75 31 jne 80102bb3 <ideintr+0x63> asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80102b82: ba f7 01 00 00 mov $0x1f7,%edx 80102b87: 89 f6 mov %esi,%esi 80102b89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102b90: ec in (%dx),%al while (((r = inb(0x1f7)) & (IDE_BSY | IDE_DRDY)) != IDE_DRDY) { 80102b91: 89 c6 mov %eax,%esi 80102b93: 83 e6 c0 and $0xffffffc0,%esi 80102b96: 89 f1 mov %esi,%ecx 80102b98: 80 f9 40 cmp $0x40,%cl 80102b9b: 75 f3 jne 80102b90 <ideintr+0x40> if (checkerr && (r & (IDE_DF | IDE_ERR)) != 0) { 80102b9d: a8 21 test $0x21,%al 80102b9f: 75 12 jne 80102bb3 <ideintr+0x63> insl(0x1f0, b->data, BSIZE / 4); 80102ba1: 8d 7b 5c lea 0x5c(%ebx),%edi asm volatile ("cld; rep insl" : 80102ba4: b9 80 00 00 00 mov $0x80,%ecx 80102ba9: ba f0 01 00 00 mov $0x1f0,%edx 80102bae: fc cld 80102baf: f3 6d rep insl (%dx),%es:(%edi) 80102bb1: 8b 3b mov (%ebx),%edi } // Wake process waiting for this buf. b->flags |= B_VALID; b->flags &= ~B_DIRTY; 80102bb3: 83 e7 fb and $0xfffffffb,%edi wakeup(b); 80102bb6: 83 ec 0c sub $0xc,%esp b->flags &= ~B_DIRTY; 80102bb9: 89 f9 mov %edi,%ecx 80102bbb: 83 c9 02 or $0x2,%ecx 80102bbe: 89 0b mov %ecx,(%ebx) wakeup(b); 80102bc0: 53 push %ebx 80102bc1: e8 6a 1e 00 00 call 80104a30 <wakeup> // Start disk on next buf in queue. if (idequeue != 0) { 80102bc6: a1 64 c5 10 80 mov 0x8010c564,%eax 80102bcb: 83 c4 10 add $0x10,%esp 80102bce: 85 c0 test %eax,%eax 80102bd0: 74 05 je 80102bd7 <ideintr+0x87> idestart(idequeue); 80102bd2: e8 19 fe ff ff call 801029f0 <idestart> release(&idelock); 80102bd7: 83 ec 0c sub $0xc,%esp 80102bda: 68 80 c5 10 80 push $0x8010c580 80102bdf: e8 1c 23 00 00 call 80104f00 <release> } release(&idelock); } 80102be4: 8d 65 f4 lea -0xc(%ebp),%esp 80102be7: 5b pop %ebx 80102be8: 5e pop %esi 80102be9: 5f pop %edi 80102bea: 5d pop %ebp 80102beb: c3 ret 80102bec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102bf0 <iderw>: // Sync buf with disk. // If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID. // Else if B_VALID is not set, read buf from disk, set B_VALID. void iderw(struct buf *b) { 80102bf0: 55 push %ebp 80102bf1: 89 e5 mov %esp,%ebp 80102bf3: 53 push %ebx 80102bf4: 83 ec 10 sub $0x10,%esp 80102bf7: 8b 5d 08 mov 0x8(%ebp),%ebx struct buf **pp; if (!holdingsleep(&b->lock)) { 80102bfa: 8d 43 0c lea 0xc(%ebx),%eax 80102bfd: 50 push %eax 80102bfe: e8 ad 20 00 00 call 80104cb0 <holdingsleep> 80102c03: 83 c4 10 add $0x10,%esp 80102c06: 85 c0 test %eax,%eax 80102c08: 0f 84 c6 00 00 00 je 80102cd4 <iderw+0xe4> panic("iderw: buf not locked"); } if ((b->flags & (B_VALID | B_DIRTY)) == B_VALID) { 80102c0e: 8b 03 mov (%ebx),%eax 80102c10: 83 e0 06 and $0x6,%eax 80102c13: 83 f8 02 cmp $0x2,%eax 80102c16: 0f 84 ab 00 00 00 je 80102cc7 <iderw+0xd7> panic("iderw: nothing to do"); } if (b->dev != 0 && !havedisk1) { 80102c1c: 8b 53 04 mov 0x4(%ebx),%edx 80102c1f: 85 d2 test %edx,%edx 80102c21: 74 0d je 80102c30 <iderw+0x40> 80102c23: a1 60 c5 10 80 mov 0x8010c560,%eax 80102c28: 85 c0 test %eax,%eax 80102c2a: 0f 84 b1 00 00 00 je 80102ce1 <iderw+0xf1> panic("iderw: ide disk 1 not present"); } acquire(&idelock); //DOC:acquire-lock 80102c30: 83 ec 0c sub $0xc,%esp 80102c33: 68 80 c5 10 80 push $0x8010c580 80102c38: e8 03 22 00 00 call 80104e40 <acquire> // Append b to idequeue. b->qnext = 0; for (pp = &idequeue; *pp; pp = &(*pp)->qnext) { //DOC:insert-queue 80102c3d: 8b 15 64 c5 10 80 mov 0x8010c564,%edx 80102c43: 83 c4 10 add $0x10,%esp b->qnext = 0; 80102c46: c7 43 58 00 00 00 00 movl $0x0,0x58(%ebx) for (pp = &idequeue; *pp; pp = &(*pp)->qnext) { //DOC:insert-queue 80102c4d: 85 d2 test %edx,%edx 80102c4f: 75 09 jne 80102c5a <iderw+0x6a> 80102c51: eb 6d jmp 80102cc0 <iderw+0xd0> 80102c53: 90 nop 80102c54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102c58: 89 c2 mov %eax,%edx 80102c5a: 8b 42 58 mov 0x58(%edx),%eax 80102c5d: 85 c0 test %eax,%eax 80102c5f: 75 f7 jne 80102c58 <iderw+0x68> 80102c61: 83 c2 58 add $0x58,%edx ; } *pp = b; 80102c64: 89 1a mov %ebx,(%edx) // Start disk if necessary. if (idequeue == b) { 80102c66: 39 1d 64 c5 10 80 cmp %ebx,0x8010c564 80102c6c: 74 42 je 80102cb0 <iderw+0xc0> idestart(b); } // Wait for request to finish. while ((b->flags & (B_VALID | B_DIRTY)) != B_VALID) { 80102c6e: 8b 03 mov (%ebx),%eax 80102c70: 83 e0 06 and $0x6,%eax 80102c73: 83 f8 02 cmp $0x2,%eax 80102c76: 74 23 je 80102c9b <iderw+0xab> 80102c78: 90 nop 80102c79: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi sleep(b, &idelock); 80102c80: 83 ec 08 sub $0x8,%esp 80102c83: 68 80 c5 10 80 push $0x8010c580 80102c88: 53 push %ebx 80102c89: e8 f2 1b 00 00 call 80104880 <sleep> while ((b->flags & (B_VALID | B_DIRTY)) != B_VALID) { 80102c8e: 8b 03 mov (%ebx),%eax 80102c90: 83 c4 10 add $0x10,%esp 80102c93: 83 e0 06 and $0x6,%eax 80102c96: 83 f8 02 cmp $0x2,%eax 80102c99: 75 e5 jne 80102c80 <iderw+0x90> } release(&idelock); 80102c9b: c7 45 08 80 c5 10 80 movl $0x8010c580,0x8(%ebp) } 80102ca2: 8b 5d fc mov -0x4(%ebp),%ebx 80102ca5: c9 leave release(&idelock); 80102ca6: e9 55 22 00 00 jmp 80104f00 <release> 80102cab: 90 nop 80102cac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi idestart(b); 80102cb0: 89 d8 mov %ebx,%eax 80102cb2: e8 39 fd ff ff call 801029f0 <idestart> 80102cb7: eb b5 jmp 80102c6e <iderw+0x7e> 80102cb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for (pp = &idequeue; *pp; pp = &(*pp)->qnext) { //DOC:insert-queue 80102cc0: ba 64 c5 10 80 mov $0x8010c564,%edx 80102cc5: eb 9d jmp 80102c64 <iderw+0x74> panic("iderw: nothing to do"); 80102cc7: 83 ec 0c sub $0xc,%esp 80102cca: 68 50 7d 10 80 push $0x80107d50 80102ccf: e8 0c d8 ff ff call 801004e0 <panic> panic("iderw: buf not locked"); 80102cd4: 83 ec 0c sub $0xc,%esp 80102cd7: 68 3a 7d 10 80 push $0x80107d3a 80102cdc: e8 ff d7 ff ff call 801004e0 <panic> panic("iderw: ide disk 1 not present"); 80102ce1: 83 ec 0c sub $0xc,%esp 80102ce4: 68 65 7d 10 80 push $0x80107d65 80102ce9: e8 f2 d7 ff ff call 801004e0 <panic> 80102cee: 66 90 xchg %ax,%ax 80102cf0 <ioapicinit>: static void ioapicwrite(int reg, uint data) { ioapic->reg = reg; ioapic->data = data; } void ioapicinit(void) { 80102cf0: 55 push %ebp int i, id, maxintr; ioapic = (volatile struct ioapic*)IOAPIC; 80102cf1: c7 05 14 4e 11 80 00 movl $0xfec00000,0x80114e14 80102cf8: 00 c0 fe void ioapicinit(void) { 80102cfb: 89 e5 mov %esp,%ebp 80102cfd: 56 push %esi 80102cfe: 53 push %ebx ioapic->reg = reg; 80102cff: c7 05 00 00 c0 fe 01 movl $0x1,0xfec00000 80102d06: 00 00 00 return ioapic->data; 80102d09: a1 14 4e 11 80 mov 0x80114e14,%eax 80102d0e: 8b 58 10 mov 0x10(%eax),%ebx ioapic->reg = reg; 80102d11: c7 00 00 00 00 00 movl $0x0,(%eax) return ioapic->data; 80102d17: 8b 0d 14 4e 11 80 mov 0x80114e14,%ecx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; id = ioapicread(REG_ID) >> 24; if (id != ioapicid) { 80102d1d: 0f b6 15 40 4f 11 80 movzbl 0x80114f40,%edx maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102d24: c1 eb 10 shr $0x10,%ebx return ioapic->data; 80102d27: 8b 41 10 mov 0x10(%ecx),%eax maxintr = (ioapicread(REG_VER) >> 16) & 0xFF; 80102d2a: 0f b6 db movzbl %bl,%ebx id = ioapicread(REG_ID) >> 24; 80102d2d: c1 e8 18 shr $0x18,%eax if (id != ioapicid) { 80102d30: 39 c2 cmp %eax,%edx 80102d32: 74 16 je 80102d4a <ioapicinit+0x5a> cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n"); 80102d34: 83 ec 0c sub $0xc,%esp 80102d37: 68 84 7d 10 80 push $0x80107d84 80102d3c: e8 1f db ff ff call 80100860 <cprintf> 80102d41: 8b 0d 14 4e 11 80 mov 0x80114e14,%ecx 80102d47: 83 c4 10 add $0x10,%esp 80102d4a: 83 c3 21 add $0x21,%ebx void ioapicinit(void) { 80102d4d: ba 10 00 00 00 mov $0x10,%edx 80102d52: b8 20 00 00 00 mov $0x20,%eax 80102d57: 89 f6 mov %esi,%esi 80102d59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ioapic->reg = reg; 80102d60: 89 11 mov %edx,(%ecx) ioapic->data = data; 80102d62: 8b 0d 14 4e 11 80 mov 0x80114e14,%ecx } // Mark all interrupts edge-triggered, active high, disabled, // and not routed to any CPUs. for (i = 0; i <= maxintr; i++) { ioapicwrite(REG_TABLE + 2 * i, INT_DISABLED | (T_IRQ0 + i)); 80102d68: 89 c6 mov %eax,%esi 80102d6a: 81 ce 00 00 01 00 or $0x10000,%esi 80102d70: 83 c0 01 add $0x1,%eax ioapic->data = data; 80102d73: 89 71 10 mov %esi,0x10(%ecx) 80102d76: 8d 72 01 lea 0x1(%edx),%esi 80102d79: 83 c2 02 add $0x2,%edx for (i = 0; i <= maxintr; i++) { 80102d7c: 39 d8 cmp %ebx,%eax ioapic->reg = reg; 80102d7e: 89 31 mov %esi,(%ecx) ioapic->data = data; 80102d80: 8b 0d 14 4e 11 80 mov 0x80114e14,%ecx 80102d86: c7 41 10 00 00 00 00 movl $0x0,0x10(%ecx) for (i = 0; i <= maxintr; i++) { 80102d8d: 75 d1 jne 80102d60 <ioapicinit+0x70> ioapicwrite(REG_TABLE + 2 * i + 1, 0); } } 80102d8f: 8d 65 f8 lea -0x8(%ebp),%esp 80102d92: 5b pop %ebx 80102d93: 5e pop %esi 80102d94: 5d pop %ebp 80102d95: c3 ret 80102d96: 8d 76 00 lea 0x0(%esi),%esi 80102d99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102da0 <ioapicenable>: void ioapicenable(int irq, int cpunum) { 80102da0: 55 push %ebp ioapic->reg = reg; 80102da1: 8b 0d 14 4e 11 80 mov 0x80114e14,%ecx void ioapicenable(int irq, int cpunum) { 80102da7: 89 e5 mov %esp,%ebp 80102da9: 8b 45 08 mov 0x8(%ebp),%eax // Mark interrupt edge-triggered, active high, // enabled, and routed to the given cpunum, // which happens to be that cpu's APIC ID. ioapicwrite(REG_TABLE + 2 * irq, T_IRQ0 + irq); 80102dac: 8d 50 20 lea 0x20(%eax),%edx 80102daf: 8d 44 00 10 lea 0x10(%eax,%eax,1),%eax ioapic->reg = reg; 80102db3: 89 01 mov %eax,(%ecx) ioapic->data = data; 80102db5: 8b 0d 14 4e 11 80 mov 0x80114e14,%ecx ioapicwrite(REG_TABLE + 2 * irq + 1, cpunum << 24); 80102dbb: 83 c0 01 add $0x1,%eax ioapic->data = data; 80102dbe: 89 51 10 mov %edx,0x10(%ecx) ioapicwrite(REG_TABLE + 2 * irq + 1, cpunum << 24); 80102dc1: 8b 55 0c mov 0xc(%ebp),%edx ioapic->reg = reg; 80102dc4: 89 01 mov %eax,(%ecx) ioapic->data = data; 80102dc6: a1 14 4e 11 80 mov 0x80114e14,%eax ioapicwrite(REG_TABLE + 2 * irq + 1, cpunum << 24); 80102dcb: c1 e2 18 shl $0x18,%edx ioapic->data = data; 80102dce: 89 50 10 mov %edx,0x10(%eax) } 80102dd1: 5d pop %ebp 80102dd2: c3 ret 80102dd3: 66 90 xchg %ax,%ax 80102dd5: 66 90 xchg %ax,%ax 80102dd7: 66 90 xchg %ax,%ax 80102dd9: 66 90 xchg %ax,%ax 80102ddb: 66 90 xchg %ax,%ax 80102ddd: 66 90 xchg %ax,%ax 80102ddf: 90 nop 80102de0 <kfree>: // Free the page of physical memory pointed at by v, // which normally should have been returned by a // call to kalloc(). (The exception is when // initializing the allocator; see kinit above.) void kfree(char *v) { 80102de0: 55 push %ebp 80102de1: 89 e5 mov %esp,%ebp 80102de3: 53 push %ebx 80102de4: 83 ec 04 sub $0x4,%esp 80102de7: 8b 5d 08 mov 0x8(%ebp),%ebx struct run *r; if ((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP) { 80102dea: f7 c3 ff 0f 00 00 test $0xfff,%ebx 80102df0: 75 70 jne 80102e62 <kfree+0x82> 80102df2: 81 fb 88 7c 11 80 cmp $0x80117c88,%ebx 80102df8: 72 68 jb 80102e62 <kfree+0x82> 80102dfa: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80102e00: 3d ff ff ff 0d cmp $0xdffffff,%eax 80102e05: 77 5b ja 80102e62 <kfree+0x82> panic("kfree"); } // Fill with junk to catch dangling refs. memset(v, 1, PGSIZE); 80102e07: 83 ec 04 sub $0x4,%esp 80102e0a: 68 00 10 00 00 push $0x1000 80102e0f: 6a 01 push $0x1 80102e11: 53 push %ebx 80102e12: e8 39 21 00 00 call 80104f50 <memset> if (kmem.use_lock) { 80102e17: 8b 15 54 4e 11 80 mov 0x80114e54,%edx 80102e1d: 83 c4 10 add $0x10,%esp 80102e20: 85 d2 test %edx,%edx 80102e22: 75 2c jne 80102e50 <kfree+0x70> acquire(&kmem.lock); } r = (struct run*)v; r->next = kmem.freelist; 80102e24: a1 58 4e 11 80 mov 0x80114e58,%eax 80102e29: 89 03 mov %eax,(%ebx) kmem.freelist = r; if (kmem.use_lock) { 80102e2b: a1 54 4e 11 80 mov 0x80114e54,%eax kmem.freelist = r; 80102e30: 89 1d 58 4e 11 80 mov %ebx,0x80114e58 if (kmem.use_lock) { 80102e36: 85 c0 test %eax,%eax 80102e38: 75 06 jne 80102e40 <kfree+0x60> release(&kmem.lock); } } 80102e3a: 8b 5d fc mov -0x4(%ebp),%ebx 80102e3d: c9 leave 80102e3e: c3 ret 80102e3f: 90 nop release(&kmem.lock); 80102e40: c7 45 08 20 4e 11 80 movl $0x80114e20,0x8(%ebp) } 80102e47: 8b 5d fc mov -0x4(%ebp),%ebx 80102e4a: c9 leave release(&kmem.lock); 80102e4b: e9 b0 20 00 00 jmp 80104f00 <release> acquire(&kmem.lock); 80102e50: 83 ec 0c sub $0xc,%esp 80102e53: 68 20 4e 11 80 push $0x80114e20 80102e58: e8 e3 1f 00 00 call 80104e40 <acquire> 80102e5d: 83 c4 10 add $0x10,%esp 80102e60: eb c2 jmp 80102e24 <kfree+0x44> panic("kfree"); 80102e62: 83 ec 0c sub $0xc,%esp 80102e65: 68 b6 7d 10 80 push $0x80107db6 80102e6a: e8 71 d6 ff ff call 801004e0 <panic> 80102e6f: 90 nop 80102e70 <freerange>: void freerange(void *vstart, void *vend) { 80102e70: 55 push %ebp 80102e71: 89 e5 mov %esp,%ebp 80102e73: 56 push %esi 80102e74: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 80102e75: 8b 45 08 mov 0x8(%ebp),%eax void freerange(void *vstart, void *vend) { 80102e78: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 80102e7b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102e81: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102e87: 81 c3 00 10 00 00 add $0x1000,%ebx 80102e8d: 39 de cmp %ebx,%esi 80102e8f: 72 23 jb 80102eb4 <freerange+0x44> 80102e91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102e98: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102e9e: 83 ec 0c sub $0xc,%esp for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102ea1: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102ea7: 50 push %eax 80102ea8: e8 33 ff ff ff call 80102de0 <kfree> for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102ead: 83 c4 10 add $0x10,%esp 80102eb0: 39 f3 cmp %esi,%ebx 80102eb2: 76 e4 jbe 80102e98 <freerange+0x28> } 80102eb4: 8d 65 f8 lea -0x8(%ebp),%esp 80102eb7: 5b pop %ebx 80102eb8: 5e pop %esi 80102eb9: 5d pop %ebp 80102eba: c3 ret 80102ebb: 90 nop 80102ebc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102ec0 <kinit1>: void kinit1(void *vstart, void *vend) { 80102ec0: 55 push %ebp 80102ec1: 89 e5 mov %esp,%ebp 80102ec3: 56 push %esi 80102ec4: 53 push %ebx 80102ec5: 8b 75 0c mov 0xc(%ebp),%esi initlock(&kmem.lock, "kmem"); 80102ec8: 83 ec 08 sub $0x8,%esp 80102ecb: 68 bc 7d 10 80 push $0x80107dbc 80102ed0: 68 20 4e 11 80 push $0x80114e20 80102ed5: e8 26 1e 00 00 call 80104d00 <initlock> p = (char*)PGROUNDUP((uint)vstart); 80102eda: 8b 45 08 mov 0x8(%ebp),%eax for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102edd: 83 c4 10 add $0x10,%esp kmem.use_lock = 0; 80102ee0: c7 05 54 4e 11 80 00 movl $0x0,0x80114e54 80102ee7: 00 00 00 p = (char*)PGROUNDUP((uint)vstart); 80102eea: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102ef0: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102ef6: 81 c3 00 10 00 00 add $0x1000,%ebx 80102efc: 39 de cmp %ebx,%esi 80102efe: 72 1c jb 80102f1c <kinit1+0x5c> kfree(p); 80102f00: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102f06: 83 ec 0c sub $0xc,%esp for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102f09: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102f0f: 50 push %eax 80102f10: e8 cb fe ff ff call 80102de0 <kfree> for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102f15: 83 c4 10 add $0x10,%esp 80102f18: 39 de cmp %ebx,%esi 80102f1a: 73 e4 jae 80102f00 <kinit1+0x40> } 80102f1c: 8d 65 f8 lea -0x8(%ebp),%esp 80102f1f: 5b pop %ebx 80102f20: 5e pop %esi 80102f21: 5d pop %ebp 80102f22: c3 ret 80102f23: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80102f29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102f30 <kinit2>: void kinit2(void *vstart, void *vend) { 80102f30: 55 push %ebp 80102f31: 89 e5 mov %esp,%ebp 80102f33: 56 push %esi 80102f34: 53 push %ebx p = (char*)PGROUNDUP((uint)vstart); 80102f35: 8b 45 08 mov 0x8(%ebp),%eax void kinit2(void *vstart, void *vend) { 80102f38: 8b 75 0c mov 0xc(%ebp),%esi p = (char*)PGROUNDUP((uint)vstart); 80102f3b: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 80102f41: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102f47: 81 c3 00 10 00 00 add $0x1000,%ebx 80102f4d: 39 de cmp %ebx,%esi 80102f4f: 72 23 jb 80102f74 <kinit2+0x44> 80102f51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi kfree(p); 80102f58: 8d 83 00 f0 ff ff lea -0x1000(%ebx),%eax 80102f5e: 83 ec 0c sub $0xc,%esp for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102f61: 81 c3 00 10 00 00 add $0x1000,%ebx kfree(p); 80102f67: 50 push %eax 80102f68: e8 73 fe ff ff call 80102de0 <kfree> for (; p + PGSIZE <= (char*)vend; p += PGSIZE) { 80102f6d: 83 c4 10 add $0x10,%esp 80102f70: 39 de cmp %ebx,%esi 80102f72: 73 e4 jae 80102f58 <kinit2+0x28> kmem.use_lock = 1; 80102f74: c7 05 54 4e 11 80 01 movl $0x1,0x80114e54 80102f7b: 00 00 00 } 80102f7e: 8d 65 f8 lea -0x8(%ebp),%esp 80102f81: 5b pop %ebx 80102f82: 5e pop %esi 80102f83: 5d pop %ebp 80102f84: c3 ret 80102f85: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80102f89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80102f90 <kalloc>: // Returns a pointer that the kernel can use. // Returns 0 if the memory cannot be allocated. char* kalloc(void) { struct run *r; if (kmem.use_lock) { 80102f90: a1 54 4e 11 80 mov 0x80114e54,%eax 80102f95: 85 c0 test %eax,%eax 80102f97: 75 1f jne 80102fb8 <kalloc+0x28> acquire(&kmem.lock); } r = kmem.freelist; 80102f99: a1 58 4e 11 80 mov 0x80114e58,%eax if (r) { 80102f9e: 85 c0 test %eax,%eax 80102fa0: 74 0e je 80102fb0 <kalloc+0x20> kmem.freelist = r->next; 80102fa2: 8b 10 mov (%eax),%edx 80102fa4: 89 15 58 4e 11 80 mov %edx,0x80114e58 80102faa: c3 ret 80102fab: 90 nop 80102fac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } if (kmem.use_lock) { release(&kmem.lock); } return (char*)r; } 80102fb0: f3 c3 repz ret 80102fb2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi char* kalloc(void) { 80102fb8: 55 push %ebp 80102fb9: 89 e5 mov %esp,%ebp 80102fbb: 83 ec 24 sub $0x24,%esp acquire(&kmem.lock); 80102fbe: 68 20 4e 11 80 push $0x80114e20 80102fc3: e8 78 1e 00 00 call 80104e40 <acquire> r = kmem.freelist; 80102fc8: a1 58 4e 11 80 mov 0x80114e58,%eax if (r) { 80102fcd: 83 c4 10 add $0x10,%esp 80102fd0: 8b 15 54 4e 11 80 mov 0x80114e54,%edx 80102fd6: 85 c0 test %eax,%eax 80102fd8: 74 08 je 80102fe2 <kalloc+0x52> kmem.freelist = r->next; 80102fda: 8b 08 mov (%eax),%ecx 80102fdc: 89 0d 58 4e 11 80 mov %ecx,0x80114e58 if (kmem.use_lock) { 80102fe2: 85 d2 test %edx,%edx 80102fe4: 74 16 je 80102ffc <kalloc+0x6c> release(&kmem.lock); 80102fe6: 83 ec 0c sub $0xc,%esp 80102fe9: 89 45 f4 mov %eax,-0xc(%ebp) 80102fec: 68 20 4e 11 80 push $0x80114e20 80102ff1: e8 0a 1f 00 00 call 80104f00 <release> return (char*)r; 80102ff6: 8b 45 f4 mov -0xc(%ebp),%eax release(&kmem.lock); 80102ff9: 83 c4 10 add $0x10,%esp } 80102ffc: c9 leave 80102ffd: c3 ret 80102ffe: 66 90 xchg %ax,%ax 80103000 <kbdgetc>: asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80103000: ba 64 00 00 00 mov $0x64,%edx 80103005: ec in (%dx),%al normalmap, shiftmap, ctlmap, ctlmap }; uint st, data, c; st = inb(KBSTATP); if ((st & KBS_DIB) == 0) { 80103006: a8 01 test $0x1,%al 80103008: 0f 84 c2 00 00 00 je 801030d0 <kbdgetc+0xd0> 8010300e: ba 60 00 00 00 mov $0x60,%edx 80103013: ec in (%dx),%al return -1; } data = inb(KBDATAP); 80103014: 0f b6 d0 movzbl %al,%edx 80103017: 8b 0d b4 c5 10 80 mov 0x8010c5b4,%ecx if (data == 0xE0) { 8010301d: 81 fa e0 00 00 00 cmp $0xe0,%edx 80103023: 0f 84 7f 00 00 00 je 801030a8 <kbdgetc+0xa8> int kbdgetc(void) { 80103029: 55 push %ebp 8010302a: 89 e5 mov %esp,%ebp 8010302c: 53 push %ebx 8010302d: 89 cb mov %ecx,%ebx 8010302f: 83 e3 40 and $0x40,%ebx shift |= E0ESC; return 0; } else if (data & 0x80) { 80103032: 84 c0 test %al,%al 80103034: 78 4a js 80103080 <kbdgetc+0x80> // Key released data = (shift & E0ESC ? data : data & 0x7F); shift &= ~(shiftcode[data] | E0ESC); return 0; } else if (shift & E0ESC) { 80103036: 85 db test %ebx,%ebx 80103038: 74 09 je 80103043 <kbdgetc+0x43> // Last character was an E0 escape; or with 0x80 data |= 0x80; 8010303a: 83 c8 80 or $0xffffff80,%eax shift &= ~E0ESC; 8010303d: 83 e1 bf and $0xffffffbf,%ecx data |= 0x80; 80103040: 0f b6 d0 movzbl %al,%edx } shift |= shiftcode[data]; 80103043: 0f b6 82 00 7f 10 80 movzbl -0x7fef8100(%edx),%eax 8010304a: 09 c1 or %eax,%ecx shift ^= togglecode[data]; 8010304c: 0f b6 82 00 7e 10 80 movzbl -0x7fef8200(%edx),%eax 80103053: 31 c1 xor %eax,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80103055: 89 c8 mov %ecx,%eax shift ^= togglecode[data]; 80103057: 89 0d b4 c5 10 80 mov %ecx,0x8010c5b4 c = charcode[shift & (CTL | SHIFT)][data]; 8010305d: 83 e0 03 and $0x3,%eax if (shift & CAPSLOCK) { 80103060: 83 e1 08 and $0x8,%ecx c = charcode[shift & (CTL | SHIFT)][data]; 80103063: 8b 04 85 e0 7d 10 80 mov -0x7fef8220(,%eax,4),%eax 8010306a: 0f b6 04 10 movzbl (%eax,%edx,1),%eax if (shift & CAPSLOCK) { 8010306e: 74 31 je 801030a1 <kbdgetc+0xa1> if ('a' <= c && c <= 'z') { 80103070: 8d 50 9f lea -0x61(%eax),%edx 80103073: 83 fa 19 cmp $0x19,%edx 80103076: 77 40 ja 801030b8 <kbdgetc+0xb8> c += 'A' - 'a'; 80103078: 83 e8 20 sub $0x20,%eax else if ('A' <= c && c <= 'Z') { c += 'a' - 'A'; } } return c; } 8010307b: 5b pop %ebx 8010307c: 5d pop %ebp 8010307d: c3 ret 8010307e: 66 90 xchg %ax,%ax data = (shift & E0ESC ? data : data & 0x7F); 80103080: 83 e0 7f and $0x7f,%eax 80103083: 85 db test %ebx,%ebx 80103085: 0f 44 d0 cmove %eax,%edx shift &= ~(shiftcode[data] | E0ESC); 80103088: 0f b6 82 00 7f 10 80 movzbl -0x7fef8100(%edx),%eax 8010308f: 83 c8 40 or $0x40,%eax 80103092: 0f b6 c0 movzbl %al,%eax 80103095: f7 d0 not %eax 80103097: 21 c1 and %eax,%ecx return 0; 80103099: 31 c0 xor %eax,%eax shift &= ~(shiftcode[data] | E0ESC); 8010309b: 89 0d b4 c5 10 80 mov %ecx,0x8010c5b4 } 801030a1: 5b pop %ebx 801030a2: 5d pop %ebp 801030a3: c3 ret 801030a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi shift |= E0ESC; 801030a8: 83 c9 40 or $0x40,%ecx return 0; 801030ab: 31 c0 xor %eax,%eax shift |= E0ESC; 801030ad: 89 0d b4 c5 10 80 mov %ecx,0x8010c5b4 return 0; 801030b3: c3 ret 801030b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi else if ('A' <= c && c <= 'Z') { 801030b8: 8d 48 bf lea -0x41(%eax),%ecx c += 'a' - 'A'; 801030bb: 8d 50 20 lea 0x20(%eax),%edx } 801030be: 5b pop %ebx c += 'a' - 'A'; 801030bf: 83 f9 1a cmp $0x1a,%ecx 801030c2: 0f 42 c2 cmovb %edx,%eax } 801030c5: 5d pop %ebp 801030c6: c3 ret 801030c7: 89 f6 mov %esi,%esi 801030c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 801030d0: b8 ff ff ff ff mov $0xffffffff,%eax } 801030d5: c3 ret 801030d6: 8d 76 00 lea 0x0(%esi),%esi 801030d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801030e0 <kbdintr>: void kbdintr(void) { 801030e0: 55 push %ebp 801030e1: 89 e5 mov %esp,%ebp 801030e3: 83 ec 14 sub $0x14,%esp consoleintr(kbdgetc); 801030e6: 68 00 30 10 80 push $0x80103000 801030eb: e8 70 d9 ff ff call 80100a60 <consoleintr> } 801030f0: 83 c4 10 add $0x10,%esp 801030f3: c9 leave 801030f4: c3 ret 801030f5: 66 90 xchg %ax,%ax 801030f7: 66 90 xchg %ax,%ax 801030f9: 66 90 xchg %ax,%ax 801030fb: 66 90 xchg %ax,%ax 801030fd: 66 90 xchg %ax,%ax 801030ff: 90 nop 80103100 <lapicinit>: lapic[index] = value; lapic[ID]; // wait for write to finish, by reading } void lapicinit(void) { if (!lapic) { 80103100: a1 5c 4e 11 80 mov 0x80114e5c,%eax void lapicinit(void) { 80103105: 55 push %ebp 80103106: 89 e5 mov %esp,%ebp if (!lapic) { 80103108: 85 c0 test %eax,%eax 8010310a: 0f 84 c8 00 00 00 je 801031d8 <lapicinit+0xd8> lapic[index] = value; 80103110: c7 80 f0 00 00 00 3f movl $0x13f,0xf0(%eax) 80103117: 01 00 00 lapic[ID]; // wait for write to finish, by reading 8010311a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010311d: c7 80 e0 03 00 00 0b movl $0xb,0x3e0(%eax) 80103124: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80103127: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010312a: c7 80 20 03 00 00 20 movl $0x20020,0x320(%eax) 80103131: 00 02 00 lapic[ID]; // wait for write to finish, by reading 80103134: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80103137: c7 80 80 03 00 00 80 movl $0x989680,0x380(%eax) 8010313e: 96 98 00 lapic[ID]; // wait for write to finish, by reading 80103141: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80103144: c7 80 50 03 00 00 00 movl $0x10000,0x350(%eax) 8010314b: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010314e: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80103151: c7 80 60 03 00 00 00 movl $0x10000,0x360(%eax) 80103158: 00 01 00 lapic[ID]; // wait for write to finish, by reading 8010315b: 8b 50 20 mov 0x20(%eax),%edx lapicw(LINT0, MASKED); lapicw(LINT1, MASKED); // Disable performance counter overflow interrupts // on machines that provide that interrupt entry. if (((lapic[VER] >> 16) & 0xFF) >= 4) { 8010315e: 8b 50 30 mov 0x30(%eax),%edx 80103161: c1 ea 10 shr $0x10,%edx 80103164: 80 fa 03 cmp $0x3,%dl 80103167: 77 77 ja 801031e0 <lapicinit+0xe0> lapic[index] = value; 80103169: c7 80 70 03 00 00 33 movl $0x33,0x370(%eax) 80103170: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80103173: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80103176: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 8010317d: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80103180: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80103183: c7 80 80 02 00 00 00 movl $0x0,0x280(%eax) 8010318a: 00 00 00 lapic[ID]; // wait for write to finish, by reading 8010318d: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 80103190: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80103197: 00 00 00 lapic[ID]; // wait for write to finish, by reading 8010319a: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 8010319d: c7 80 10 03 00 00 00 movl $0x0,0x310(%eax) 801031a4: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801031a7: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801031aa: c7 80 00 03 00 00 00 movl $0x88500,0x300(%eax) 801031b1: 85 08 00 lapic[ID]; // wait for write to finish, by reading 801031b4: 8b 50 20 mov 0x20(%eax),%edx 801031b7: 89 f6 mov %esi,%esi 801031b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapicw(EOI, 0); // Send an Init Level De-Assert to synchronise arbitration ID's. lapicw(ICRHI, 0); lapicw(ICRLO, BCAST | INIT | LEVEL); while (lapic[ICRLO] & DELIVS) { 801031c0: 8b 90 00 03 00 00 mov 0x300(%eax),%edx 801031c6: 80 e6 10 and $0x10,%dh 801031c9: 75 f5 jne 801031c0 <lapicinit+0xc0> lapic[index] = value; 801031cb: c7 80 80 00 00 00 00 movl $0x0,0x80(%eax) 801031d2: 00 00 00 lapic[ID]; // wait for write to finish, by reading 801031d5: 8b 40 20 mov 0x20(%eax),%eax ; } // Enable interrupts on the APIC (but not on the processor). lapicw(TPR, 0); } 801031d8: 5d pop %ebp 801031d9: c3 ret 801031da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi lapic[index] = value; 801031e0: c7 80 40 03 00 00 00 movl $0x10000,0x340(%eax) 801031e7: 00 01 00 lapic[ID]; // wait for write to finish, by reading 801031ea: 8b 50 20 mov 0x20(%eax),%edx 801031ed: e9 77 ff ff ff jmp 80103169 <lapicinit+0x69> 801031f2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801031f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103200 <lapicid>: int lapicid(void) { if (!lapic) { 80103200: 8b 15 5c 4e 11 80 mov 0x80114e5c,%edx int lapicid(void) { 80103206: 55 push %ebp 80103207: 31 c0 xor %eax,%eax 80103209: 89 e5 mov %esp,%ebp if (!lapic) { 8010320b: 85 d2 test %edx,%edx 8010320d: 74 06 je 80103215 <lapicid+0x15> return 0; } return lapic[ID] >> 24; 8010320f: 8b 42 20 mov 0x20(%edx),%eax 80103212: c1 e8 18 shr $0x18,%eax } 80103215: 5d pop %ebp 80103216: c3 ret 80103217: 89 f6 mov %esi,%esi 80103219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103220 <lapiceoi>: // Acknowledge interrupt. void lapiceoi(void) { if (lapic) { 80103220: a1 5c 4e 11 80 mov 0x80114e5c,%eax void lapiceoi(void) { 80103225: 55 push %ebp 80103226: 89 e5 mov %esp,%ebp if (lapic) { 80103228: 85 c0 test %eax,%eax 8010322a: 74 0d je 80103239 <lapiceoi+0x19> lapic[index] = value; 8010322c: c7 80 b0 00 00 00 00 movl $0x0,0xb0(%eax) 80103233: 00 00 00 lapic[ID]; // wait for write to finish, by reading 80103236: 8b 40 20 mov 0x20(%eax),%eax lapicw(EOI, 0); } } 80103239: 5d pop %ebp 8010323a: c3 ret 8010323b: 90 nop 8010323c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103240 <microdelay>: // Spin for a given number of microseconds. // On real hardware would want to tune this dynamically. void microdelay(int us) { 80103240: 55 push %ebp 80103241: 89 e5 mov %esp,%ebp } 80103243: 5d pop %ebp 80103244: c3 ret 80103245: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103249: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103250 <lapicstartap>: #define CMOS_PORT 0x70 #define CMOS_RETURN 0x71 // Start additional processor running entry code at addr. // See Appendix B of MultiProcessor Specification. void lapicstartap(uchar apicid, uint addr) { 80103250: 55 push %ebp asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80103251: b8 0f 00 00 00 mov $0xf,%eax 80103256: ba 70 00 00 00 mov $0x70,%edx 8010325b: 89 e5 mov %esp,%ebp 8010325d: 53 push %ebx 8010325e: 8b 4d 0c mov 0xc(%ebp),%ecx 80103261: 8b 5d 08 mov 0x8(%ebp),%ebx 80103264: ee out %al,(%dx) 80103265: b8 0a 00 00 00 mov $0xa,%eax 8010326a: ba 71 00 00 00 mov $0x71,%edx 8010326f: ee out %al,(%dx) // and the warm reset vector (DWORD based at 40:67) to point at // the AP startup code prior to the [universal startup algorithm]." outb(CMOS_PORT, 0xF); // offset 0xF is shutdown code outb(CMOS_PORT + 1, 0x0A); wrv = (ushort*)P2V((0x40 << 4 | 0x67)); // Warm reset vector wrv[0] = 0; 80103270: 31 c0 xor %eax,%eax wrv[1] = addr >> 4; // "Universal startup algorithm." // Send INIT (level-triggered) interrupt to reset other CPU. lapicw(ICRHI, apicid << 24); 80103272: c1 e3 18 shl $0x18,%ebx wrv[0] = 0; 80103275: 66 a3 67 04 00 80 mov %ax,0x80000467 wrv[1] = addr >> 4; 8010327b: 89 c8 mov %ecx,%eax // when it is in the halted state due to an INIT. So the second // should be ignored, but it is part of the official Intel algorithm. // Bochs complains about the second one. Too bad for Bochs. for (i = 0; i < 2; i++) { lapicw(ICRHI, apicid << 24); lapicw(ICRLO, STARTUP | (addr >> 12)); 8010327d: c1 e9 0c shr $0xc,%ecx wrv[1] = addr >> 4; 80103280: c1 e8 04 shr $0x4,%eax lapicw(ICRHI, apicid << 24); 80103283: 89 da mov %ebx,%edx lapicw(ICRLO, STARTUP | (addr >> 12)); 80103285: 80 cd 06 or $0x6,%ch wrv[1] = addr >> 4; 80103288: 66 a3 69 04 00 80 mov %ax,0x80000469 lapic[index] = value; 8010328e: a1 5c 4e 11 80 mov 0x80114e5c,%eax 80103293: 89 98 10 03 00 00 mov %ebx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 80103299: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 8010329c: c7 80 00 03 00 00 00 movl $0xc500,0x300(%eax) 801032a3: c5 00 00 lapic[ID]; // wait for write to finish, by reading 801032a6: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801032a9: c7 80 00 03 00 00 00 movl $0x8500,0x300(%eax) 801032b0: 85 00 00 lapic[ID]; // wait for write to finish, by reading 801032b3: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801032b6: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801032bc: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801032bf: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801032c5: 8b 58 20 mov 0x20(%eax),%ebx lapic[index] = value; 801032c8: 89 90 10 03 00 00 mov %edx,0x310(%eax) lapic[ID]; // wait for write to finish, by reading 801032ce: 8b 50 20 mov 0x20(%eax),%edx lapic[index] = value; 801032d1: 89 88 00 03 00 00 mov %ecx,0x300(%eax) lapic[ID]; // wait for write to finish, by reading 801032d7: 8b 40 20 mov 0x20(%eax),%eax microdelay(200); } } 801032da: 5b pop %ebx 801032db: 5d pop %ebp 801032dc: c3 ret 801032dd: 8d 76 00 lea 0x0(%esi),%esi 801032e0 <cmostime>: r->month = cmos_read(MONTH); r->year = cmos_read(YEAR); } // qemu seems to use 24-hour GWT and the values are BCD encoded void cmostime(struct rtcdate *r) { 801032e0: 55 push %ebp 801032e1: b8 0b 00 00 00 mov $0xb,%eax 801032e6: ba 70 00 00 00 mov $0x70,%edx 801032eb: 89 e5 mov %esp,%ebp 801032ed: 57 push %edi 801032ee: 56 push %esi 801032ef: 53 push %ebx 801032f0: 83 ec 4c sub $0x4c,%esp 801032f3: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801032f4: ba 71 00 00 00 mov $0x71,%edx 801032f9: ec in (%dx),%al 801032fa: 83 e0 04 and $0x4,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801032fd: bb 70 00 00 00 mov $0x70,%ebx 80103302: 88 45 b3 mov %al,-0x4d(%ebp) 80103305: 8d 76 00 lea 0x0(%esi),%esi 80103308: 31 c0 xor %eax,%eax 8010330a: 89 da mov %ebx,%edx 8010330c: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010330d: b9 71 00 00 00 mov $0x71,%ecx 80103312: 89 ca mov %ecx,%edx 80103314: ec in (%dx),%al 80103315: 88 45 b7 mov %al,-0x49(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80103318: 89 da mov %ebx,%edx 8010331a: b8 02 00 00 00 mov $0x2,%eax 8010331f: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80103320: 89 ca mov %ecx,%edx 80103322: ec in (%dx),%al 80103323: 88 45 b6 mov %al,-0x4a(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80103326: 89 da mov %ebx,%edx 80103328: b8 04 00 00 00 mov $0x4,%eax 8010332d: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010332e: 89 ca mov %ecx,%edx 80103330: ec in (%dx),%al 80103331: 88 45 b5 mov %al,-0x4b(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80103334: 89 da mov %ebx,%edx 80103336: b8 07 00 00 00 mov $0x7,%eax 8010333b: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010333c: 89 ca mov %ecx,%edx 8010333e: ec in (%dx),%al 8010333f: 88 45 b4 mov %al,-0x4c(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80103342: 89 da mov %ebx,%edx 80103344: b8 08 00 00 00 mov $0x8,%eax 80103349: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010334a: 89 ca mov %ecx,%edx 8010334c: ec in (%dx),%al 8010334d: 89 c7 mov %eax,%edi asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 8010334f: 89 da mov %ebx,%edx 80103351: b8 09 00 00 00 mov $0x9,%eax 80103356: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80103357: 89 ca mov %ecx,%edx 80103359: ec in (%dx),%al 8010335a: 89 c6 mov %eax,%esi asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 8010335c: 89 da mov %ebx,%edx 8010335e: b8 0a 00 00 00 mov $0xa,%eax 80103363: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80103364: 89 ca mov %ecx,%edx 80103366: ec in (%dx),%al bcd = (sb & (1 << 2)) == 0; // make sure CMOS doesn't modify time while we read it for (;;) { fill_rtcdate(&t1); if (cmos_read(CMOS_STATA) & CMOS_UIP) { 80103367: 84 c0 test %al,%al 80103369: 78 9d js 80103308 <cmostime+0x28> return inb(CMOS_RETURN); 8010336b: 0f b6 45 b7 movzbl -0x49(%ebp),%eax 8010336f: 89 fa mov %edi,%edx 80103371: 0f b6 fa movzbl %dl,%edi 80103374: 89 f2 mov %esi,%edx 80103376: 0f b6 f2 movzbl %dl,%esi 80103379: 89 7d c8 mov %edi,-0x38(%ebp) asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 8010337c: 89 da mov %ebx,%edx 8010337e: 89 75 cc mov %esi,-0x34(%ebp) 80103381: 89 45 b8 mov %eax,-0x48(%ebp) 80103384: 0f b6 45 b6 movzbl -0x4a(%ebp),%eax 80103388: 89 45 bc mov %eax,-0x44(%ebp) 8010338b: 0f b6 45 b5 movzbl -0x4b(%ebp),%eax 8010338f: 89 45 c0 mov %eax,-0x40(%ebp) 80103392: 0f b6 45 b4 movzbl -0x4c(%ebp),%eax 80103396: 89 45 c4 mov %eax,-0x3c(%ebp) 80103399: 31 c0 xor %eax,%eax 8010339b: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010339c: 89 ca mov %ecx,%edx 8010339e: ec in (%dx),%al 8010339f: 0f b6 c0 movzbl %al,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801033a2: 89 da mov %ebx,%edx 801033a4: 89 45 d0 mov %eax,-0x30(%ebp) 801033a7: b8 02 00 00 00 mov $0x2,%eax 801033ac: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801033ad: 89 ca mov %ecx,%edx 801033af: ec in (%dx),%al 801033b0: 0f b6 c0 movzbl %al,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801033b3: 89 da mov %ebx,%edx 801033b5: 89 45 d4 mov %eax,-0x2c(%ebp) 801033b8: b8 04 00 00 00 mov $0x4,%eax 801033bd: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801033be: 89 ca mov %ecx,%edx 801033c0: ec in (%dx),%al 801033c1: 0f b6 c0 movzbl %al,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801033c4: 89 da mov %ebx,%edx 801033c6: 89 45 d8 mov %eax,-0x28(%ebp) 801033c9: b8 07 00 00 00 mov $0x7,%eax 801033ce: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801033cf: 89 ca mov %ecx,%edx 801033d1: ec in (%dx),%al 801033d2: 0f b6 c0 movzbl %al,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801033d5: 89 da mov %ebx,%edx 801033d7: 89 45 dc mov %eax,-0x24(%ebp) 801033da: b8 08 00 00 00 mov $0x8,%eax 801033df: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801033e0: 89 ca mov %ecx,%edx 801033e2: ec in (%dx),%al 801033e3: 0f b6 c0 movzbl %al,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 801033e6: 89 da mov %ebx,%edx 801033e8: 89 45 e0 mov %eax,-0x20(%ebp) 801033eb: b8 09 00 00 00 mov $0x9,%eax 801033f0: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801033f1: 89 ca mov %ecx,%edx 801033f3: ec in (%dx),%al 801033f4: 0f b6 c0 movzbl %al,%eax continue; } fill_rtcdate(&t2); if (memcmp(&t1, &t2, sizeof(t1)) == 0) { 801033f7: 83 ec 04 sub $0x4,%esp return inb(CMOS_RETURN); 801033fa: 89 45 e4 mov %eax,-0x1c(%ebp) if (memcmp(&t1, &t2, sizeof(t1)) == 0) { 801033fd: 8d 45 d0 lea -0x30(%ebp),%eax 80103400: 6a 18 push $0x18 80103402: 50 push %eax 80103403: 8d 45 b8 lea -0x48(%ebp),%eax 80103406: 50 push %eax 80103407: e8 94 1b 00 00 call 80104fa0 <memcmp> 8010340c: 83 c4 10 add $0x10,%esp 8010340f: 85 c0 test %eax,%eax 80103411: 0f 85 f1 fe ff ff jne 80103308 <cmostime+0x28> break; } } // convert if (bcd) { 80103417: 80 7d b3 00 cmpb $0x0,-0x4d(%ebp) 8010341b: 75 78 jne 80103495 <cmostime+0x1b5> #define CONV(x) (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf)) CONV(second); 8010341d: 8b 45 b8 mov -0x48(%ebp),%eax 80103420: 89 c2 mov %eax,%edx 80103422: 83 e0 0f and $0xf,%eax 80103425: c1 ea 04 shr $0x4,%edx 80103428: 8d 14 92 lea (%edx,%edx,4),%edx 8010342b: 8d 04 50 lea (%eax,%edx,2),%eax 8010342e: 89 45 b8 mov %eax,-0x48(%ebp) CONV(minute); 80103431: 8b 45 bc mov -0x44(%ebp),%eax 80103434: 89 c2 mov %eax,%edx 80103436: 83 e0 0f and $0xf,%eax 80103439: c1 ea 04 shr $0x4,%edx 8010343c: 8d 14 92 lea (%edx,%edx,4),%edx 8010343f: 8d 04 50 lea (%eax,%edx,2),%eax 80103442: 89 45 bc mov %eax,-0x44(%ebp) CONV(hour ); 80103445: 8b 45 c0 mov -0x40(%ebp),%eax 80103448: 89 c2 mov %eax,%edx 8010344a: 83 e0 0f and $0xf,%eax 8010344d: c1 ea 04 shr $0x4,%edx 80103450: 8d 14 92 lea (%edx,%edx,4),%edx 80103453: 8d 04 50 lea (%eax,%edx,2),%eax 80103456: 89 45 c0 mov %eax,-0x40(%ebp) CONV(day ); 80103459: 8b 45 c4 mov -0x3c(%ebp),%eax 8010345c: 89 c2 mov %eax,%edx 8010345e: 83 e0 0f and $0xf,%eax 80103461: c1 ea 04 shr $0x4,%edx 80103464: 8d 14 92 lea (%edx,%edx,4),%edx 80103467: 8d 04 50 lea (%eax,%edx,2),%eax 8010346a: 89 45 c4 mov %eax,-0x3c(%ebp) CONV(month ); 8010346d: 8b 45 c8 mov -0x38(%ebp),%eax 80103470: 89 c2 mov %eax,%edx 80103472: 83 e0 0f and $0xf,%eax 80103475: c1 ea 04 shr $0x4,%edx 80103478: 8d 14 92 lea (%edx,%edx,4),%edx 8010347b: 8d 04 50 lea (%eax,%edx,2),%eax 8010347e: 89 45 c8 mov %eax,-0x38(%ebp) CONV(year ); 80103481: 8b 45 cc mov -0x34(%ebp),%eax 80103484: 89 c2 mov %eax,%edx 80103486: 83 e0 0f and $0xf,%eax 80103489: c1 ea 04 shr $0x4,%edx 8010348c: 8d 14 92 lea (%edx,%edx,4),%edx 8010348f: 8d 04 50 lea (%eax,%edx,2),%eax 80103492: 89 45 cc mov %eax,-0x34(%ebp) #undef CONV } *r = t1; 80103495: 8b 75 08 mov 0x8(%ebp),%esi 80103498: 8b 45 b8 mov -0x48(%ebp),%eax 8010349b: 89 06 mov %eax,(%esi) 8010349d: 8b 45 bc mov -0x44(%ebp),%eax 801034a0: 89 46 04 mov %eax,0x4(%esi) 801034a3: 8b 45 c0 mov -0x40(%ebp),%eax 801034a6: 89 46 08 mov %eax,0x8(%esi) 801034a9: 8b 45 c4 mov -0x3c(%ebp),%eax 801034ac: 89 46 0c mov %eax,0xc(%esi) 801034af: 8b 45 c8 mov -0x38(%ebp),%eax 801034b2: 89 46 10 mov %eax,0x10(%esi) 801034b5: 8b 45 cc mov -0x34(%ebp),%eax 801034b8: 89 46 14 mov %eax,0x14(%esi) r->year += 2000; 801034bb: 81 46 14 d0 07 00 00 addl $0x7d0,0x14(%esi) } 801034c2: 8d 65 f4 lea -0xc(%ebp),%esp 801034c5: 5b pop %ebx 801034c6: 5e pop %esi 801034c7: 5f pop %edi 801034c8: 5d pop %ebp 801034c9: c3 ret 801034ca: 66 90 xchg %ax,%ax 801034cc: 66 90 xchg %ax,%ax 801034ce: 66 90 xchg %ax,%ax 801034d0 <install_trans>: static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { 801034d0: 8b 0d a8 4e 11 80 mov 0x80114ea8,%ecx 801034d6: 85 c9 test %ecx,%ecx 801034d8: 0f 8e 8a 00 00 00 jle 80103568 <install_trans+0x98> { 801034de: 55 push %ebp 801034df: 89 e5 mov %esp,%ebp 801034e1: 57 push %edi 801034e2: 56 push %esi 801034e3: 53 push %ebx for (tail = 0; tail < log.lh.n; tail++) { 801034e4: 31 db xor %ebx,%ebx { 801034e6: 83 ec 0c sub $0xc,%esp 801034e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 801034f0: a1 94 4e 11 80 mov 0x80114e94,%eax 801034f5: 83 ec 08 sub $0x8,%esp 801034f8: 01 d8 add %ebx,%eax 801034fa: 83 c0 01 add $0x1,%eax 801034fd: 50 push %eax 801034fe: ff 35 a4 4e 11 80 pushl 0x80114ea4 80103504: e8 c7 cb ff ff call 801000d0 <bread> 80103509: 89 c7 mov %eax,%edi struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 8010350b: 58 pop %eax 8010350c: 5a pop %edx 8010350d: ff 34 9d ac 4e 11 80 pushl -0x7feeb154(,%ebx,4) 80103514: ff 35 a4 4e 11 80 pushl 0x80114ea4 for (tail = 0; tail < log.lh.n; tail++) { 8010351a: 83 c3 01 add $0x1,%ebx struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 8010351d: e8 ae cb ff ff call 801000d0 <bread> 80103522: 89 c6 mov %eax,%esi memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 80103524: 8d 47 5c lea 0x5c(%edi),%eax 80103527: 83 c4 0c add $0xc,%esp 8010352a: 68 00 02 00 00 push $0x200 8010352f: 50 push %eax 80103530: 8d 46 5c lea 0x5c(%esi),%eax 80103533: 50 push %eax 80103534: e8 c7 1a 00 00 call 80105000 <memmove> bwrite(dbuf); // write dst to disk 80103539: 89 34 24 mov %esi,(%esp) 8010353c: e8 5f cc ff ff call 801001a0 <bwrite> brelse(lbuf); 80103541: 89 3c 24 mov %edi,(%esp) 80103544: e8 97 cc ff ff call 801001e0 <brelse> brelse(dbuf); 80103549: 89 34 24 mov %esi,(%esp) 8010354c: e8 8f cc ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80103551: 83 c4 10 add $0x10,%esp 80103554: 39 1d a8 4e 11 80 cmp %ebx,0x80114ea8 8010355a: 7f 94 jg 801034f0 <install_trans+0x20> } } 8010355c: 8d 65 f4 lea -0xc(%ebp),%esp 8010355f: 5b pop %ebx 80103560: 5e pop %esi 80103561: 5f pop %edi 80103562: 5d pop %ebp 80103563: c3 ret 80103564: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80103568: f3 c3 repz ret 8010356a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103570 <write_head>: // Write in-memory log header to disk. // This is the true point at which the // current transaction commits. static void write_head(void) { 80103570: 55 push %ebp 80103571: 89 e5 mov %esp,%ebp 80103573: 56 push %esi 80103574: 53 push %ebx struct buf *buf = bread(log.dev, log.start); 80103575: 83 ec 08 sub $0x8,%esp 80103578: ff 35 94 4e 11 80 pushl 0x80114e94 8010357e: ff 35 a4 4e 11 80 pushl 0x80114ea4 80103584: e8 47 cb ff ff call 801000d0 <bread> struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80103589: 8b 1d a8 4e 11 80 mov 0x80114ea8,%ebx for (i = 0; i < log.lh.n; i++) { 8010358f: 83 c4 10 add $0x10,%esp struct buf *buf = bread(log.dev, log.start); 80103592: 89 c6 mov %eax,%esi for (i = 0; i < log.lh.n; i++) { 80103594: 85 db test %ebx,%ebx hb->n = log.lh.n; 80103596: 89 58 5c mov %ebx,0x5c(%eax) for (i = 0; i < log.lh.n; i++) { 80103599: 7e 16 jle 801035b1 <write_head+0x41> 8010359b: c1 e3 02 shl $0x2,%ebx 8010359e: 31 d2 xor %edx,%edx hb->block[i] = log.lh.block[i]; 801035a0: 8b 8a ac 4e 11 80 mov -0x7feeb154(%edx),%ecx 801035a6: 89 4c 16 60 mov %ecx,0x60(%esi,%edx,1) 801035aa: 83 c2 04 add $0x4,%edx for (i = 0; i < log.lh.n; i++) { 801035ad: 39 da cmp %ebx,%edx 801035af: 75 ef jne 801035a0 <write_head+0x30> } bwrite(buf); 801035b1: 83 ec 0c sub $0xc,%esp 801035b4: 56 push %esi 801035b5: e8 e6 cb ff ff call 801001a0 <bwrite> brelse(buf); 801035ba: 89 34 24 mov %esi,(%esp) 801035bd: e8 1e cc ff ff call 801001e0 <brelse> } 801035c2: 83 c4 10 add $0x10,%esp 801035c5: 8d 65 f8 lea -0x8(%ebp),%esp 801035c8: 5b pop %ebx 801035c9: 5e pop %esi 801035ca: 5d pop %ebp 801035cb: c3 ret 801035cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801035d0 <initlog>: { 801035d0: 55 push %ebp 801035d1: 89 e5 mov %esp,%ebp 801035d3: 53 push %ebx 801035d4: 83 ec 2c sub $0x2c,%esp 801035d7: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&log.lock, "log"); 801035da: 68 00 80 10 80 push $0x80108000 801035df: 68 60 4e 11 80 push $0x80114e60 801035e4: e8 17 17 00 00 call 80104d00 <initlock> readsb(dev, &sb); 801035e9: 58 pop %eax 801035ea: 8d 45 dc lea -0x24(%ebp),%eax 801035ed: 5a pop %edx 801035ee: 50 push %eax 801035ef: 53 push %ebx 801035f0: e8 1b e9 ff ff call 80101f10 <readsb> log.size = sb.nlog; 801035f5: 8b 55 e8 mov -0x18(%ebp),%edx log.start = sb.logstart; 801035f8: 8b 45 ec mov -0x14(%ebp),%eax struct buf *buf = bread(log.dev, log.start); 801035fb: 59 pop %ecx log.dev = dev; 801035fc: 89 1d a4 4e 11 80 mov %ebx,0x80114ea4 log.size = sb.nlog; 80103602: 89 15 98 4e 11 80 mov %edx,0x80114e98 log.start = sb.logstart; 80103608: a3 94 4e 11 80 mov %eax,0x80114e94 struct buf *buf = bread(log.dev, log.start); 8010360d: 5a pop %edx 8010360e: 50 push %eax 8010360f: 53 push %ebx 80103610: e8 bb ca ff ff call 801000d0 <bread> log.lh.n = lh->n; 80103615: 8b 58 5c mov 0x5c(%eax),%ebx for (i = 0; i < log.lh.n; i++) { 80103618: 83 c4 10 add $0x10,%esp 8010361b: 85 db test %ebx,%ebx log.lh.n = lh->n; 8010361d: 89 1d a8 4e 11 80 mov %ebx,0x80114ea8 for (i = 0; i < log.lh.n; i++) { 80103623: 7e 1c jle 80103641 <initlog+0x71> 80103625: c1 e3 02 shl $0x2,%ebx 80103628: 31 d2 xor %edx,%edx 8010362a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = lh->block[i]; 80103630: 8b 4c 10 60 mov 0x60(%eax,%edx,1),%ecx 80103634: 83 c2 04 add $0x4,%edx 80103637: 89 8a a8 4e 11 80 mov %ecx,-0x7feeb158(%edx) for (i = 0; i < log.lh.n; i++) { 8010363d: 39 d3 cmp %edx,%ebx 8010363f: 75 ef jne 80103630 <initlog+0x60> brelse(buf); 80103641: 83 ec 0c sub $0xc,%esp 80103644: 50 push %eax 80103645: e8 96 cb ff ff call 801001e0 <brelse> static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk 8010364a: e8 81 fe ff ff call 801034d0 <install_trans> log.lh.n = 0; 8010364f: c7 05 a8 4e 11 80 00 movl $0x0,0x80114ea8 80103656: 00 00 00 write_head(); // clear the log 80103659: e8 12 ff ff ff call 80103570 <write_head> } 8010365e: 83 c4 10 add $0x10,%esp 80103661: 8b 5d fc mov -0x4(%ebp),%ebx 80103664: c9 leave 80103665: c3 ret 80103666: 8d 76 00 lea 0x0(%esi),%esi 80103669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103670 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 80103670: 55 push %ebp 80103671: 89 e5 mov %esp,%ebp 80103673: 83 ec 14 sub $0x14,%esp acquire(&log.lock); 80103676: 68 60 4e 11 80 push $0x80114e60 8010367b: e8 c0 17 00 00 call 80104e40 <acquire> 80103680: 83 c4 10 add $0x10,%esp 80103683: eb 18 jmp 8010369d <begin_op+0x2d> 80103685: 8d 76 00 lea 0x0(%esi),%esi while(1){ if(log.committing){ sleep(&log, &log.lock); 80103688: 83 ec 08 sub $0x8,%esp 8010368b: 68 60 4e 11 80 push $0x80114e60 80103690: 68 60 4e 11 80 push $0x80114e60 80103695: e8 e6 11 00 00 call 80104880 <sleep> 8010369a: 83 c4 10 add $0x10,%esp if(log.committing){ 8010369d: a1 a0 4e 11 80 mov 0x80114ea0,%eax 801036a2: 85 c0 test %eax,%eax 801036a4: 75 e2 jne 80103688 <begin_op+0x18> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 801036a6: a1 9c 4e 11 80 mov 0x80114e9c,%eax 801036ab: 8b 15 a8 4e 11 80 mov 0x80114ea8,%edx 801036b1: 83 c0 01 add $0x1,%eax 801036b4: 8d 0c 80 lea (%eax,%eax,4),%ecx 801036b7: 8d 14 4a lea (%edx,%ecx,2),%edx 801036ba: 83 fa 1e cmp $0x1e,%edx 801036bd: 7f c9 jg 80103688 <begin_op+0x18> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); } else { log.outstanding += 1; release(&log.lock); 801036bf: 83 ec 0c sub $0xc,%esp log.outstanding += 1; 801036c2: a3 9c 4e 11 80 mov %eax,0x80114e9c release(&log.lock); 801036c7: 68 60 4e 11 80 push $0x80114e60 801036cc: e8 2f 18 00 00 call 80104f00 <release> break; } } } 801036d1: 83 c4 10 add $0x10,%esp 801036d4: c9 leave 801036d5: c3 ret 801036d6: 8d 76 00 lea 0x0(%esi),%esi 801036d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801036e0 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 801036e0: 55 push %ebp 801036e1: 89 e5 mov %esp,%ebp 801036e3: 57 push %edi 801036e4: 56 push %esi 801036e5: 53 push %ebx 801036e6: 83 ec 18 sub $0x18,%esp int do_commit = 0; acquire(&log.lock); 801036e9: 68 60 4e 11 80 push $0x80114e60 801036ee: e8 4d 17 00 00 call 80104e40 <acquire> log.outstanding -= 1; 801036f3: a1 9c 4e 11 80 mov 0x80114e9c,%eax if(log.committing) 801036f8: 8b 35 a0 4e 11 80 mov 0x80114ea0,%esi 801036fe: 83 c4 10 add $0x10,%esp log.outstanding -= 1; 80103701: 8d 58 ff lea -0x1(%eax),%ebx if(log.committing) 80103704: 85 f6 test %esi,%esi log.outstanding -= 1; 80103706: 89 1d 9c 4e 11 80 mov %ebx,0x80114e9c if(log.committing) 8010370c: 0f 85 1a 01 00 00 jne 8010382c <end_op+0x14c> panic("log.committing"); if(log.outstanding == 0){ 80103712: 85 db test %ebx,%ebx 80103714: 0f 85 ee 00 00 00 jne 80103808 <end_op+0x128> // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 8010371a: 83 ec 0c sub $0xc,%esp log.committing = 1; 8010371d: c7 05 a0 4e 11 80 01 movl $0x1,0x80114ea0 80103724: 00 00 00 release(&log.lock); 80103727: 68 60 4e 11 80 push $0x80114e60 8010372c: e8 cf 17 00 00 call 80104f00 <release> } static void commit() { if (log.lh.n > 0) { 80103731: 8b 0d a8 4e 11 80 mov 0x80114ea8,%ecx 80103737: 83 c4 10 add $0x10,%esp 8010373a: 85 c9 test %ecx,%ecx 8010373c: 0f 8e 85 00 00 00 jle 801037c7 <end_op+0xe7> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80103742: a1 94 4e 11 80 mov 0x80114e94,%eax 80103747: 83 ec 08 sub $0x8,%esp 8010374a: 01 d8 add %ebx,%eax 8010374c: 83 c0 01 add $0x1,%eax 8010374f: 50 push %eax 80103750: ff 35 a4 4e 11 80 pushl 0x80114ea4 80103756: e8 75 c9 ff ff call 801000d0 <bread> 8010375b: 89 c6 mov %eax,%esi struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 8010375d: 58 pop %eax 8010375e: 5a pop %edx 8010375f: ff 34 9d ac 4e 11 80 pushl -0x7feeb154(,%ebx,4) 80103766: ff 35 a4 4e 11 80 pushl 0x80114ea4 for (tail = 0; tail < log.lh.n; tail++) { 8010376c: 83 c3 01 add $0x1,%ebx struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 8010376f: e8 5c c9 ff ff call 801000d0 <bread> 80103774: 89 c7 mov %eax,%edi memmove(to->data, from->data, BSIZE); 80103776: 8d 40 5c lea 0x5c(%eax),%eax 80103779: 83 c4 0c add $0xc,%esp 8010377c: 68 00 02 00 00 push $0x200 80103781: 50 push %eax 80103782: 8d 46 5c lea 0x5c(%esi),%eax 80103785: 50 push %eax 80103786: e8 75 18 00 00 call 80105000 <memmove> bwrite(to); // write the log 8010378b: 89 34 24 mov %esi,(%esp) 8010378e: e8 0d ca ff ff call 801001a0 <bwrite> brelse(from); 80103793: 89 3c 24 mov %edi,(%esp) 80103796: e8 45 ca ff ff call 801001e0 <brelse> brelse(to); 8010379b: 89 34 24 mov %esi,(%esp) 8010379e: e8 3d ca ff ff call 801001e0 <brelse> for (tail = 0; tail < log.lh.n; tail++) { 801037a3: 83 c4 10 add $0x10,%esp 801037a6: 3b 1d a8 4e 11 80 cmp 0x80114ea8,%ebx 801037ac: 7c 94 jl 80103742 <end_op+0x62> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 801037ae: e8 bd fd ff ff call 80103570 <write_head> install_trans(); // Now install writes to home locations 801037b3: e8 18 fd ff ff call 801034d0 <install_trans> log.lh.n = 0; 801037b8: c7 05 a8 4e 11 80 00 movl $0x0,0x80114ea8 801037bf: 00 00 00 write_head(); // Erase the transaction from the log 801037c2: e8 a9 fd ff ff call 80103570 <write_head> acquire(&log.lock); 801037c7: 83 ec 0c sub $0xc,%esp 801037ca: 68 60 4e 11 80 push $0x80114e60 801037cf: e8 6c 16 00 00 call 80104e40 <acquire> wakeup(&log); 801037d4: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) log.committing = 0; 801037db: c7 05 a0 4e 11 80 00 movl $0x0,0x80114ea0 801037e2: 00 00 00 wakeup(&log); 801037e5: e8 46 12 00 00 call 80104a30 <wakeup> release(&log.lock); 801037ea: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 801037f1: e8 0a 17 00 00 call 80104f00 <release> 801037f6: 83 c4 10 add $0x10,%esp } 801037f9: 8d 65 f4 lea -0xc(%ebp),%esp 801037fc: 5b pop %ebx 801037fd: 5e pop %esi 801037fe: 5f pop %edi 801037ff: 5d pop %ebp 80103800: c3 ret 80103801: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&log); 80103808: 83 ec 0c sub $0xc,%esp 8010380b: 68 60 4e 11 80 push $0x80114e60 80103810: e8 1b 12 00 00 call 80104a30 <wakeup> release(&log.lock); 80103815: c7 04 24 60 4e 11 80 movl $0x80114e60,(%esp) 8010381c: e8 df 16 00 00 call 80104f00 <release> 80103821: 83 c4 10 add $0x10,%esp } 80103824: 8d 65 f4 lea -0xc(%ebp),%esp 80103827: 5b pop %ebx 80103828: 5e pop %esi 80103829: 5f pop %edi 8010382a: 5d pop %ebp 8010382b: c3 ret panic("log.committing"); 8010382c: 83 ec 0c sub $0xc,%esp 8010382f: 68 04 80 10 80 push $0x80108004 80103834: e8 a7 cc ff ff call 801004e0 <panic> 80103839: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103840 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80103840: 55 push %ebp 80103841: 89 e5 mov %esp,%ebp 80103843: 53 push %ebx 80103844: 83 ec 04 sub $0x4,%esp int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80103847: 8b 15 a8 4e 11 80 mov 0x80114ea8,%edx { 8010384d: 8b 5d 08 mov 0x8(%ebp),%ebx if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 80103850: 83 fa 1d cmp $0x1d,%edx 80103853: 0f 8f 9d 00 00 00 jg 801038f6 <log_write+0xb6> 80103859: a1 98 4e 11 80 mov 0x80114e98,%eax 8010385e: 83 e8 01 sub $0x1,%eax 80103861: 39 c2 cmp %eax,%edx 80103863: 0f 8d 8d 00 00 00 jge 801038f6 <log_write+0xb6> panic("too big a transaction"); if (log.outstanding < 1) 80103869: a1 9c 4e 11 80 mov 0x80114e9c,%eax 8010386e: 85 c0 test %eax,%eax 80103870: 0f 8e 8d 00 00 00 jle 80103903 <log_write+0xc3> panic("log_write outside of trans"); acquire(&log.lock); 80103876: 83 ec 0c sub $0xc,%esp 80103879: 68 60 4e 11 80 push $0x80114e60 8010387e: e8 bd 15 00 00 call 80104e40 <acquire> for (i = 0; i < log.lh.n; i++) { 80103883: 8b 0d a8 4e 11 80 mov 0x80114ea8,%ecx 80103889: 83 c4 10 add $0x10,%esp 8010388c: 83 f9 00 cmp $0x0,%ecx 8010388f: 7e 57 jle 801038e8 <log_write+0xa8> if (log.lh.block[i] == b->blockno) // log absorbtion 80103891: 8b 53 08 mov 0x8(%ebx),%edx for (i = 0; i < log.lh.n; i++) { 80103894: 31 c0 xor %eax,%eax if (log.lh.block[i] == b->blockno) // log absorbtion 80103896: 3b 15 ac 4e 11 80 cmp 0x80114eac,%edx 8010389c: 75 0b jne 801038a9 <log_write+0x69> 8010389e: eb 38 jmp 801038d8 <log_write+0x98> 801038a0: 39 14 85 ac 4e 11 80 cmp %edx,-0x7feeb154(,%eax,4) 801038a7: 74 2f je 801038d8 <log_write+0x98> for (i = 0; i < log.lh.n; i++) { 801038a9: 83 c0 01 add $0x1,%eax 801038ac: 39 c1 cmp %eax,%ecx 801038ae: 75 f0 jne 801038a0 <log_write+0x60> break; } log.lh.block[i] = b->blockno; 801038b0: 89 14 85 ac 4e 11 80 mov %edx,-0x7feeb154(,%eax,4) if (i == log.lh.n) log.lh.n++; 801038b7: 83 c0 01 add $0x1,%eax 801038ba: a3 a8 4e 11 80 mov %eax,0x80114ea8 b->flags |= B_DIRTY; // prevent eviction 801038bf: 83 0b 04 orl $0x4,(%ebx) release(&log.lock); 801038c2: c7 45 08 60 4e 11 80 movl $0x80114e60,0x8(%ebp) } 801038c9: 8b 5d fc mov -0x4(%ebp),%ebx 801038cc: c9 leave release(&log.lock); 801038cd: e9 2e 16 00 00 jmp 80104f00 <release> 801038d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi log.lh.block[i] = b->blockno; 801038d8: 89 14 85 ac 4e 11 80 mov %edx,-0x7feeb154(,%eax,4) 801038df: eb de jmp 801038bf <log_write+0x7f> 801038e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801038e8: 8b 43 08 mov 0x8(%ebx),%eax 801038eb: a3 ac 4e 11 80 mov %eax,0x80114eac if (i == log.lh.n) 801038f0: 75 cd jne 801038bf <log_write+0x7f> 801038f2: 31 c0 xor %eax,%eax 801038f4: eb c1 jmp 801038b7 <log_write+0x77> panic("too big a transaction"); 801038f6: 83 ec 0c sub $0xc,%esp 801038f9: 68 13 80 10 80 push $0x80108013 801038fe: e8 dd cb ff ff call 801004e0 <panic> panic("log_write outside of trans"); 80103903: 83 ec 0c sub $0xc,%esp 80103906: 68 29 80 10 80 push $0x80108029 8010390b: e8 d0 cb ff ff call 801004e0 <panic> 80103910 <mpmain>: lapicinit(); mpmain(); } // Common CPU setup code. static void mpmain(void) { 80103910: 55 push %ebp 80103911: 89 e5 mov %esp,%ebp 80103913: 53 push %ebx 80103914: 83 ec 04 sub $0x4,%esp cprintf("cpu%d: starting %d\n", cpuid(), cpuid()); 80103917: e8 a4 09 00 00 call 801042c0 <cpuid> 8010391c: 89 c3 mov %eax,%ebx 8010391e: e8 9d 09 00 00 call 801042c0 <cpuid> 80103923: 83 ec 04 sub $0x4,%esp 80103926: 53 push %ebx 80103927: 50 push %eax 80103928: 68 44 80 10 80 push $0x80108044 8010392d: e8 2e cf ff ff call 80100860 <cprintf> idtinit(); // load idt register 80103932: e8 e9 29 00 00 call 80106320 <idtinit> xchg(&(mycpu()->started), 1); // tell startothers() we're up 80103937: e8 04 09 00 00 call 80104240 <mycpu> 8010393c: 89 c2 mov %eax,%edx static inline uint xchg(volatile uint *addr, uint newval) { uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile ("lock; xchgl %0, %1" : 8010393e: b8 01 00 00 00 mov $0x1,%eax 80103943: f0 87 82 a0 00 00 00 lock xchg %eax,0xa0(%edx) scheduler(); // start running processes 8010394a: e8 51 0c 00 00 call 801045a0 <scheduler> 8010394f: 90 nop 80103950 <mpenter>: static void mpenter(void) { 80103950: 55 push %ebp 80103951: 89 e5 mov %esp,%ebp 80103953: 83 ec 08 sub $0x8,%esp switchkvm(); 80103956: e8 b5 3a 00 00 call 80107410 <switchkvm> seginit(); 8010395b: e8 20 3a 00 00 call 80107380 <seginit> lapicinit(); 80103960: e8 9b f7 ff ff call 80103100 <lapicinit> mpmain(); 80103965: e8 a6 ff ff ff call 80103910 <mpmain> 8010396a: 66 90 xchg %ax,%ax 8010396c: 66 90 xchg %ax,%ax 8010396e: 66 90 xchg %ax,%ax 80103970 <main>: int main(void) { 80103970: 8d 4c 24 04 lea 0x4(%esp),%ecx 80103974: 83 e4 f0 and $0xfffffff0,%esp 80103977: ff 71 fc pushl -0x4(%ecx) 8010397a: 55 push %ebp 8010397b: 89 e5 mov %esp,%ebp 8010397d: 53 push %ebx 8010397e: 51 push %ecx kinit1(end, P2V(4 * 1024 * 1024)); // phys page allocator 8010397f: 83 ec 08 sub $0x8,%esp 80103982: 68 00 00 40 80 push $0x80400000 80103987: 68 88 7c 11 80 push $0x80117c88 8010398c: e8 2f f5 ff ff call 80102ec0 <kinit1> kvmalloc(); // kernel page table 80103991: e8 4a 3f 00 00 call 801078e0 <kvmalloc> mpinit(); // detect other processors 80103996: e8 75 01 00 00 call 80103b10 <mpinit> lapicinit(); // interrupt controller 8010399b: e8 60 f7 ff ff call 80103100 <lapicinit> seginit(); // segment descriptors 801039a0: e8 db 39 00 00 call 80107380 <seginit> picinit(); // disable pic 801039a5: e8 46 03 00 00 call 80103cf0 <picinit> ioapicinit(); // another interrupt controller 801039aa: e8 41 f3 ff ff call 80102cf0 <ioapicinit> consoleinit(); // console hardware 801039af: e8 5c d2 ff ff call 80100c10 <consoleinit> uartinit(); // serial port 801039b4: e8 97 2c 00 00 call 80106650 <uartinit> pinit(); // process table 801039b9: e8 62 08 00 00 call 80104220 <pinit> tvinit(); // trap vectors 801039be: e8 dd 28 00 00 call 801062a0 <tvinit> binit(); // buffer cache 801039c3: e8 78 c6 ff ff call 80100040 <binit> fileinit(); // file table 801039c8: e8 63 de ff ff call 80101830 <fileinit> ideinit(); // disk 801039cd: e8 fe f0 ff ff call 80102ad0 <ideinit> // Write entry code to unused memory at 0x7000. // The linker has placed the image of entryother.S in // _binary_entryother_start. code = P2V(0x7000); memmove(code, _binary_entryother_start, (uint)_binary_entryother_size); 801039d2: 83 c4 0c add $0xc,%esp 801039d5: 68 7a 00 00 00 push $0x7a 801039da: 68 8c c4 10 80 push $0x8010c48c 801039df: 68 00 70 00 80 push $0x80007000 801039e4: e8 17 16 00 00 call 80105000 <memmove> for (c = cpus; c < cpus + ncpu; c++) { 801039e9: 69 05 e0 54 11 80 b0 imul $0xb0,0x801154e0,%eax 801039f0: 00 00 00 801039f3: 83 c4 10 add $0x10,%esp 801039f6: 05 60 4f 11 80 add $0x80114f60,%eax 801039fb: 3d 60 4f 11 80 cmp $0x80114f60,%eax 80103a00: 76 71 jbe 80103a73 <main+0x103> 80103a02: bb 60 4f 11 80 mov $0x80114f60,%ebx 80103a07: 89 f6 mov %esi,%esi 80103a09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if (c == mycpu()) { // We've started already. 80103a10: e8 2b 08 00 00 call 80104240 <mycpu> 80103a15: 39 d8 cmp %ebx,%eax 80103a17: 74 41 je 80103a5a <main+0xea> } // Tell entryother.S what stack to use, where to enter, and what // pgdir to use. We cannot use kpgdir yet, because the AP processor // is running in low memory, so we use entrypgdir for the APs too. stack = kalloc(); 80103a19: e8 72 f5 ff ff call 80102f90 <kalloc> *(void**)(code - 4) = stack + KSTACKSIZE; 80103a1e: 05 00 10 00 00 add $0x1000,%eax *(void(**)(void))(code - 8) = mpenter; 80103a23: c7 05 f8 6f 00 80 50 movl $0x80103950,0x80006ff8 80103a2a: 39 10 80 *(int**)(code - 12) = (void *) V2P(entrypgdir); 80103a2d: c7 05 f4 6f 00 80 00 movl $0x10b000,0x80006ff4 80103a34: b0 10 00 *(void**)(code - 4) = stack + KSTACKSIZE; 80103a37: a3 fc 6f 00 80 mov %eax,0x80006ffc lapicstartap(c->apicid, V2P(code)); 80103a3c: 0f b6 03 movzbl (%ebx),%eax 80103a3f: 83 ec 08 sub $0x8,%esp 80103a42: 68 00 70 00 00 push $0x7000 80103a47: 50 push %eax 80103a48: e8 03 f8 ff ff call 80103250 <lapicstartap> 80103a4d: 83 c4 10 add $0x10,%esp // wait for cpu to finish mpmain() while (c->started == 0) { 80103a50: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 80103a56: 85 c0 test %eax,%eax 80103a58: 74 f6 je 80103a50 <main+0xe0> for (c = cpus; c < cpus + ncpu; c++) { 80103a5a: 69 05 e0 54 11 80 b0 imul $0xb0,0x801154e0,%eax 80103a61: 00 00 00 80103a64: 81 c3 b0 00 00 00 add $0xb0,%ebx 80103a6a: 05 60 4f 11 80 add $0x80114f60,%eax 80103a6f: 39 c3 cmp %eax,%ebx 80103a71: 72 9d jb 80103a10 <main+0xa0> kinit2(P2V(4 * 1024 * 1024), P2V(PHYSTOP)); // must come after startothers() 80103a73: 83 ec 08 sub $0x8,%esp 80103a76: 68 00 00 00 8e push $0x8e000000 80103a7b: 68 00 00 40 80 push $0x80400000 80103a80: e8 ab f4 ff ff call 80102f30 <kinit2> userinit(); // first user process 80103a85: e8 86 08 00 00 call 80104310 <userinit> mpmain(); // finish this processor's setup 80103a8a: e8 81 fe ff ff call 80103910 <mpmain> 80103a8f: 90 nop 80103a90 <mpsearch1>: } return sum; } // Look for an MP structure in the len bytes at addr. static struct mp*mpsearch1(uint a, int len) { 80103a90: 55 push %ebp 80103a91: 89 e5 mov %esp,%ebp 80103a93: 57 push %edi 80103a94: 56 push %esi uchar *e, *p, *addr; addr = P2V(a); 80103a95: 8d b0 00 00 00 80 lea -0x80000000(%eax),%esi static struct mp*mpsearch1(uint a, int len) { 80103a9b: 53 push %ebx e = addr + len; 80103a9c: 8d 1c 16 lea (%esi,%edx,1),%ebx static struct mp*mpsearch1(uint a, int len) { 80103a9f: 83 ec 0c sub $0xc,%esp for (p = addr; p < e; p += sizeof(struct mp)) { 80103aa2: 39 de cmp %ebx,%esi 80103aa4: 72 10 jb 80103ab6 <mpsearch1+0x26> 80103aa6: eb 50 jmp 80103af8 <mpsearch1+0x68> 80103aa8: 90 nop 80103aa9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103ab0: 39 fb cmp %edi,%ebx 80103ab2: 89 fe mov %edi,%esi 80103ab4: 76 42 jbe 80103af8 <mpsearch1+0x68> if (memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) { 80103ab6: 83 ec 04 sub $0x4,%esp 80103ab9: 8d 7e 10 lea 0x10(%esi),%edi 80103abc: 6a 04 push $0x4 80103abe: 68 58 80 10 80 push $0x80108058 80103ac3: 56 push %esi 80103ac4: e8 d7 14 00 00 call 80104fa0 <memcmp> 80103ac9: 83 c4 10 add $0x10,%esp 80103acc: 85 c0 test %eax,%eax 80103ace: 75 e0 jne 80103ab0 <mpsearch1+0x20> 80103ad0: 89 f1 mov %esi,%ecx 80103ad2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi sum += addr[i]; 80103ad8: 0f b6 11 movzbl (%ecx),%edx 80103adb: 83 c1 01 add $0x1,%ecx 80103ade: 01 d0 add %edx,%eax for (i = 0; i < len; i++) { 80103ae0: 39 f9 cmp %edi,%ecx 80103ae2: 75 f4 jne 80103ad8 <mpsearch1+0x48> if (memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) { 80103ae4: 84 c0 test %al,%al 80103ae6: 75 c8 jne 80103ab0 <mpsearch1+0x20> return (struct mp*)p; } } return 0; } 80103ae8: 8d 65 f4 lea -0xc(%ebp),%esp 80103aeb: 89 f0 mov %esi,%eax 80103aed: 5b pop %ebx 80103aee: 5e pop %esi 80103aef: 5f pop %edi 80103af0: 5d pop %ebp 80103af1: c3 ret 80103af2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103af8: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80103afb: 31 f6 xor %esi,%esi } 80103afd: 89 f0 mov %esi,%eax 80103aff: 5b pop %ebx 80103b00: 5e pop %esi 80103b01: 5f pop %edi 80103b02: 5d pop %ebp 80103b03: c3 ret 80103b04: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103b0a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80103b10 <mpinit>: } *pmp = mp; return conf; } void mpinit(void) { 80103b10: 55 push %ebp 80103b11: 89 e5 mov %esp,%ebp 80103b13: 57 push %edi 80103b14: 56 push %esi 80103b15: 53 push %ebx 80103b16: 83 ec 1c sub $0x1c,%esp if ((p = ((bda[0x0F] << 8) | bda[0x0E]) << 4)) { 80103b19: 0f b6 05 0f 04 00 80 movzbl 0x8000040f,%eax 80103b20: 0f b6 15 0e 04 00 80 movzbl 0x8000040e,%edx 80103b27: c1 e0 08 shl $0x8,%eax 80103b2a: 09 d0 or %edx,%eax 80103b2c: c1 e0 04 shl $0x4,%eax 80103b2f: 85 c0 test %eax,%eax 80103b31: 75 1b jne 80103b4e <mpinit+0x3e> p = ((bda[0x14] << 8) | bda[0x13]) * 1024; 80103b33: 0f b6 05 14 04 00 80 movzbl 0x80000414,%eax 80103b3a: 0f b6 15 13 04 00 80 movzbl 0x80000413,%edx 80103b41: c1 e0 08 shl $0x8,%eax 80103b44: 09 d0 or %edx,%eax 80103b46: c1 e0 0a shl $0xa,%eax if ((mp = mpsearch1(p - 1024, 1024))) { 80103b49: 2d 00 04 00 00 sub $0x400,%eax if ((mp = mpsearch1(p, 1024))) { 80103b4e: ba 00 04 00 00 mov $0x400,%edx 80103b53: e8 38 ff ff ff call 80103a90 <mpsearch1> 80103b58: 85 c0 test %eax,%eax 80103b5a: 89 45 e4 mov %eax,-0x1c(%ebp) 80103b5d: 0f 84 3d 01 00 00 je 80103ca0 <mpinit+0x190> if ((mp = mpsearch()) == 0 || mp->physaddr == 0) { 80103b63: 8b 45 e4 mov -0x1c(%ebp),%eax 80103b66: 8b 58 04 mov 0x4(%eax),%ebx 80103b69: 85 db test %ebx,%ebx 80103b6b: 0f 84 4f 01 00 00 je 80103cc0 <mpinit+0x1b0> conf = (struct mpconf*) P2V((uint) mp->physaddr); 80103b71: 8d b3 00 00 00 80 lea -0x80000000(%ebx),%esi if (memcmp(conf, "PCMP", 4) != 0) { 80103b77: 83 ec 04 sub $0x4,%esp 80103b7a: 6a 04 push $0x4 80103b7c: 68 75 80 10 80 push $0x80108075 80103b81: 56 push %esi 80103b82: e8 19 14 00 00 call 80104fa0 <memcmp> 80103b87: 83 c4 10 add $0x10,%esp 80103b8a: 85 c0 test %eax,%eax 80103b8c: 0f 85 2e 01 00 00 jne 80103cc0 <mpinit+0x1b0> if (conf->version != 1 && conf->version != 4) { 80103b92: 0f b6 83 06 00 00 80 movzbl -0x7ffffffa(%ebx),%eax 80103b99: 3c 01 cmp $0x1,%al 80103b9b: 0f 95 c2 setne %dl 80103b9e: 3c 04 cmp $0x4,%al 80103ba0: 0f 95 c0 setne %al 80103ba3: 20 c2 and %al,%dl 80103ba5: 0f 85 15 01 00 00 jne 80103cc0 <mpinit+0x1b0> if (sum((uchar*)conf, conf->length) != 0) { 80103bab: 0f b7 bb 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edi for (i = 0; i < len; i++) { 80103bb2: 66 85 ff test %di,%di 80103bb5: 74 1a je 80103bd1 <mpinit+0xc1> 80103bb7: 89 f0 mov %esi,%eax 80103bb9: 01 f7 add %esi,%edi sum = 0; 80103bbb: 31 d2 xor %edx,%edx 80103bbd: 8d 76 00 lea 0x0(%esi),%esi sum += addr[i]; 80103bc0: 0f b6 08 movzbl (%eax),%ecx 80103bc3: 83 c0 01 add $0x1,%eax 80103bc6: 01 ca add %ecx,%edx for (i = 0; i < len; i++) { 80103bc8: 39 c7 cmp %eax,%edi 80103bca: 75 f4 jne 80103bc0 <mpinit+0xb0> 80103bcc: 84 d2 test %dl,%dl 80103bce: 0f 95 c2 setne %dl struct mp *mp; struct mpconf *conf; struct mpproc *proc; struct mpioapic *ioapic; if ((conf = mpconfig(&mp)) == 0) { 80103bd1: 85 f6 test %esi,%esi 80103bd3: 0f 84 e7 00 00 00 je 80103cc0 <mpinit+0x1b0> 80103bd9: 84 d2 test %dl,%dl 80103bdb: 0f 85 df 00 00 00 jne 80103cc0 <mpinit+0x1b0> panic("Expect to run on an SMP"); } ismp = 1; lapic = (uint*)conf->lapicaddr; 80103be1: 8b 83 24 00 00 80 mov -0x7fffffdc(%ebx),%eax 80103be7: a3 5c 4e 11 80 mov %eax,0x80114e5c for (p = (uchar*)(conf + 1), e = (uchar*)conf + conf->length; p < e;) { 80103bec: 0f b7 93 04 00 00 80 movzwl -0x7ffffffc(%ebx),%edx 80103bf3: 8d 83 2c 00 00 80 lea -0x7fffffd4(%ebx),%eax ismp = 1; 80103bf9: bb 01 00 00 00 mov $0x1,%ebx for (p = (uchar*)(conf + 1), e = (uchar*)conf + conf->length; p < e;) { 80103bfe: 01 d6 add %edx,%esi 80103c00: 39 c6 cmp %eax,%esi 80103c02: 76 23 jbe 80103c27 <mpinit+0x117> switch (*p) { 80103c04: 0f b6 10 movzbl (%eax),%edx 80103c07: 80 fa 04 cmp $0x4,%dl 80103c0a: 0f 87 ca 00 00 00 ja 80103cda <mpinit+0x1ca> 80103c10: ff 24 95 9c 80 10 80 jmp *-0x7fef7f64(,%edx,4) 80103c17: 89 f6 mov %esi,%esi 80103c19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p += sizeof(struct mpioapic); continue; case MPBUS: case MPIOINTR: case MPLINTR: p += 8; 80103c20: 83 c0 08 add $0x8,%eax for (p = (uchar*)(conf + 1), e = (uchar*)conf + conf->length; p < e;) { 80103c23: 39 c6 cmp %eax,%esi 80103c25: 77 dd ja 80103c04 <mpinit+0xf4> default: ismp = 0; break; } } if (!ismp) { 80103c27: 85 db test %ebx,%ebx 80103c29: 0f 84 9e 00 00 00 je 80103ccd <mpinit+0x1bd> panic("Didn't find a suitable machine"); } if (mp->imcrp) { 80103c2f: 8b 45 e4 mov -0x1c(%ebp),%eax 80103c32: 80 78 0c 00 cmpb $0x0,0xc(%eax) 80103c36: 74 15 je 80103c4d <mpinit+0x13d> asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80103c38: b8 70 00 00 00 mov $0x70,%eax 80103c3d: ba 22 00 00 00 mov $0x22,%edx 80103c42: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 80103c43: ba 23 00 00 00 mov $0x23,%edx 80103c48: ec in (%dx),%al // Bochs doesn't support IMCR, so this doesn't run on Bochs. // But it would on real hardware. outb(0x22, 0x70); // Select IMCR outb(0x23, inb(0x23) | 1); // Mask external interrupts. 80103c49: 83 c8 01 or $0x1,%eax asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80103c4c: ee out %al,(%dx) } } 80103c4d: 8d 65 f4 lea -0xc(%ebp),%esp 80103c50: 5b pop %ebx 80103c51: 5e pop %esi 80103c52: 5f pop %edi 80103c53: 5d pop %ebp 80103c54: c3 ret 80103c55: 8d 76 00 lea 0x0(%esi),%esi if (ncpu < NCPU) { 80103c58: 8b 0d e0 54 11 80 mov 0x801154e0,%ecx 80103c5e: 83 f9 07 cmp $0x7,%ecx 80103c61: 7f 19 jg 80103c7c <mpinit+0x16c> cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103c63: 0f b6 50 01 movzbl 0x1(%eax),%edx 80103c67: 69 f9 b0 00 00 00 imul $0xb0,%ecx,%edi ncpu++; 80103c6d: 83 c1 01 add $0x1,%ecx 80103c70: 89 0d e0 54 11 80 mov %ecx,0x801154e0 cpus[ncpu].apicid = proc->apicid; // apicid may differ from ncpu 80103c76: 88 97 60 4f 11 80 mov %dl,-0x7feeb0a0(%edi) p += sizeof(struct mpproc); 80103c7c: 83 c0 14 add $0x14,%eax continue; 80103c7f: e9 7c ff ff ff jmp 80103c00 <mpinit+0xf0> 80103c84: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ioapicid = ioapic->apicno; 80103c88: 0f b6 50 01 movzbl 0x1(%eax),%edx p += sizeof(struct mpioapic); 80103c8c: 83 c0 08 add $0x8,%eax ioapicid = ioapic->apicno; 80103c8f: 88 15 40 4f 11 80 mov %dl,0x80114f40 continue; 80103c95: e9 66 ff ff ff jmp 80103c00 <mpinit+0xf0> 80103c9a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return mpsearch1(0xF0000, 0x10000); 80103ca0: ba 00 00 01 00 mov $0x10000,%edx 80103ca5: b8 00 00 0f 00 mov $0xf0000,%eax 80103caa: e8 e1 fd ff ff call 80103a90 <mpsearch1> if ((mp = mpsearch()) == 0 || mp->physaddr == 0) { 80103caf: 85 c0 test %eax,%eax return mpsearch1(0xF0000, 0x10000); 80103cb1: 89 45 e4 mov %eax,-0x1c(%ebp) if ((mp = mpsearch()) == 0 || mp->physaddr == 0) { 80103cb4: 0f 85 a9 fe ff ff jne 80103b63 <mpinit+0x53> 80103cba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi panic("Expect to run on an SMP"); 80103cc0: 83 ec 0c sub $0xc,%esp 80103cc3: 68 5d 80 10 80 push $0x8010805d 80103cc8: e8 13 c8 ff ff call 801004e0 <panic> panic("Didn't find a suitable machine"); 80103ccd: 83 ec 0c sub $0xc,%esp 80103cd0: 68 7c 80 10 80 push $0x8010807c 80103cd5: e8 06 c8 ff ff call 801004e0 <panic> ismp = 0; 80103cda: 31 db xor %ebx,%ebx 80103cdc: e9 26 ff ff ff jmp 80103c07 <mpinit+0xf7> 80103ce1: 66 90 xchg %ax,%ax 80103ce3: 66 90 xchg %ax,%ax 80103ce5: 66 90 xchg %ax,%ax 80103ce7: 66 90 xchg %ax,%ax 80103ce9: 66 90 xchg %ax,%ax 80103ceb: 66 90 xchg %ax,%ax 80103ced: 66 90 xchg %ax,%ax 80103cef: 90 nop 80103cf0 <picinit>: // I/O Addresses of the two programmable interrupt controllers #define IO_PIC1 0x20 // Master (IRQs 0-7) #define IO_PIC2 0xA0 // Slave (IRQs 8-15) // Don't use the 8259A interrupt controllers. Xv6 assumes SMP hardware. void picinit(void) { 80103cf0: 55 push %ebp 80103cf1: b8 ff ff ff ff mov $0xffffffff,%eax 80103cf6: ba 21 00 00 00 mov $0x21,%edx 80103cfb: 89 e5 mov %esp,%ebp 80103cfd: ee out %al,(%dx) 80103cfe: ba a1 00 00 00 mov $0xa1,%edx 80103d03: ee out %al,(%dx) // mask all interrupts outb(IO_PIC1 + 1, 0xFF); outb(IO_PIC2 + 1, 0xFF); } 80103d04: 5d pop %ebp 80103d05: c3 ret 80103d06: 66 90 xchg %ax,%ax 80103d08: 66 90 xchg %ax,%ax 80103d0a: 66 90 xchg %ax,%ax 80103d0c: 66 90 xchg %ax,%ax 80103d0e: 66 90 xchg %ax,%ax 80103d10 <cleanuppipealloc>: uint nwrite; // number of bytes written int readopen; // read fd is still open int writeopen; // write fd is still open }; void cleanuppipealloc(struct pipe *p, struct file **f0, struct file **f1) { 80103d10: 55 push %ebp 80103d11: 89 e5 mov %esp,%ebp 80103d13: 56 push %esi 80103d14: 53 push %ebx 80103d15: 8b 45 08 mov 0x8(%ebp),%eax 80103d18: 8b 75 0c mov 0xc(%ebp),%esi 80103d1b: 8b 5d 10 mov 0x10(%ebp),%ebx if (p) { 80103d1e: 85 c0 test %eax,%eax 80103d20: 74 0c je 80103d2e <cleanuppipealloc+0x1e> kfree((char*)p); 80103d22: 83 ec 0c sub $0xc,%esp 80103d25: 50 push %eax 80103d26: e8 b5 f0 ff ff call 80102de0 <kfree> 80103d2b: 83 c4 10 add $0x10,%esp } if (*f0) { 80103d2e: 8b 06 mov (%esi),%eax 80103d30: 85 c0 test %eax,%eax 80103d32: 74 0c je 80103d40 <cleanuppipealloc+0x30> fileclose(*f0); 80103d34: 83 ec 0c sub $0xc,%esp 80103d37: 50 push %eax 80103d38: e8 d3 db ff ff call 80101910 <fileclose> 80103d3d: 83 c4 10 add $0x10,%esp } if (*f1) { 80103d40: 8b 03 mov (%ebx),%eax 80103d42: 85 c0 test %eax,%eax 80103d44: 74 12 je 80103d58 <cleanuppipealloc+0x48> fileclose(*f1); 80103d46: 89 45 08 mov %eax,0x8(%ebp) } } 80103d49: 8d 65 f8 lea -0x8(%ebp),%esp 80103d4c: 5b pop %ebx 80103d4d: 5e pop %esi 80103d4e: 5d pop %ebp fileclose(*f1); 80103d4f: e9 bc db ff ff jmp 80101910 <fileclose> 80103d54: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } 80103d58: 8d 65 f8 lea -0x8(%ebp),%esp 80103d5b: 5b pop %ebx 80103d5c: 5e pop %esi 80103d5d: 5d pop %ebp 80103d5e: c3 ret 80103d5f: 90 nop 80103d60 <pipealloc>: int pipealloc(struct file **f0, struct file **f1) { 80103d60: 55 push %ebp 80103d61: 89 e5 mov %esp,%ebp 80103d63: 57 push %edi 80103d64: 56 push %esi 80103d65: 53 push %ebx 80103d66: 83 ec 0c sub $0xc,%esp 80103d69: 8b 75 08 mov 0x8(%ebp),%esi 80103d6c: 8b 7d 0c mov 0xc(%ebp),%edi struct pipe *p; p = 0; *f0 = *f1 = 0; 80103d6f: c7 07 00 00 00 00 movl $0x0,(%edi) 80103d75: c7 06 00 00 00 00 movl $0x0,(%esi) if ((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) { 80103d7b: e8 d0 da ff ff call 80101850 <filealloc> 80103d80: 85 c0 test %eax,%eax 80103d82: 89 06 mov %eax,(%esi) 80103d84: 0f 84 96 00 00 00 je 80103e20 <pipealloc+0xc0> 80103d8a: e8 c1 da ff ff call 80101850 <filealloc> 80103d8f: 85 c0 test %eax,%eax 80103d91: 89 07 mov %eax,(%edi) 80103d93: 0f 84 87 00 00 00 je 80103e20 <pipealloc+0xc0> cleanuppipealloc(p, f0, f1); return -1; } if ((p = (struct pipe*)kalloc()) == 0) { 80103d99: e8 f2 f1 ff ff call 80102f90 <kalloc> 80103d9e: 85 c0 test %eax,%eax 80103da0: 89 c3 mov %eax,%ebx 80103da2: 74 7c je 80103e20 <pipealloc+0xc0> } p->readopen = 1; p->writeopen = 1; p->nwrite = 0; p->nread = 0; initlock(&p->lock, "pipe"); 80103da4: 83 ec 08 sub $0x8,%esp p->readopen = 1; 80103da7: c7 80 3c 02 00 00 01 movl $0x1,0x23c(%eax) 80103dae: 00 00 00 p->writeopen = 1; 80103db1: c7 80 40 02 00 00 01 movl $0x1,0x240(%eax) 80103db8: 00 00 00 p->nwrite = 0; 80103dbb: c7 80 38 02 00 00 00 movl $0x0,0x238(%eax) 80103dc2: 00 00 00 p->nread = 0; 80103dc5: c7 80 34 02 00 00 00 movl $0x0,0x234(%eax) 80103dcc: 00 00 00 initlock(&p->lock, "pipe"); 80103dcf: 68 b0 80 10 80 push $0x801080b0 80103dd4: 50 push %eax 80103dd5: e8 26 0f 00 00 call 80104d00 <initlock> (*f0)->type = FD_PIPE; 80103dda: 8b 06 mov (%esi),%eax (*f0)->pipe = p; (*f1)->type = FD_PIPE; (*f1)->readable = 0; (*f1)->writable = 1; (*f1)->pipe = p; return 0; 80103ddc: 83 c4 10 add $0x10,%esp (*f0)->type = FD_PIPE; 80103ddf: c7 00 01 00 00 00 movl $0x1,(%eax) (*f0)->readable = 1; 80103de5: 8b 06 mov (%esi),%eax 80103de7: c6 40 08 01 movb $0x1,0x8(%eax) (*f0)->writable = 0; 80103deb: 8b 06 mov (%esi),%eax 80103ded: c6 40 09 00 movb $0x0,0x9(%eax) (*f0)->pipe = p; 80103df1: 8b 06 mov (%esi),%eax 80103df3: 89 58 0c mov %ebx,0xc(%eax) (*f1)->type = FD_PIPE; 80103df6: 8b 07 mov (%edi),%eax 80103df8: c7 00 01 00 00 00 movl $0x1,(%eax) (*f1)->readable = 0; 80103dfe: 8b 07 mov (%edi),%eax 80103e00: c6 40 08 00 movb $0x0,0x8(%eax) (*f1)->writable = 1; 80103e04: 8b 07 mov (%edi),%eax 80103e06: c6 40 09 01 movb $0x1,0x9(%eax) (*f1)->pipe = p; 80103e0a: 8b 07 mov (%edi),%eax 80103e0c: 89 58 0c mov %ebx,0xc(%eax) return 0; 80103e0f: 31 c0 xor %eax,%eax } 80103e11: 8d 65 f4 lea -0xc(%ebp),%esp 80103e14: 5b pop %ebx 80103e15: 5e pop %esi 80103e16: 5f pop %edi 80103e17: 5d pop %ebp 80103e18: c3 ret 80103e19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi cleanuppipealloc(p, f0, f1); 80103e20: 83 ec 04 sub $0x4,%esp 80103e23: 57 push %edi 80103e24: 56 push %esi 80103e25: 6a 00 push $0x0 80103e27: e8 e4 fe ff ff call 80103d10 <cleanuppipealloc> return -1; 80103e2c: 83 c4 10 add $0x10,%esp 80103e2f: b8 ff ff ff ff mov $0xffffffff,%eax 80103e34: eb db jmp 80103e11 <pipealloc+0xb1> 80103e36: 8d 76 00 lea 0x0(%esi),%esi 80103e39: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80103e40 <pipeclose>: void pipeclose(struct pipe *p, int writable) { 80103e40: 55 push %ebp 80103e41: 89 e5 mov %esp,%ebp 80103e43: 56 push %esi 80103e44: 53 push %ebx 80103e45: 8b 5d 08 mov 0x8(%ebp),%ebx 80103e48: 8b 75 0c mov 0xc(%ebp),%esi acquire(&p->lock); 80103e4b: 83 ec 0c sub $0xc,%esp 80103e4e: 53 push %ebx 80103e4f: e8 ec 0f 00 00 call 80104e40 <acquire> if (writable) { 80103e54: 83 c4 10 add $0x10,%esp 80103e57: 85 f6 test %esi,%esi 80103e59: 74 45 je 80103ea0 <pipeclose+0x60> p->writeopen = 0; wakeup(&p->nread); 80103e5b: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103e61: 83 ec 0c sub $0xc,%esp p->writeopen = 0; 80103e64: c7 83 40 02 00 00 00 movl $0x0,0x240(%ebx) 80103e6b: 00 00 00 wakeup(&p->nread); 80103e6e: 50 push %eax 80103e6f: e8 bc 0b 00 00 call 80104a30 <wakeup> 80103e74: 83 c4 10 add $0x10,%esp } else { p->readopen = 0; wakeup(&p->nwrite); } if (p->readopen == 0 && p->writeopen == 0) { 80103e77: 8b 93 3c 02 00 00 mov 0x23c(%ebx),%edx 80103e7d: 85 d2 test %edx,%edx 80103e7f: 75 0a jne 80103e8b <pipeclose+0x4b> 80103e81: 8b 83 40 02 00 00 mov 0x240(%ebx),%eax 80103e87: 85 c0 test %eax,%eax 80103e89: 74 35 je 80103ec0 <pipeclose+0x80> release(&p->lock); kfree((char*)p); } else { release(&p->lock); 80103e8b: 89 5d 08 mov %ebx,0x8(%ebp) } } 80103e8e: 8d 65 f8 lea -0x8(%ebp),%esp 80103e91: 5b pop %ebx 80103e92: 5e pop %esi 80103e93: 5d pop %ebp release(&p->lock); 80103e94: e9 67 10 00 00 jmp 80104f00 <release> 80103e99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wakeup(&p->nwrite); 80103ea0: 8d 83 38 02 00 00 lea 0x238(%ebx),%eax 80103ea6: 83 ec 0c sub $0xc,%esp p->readopen = 0; 80103ea9: c7 83 3c 02 00 00 00 movl $0x0,0x23c(%ebx) 80103eb0: 00 00 00 wakeup(&p->nwrite); 80103eb3: 50 push %eax 80103eb4: e8 77 0b 00 00 call 80104a30 <wakeup> 80103eb9: 83 c4 10 add $0x10,%esp 80103ebc: eb b9 jmp 80103e77 <pipeclose+0x37> 80103ebe: 66 90 xchg %ax,%ax release(&p->lock); 80103ec0: 83 ec 0c sub $0xc,%esp 80103ec3: 53 push %ebx 80103ec4: e8 37 10 00 00 call 80104f00 <release> kfree((char*)p); 80103ec9: 89 5d 08 mov %ebx,0x8(%ebp) 80103ecc: 83 c4 10 add $0x10,%esp } 80103ecf: 8d 65 f8 lea -0x8(%ebp),%esp 80103ed2: 5b pop %ebx 80103ed3: 5e pop %esi 80103ed4: 5d pop %ebp kfree((char*)p); 80103ed5: e9 06 ef ff ff jmp 80102de0 <kfree> 80103eda: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80103ee0 <pipewrite>: int pipewrite(struct pipe *p, char *addr, int n) { 80103ee0: 55 push %ebp 80103ee1: 89 e5 mov %esp,%ebp 80103ee3: 57 push %edi 80103ee4: 56 push %esi 80103ee5: 53 push %ebx 80103ee6: 83 ec 28 sub $0x28,%esp 80103ee9: 8b 5d 08 mov 0x8(%ebp),%ebx int i; acquire(&p->lock); 80103eec: 53 push %ebx 80103eed: e8 4e 0f 00 00 call 80104e40 <acquire> for (i = 0; i < n; i++) { 80103ef2: 8b 45 10 mov 0x10(%ebp),%eax 80103ef5: 83 c4 10 add $0x10,%esp 80103ef8: 85 c0 test %eax,%eax 80103efa: 0f 8e c9 00 00 00 jle 80103fc9 <pipewrite+0xe9> 80103f00: 8b 4d 0c mov 0xc(%ebp),%ecx 80103f03: 8b 83 38 02 00 00 mov 0x238(%ebx),%eax while (p->nwrite == p->nread + PIPESIZE) { //DOC: pipewrite-full if (p->readopen == 0 || myproc()->killed) { release(&p->lock); return -1; } wakeup(&p->nread); 80103f09: 8d bb 34 02 00 00 lea 0x234(%ebx),%edi 80103f0f: 89 4d e4 mov %ecx,-0x1c(%ebp) 80103f12: 03 4d 10 add 0x10(%ebp),%ecx 80103f15: 89 4d e0 mov %ecx,-0x20(%ebp) while (p->nwrite == p->nread + PIPESIZE) { //DOC: pipewrite-full 80103f18: 8b 8b 34 02 00 00 mov 0x234(%ebx),%ecx 80103f1e: 8d 91 00 02 00 00 lea 0x200(%ecx),%edx 80103f24: 39 d0 cmp %edx,%eax 80103f26: 75 71 jne 80103f99 <pipewrite+0xb9> if (p->readopen == 0 || myproc()->killed) { 80103f28: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 80103f2e: 85 c0 test %eax,%eax 80103f30: 74 4e je 80103f80 <pipewrite+0xa0> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103f32: 8d b3 38 02 00 00 lea 0x238(%ebx),%esi 80103f38: eb 3a jmp 80103f74 <pipewrite+0x94> 80103f3a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi wakeup(&p->nread); 80103f40: 83 ec 0c sub $0xc,%esp 80103f43: 57 push %edi 80103f44: e8 e7 0a 00 00 call 80104a30 <wakeup> sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep 80103f49: 5a pop %edx 80103f4a: 59 pop %ecx 80103f4b: 53 push %ebx 80103f4c: 56 push %esi 80103f4d: e8 2e 09 00 00 call 80104880 <sleep> while (p->nwrite == p->nread + PIPESIZE) { //DOC: pipewrite-full 80103f52: 8b 83 34 02 00 00 mov 0x234(%ebx),%eax 80103f58: 8b 93 38 02 00 00 mov 0x238(%ebx),%edx 80103f5e: 83 c4 10 add $0x10,%esp 80103f61: 05 00 02 00 00 add $0x200,%eax 80103f66: 39 c2 cmp %eax,%edx 80103f68: 75 36 jne 80103fa0 <pipewrite+0xc0> if (p->readopen == 0 || myproc()->killed) { 80103f6a: 8b 83 3c 02 00 00 mov 0x23c(%ebx),%eax 80103f70: 85 c0 test %eax,%eax 80103f72: 74 0c je 80103f80 <pipewrite+0xa0> 80103f74: e8 67 03 00 00 call 801042e0 <myproc> 80103f79: 8b 40 24 mov 0x24(%eax),%eax 80103f7c: 85 c0 test %eax,%eax 80103f7e: 74 c0 je 80103f40 <pipewrite+0x60> release(&p->lock); 80103f80: 83 ec 0c sub $0xc,%esp 80103f83: 53 push %ebx 80103f84: e8 77 0f 00 00 call 80104f00 <release> return -1; 80103f89: 83 c4 10 add $0x10,%esp 80103f8c: b8 ff ff ff ff mov $0xffffffff,%eax p->data[p->nwrite++ % PIPESIZE] = addr[i]; } wakeup(&p->nread); //DOC: pipewrite-wakeup1 release(&p->lock); return n; } 80103f91: 8d 65 f4 lea -0xc(%ebp),%esp 80103f94: 5b pop %ebx 80103f95: 5e pop %esi 80103f96: 5f pop %edi 80103f97: 5d pop %ebp 80103f98: c3 ret while (p->nwrite == p->nread + PIPESIZE) { //DOC: pipewrite-full 80103f99: 89 c2 mov %eax,%edx 80103f9b: 90 nop 80103f9c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p->data[p->nwrite++ % PIPESIZE] = addr[i]; 80103fa0: 8b 75 e4 mov -0x1c(%ebp),%esi 80103fa3: 8d 42 01 lea 0x1(%edx),%eax 80103fa6: 81 e2 ff 01 00 00 and $0x1ff,%edx 80103fac: 89 83 38 02 00 00 mov %eax,0x238(%ebx) 80103fb2: 83 c6 01 add $0x1,%esi 80103fb5: 0f b6 4e ff movzbl -0x1(%esi),%ecx for (i = 0; i < n; i++) { 80103fb9: 3b 75 e0 cmp -0x20(%ebp),%esi 80103fbc: 89 75 e4 mov %esi,-0x1c(%ebp) p->data[p->nwrite++ % PIPESIZE] = addr[i]; 80103fbf: 88 4c 13 34 mov %cl,0x34(%ebx,%edx,1) for (i = 0; i < n; i++) { 80103fc3: 0f 85 4f ff ff ff jne 80103f18 <pipewrite+0x38> wakeup(&p->nread); //DOC: pipewrite-wakeup1 80103fc9: 8d 83 34 02 00 00 lea 0x234(%ebx),%eax 80103fcf: 83 ec 0c sub $0xc,%esp 80103fd2: 50 push %eax 80103fd3: e8 58 0a 00 00 call 80104a30 <wakeup> release(&p->lock); 80103fd8: 89 1c 24 mov %ebx,(%esp) 80103fdb: e8 20 0f 00 00 call 80104f00 <release> return n; 80103fe0: 83 c4 10 add $0x10,%esp 80103fe3: 8b 45 10 mov 0x10(%ebp),%eax 80103fe6: eb a9 jmp 80103f91 <pipewrite+0xb1> 80103fe8: 90 nop 80103fe9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80103ff0 <piperead>: int piperead(struct pipe *p, char *addr, int n) { 80103ff0: 55 push %ebp 80103ff1: 89 e5 mov %esp,%ebp 80103ff3: 57 push %edi 80103ff4: 56 push %esi 80103ff5: 53 push %ebx 80103ff6: 83 ec 18 sub $0x18,%esp 80103ff9: 8b 75 08 mov 0x8(%ebp),%esi 80103ffc: 8b 7d 0c mov 0xc(%ebp),%edi int i; acquire(&p->lock); 80103fff: 56 push %esi 80104000: e8 3b 0e 00 00 call 80104e40 <acquire> while (p->nread == p->nwrite && p->writeopen) { //DOC: pipe-empty 80104005: 83 c4 10 add $0x10,%esp 80104008: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 8010400e: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80104014: 75 6a jne 80104080 <piperead+0x90> 80104016: 8b 9e 40 02 00 00 mov 0x240(%esi),%ebx 8010401c: 85 db test %ebx,%ebx 8010401e: 0f 84 c4 00 00 00 je 801040e8 <piperead+0xf8> if (myproc()->killed) { release(&p->lock); return -1; } sleep(&p->nread, &p->lock); //DOC: piperead-sleep 80104024: 8d 9e 34 02 00 00 lea 0x234(%esi),%ebx 8010402a: eb 2d jmp 80104059 <piperead+0x69> 8010402c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104030: 83 ec 08 sub $0x8,%esp 80104033: 56 push %esi 80104034: 53 push %ebx 80104035: e8 46 08 00 00 call 80104880 <sleep> while (p->nread == p->nwrite && p->writeopen) { //DOC: pipe-empty 8010403a: 83 c4 10 add $0x10,%esp 8010403d: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80104043: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 80104049: 75 35 jne 80104080 <piperead+0x90> 8010404b: 8b 96 40 02 00 00 mov 0x240(%esi),%edx 80104051: 85 d2 test %edx,%edx 80104053: 0f 84 8f 00 00 00 je 801040e8 <piperead+0xf8> if (myproc()->killed) { 80104059: e8 82 02 00 00 call 801042e0 <myproc> 8010405e: 8b 48 24 mov 0x24(%eax),%ecx 80104061: 85 c9 test %ecx,%ecx 80104063: 74 cb je 80104030 <piperead+0x40> release(&p->lock); 80104065: 83 ec 0c sub $0xc,%esp return -1; 80104068: bb ff ff ff ff mov $0xffffffff,%ebx release(&p->lock); 8010406d: 56 push %esi 8010406e: e8 8d 0e 00 00 call 80104f00 <release> return -1; 80104073: 83 c4 10 add $0x10,%esp addr[i] = p->data[p->nread++ % PIPESIZE]; } wakeup(&p->nwrite); //DOC: piperead-wakeup release(&p->lock); return i; } 80104076: 8d 65 f4 lea -0xc(%ebp),%esp 80104079: 89 d8 mov %ebx,%eax 8010407b: 5b pop %ebx 8010407c: 5e pop %esi 8010407d: 5f pop %edi 8010407e: 5d pop %ebp 8010407f: c3 ret for (i = 0; i < n; i++) { //DOC: piperead-copy 80104080: 8b 45 10 mov 0x10(%ebp),%eax 80104083: 85 c0 test %eax,%eax 80104085: 7e 61 jle 801040e8 <piperead+0xf8> if (p->nread == p->nwrite) { 80104087: 31 db xor %ebx,%ebx 80104089: eb 13 jmp 8010409e <piperead+0xae> 8010408b: 90 nop 8010408c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104090: 8b 8e 34 02 00 00 mov 0x234(%esi),%ecx 80104096: 3b 8e 38 02 00 00 cmp 0x238(%esi),%ecx 8010409c: 74 1f je 801040bd <piperead+0xcd> addr[i] = p->data[p->nread++ % PIPESIZE]; 8010409e: 8d 41 01 lea 0x1(%ecx),%eax 801040a1: 81 e1 ff 01 00 00 and $0x1ff,%ecx 801040a7: 89 86 34 02 00 00 mov %eax,0x234(%esi) 801040ad: 0f b6 44 0e 34 movzbl 0x34(%esi,%ecx,1),%eax 801040b2: 88 04 1f mov %al,(%edi,%ebx,1) for (i = 0; i < n; i++) { //DOC: piperead-copy 801040b5: 83 c3 01 add $0x1,%ebx 801040b8: 39 5d 10 cmp %ebx,0x10(%ebp) 801040bb: 75 d3 jne 80104090 <piperead+0xa0> wakeup(&p->nwrite); //DOC: piperead-wakeup 801040bd: 8d 86 38 02 00 00 lea 0x238(%esi),%eax 801040c3: 83 ec 0c sub $0xc,%esp 801040c6: 50 push %eax 801040c7: e8 64 09 00 00 call 80104a30 <wakeup> release(&p->lock); 801040cc: 89 34 24 mov %esi,(%esp) 801040cf: e8 2c 0e 00 00 call 80104f00 <release> return i; 801040d4: 83 c4 10 add $0x10,%esp } 801040d7: 8d 65 f4 lea -0xc(%ebp),%esp 801040da: 89 d8 mov %ebx,%eax 801040dc: 5b pop %ebx 801040dd: 5e pop %esi 801040de: 5f pop %edi 801040df: 5d pop %ebp 801040e0: c3 ret 801040e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801040e8: 31 db xor %ebx,%ebx 801040ea: eb d1 jmp 801040bd <piperead+0xcd> 801040ec: 66 90 xchg %ax,%ax 801040ee: 66 90 xchg %ax,%ax 801040f0 <allocproc>: // Look in the process table for an UNUSED proc. // If found, change state to EMBRYO and initialize // state required to run in the kernel. // Otherwise return 0. static struct proc* allocproc(void) { 801040f0: 55 push %ebp 801040f1: 89 e5 mov %esp,%ebp 801040f3: 53 push %ebx 801040f4: 83 ec 10 sub $0x10,%esp struct proc *p; char *sp; int found = 0; acquire(&ptable.lock); 801040f7: 68 00 55 11 80 push $0x80115500 801040fc: e8 3f 0d 00 00 call 80104e40 <acquire> p = ptable.proc; while (p < &ptable.proc[NPROC] && !found) { if (p->state == UNUSED) { 80104101: 8b 15 40 55 11 80 mov 0x80115540,%edx 80104107: 83 c4 10 add $0x10,%esp 8010410a: 85 d2 test %edx,%edx 8010410c: 74 3a je 80104148 <allocproc+0x58> found = 1; } else { p++; 8010410e: bb b0 55 11 80 mov $0x801155b0,%ebx 80104113: 90 nop 80104114: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (p->state == UNUSED) { 80104118: 8b 43 0c mov 0xc(%ebx),%eax 8010411b: 85 c0 test %eax,%eax 8010411d: 74 31 je 80104150 <allocproc+0x60> p++; 8010411f: 83 c3 7c add $0x7c,%ebx while (p < &ptable.proc[NPROC] && !found) { 80104122: 81 fb 34 74 11 80 cmp $0x80117434,%ebx 80104128: 72 ee jb 80104118 <allocproc+0x28> } } if (!found) { release(&ptable.lock); 8010412a: 83 ec 0c sub $0xc,%esp return 0; 8010412d: 31 db xor %ebx,%ebx release(&ptable.lock); 8010412f: 68 00 55 11 80 push $0x80115500 80104134: e8 c7 0d 00 00 call 80104f00 <release> return 0; 80104139: 83 c4 10 add $0x10,%esp p->context = (struct context*)sp; memset(p->context, 0, sizeof *p->context); p->context->eip = (uint)forkret; return p; } 8010413c: 89 d8 mov %ebx,%eax 8010413e: 8b 5d fc mov -0x4(%ebp),%ebx 80104141: c9 leave 80104142: c3 ret 80104143: 90 nop 80104144: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi p = ptable.proc; 80104148: bb 34 55 11 80 mov $0x80115534,%ebx 8010414d: 8d 76 00 lea 0x0(%esi),%esi p->pid = nextpid++; 80104150: a1 04 c0 10 80 mov 0x8010c004,%eax release(&ptable.lock); 80104155: 83 ec 0c sub $0xc,%esp p->state = EMBRYO; 80104158: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) p->pid = nextpid++; 8010415f: 8d 50 01 lea 0x1(%eax),%edx 80104162: 89 43 10 mov %eax,0x10(%ebx) release(&ptable.lock); 80104165: 68 00 55 11 80 push $0x80115500 p->pid = nextpid++; 8010416a: 89 15 04 c0 10 80 mov %edx,0x8010c004 release(&ptable.lock); 80104170: e8 8b 0d 00 00 call 80104f00 <release> if ((p->kstack = kalloc()) == 0) { 80104175: e8 16 ee ff ff call 80102f90 <kalloc> 8010417a: 83 c4 10 add $0x10,%esp 8010417d: 85 c0 test %eax,%eax 8010417f: 89 43 08 mov %eax,0x8(%ebx) 80104182: 74 3c je 801041c0 <allocproc+0xd0> sp -= sizeof *p->tf; 80104184: 8d 90 b4 0f 00 00 lea 0xfb4(%eax),%edx memset(p->context, 0, sizeof *p->context); 8010418a: 83 ec 04 sub $0x4,%esp sp -= sizeof *p->context; 8010418d: 05 9c 0f 00 00 add $0xf9c,%eax sp -= sizeof *p->tf; 80104192: 89 53 18 mov %edx,0x18(%ebx) *(uint*)sp = (uint)trapret; 80104195: c7 40 14 87 62 10 80 movl $0x80106287,0x14(%eax) p->context = (struct context*)sp; 8010419c: 89 43 1c mov %eax,0x1c(%ebx) memset(p->context, 0, sizeof *p->context); 8010419f: 6a 14 push $0x14 801041a1: 6a 00 push $0x0 801041a3: 50 push %eax 801041a4: e8 a7 0d 00 00 call 80104f50 <memset> p->context->eip = (uint)forkret; 801041a9: 8b 43 1c mov 0x1c(%ebx),%eax return p; 801041ac: 83 c4 10 add $0x10,%esp p->context->eip = (uint)forkret; 801041af: c7 40 10 d0 41 10 80 movl $0x801041d0,0x10(%eax) } 801041b6: 89 d8 mov %ebx,%eax 801041b8: 8b 5d fc mov -0x4(%ebp),%ebx 801041bb: c9 leave 801041bc: c3 ret 801041bd: 8d 76 00 lea 0x0(%esi),%esi p->state = UNUSED; 801041c0: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return 0; 801041c7: 31 db xor %ebx,%ebx 801041c9: e9 6e ff ff ff jmp 8010413c <allocproc+0x4c> 801041ce: 66 90 xchg %ax,%ax 801041d0 <forkret>: release(&ptable.lock); } // A fork child's very first scheduling by scheduler() // will swtch here. "Return" to user space. void forkret(void) { 801041d0: 55 push %ebp 801041d1: 89 e5 mov %esp,%ebp 801041d3: 83 ec 14 sub $0x14,%esp static int first = 1; // Still holding ptable.lock from scheduler. release(&ptable.lock); 801041d6: 68 00 55 11 80 push $0x80115500 801041db: e8 20 0d 00 00 call 80104f00 <release> if (first) { 801041e0: a1 00 c0 10 80 mov 0x8010c000,%eax 801041e5: 83 c4 10 add $0x10,%esp 801041e8: 85 c0 test %eax,%eax 801041ea: 75 04 jne 801041f0 <forkret+0x20> iinit(ROOTDEV); initlog(ROOTDEV); } // Return to "caller", actually trapret (see allocproc). } 801041ec: c9 leave 801041ed: c3 ret 801041ee: 66 90 xchg %ax,%ax iinit(ROOTDEV); 801041f0: 83 ec 0c sub $0xc,%esp first = 0; 801041f3: c7 05 00 c0 10 80 00 movl $0x0,0x8010c000 801041fa: 00 00 00 iinit(ROOTDEV); 801041fd: 6a 01 push $0x1 801041ff: e8 4c dd ff ff call 80101f50 <iinit> initlog(ROOTDEV); 80104204: c7 04 24 01 00 00 00 movl $0x1,(%esp) 8010420b: e8 c0 f3 ff ff call 801035d0 <initlog> 80104210: 83 c4 10 add $0x10,%esp } 80104213: c9 leave 80104214: c3 ret 80104215: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104220 <pinit>: void pinit(void) { 80104220: 55 push %ebp 80104221: 89 e5 mov %esp,%ebp 80104223: 83 ec 10 sub $0x10,%esp initlock(&ptable.lock, "ptable"); 80104226: 68 b5 80 10 80 push $0x801080b5 8010422b: 68 00 55 11 80 push $0x80115500 80104230: e8 cb 0a 00 00 call 80104d00 <initlock> } 80104235: 83 c4 10 add $0x10,%esp 80104238: c9 leave 80104239: c3 ret 8010423a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104240 <mycpu>: struct cpu*mycpu(void) { 80104240: 55 push %ebp 80104241: 89 e5 mov %esp,%ebp 80104243: 56 push %esi 80104244: 53 push %ebx asm volatile ("pushfl; popl %0" : "=r" (eflags)); 80104245: 9c pushf 80104246: 58 pop %eax if (readeflags() & FL_IF) { 80104247: f6 c4 02 test $0x2,%ah 8010424a: 75 5e jne 801042aa <mycpu+0x6a> apicid = lapicid(); 8010424c: e8 af ef ff ff call 80103200 <lapicid> for (i = 0; i < ncpu; ++i) { 80104251: 8b 35 e0 54 11 80 mov 0x801154e0,%esi 80104257: 85 f6 test %esi,%esi 80104259: 7e 42 jle 8010429d <mycpu+0x5d> if (cpus[i].apicid == apicid) { 8010425b: 0f b6 15 60 4f 11 80 movzbl 0x80114f60,%edx 80104262: 39 d0 cmp %edx,%eax 80104264: 74 30 je 80104296 <mycpu+0x56> 80104266: b9 10 50 11 80 mov $0x80115010,%ecx for (i = 0; i < ncpu; ++i) { 8010426b: 31 d2 xor %edx,%edx 8010426d: 8d 76 00 lea 0x0(%esi),%esi 80104270: 83 c2 01 add $0x1,%edx 80104273: 39 f2 cmp %esi,%edx 80104275: 74 26 je 8010429d <mycpu+0x5d> if (cpus[i].apicid == apicid) { 80104277: 0f b6 19 movzbl (%ecx),%ebx 8010427a: 81 c1 b0 00 00 00 add $0xb0,%ecx 80104280: 39 c3 cmp %eax,%ebx 80104282: 75 ec jne 80104270 <mycpu+0x30> 80104284: 69 c2 b0 00 00 00 imul $0xb0,%edx,%eax 8010428a: 05 60 4f 11 80 add $0x80114f60,%eax } 8010428f: 8d 65 f8 lea -0x8(%ebp),%esp 80104292: 5b pop %ebx 80104293: 5e pop %esi 80104294: 5d pop %ebp 80104295: c3 ret if (cpus[i].apicid == apicid) { 80104296: b8 60 4f 11 80 mov $0x80114f60,%eax return &cpus[i]; 8010429b: eb f2 jmp 8010428f <mycpu+0x4f> panic("unknown apicid\n"); 8010429d: 83 ec 0c sub $0xc,%esp 801042a0: 68 bc 80 10 80 push $0x801080bc 801042a5: e8 36 c2 ff ff call 801004e0 <panic> panic("mycpu called with interrupts enabled\n"); 801042aa: 83 ec 0c sub $0xc,%esp 801042ad: 68 98 81 10 80 push $0x80108198 801042b2: e8 29 c2 ff ff call 801004e0 <panic> 801042b7: 89 f6 mov %esi,%esi 801042b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801042c0 <cpuid>: int cpuid() { 801042c0: 55 push %ebp 801042c1: 89 e5 mov %esp,%ebp 801042c3: 83 ec 08 sub $0x8,%esp return mycpu() - cpus; 801042c6: e8 75 ff ff ff call 80104240 <mycpu> 801042cb: 2d 60 4f 11 80 sub $0x80114f60,%eax } 801042d0: c9 leave return mycpu() - cpus; 801042d1: c1 f8 04 sar $0x4,%eax 801042d4: 69 c0 a3 8b 2e ba imul $0xba2e8ba3,%eax,%eax } 801042da: c3 ret 801042db: 90 nop 801042dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801042e0 <myproc>: struct proc*myproc(void) { 801042e0: 55 push %ebp 801042e1: 89 e5 mov %esp,%ebp 801042e3: 53 push %ebx 801042e4: 83 ec 04 sub $0x4,%esp pushcli(); 801042e7: e8 84 0a 00 00 call 80104d70 <pushcli> c = mycpu(); 801042ec: e8 4f ff ff ff call 80104240 <mycpu> p = c->proc; 801042f1: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 801042f7: e8 b4 0a 00 00 call 80104db0 <popcli> } 801042fc: 83 c4 04 add $0x4,%esp 801042ff: 89 d8 mov %ebx,%eax 80104301: 5b pop %ebx 80104302: 5d pop %ebp 80104303: c3 ret 80104304: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010430a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104310 <userinit>: void userinit(void) { 80104310: 55 push %ebp 80104311: 89 e5 mov %esp,%ebp 80104313: 53 push %ebx 80104314: 83 ec 04 sub $0x4,%esp p = allocproc(); 80104317: e8 d4 fd ff ff call 801040f0 <allocproc> 8010431c: 89 c3 mov %eax,%ebx initproc = p; 8010431e: a3 b8 c5 10 80 mov %eax,0x8010c5b8 if ((p->pgdir = setupkvm()) == 0) { 80104323: e8 38 35 00 00 call 80107860 <setupkvm> 80104328: 85 c0 test %eax,%eax 8010432a: 89 43 04 mov %eax,0x4(%ebx) 8010432d: 0f 84 bd 00 00 00 je 801043f0 <userinit+0xe0> inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); 80104333: 83 ec 04 sub $0x4,%esp 80104336: 68 2c 00 00 00 push $0x2c 8010433b: 68 60 c4 10 80 push $0x8010c460 80104340: 50 push %eax 80104341: e8 fa 31 00 00 call 80107540 <inituvm> memset(p->tf, 0, sizeof(*p->tf)); 80104346: 83 c4 0c add $0xc,%esp p->sz = PGSIZE; 80104349: c7 03 00 10 00 00 movl $0x1000,(%ebx) memset(p->tf, 0, sizeof(*p->tf)); 8010434f: 6a 4c push $0x4c 80104351: 6a 00 push $0x0 80104353: ff 73 18 pushl 0x18(%ebx) 80104356: e8 f5 0b 00 00 call 80104f50 <memset> p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010435b: 8b 43 18 mov 0x18(%ebx),%eax 8010435e: ba 1b 00 00 00 mov $0x1b,%edx p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 80104363: b9 23 00 00 00 mov $0x23,%ecx safestrcpy(p->name, "initcode", sizeof(p->name)); 80104368: 83 c4 0c add $0xc,%esp p->tf->cs = (SEG_UCODE << 3) | DPL_USER; 8010436b: 66 89 50 3c mov %dx,0x3c(%eax) p->tf->ds = (SEG_UDATA << 3) | DPL_USER; 8010436f: 8b 43 18 mov 0x18(%ebx),%eax 80104372: 66 89 48 2c mov %cx,0x2c(%eax) p->tf->es = p->tf->ds; 80104376: 8b 43 18 mov 0x18(%ebx),%eax 80104379: 0f b7 50 2c movzwl 0x2c(%eax),%edx 8010437d: 66 89 50 28 mov %dx,0x28(%eax) p->tf->ss = p->tf->ds; 80104381: 8b 43 18 mov 0x18(%ebx),%eax 80104384: 0f b7 50 2c movzwl 0x2c(%eax),%edx 80104388: 66 89 50 48 mov %dx,0x48(%eax) p->tf->eflags = FL_IF; 8010438c: 8b 43 18 mov 0x18(%ebx),%eax 8010438f: c7 40 40 00 02 00 00 movl $0x200,0x40(%eax) p->tf->esp = PGSIZE; 80104396: 8b 43 18 mov 0x18(%ebx),%eax 80104399: c7 40 44 00 10 00 00 movl $0x1000,0x44(%eax) p->tf->eip = 0; // beginning of initcode.S 801043a0: 8b 43 18 mov 0x18(%ebx),%eax 801043a3: c7 40 38 00 00 00 00 movl $0x0,0x38(%eax) safestrcpy(p->name, "initcode", sizeof(p->name)); 801043aa: 8d 43 6c lea 0x6c(%ebx),%eax 801043ad: 6a 10 push $0x10 801043af: 68 e5 80 10 80 push $0x801080e5 801043b4: 50 push %eax 801043b5: e8 76 0d 00 00 call 80105130 <safestrcpy> p->cwd = namei("/"); 801043ba: c7 04 24 ee 80 10 80 movl $0x801080ee,(%esp) 801043c1: e8 ea e5 ff ff call 801029b0 <namei> 801043c6: 89 43 68 mov %eax,0x68(%ebx) acquire(&ptable.lock); 801043c9: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) 801043d0: e8 6b 0a 00 00 call 80104e40 <acquire> p->state = RUNNABLE; 801043d5: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) release(&ptable.lock); 801043dc: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) 801043e3: e8 18 0b 00 00 call 80104f00 <release> } 801043e8: 83 c4 10 add $0x10,%esp 801043eb: 8b 5d fc mov -0x4(%ebp),%ebx 801043ee: c9 leave 801043ef: c3 ret panic("userinit: out of memory?"); 801043f0: 83 ec 0c sub $0xc,%esp 801043f3: 68 cc 80 10 80 push $0x801080cc 801043f8: e8 e3 c0 ff ff call 801004e0 <panic> 801043fd: 8d 76 00 lea 0x0(%esi),%esi 80104400 <growproc>: int growproc(int n) { 80104400: 55 push %ebp 80104401: 89 e5 mov %esp,%ebp 80104403: 56 push %esi 80104404: 53 push %ebx 80104405: 8b 75 08 mov 0x8(%ebp),%esi pushcli(); 80104408: e8 63 09 00 00 call 80104d70 <pushcli> c = mycpu(); 8010440d: e8 2e fe ff ff call 80104240 <mycpu> p = c->proc; 80104412: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80104418: e8 93 09 00 00 call 80104db0 <popcli> if (n > 0) { 8010441d: 83 fe 00 cmp $0x0,%esi sz = curproc->sz; 80104420: 8b 03 mov (%ebx),%eax if (n > 0) { 80104422: 7f 1c jg 80104440 <growproc+0x40> else if (n < 0) { 80104424: 75 3a jne 80104460 <growproc+0x60> switchuvm(curproc); 80104426: 83 ec 0c sub $0xc,%esp curproc->sz = sz; 80104429: 89 03 mov %eax,(%ebx) switchuvm(curproc); 8010442b: 53 push %ebx 8010442c: e8 ff 2f 00 00 call 80107430 <switchuvm> return 0; 80104431: 83 c4 10 add $0x10,%esp 80104434: 31 c0 xor %eax,%eax } 80104436: 8d 65 f8 lea -0x8(%ebp),%esp 80104439: 5b pop %ebx 8010443a: 5e pop %esi 8010443b: 5d pop %ebp 8010443c: c3 ret 8010443d: 8d 76 00 lea 0x0(%esi),%esi if ((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0) { 80104440: 83 ec 04 sub $0x4,%esp 80104443: 01 c6 add %eax,%esi 80104445: 56 push %esi 80104446: 50 push %eax 80104447: ff 73 04 pushl 0x4(%ebx) 8010444a: e8 31 32 00 00 call 80107680 <allocuvm> 8010444f: 83 c4 10 add $0x10,%esp 80104452: 85 c0 test %eax,%eax 80104454: 75 d0 jne 80104426 <growproc+0x26> return -1; 80104456: b8 ff ff ff ff mov $0xffffffff,%eax 8010445b: eb d9 jmp 80104436 <growproc+0x36> 8010445d: 8d 76 00 lea 0x0(%esi),%esi if ((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0) { 80104460: 83 ec 04 sub $0x4,%esp 80104463: 01 c6 add %eax,%esi 80104465: 56 push %esi 80104466: 50 push %eax 80104467: ff 73 04 pushl 0x4(%ebx) 8010446a: e8 41 33 00 00 call 801077b0 <deallocuvm> 8010446f: 83 c4 10 add $0x10,%esp 80104472: 85 c0 test %eax,%eax 80104474: 75 b0 jne 80104426 <growproc+0x26> 80104476: eb de jmp 80104456 <growproc+0x56> 80104478: 90 nop 80104479: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104480 <fork>: int fork(void) { 80104480: 55 push %ebp 80104481: 89 e5 mov %esp,%ebp 80104483: 57 push %edi 80104484: 56 push %esi 80104485: 53 push %ebx 80104486: 83 ec 1c sub $0x1c,%esp pushcli(); 80104489: e8 e2 08 00 00 call 80104d70 <pushcli> c = mycpu(); 8010448e: e8 ad fd ff ff call 80104240 <mycpu> p = c->proc; 80104493: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80104499: e8 12 09 00 00 call 80104db0 <popcli> if ((np = allocproc()) == 0) { 8010449e: e8 4d fc ff ff call 801040f0 <allocproc> 801044a3: 85 c0 test %eax,%eax 801044a5: 89 45 e4 mov %eax,-0x1c(%ebp) 801044a8: 0f 84 b7 00 00 00 je 80104565 <fork+0xe5> if ((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0) { 801044ae: 83 ec 08 sub $0x8,%esp 801044b1: ff 33 pushl (%ebx) 801044b3: ff 73 04 pushl 0x4(%ebx) 801044b6: 89 c7 mov %eax,%edi 801044b8: e8 73 34 00 00 call 80107930 <copyuvm> 801044bd: 83 c4 10 add $0x10,%esp 801044c0: 85 c0 test %eax,%eax 801044c2: 89 47 04 mov %eax,0x4(%edi) 801044c5: 0f 84 a1 00 00 00 je 8010456c <fork+0xec> np->sz = curproc->sz; 801044cb: 8b 03 mov (%ebx),%eax 801044cd: 8b 4d e4 mov -0x1c(%ebp),%ecx 801044d0: 89 01 mov %eax,(%ecx) np->parent = curproc; 801044d2: 89 59 14 mov %ebx,0x14(%ecx) 801044d5: 89 c8 mov %ecx,%eax *np->tf = *curproc->tf; 801044d7: 8b 79 18 mov 0x18(%ecx),%edi 801044da: 8b 73 18 mov 0x18(%ebx),%esi 801044dd: b9 13 00 00 00 mov $0x13,%ecx 801044e2: f3 a5 rep movsl %ds:(%esi),%es:(%edi) for (i = 0; i < NOFILE; i++) { 801044e4: 31 f6 xor %esi,%esi np->tf->eax = 0; 801044e6: 8b 40 18 mov 0x18(%eax),%eax 801044e9: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) if (curproc->ofile[i]) { 801044f0: 8b 44 b3 28 mov 0x28(%ebx,%esi,4),%eax 801044f4: 85 c0 test %eax,%eax 801044f6: 74 13 je 8010450b <fork+0x8b> np->ofile[i] = filedup(curproc->ofile[i]); 801044f8: 83 ec 0c sub $0xc,%esp 801044fb: 50 push %eax 801044fc: e8 bf d3 ff ff call 801018c0 <filedup> 80104501: 8b 55 e4 mov -0x1c(%ebp),%edx 80104504: 83 c4 10 add $0x10,%esp 80104507: 89 44 b2 28 mov %eax,0x28(%edx,%esi,4) for (i = 0; i < NOFILE; i++) { 8010450b: 83 c6 01 add $0x1,%esi 8010450e: 83 fe 10 cmp $0x10,%esi 80104511: 75 dd jne 801044f0 <fork+0x70> np->cwd = idup(curproc->cwd); 80104513: 83 ec 0c sub $0xc,%esp 80104516: ff 73 68 pushl 0x68(%ebx) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80104519: 83 c3 6c add $0x6c,%ebx np->cwd = idup(curproc->cwd); 8010451c: e8 ff db ff ff call 80102120 <idup> 80104521: 8b 7d e4 mov -0x1c(%ebp),%edi safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 80104524: 83 c4 0c add $0xc,%esp np->cwd = idup(curproc->cwd); 80104527: 89 47 68 mov %eax,0x68(%edi) safestrcpy(np->name, curproc->name, sizeof(curproc->name)); 8010452a: 8d 47 6c lea 0x6c(%edi),%eax 8010452d: 6a 10 push $0x10 8010452f: 53 push %ebx 80104530: 50 push %eax 80104531: e8 fa 0b 00 00 call 80105130 <safestrcpy> pid = np->pid; 80104536: 8b 5f 10 mov 0x10(%edi),%ebx acquire(&ptable.lock); 80104539: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) 80104540: e8 fb 08 00 00 call 80104e40 <acquire> np->state = RUNNABLE; 80104545: c7 47 0c 03 00 00 00 movl $0x3,0xc(%edi) release(&ptable.lock); 8010454c: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) 80104553: e8 a8 09 00 00 call 80104f00 <release> return pid; 80104558: 83 c4 10 add $0x10,%esp } 8010455b: 8d 65 f4 lea -0xc(%ebp),%esp 8010455e: 89 d8 mov %ebx,%eax 80104560: 5b pop %ebx 80104561: 5e pop %esi 80104562: 5f pop %edi 80104563: 5d pop %ebp 80104564: c3 ret return -1; 80104565: bb ff ff ff ff mov $0xffffffff,%ebx 8010456a: eb ef jmp 8010455b <fork+0xdb> kfree(np->kstack); 8010456c: 8b 5d e4 mov -0x1c(%ebp),%ebx 8010456f: 83 ec 0c sub $0xc,%esp 80104572: ff 73 08 pushl 0x8(%ebx) 80104575: e8 66 e8 ff ff call 80102de0 <kfree> np->kstack = 0; 8010457a: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) np->state = UNUSED; 80104581: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) return -1; 80104588: 83 c4 10 add $0x10,%esp 8010458b: bb ff ff ff ff mov $0xffffffff,%ebx 80104590: eb c9 jmp 8010455b <fork+0xdb> 80104592: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104599: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801045a0 <scheduler>: void scheduler(void) { 801045a0: 55 push %ebp 801045a1: 89 e5 mov %esp,%ebp 801045a3: 57 push %edi 801045a4: 56 push %esi 801045a5: 53 push %ebx 801045a6: 83 ec 0c sub $0xc,%esp struct cpu *c = mycpu(); 801045a9: e8 92 fc ff ff call 80104240 <mycpu> 801045ae: 8d 78 04 lea 0x4(%eax),%edi 801045b1: 89 c6 mov %eax,%esi c->proc = 0; 801045b3: c7 80 ac 00 00 00 00 movl $0x0,0xac(%eax) 801045ba: 00 00 00 801045bd: 8d 76 00 lea 0x0(%esi),%esi asm volatile ("sti"); 801045c0: fb sti acquire(&ptable.lock); 801045c1: 83 ec 0c sub $0xc,%esp for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 801045c4: bb 34 55 11 80 mov $0x80115534,%ebx acquire(&ptable.lock); 801045c9: 68 00 55 11 80 push $0x80115500 801045ce: e8 6d 08 00 00 call 80104e40 <acquire> 801045d3: 83 c4 10 add $0x10,%esp 801045d6: 8d 76 00 lea 0x0(%esi),%esi 801045d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi if (p->state != RUNNABLE) { 801045e0: 83 7b 0c 03 cmpl $0x3,0xc(%ebx) 801045e4: 75 33 jne 80104619 <scheduler+0x79> switchuvm(p); 801045e6: 83 ec 0c sub $0xc,%esp c->proc = p; 801045e9: 89 9e ac 00 00 00 mov %ebx,0xac(%esi) switchuvm(p); 801045ef: 53 push %ebx 801045f0: e8 3b 2e 00 00 call 80107430 <switchuvm> swtch(&(c->scheduler), p->context); 801045f5: 58 pop %eax 801045f6: 5a pop %edx 801045f7: ff 73 1c pushl 0x1c(%ebx) 801045fa: 57 push %edi p->state = RUNNING; 801045fb: c7 43 0c 04 00 00 00 movl $0x4,0xc(%ebx) swtch(&(c->scheduler), p->context); 80104602: e8 84 0b 00 00 call 8010518b <swtch> switchkvm(); 80104607: e8 04 2e 00 00 call 80107410 <switchkvm> c->proc = 0; 8010460c: c7 86 ac 00 00 00 00 movl $0x0,0xac(%esi) 80104613: 00 00 00 80104616: 83 c4 10 add $0x10,%esp for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 80104619: 83 c3 7c add $0x7c,%ebx 8010461c: 81 fb 34 74 11 80 cmp $0x80117434,%ebx 80104622: 72 bc jb 801045e0 <scheduler+0x40> release(&ptable.lock); 80104624: 83 ec 0c sub $0xc,%esp 80104627: 68 00 55 11 80 push $0x80115500 8010462c: e8 cf 08 00 00 call 80104f00 <release> sti(); 80104631: 83 c4 10 add $0x10,%esp 80104634: eb 8a jmp 801045c0 <scheduler+0x20> 80104636: 8d 76 00 lea 0x0(%esi),%esi 80104639: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104640 <sched>: void sched(void) { 80104640: 55 push %ebp 80104641: 89 e5 mov %esp,%ebp 80104643: 56 push %esi 80104644: 53 push %ebx pushcli(); 80104645: e8 26 07 00 00 call 80104d70 <pushcli> c = mycpu(); 8010464a: e8 f1 fb ff ff call 80104240 <mycpu> p = c->proc; 8010464f: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80104655: e8 56 07 00 00 call 80104db0 <popcli> if (!holding(&ptable.lock)) { 8010465a: 83 ec 0c sub $0xc,%esp 8010465d: 68 00 55 11 80 push $0x80115500 80104662: e8 a9 07 00 00 call 80104e10 <holding> 80104667: 83 c4 10 add $0x10,%esp 8010466a: 85 c0 test %eax,%eax 8010466c: 74 4f je 801046bd <sched+0x7d> if (mycpu()->ncli != 1) { 8010466e: e8 cd fb ff ff call 80104240 <mycpu> 80104673: 83 b8 a4 00 00 00 01 cmpl $0x1,0xa4(%eax) 8010467a: 75 68 jne 801046e4 <sched+0xa4> if (p->state == RUNNING) { 8010467c: 83 7b 0c 04 cmpl $0x4,0xc(%ebx) 80104680: 74 55 je 801046d7 <sched+0x97> asm volatile ("pushfl; popl %0" : "=r" (eflags)); 80104682: 9c pushf 80104683: 58 pop %eax if (readeflags() & FL_IF) { 80104684: f6 c4 02 test $0x2,%ah 80104687: 75 41 jne 801046ca <sched+0x8a> intena = mycpu()->intena; 80104689: e8 b2 fb ff ff call 80104240 <mycpu> swtch(&p->context, mycpu()->scheduler); 8010468e: 83 c3 1c add $0x1c,%ebx intena = mycpu()->intena; 80104691: 8b b0 a8 00 00 00 mov 0xa8(%eax),%esi swtch(&p->context, mycpu()->scheduler); 80104697: e8 a4 fb ff ff call 80104240 <mycpu> 8010469c: 83 ec 08 sub $0x8,%esp 8010469f: ff 70 04 pushl 0x4(%eax) 801046a2: 53 push %ebx 801046a3: e8 e3 0a 00 00 call 8010518b <swtch> mycpu()->intena = intena; 801046a8: e8 93 fb ff ff call 80104240 <mycpu> } 801046ad: 83 c4 10 add $0x10,%esp mycpu()->intena = intena; 801046b0: 89 b0 a8 00 00 00 mov %esi,0xa8(%eax) } 801046b6: 8d 65 f8 lea -0x8(%ebp),%esp 801046b9: 5b pop %ebx 801046ba: 5e pop %esi 801046bb: 5d pop %ebp 801046bc: c3 ret panic("sched ptable.lock"); 801046bd: 83 ec 0c sub $0xc,%esp 801046c0: 68 f0 80 10 80 push $0x801080f0 801046c5: e8 16 be ff ff call 801004e0 <panic> panic("sched interruptible"); 801046ca: 83 ec 0c sub $0xc,%esp 801046cd: 68 1c 81 10 80 push $0x8010811c 801046d2: e8 09 be ff ff call 801004e0 <panic> panic("sched running"); 801046d7: 83 ec 0c sub $0xc,%esp 801046da: 68 0e 81 10 80 push $0x8010810e 801046df: e8 fc bd ff ff call 801004e0 <panic> panic("sched locks"); 801046e4: 83 ec 0c sub $0xc,%esp 801046e7: 68 02 81 10 80 push $0x80108102 801046ec: e8 ef bd ff ff call 801004e0 <panic> 801046f1: eb 0d jmp 80104700 <exit> 801046f3: 90 nop 801046f4: 90 nop 801046f5: 90 nop 801046f6: 90 nop 801046f7: 90 nop 801046f8: 90 nop 801046f9: 90 nop 801046fa: 90 nop 801046fb: 90 nop 801046fc: 90 nop 801046fd: 90 nop 801046fe: 90 nop 801046ff: 90 nop 80104700 <exit>: void exit(void) { 80104700: 55 push %ebp 80104701: 89 e5 mov %esp,%ebp 80104703: 57 push %edi 80104704: 56 push %esi 80104705: 53 push %ebx 80104706: 83 ec 0c sub $0xc,%esp pushcli(); 80104709: e8 62 06 00 00 call 80104d70 <pushcli> c = mycpu(); 8010470e: e8 2d fb ff ff call 80104240 <mycpu> p = c->proc; 80104713: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104719: e8 92 06 00 00 call 80104db0 <popcli> if (curproc == initproc) { 8010471e: 39 35 b8 c5 10 80 cmp %esi,0x8010c5b8 80104724: 8d 5e 28 lea 0x28(%esi),%ebx 80104727: 8d 7e 68 lea 0x68(%esi),%edi 8010472a: 0f 84 e7 00 00 00 je 80104817 <exit+0x117> if (curproc->ofile[fd]) { 80104730: 8b 03 mov (%ebx),%eax 80104732: 85 c0 test %eax,%eax 80104734: 74 12 je 80104748 <exit+0x48> fileclose(curproc->ofile[fd]); 80104736: 83 ec 0c sub $0xc,%esp 80104739: 50 push %eax 8010473a: e8 d1 d1 ff ff call 80101910 <fileclose> curproc->ofile[fd] = 0; 8010473f: c7 03 00 00 00 00 movl $0x0,(%ebx) 80104745: 83 c4 10 add $0x10,%esp 80104748: 83 c3 04 add $0x4,%ebx for (fd = 0; fd < NOFILE; fd++) { 8010474b: 39 fb cmp %edi,%ebx 8010474d: 75 e1 jne 80104730 <exit+0x30> begin_op(); 8010474f: e8 1c ef ff ff call 80103670 <begin_op> iput(curproc->cwd); 80104754: 83 ec 0c sub $0xc,%esp 80104757: ff 76 68 pushl 0x68(%esi) 8010475a: e8 21 db ff ff call 80102280 <iput> end_op(); 8010475f: e8 7c ef ff ff call 801036e0 <end_op> curproc->cwd = 0; 80104764: c7 46 68 00 00 00 00 movl $0x0,0x68(%esi) acquire(&ptable.lock); 8010476b: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) 80104772: e8 c9 06 00 00 call 80104e40 <acquire> wakeup1(curproc->parent); 80104777: 8b 56 14 mov 0x14(%esi),%edx 8010477a: 83 c4 10 add $0x10,%esp // Wake up all processes sleeping on chan. // The ptable lock must be held. static void wakeup1(void *chan) { struct proc *p; for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 8010477d: b8 34 55 11 80 mov $0x80115534,%eax 80104782: eb 0e jmp 80104792 <exit+0x92> 80104784: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104788: 83 c0 7c add $0x7c,%eax 8010478b: 3d 34 74 11 80 cmp $0x80117434,%eax 80104790: 73 1c jae 801047ae <exit+0xae> if (p->state == SLEEPING && p->chan == chan) { 80104792: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80104796: 75 f0 jne 80104788 <exit+0x88> 80104798: 3b 50 20 cmp 0x20(%eax),%edx 8010479b: 75 eb jne 80104788 <exit+0x88> p->state = RUNNABLE; 8010479d: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 801047a4: 83 c0 7c add $0x7c,%eax 801047a7: 3d 34 74 11 80 cmp $0x80117434,%eax 801047ac: 72 e4 jb 80104792 <exit+0x92> p->parent = initproc; 801047ae: 8b 0d b8 c5 10 80 mov 0x8010c5b8,%ecx for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 801047b4: ba 34 55 11 80 mov $0x80115534,%edx 801047b9: eb 10 jmp 801047cb <exit+0xcb> 801047bb: 90 nop 801047bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801047c0: 83 c2 7c add $0x7c,%edx 801047c3: 81 fa 34 74 11 80 cmp $0x80117434,%edx 801047c9: 73 33 jae 801047fe <exit+0xfe> if (p->parent == curproc) { 801047cb: 39 72 14 cmp %esi,0x14(%edx) 801047ce: 75 f0 jne 801047c0 <exit+0xc0> if (p->state == ZOMBIE) { 801047d0: 83 7a 0c 05 cmpl $0x5,0xc(%edx) p->parent = initproc; 801047d4: 89 4a 14 mov %ecx,0x14(%edx) if (p->state == ZOMBIE) { 801047d7: 75 e7 jne 801047c0 <exit+0xc0> for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 801047d9: b8 34 55 11 80 mov $0x80115534,%eax 801047de: eb 0a jmp 801047ea <exit+0xea> 801047e0: 83 c0 7c add $0x7c,%eax 801047e3: 3d 34 74 11 80 cmp $0x80117434,%eax 801047e8: 73 d6 jae 801047c0 <exit+0xc0> if (p->state == SLEEPING && p->chan == chan) { 801047ea: 83 78 0c 02 cmpl $0x2,0xc(%eax) 801047ee: 75 f0 jne 801047e0 <exit+0xe0> 801047f0: 3b 48 20 cmp 0x20(%eax),%ecx 801047f3: 75 eb jne 801047e0 <exit+0xe0> p->state = RUNNABLE; 801047f5: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) 801047fc: eb e2 jmp 801047e0 <exit+0xe0> curproc->state = ZOMBIE; 801047fe: c7 46 0c 05 00 00 00 movl $0x5,0xc(%esi) sched(); 80104805: e8 36 fe ff ff call 80104640 <sched> panic("zombie exit"); 8010480a: 83 ec 0c sub $0xc,%esp 8010480d: 68 3d 81 10 80 push $0x8010813d 80104812: e8 c9 bc ff ff call 801004e0 <panic> panic("init exiting"); 80104817: 83 ec 0c sub $0xc,%esp 8010481a: 68 30 81 10 80 push $0x80108130 8010481f: e8 bc bc ff ff call 801004e0 <panic> 80104824: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010482a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80104830 <yield>: void yield(void) { 80104830: 55 push %ebp 80104831: 89 e5 mov %esp,%ebp 80104833: 53 push %ebx 80104834: 83 ec 10 sub $0x10,%esp acquire(&ptable.lock); //DOC: yieldlock 80104837: 68 00 55 11 80 push $0x80115500 8010483c: e8 ff 05 00 00 call 80104e40 <acquire> pushcli(); 80104841: e8 2a 05 00 00 call 80104d70 <pushcli> c = mycpu(); 80104846: e8 f5 f9 ff ff call 80104240 <mycpu> p = c->proc; 8010484b: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 80104851: e8 5a 05 00 00 call 80104db0 <popcli> myproc()->state = RUNNABLE; 80104856: c7 43 0c 03 00 00 00 movl $0x3,0xc(%ebx) sched(); 8010485d: e8 de fd ff ff call 80104640 <sched> release(&ptable.lock); 80104862: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) 80104869: e8 92 06 00 00 call 80104f00 <release> } 8010486e: 83 c4 10 add $0x10,%esp 80104871: 8b 5d fc mov -0x4(%ebp),%ebx 80104874: c9 leave 80104875: c3 ret 80104876: 8d 76 00 lea 0x0(%esi),%esi 80104879: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104880 <sleep>: void sleep(void *chan, struct spinlock *lk) { 80104880: 55 push %ebp 80104881: 89 e5 mov %esp,%ebp 80104883: 57 push %edi 80104884: 56 push %esi 80104885: 53 push %ebx 80104886: 83 ec 0c sub $0xc,%esp 80104889: 8b 7d 08 mov 0x8(%ebp),%edi 8010488c: 8b 75 0c mov 0xc(%ebp),%esi pushcli(); 8010488f: e8 dc 04 00 00 call 80104d70 <pushcli> c = mycpu(); 80104894: e8 a7 f9 ff ff call 80104240 <mycpu> p = c->proc; 80104899: 8b 98 ac 00 00 00 mov 0xac(%eax),%ebx popcli(); 8010489f: e8 0c 05 00 00 call 80104db0 <popcli> if (p == 0) { 801048a4: 85 db test %ebx,%ebx 801048a6: 0f 84 87 00 00 00 je 80104933 <sleep+0xb3> if (lk == 0) { 801048ac: 85 f6 test %esi,%esi 801048ae: 74 76 je 80104926 <sleep+0xa6> if (lk != &ptable.lock) { //DOC: sleeplock0 801048b0: 81 fe 00 55 11 80 cmp $0x80115500,%esi 801048b6: 74 50 je 80104908 <sleep+0x88> acquire(&ptable.lock); //DOC: sleeplock1 801048b8: 83 ec 0c sub $0xc,%esp 801048bb: 68 00 55 11 80 push $0x80115500 801048c0: e8 7b 05 00 00 call 80104e40 <acquire> release(lk); 801048c5: 89 34 24 mov %esi,(%esp) 801048c8: e8 33 06 00 00 call 80104f00 <release> p->chan = chan; 801048cd: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 801048d0: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 801048d7: e8 64 fd ff ff call 80104640 <sched> p->chan = 0; 801048dc: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) release(&ptable.lock); 801048e3: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) 801048ea: e8 11 06 00 00 call 80104f00 <release> acquire(lk); 801048ef: 89 75 08 mov %esi,0x8(%ebp) 801048f2: 83 c4 10 add $0x10,%esp } 801048f5: 8d 65 f4 lea -0xc(%ebp),%esp 801048f8: 5b pop %ebx 801048f9: 5e pop %esi 801048fa: 5f pop %edi 801048fb: 5d pop %ebp acquire(lk); 801048fc: e9 3f 05 00 00 jmp 80104e40 <acquire> 80104901: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi p->chan = chan; 80104908: 89 7b 20 mov %edi,0x20(%ebx) p->state = SLEEPING; 8010490b: c7 43 0c 02 00 00 00 movl $0x2,0xc(%ebx) sched(); 80104912: e8 29 fd ff ff call 80104640 <sched> p->chan = 0; 80104917: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) } 8010491e: 8d 65 f4 lea -0xc(%ebp),%esp 80104921: 5b pop %ebx 80104922: 5e pop %esi 80104923: 5f pop %edi 80104924: 5d pop %ebp 80104925: c3 ret panic("sleep without lk"); 80104926: 83 ec 0c sub $0xc,%esp 80104929: 68 4f 81 10 80 push $0x8010814f 8010492e: e8 ad bb ff ff call 801004e0 <panic> panic("sleep"); 80104933: 83 ec 0c sub $0xc,%esp 80104936: 68 49 81 10 80 push $0x80108149 8010493b: e8 a0 bb ff ff call 801004e0 <panic> 80104940 <wait>: int wait(void) { 80104940: 55 push %ebp 80104941: 89 e5 mov %esp,%ebp 80104943: 56 push %esi 80104944: 53 push %ebx pushcli(); 80104945: e8 26 04 00 00 call 80104d70 <pushcli> c = mycpu(); 8010494a: e8 f1 f8 ff ff call 80104240 <mycpu> p = c->proc; 8010494f: 8b b0 ac 00 00 00 mov 0xac(%eax),%esi popcli(); 80104955: e8 56 04 00 00 call 80104db0 <popcli> acquire(&ptable.lock); 8010495a: 83 ec 0c sub $0xc,%esp 8010495d: 68 00 55 11 80 push $0x80115500 80104962: e8 d9 04 00 00 call 80104e40 <acquire> 80104967: 83 c4 10 add $0x10,%esp havekids = 0; 8010496a: 31 c0 xor %eax,%eax for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 8010496c: bb 34 55 11 80 mov $0x80115534,%ebx 80104971: eb 10 jmp 80104983 <wait+0x43> 80104973: 90 nop 80104974: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104978: 83 c3 7c add $0x7c,%ebx 8010497b: 81 fb 34 74 11 80 cmp $0x80117434,%ebx 80104981: 73 1b jae 8010499e <wait+0x5e> if (p->parent != curproc) { 80104983: 39 73 14 cmp %esi,0x14(%ebx) 80104986: 75 f0 jne 80104978 <wait+0x38> if (p->state == ZOMBIE) { 80104988: 83 7b 0c 05 cmpl $0x5,0xc(%ebx) 8010498c: 74 32 je 801049c0 <wait+0x80> for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 8010498e: 83 c3 7c add $0x7c,%ebx havekids = 1; 80104991: b8 01 00 00 00 mov $0x1,%eax for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 80104996: 81 fb 34 74 11 80 cmp $0x80117434,%ebx 8010499c: 72 e5 jb 80104983 <wait+0x43> if (!havekids || curproc->killed) { 8010499e: 85 c0 test %eax,%eax 801049a0: 74 74 je 80104a16 <wait+0xd6> 801049a2: 8b 46 24 mov 0x24(%esi),%eax 801049a5: 85 c0 test %eax,%eax 801049a7: 75 6d jne 80104a16 <wait+0xd6> sleep(curproc, &ptable.lock); //DOC: wait-sleep 801049a9: 83 ec 08 sub $0x8,%esp 801049ac: 68 00 55 11 80 push $0x80115500 801049b1: 56 push %esi 801049b2: e8 c9 fe ff ff call 80104880 <sleep> havekids = 0; 801049b7: 83 c4 10 add $0x10,%esp 801049ba: eb ae jmp 8010496a <wait+0x2a> 801049bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(p->kstack); 801049c0: 83 ec 0c sub $0xc,%esp 801049c3: ff 73 08 pushl 0x8(%ebx) pid = p->pid; 801049c6: 8b 73 10 mov 0x10(%ebx),%esi kfree(p->kstack); 801049c9: e8 12 e4 ff ff call 80102de0 <kfree> freevm(p->pgdir); 801049ce: 5a pop %edx 801049cf: ff 73 04 pushl 0x4(%ebx) p->kstack = 0; 801049d2: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) freevm(p->pgdir); 801049d9: e8 02 2e 00 00 call 801077e0 <freevm> release(&ptable.lock); 801049de: c7 04 24 00 55 11 80 movl $0x80115500,(%esp) p->pid = 0; 801049e5: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) p->parent = 0; 801049ec: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) p->name[0] = 0; 801049f3: c6 43 6c 00 movb $0x0,0x6c(%ebx) p->killed = 0; 801049f7: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) p->state = UNUSED; 801049fe: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) release(&ptable.lock); 80104a05: e8 f6 04 00 00 call 80104f00 <release> return pid; 80104a0a: 83 c4 10 add $0x10,%esp } 80104a0d: 8d 65 f8 lea -0x8(%ebp),%esp 80104a10: 89 f0 mov %esi,%eax 80104a12: 5b pop %ebx 80104a13: 5e pop %esi 80104a14: 5d pop %ebp 80104a15: c3 ret release(&ptable.lock); 80104a16: 83 ec 0c sub $0xc,%esp return -1; 80104a19: be ff ff ff ff mov $0xffffffff,%esi release(&ptable.lock); 80104a1e: 68 00 55 11 80 push $0x80115500 80104a23: e8 d8 04 00 00 call 80104f00 <release> return -1; 80104a28: 83 c4 10 add $0x10,%esp 80104a2b: eb e0 jmp 80104a0d <wait+0xcd> 80104a2d: 8d 76 00 lea 0x0(%esi),%esi 80104a30 <wakeup>: } } } // Wake up all processes sleeping on chan. void wakeup(void *chan) { 80104a30: 55 push %ebp 80104a31: 89 e5 mov %esp,%ebp 80104a33: 53 push %ebx 80104a34: 83 ec 10 sub $0x10,%esp 80104a37: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&ptable.lock); 80104a3a: 68 00 55 11 80 push $0x80115500 80104a3f: e8 fc 03 00 00 call 80104e40 <acquire> 80104a44: 83 c4 10 add $0x10,%esp for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 80104a47: b8 34 55 11 80 mov $0x80115534,%eax 80104a4c: eb 0c jmp 80104a5a <wakeup+0x2a> 80104a4e: 66 90 xchg %ax,%ax 80104a50: 83 c0 7c add $0x7c,%eax 80104a53: 3d 34 74 11 80 cmp $0x80117434,%eax 80104a58: 73 1c jae 80104a76 <wakeup+0x46> if (p->state == SLEEPING && p->chan == chan) { 80104a5a: 83 78 0c 02 cmpl $0x2,0xc(%eax) 80104a5e: 75 f0 jne 80104a50 <wakeup+0x20> 80104a60: 3b 58 20 cmp 0x20(%eax),%ebx 80104a63: 75 eb jne 80104a50 <wakeup+0x20> p->state = RUNNABLE; 80104a65: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 80104a6c: 83 c0 7c add $0x7c,%eax 80104a6f: 3d 34 74 11 80 cmp $0x80117434,%eax 80104a74: 72 e4 jb 80104a5a <wakeup+0x2a> wakeup1(chan); release(&ptable.lock); 80104a76: c7 45 08 00 55 11 80 movl $0x80115500,0x8(%ebp) } 80104a7d: 8b 5d fc mov -0x4(%ebp),%ebx 80104a80: c9 leave release(&ptable.lock); 80104a81: e9 7a 04 00 00 jmp 80104f00 <release> 80104a86: 8d 76 00 lea 0x0(%esi),%esi 80104a89: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104a90 <kill>: // Kill the process with the given pid. // Process won't exit until it returns // to user space (see trap in trap.c). int kill(int pid) { 80104a90: 55 push %ebp 80104a91: 89 e5 mov %esp,%ebp 80104a93: 53 push %ebx 80104a94: 83 ec 10 sub $0x10,%esp 80104a97: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *p; acquire(&ptable.lock); 80104a9a: 68 00 55 11 80 push $0x80115500 80104a9f: e8 9c 03 00 00 call 80104e40 <acquire> 80104aa4: 83 c4 10 add $0x10,%esp for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 80104aa7: b8 34 55 11 80 mov $0x80115534,%eax 80104aac: eb 0c jmp 80104aba <kill+0x2a> 80104aae: 66 90 xchg %ax,%ax 80104ab0: 83 c0 7c add $0x7c,%eax 80104ab3: 3d 34 74 11 80 cmp $0x80117434,%eax 80104ab8: 73 36 jae 80104af0 <kill+0x60> if (p->pid == pid) { 80104aba: 39 58 10 cmp %ebx,0x10(%eax) 80104abd: 75 f1 jne 80104ab0 <kill+0x20> p->killed = 1; // Wake process from sleep if necessary. if (p->state == SLEEPING) { 80104abf: 83 78 0c 02 cmpl $0x2,0xc(%eax) p->killed = 1; 80104ac3: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) if (p->state == SLEEPING) { 80104aca: 75 07 jne 80104ad3 <kill+0x43> p->state = RUNNABLE; 80104acc: c7 40 0c 03 00 00 00 movl $0x3,0xc(%eax) } release(&ptable.lock); 80104ad3: 83 ec 0c sub $0xc,%esp 80104ad6: 68 00 55 11 80 push $0x80115500 80104adb: e8 20 04 00 00 call 80104f00 <release> return 0; 80104ae0: 83 c4 10 add $0x10,%esp 80104ae3: 31 c0 xor %eax,%eax } } release(&ptable.lock); return -1; } 80104ae5: 8b 5d fc mov -0x4(%ebp),%ebx 80104ae8: c9 leave 80104ae9: c3 ret 80104aea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi release(&ptable.lock); 80104af0: 83 ec 0c sub $0xc,%esp 80104af3: 68 00 55 11 80 push $0x80115500 80104af8: e8 03 04 00 00 call 80104f00 <release> return -1; 80104afd: 83 c4 10 add $0x10,%esp 80104b00: b8 ff ff ff ff mov $0xffffffff,%eax } 80104b05: 8b 5d fc mov -0x4(%ebp),%ebx 80104b08: c9 leave 80104b09: c3 ret 80104b0a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104b10 <procdump>: // Print a process listing to console. For debugging. // Runs when user types ^P on console. // No lock to avoid wedging a stuck machine further. void procdump(void) { 80104b10: 55 push %ebp 80104b11: 89 e5 mov %esp,%ebp 80104b13: 57 push %edi 80104b14: 56 push %esi 80104b15: 53 push %ebx 80104b16: 8d 75 e8 lea -0x18(%ebp),%esi int i; struct proc *p; char *state; uint pc[10]; for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 80104b19: bb 34 55 11 80 mov $0x80115534,%ebx void procdump(void) { 80104b1e: 83 ec 3c sub $0x3c,%esp 80104b21: eb 24 jmp 80104b47 <procdump+0x37> 80104b23: 90 nop 80104b24: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi getcallerpcs((uint*)p->context->ebp + 2, pc); for (i = 0; i < 10 && pc[i] != 0; i++) { cprintf(" %p", pc[i]); } } cprintf("\n"); 80104b28: 83 ec 0c sub $0xc,%esp 80104b2b: 68 47 85 10 80 push $0x80108547 80104b30: e8 2b bd ff ff call 80100860 <cprintf> 80104b35: 83 c4 10 add $0x10,%esp for (p = ptable.proc; p < &ptable.proc[NPROC]; p++) { 80104b38: 83 c3 7c add $0x7c,%ebx 80104b3b: 81 fb 34 74 11 80 cmp $0x80117434,%ebx 80104b41: 0f 83 81 00 00 00 jae 80104bc8 <procdump+0xb8> if (p->state == UNUSED) { 80104b47: 8b 43 0c mov 0xc(%ebx),%eax 80104b4a: 85 c0 test %eax,%eax 80104b4c: 74 ea je 80104b38 <procdump+0x28> if (p->state >= 0 && p->state < NELEM(states) && states[p->state]) { 80104b4e: 83 f8 05 cmp $0x5,%eax state = "???"; 80104b51: ba 60 81 10 80 mov $0x80108160,%edx if (p->state >= 0 && p->state < NELEM(states) && states[p->state]) { 80104b56: 77 11 ja 80104b69 <procdump+0x59> 80104b58: 8b 14 85 c0 81 10 80 mov -0x7fef7e40(,%eax,4),%edx state = "???"; 80104b5f: b8 60 81 10 80 mov $0x80108160,%eax 80104b64: 85 d2 test %edx,%edx 80104b66: 0f 44 d0 cmove %eax,%edx cprintf("%d %s %s", p->pid, state, p->name); 80104b69: 8d 43 6c lea 0x6c(%ebx),%eax 80104b6c: 50 push %eax 80104b6d: 52 push %edx 80104b6e: ff 73 10 pushl 0x10(%ebx) 80104b71: 68 64 81 10 80 push $0x80108164 80104b76: e8 e5 bc ff ff call 80100860 <cprintf> if (p->state == SLEEPING) { 80104b7b: 83 c4 10 add $0x10,%esp 80104b7e: 83 7b 0c 02 cmpl $0x2,0xc(%ebx) 80104b82: 75 a4 jne 80104b28 <procdump+0x18> getcallerpcs((uint*)p->context->ebp + 2, pc); 80104b84: 8d 45 c0 lea -0x40(%ebp),%eax 80104b87: 83 ec 08 sub $0x8,%esp 80104b8a: 8d 7d c0 lea -0x40(%ebp),%edi 80104b8d: 50 push %eax 80104b8e: 8b 43 1c mov 0x1c(%ebx),%eax 80104b91: 8b 40 0c mov 0xc(%eax),%eax 80104b94: 83 c0 08 add $0x8,%eax 80104b97: 50 push %eax 80104b98: e8 83 01 00 00 call 80104d20 <getcallerpcs> 80104b9d: 83 c4 10 add $0x10,%esp for (i = 0; i < 10 && pc[i] != 0; i++) { 80104ba0: 8b 17 mov (%edi),%edx 80104ba2: 85 d2 test %edx,%edx 80104ba4: 74 82 je 80104b28 <procdump+0x18> cprintf(" %p", pc[i]); 80104ba6: 83 ec 08 sub $0x8,%esp 80104ba9: 83 c7 04 add $0x4,%edi 80104bac: 52 push %edx 80104bad: 68 61 7b 10 80 push $0x80107b61 80104bb2: e8 a9 bc ff ff call 80100860 <cprintf> for (i = 0; i < 10 && pc[i] != 0; i++) { 80104bb7: 83 c4 10 add $0x10,%esp 80104bba: 39 fe cmp %edi,%esi 80104bbc: 75 e2 jne 80104ba0 <procdump+0x90> 80104bbe: e9 65 ff ff ff jmp 80104b28 <procdump+0x18> 80104bc3: 90 nop 80104bc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } 80104bc8: 8d 65 f4 lea -0xc(%ebp),%esp 80104bcb: 5b pop %ebx 80104bcc: 5e pop %esi 80104bcd: 5f pop %edi 80104bce: 5d pop %ebp 80104bcf: c3 ret 80104bd0 <initsleeplock>: #include "mmu.h" #include "proc.h" #include "spinlock.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 80104bd0: 55 push %ebp 80104bd1: 89 e5 mov %esp,%ebp 80104bd3: 53 push %ebx 80104bd4: 83 ec 0c sub $0xc,%esp 80104bd7: 8b 5d 08 mov 0x8(%ebp),%ebx initlock(&lk->lk, "sleep lock"); 80104bda: 68 d8 81 10 80 push $0x801081d8 80104bdf: 8d 43 04 lea 0x4(%ebx),%eax 80104be2: 50 push %eax 80104be3: e8 18 01 00 00 call 80104d00 <initlock> lk->name = name; 80104be8: 8b 45 0c mov 0xc(%ebp),%eax lk->locked = 0; 80104beb: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; } 80104bf1: 83 c4 10 add $0x10,%esp lk->pid = 0; 80104bf4: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) lk->name = name; 80104bfb: 89 43 38 mov %eax,0x38(%ebx) } 80104bfe: 8b 5d fc mov -0x4(%ebp),%ebx 80104c01: c9 leave 80104c02: c3 ret 80104c03: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104c09: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c10 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 80104c10: 55 push %ebp 80104c11: 89 e5 mov %esp,%ebp 80104c13: 56 push %esi 80104c14: 53 push %ebx 80104c15: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104c18: 83 ec 0c sub $0xc,%esp 80104c1b: 8d 73 04 lea 0x4(%ebx),%esi 80104c1e: 56 push %esi 80104c1f: e8 1c 02 00 00 call 80104e40 <acquire> while (lk->locked) { 80104c24: 8b 13 mov (%ebx),%edx 80104c26: 83 c4 10 add $0x10,%esp 80104c29: 85 d2 test %edx,%edx 80104c2b: 74 16 je 80104c43 <acquiresleep+0x33> 80104c2d: 8d 76 00 lea 0x0(%esi),%esi sleep(lk, &lk->lk); 80104c30: 83 ec 08 sub $0x8,%esp 80104c33: 56 push %esi 80104c34: 53 push %ebx 80104c35: e8 46 fc ff ff call 80104880 <sleep> while (lk->locked) { 80104c3a: 8b 03 mov (%ebx),%eax 80104c3c: 83 c4 10 add $0x10,%esp 80104c3f: 85 c0 test %eax,%eax 80104c41: 75 ed jne 80104c30 <acquiresleep+0x20> } lk->locked = 1; 80104c43: c7 03 01 00 00 00 movl $0x1,(%ebx) lk->pid = myproc()->pid; 80104c49: e8 92 f6 ff ff call 801042e0 <myproc> 80104c4e: 8b 40 10 mov 0x10(%eax),%eax 80104c51: 89 43 3c mov %eax,0x3c(%ebx) release(&lk->lk); 80104c54: 89 75 08 mov %esi,0x8(%ebp) } 80104c57: 8d 65 f8 lea -0x8(%ebp),%esp 80104c5a: 5b pop %ebx 80104c5b: 5e pop %esi 80104c5c: 5d pop %ebp release(&lk->lk); 80104c5d: e9 9e 02 00 00 jmp 80104f00 <release> 80104c62: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104c69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80104c70 <releasesleep>: void releasesleep(struct sleeplock *lk) { 80104c70: 55 push %ebp 80104c71: 89 e5 mov %esp,%ebp 80104c73: 56 push %esi 80104c74: 53 push %ebx 80104c75: 8b 5d 08 mov 0x8(%ebp),%ebx acquire(&lk->lk); 80104c78: 83 ec 0c sub $0xc,%esp 80104c7b: 8d 73 04 lea 0x4(%ebx),%esi 80104c7e: 56 push %esi 80104c7f: e8 bc 01 00 00 call 80104e40 <acquire> lk->locked = 0; 80104c84: c7 03 00 00 00 00 movl $0x0,(%ebx) lk->pid = 0; 80104c8a: c7 43 3c 00 00 00 00 movl $0x0,0x3c(%ebx) wakeup(lk); 80104c91: 89 1c 24 mov %ebx,(%esp) 80104c94: e8 97 fd ff ff call 80104a30 <wakeup> release(&lk->lk); 80104c99: 89 75 08 mov %esi,0x8(%ebp) 80104c9c: 83 c4 10 add $0x10,%esp } 80104c9f: 8d 65 f8 lea -0x8(%ebp),%esp 80104ca2: 5b pop %ebx 80104ca3: 5e pop %esi 80104ca4: 5d pop %ebp release(&lk->lk); 80104ca5: e9 56 02 00 00 jmp 80104f00 <release> 80104caa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104cb0 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 80104cb0: 55 push %ebp 80104cb1: 89 e5 mov %esp,%ebp 80104cb3: 57 push %edi 80104cb4: 56 push %esi 80104cb5: 53 push %ebx 80104cb6: 31 ff xor %edi,%edi 80104cb8: 83 ec 18 sub $0x18,%esp 80104cbb: 8b 5d 08 mov 0x8(%ebp),%ebx int r; acquire(&lk->lk); 80104cbe: 8d 73 04 lea 0x4(%ebx),%esi 80104cc1: 56 push %esi 80104cc2: e8 79 01 00 00 call 80104e40 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 80104cc7: 8b 03 mov (%ebx),%eax 80104cc9: 83 c4 10 add $0x10,%esp 80104ccc: 85 c0 test %eax,%eax 80104cce: 74 13 je 80104ce3 <holdingsleep+0x33> 80104cd0: 8b 5b 3c mov 0x3c(%ebx),%ebx 80104cd3: e8 08 f6 ff ff call 801042e0 <myproc> 80104cd8: 39 58 10 cmp %ebx,0x10(%eax) 80104cdb: 0f 94 c0 sete %al 80104cde: 0f b6 c0 movzbl %al,%eax 80104ce1: 89 c7 mov %eax,%edi release(&lk->lk); 80104ce3: 83 ec 0c sub $0xc,%esp 80104ce6: 56 push %esi 80104ce7: e8 14 02 00 00 call 80104f00 <release> return r; } 80104cec: 8d 65 f4 lea -0xc(%ebp),%esp 80104cef: 89 f8 mov %edi,%eax 80104cf1: 5b pop %ebx 80104cf2: 5e pop %esi 80104cf3: 5f pop %edi 80104cf4: 5d pop %ebp 80104cf5: c3 ret 80104cf6: 66 90 xchg %ax,%ax 80104cf8: 66 90 xchg %ax,%ax 80104cfa: 66 90 xchg %ax,%ax 80104cfc: 66 90 xchg %ax,%ax 80104cfe: 66 90 xchg %ax,%ax 80104d00 <initlock>: #include "memlayout.h" #include "mmu.h" #include "proc.h" #include "spinlock.h" void initlock(struct spinlock *lk, char *name) { 80104d00: 55 push %ebp 80104d01: 89 e5 mov %esp,%ebp 80104d03: 8b 45 08 mov 0x8(%ebp),%eax lk->name = name; 80104d06: 8b 55 0c mov 0xc(%ebp),%edx lk->locked = 0; 80104d09: c7 00 00 00 00 00 movl $0x0,(%eax) lk->name = name; 80104d0f: 89 50 04 mov %edx,0x4(%eax) lk->cpu = 0; 80104d12: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 80104d19: 5d pop %ebp 80104d1a: c3 ret 80104d1b: 90 nop 80104d1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104d20 <getcallerpcs>: popcli(); } // Record the current call stack in pcs[] by following the %ebp chain. void getcallerpcs(void *v, uint pcs[]) { 80104d20: 55 push %ebp uint *ebp; int i; ebp = (uint*)v - 2; for (i = 0; i < 10; i++) { 80104d21: 31 d2 xor %edx,%edx void getcallerpcs(void *v, uint pcs[]) { 80104d23: 89 e5 mov %esp,%ebp 80104d25: 53 push %ebx ebp = (uint*)v - 2; 80104d26: 8b 45 08 mov 0x8(%ebp),%eax void getcallerpcs(void *v, uint pcs[]) { 80104d29: 8b 4d 0c mov 0xc(%ebp),%ecx ebp = (uint*)v - 2; 80104d2c: 83 e8 08 sub $0x8,%eax 80104d2f: 90 nop if (ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) { 80104d30: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx 80104d36: 81 fb fe ff ff 7f cmp $0x7ffffffe,%ebx 80104d3c: 77 1a ja 80104d58 <getcallerpcs+0x38> break; } pcs[i] = ebp[1]; // saved %eip 80104d3e: 8b 58 04 mov 0x4(%eax),%ebx 80104d41: 89 1c 91 mov %ebx,(%ecx,%edx,4) for (i = 0; i < 10; i++) { 80104d44: 83 c2 01 add $0x1,%edx ebp = (uint*)ebp[0]; // saved %ebp 80104d47: 8b 00 mov (%eax),%eax for (i = 0; i < 10; i++) { 80104d49: 83 fa 0a cmp $0xa,%edx 80104d4c: 75 e2 jne 80104d30 <getcallerpcs+0x10> } for (; i < 10; i++) { pcs[i] = 0; } } 80104d4e: 5b pop %ebx 80104d4f: 5d pop %ebp 80104d50: c3 ret 80104d51: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104d58: 8d 04 91 lea (%ecx,%edx,4),%eax 80104d5b: 83 c1 28 add $0x28,%ecx 80104d5e: 66 90 xchg %ax,%ax pcs[i] = 0; 80104d60: c7 00 00 00 00 00 movl $0x0,(%eax) 80104d66: 83 c0 04 add $0x4,%eax for (; i < 10; i++) { 80104d69: 39 c1 cmp %eax,%ecx 80104d6b: 75 f3 jne 80104d60 <getcallerpcs+0x40> } 80104d6d: 5b pop %ebx 80104d6e: 5d pop %ebp 80104d6f: c3 ret 80104d70 <pushcli>: // Pushcli/popcli are like cli/sti except that they are matched: // it takes two popcli to undo two pushcli. Also, if interrupts // are off, then pushcli, popcli leaves them off. void pushcli(void) { 80104d70: 55 push %ebp 80104d71: 89 e5 mov %esp,%ebp 80104d73: 53 push %ebx 80104d74: 83 ec 04 sub $0x4,%esp 80104d77: 9c pushf 80104d78: 5b pop %ebx asm volatile ("cli"); 80104d79: fa cli int eflags; eflags = readeflags(); cli(); if (mycpu()->ncli == 0) { 80104d7a: e8 c1 f4 ff ff call 80104240 <mycpu> 80104d7f: 8b 80 a4 00 00 00 mov 0xa4(%eax),%eax 80104d85: 85 c0 test %eax,%eax 80104d87: 75 11 jne 80104d9a <pushcli+0x2a> mycpu()->intena = eflags & FL_IF; 80104d89: 81 e3 00 02 00 00 and $0x200,%ebx 80104d8f: e8 ac f4 ff ff call 80104240 <mycpu> 80104d94: 89 98 a8 00 00 00 mov %ebx,0xa8(%eax) } mycpu()->ncli += 1; 80104d9a: e8 a1 f4 ff ff call 80104240 <mycpu> 80104d9f: 83 80 a4 00 00 00 01 addl $0x1,0xa4(%eax) } 80104da6: 83 c4 04 add $0x4,%esp 80104da9: 5b pop %ebx 80104daa: 5d pop %ebp 80104dab: c3 ret 80104dac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104db0 <popcli>: void popcli(void) { 80104db0: 55 push %ebp 80104db1: 89 e5 mov %esp,%ebp 80104db3: 83 ec 08 sub $0x8,%esp asm volatile ("pushfl; popl %0" : "=r" (eflags)); 80104db6: 9c pushf 80104db7: 58 pop %eax if (readeflags() & FL_IF) { 80104db8: f6 c4 02 test $0x2,%ah 80104dbb: 75 35 jne 80104df2 <popcli+0x42> panic("popcli - interruptible"); } if (--mycpu()->ncli < 0) { 80104dbd: e8 7e f4 ff ff call 80104240 <mycpu> 80104dc2: 83 a8 a4 00 00 00 01 subl $0x1,0xa4(%eax) 80104dc9: 78 34 js 80104dff <popcli+0x4f> panic("popcli"); } if (mycpu()->ncli == 0 && mycpu()->intena) { 80104dcb: e8 70 f4 ff ff call 80104240 <mycpu> 80104dd0: 8b 90 a4 00 00 00 mov 0xa4(%eax),%edx 80104dd6: 85 d2 test %edx,%edx 80104dd8: 74 06 je 80104de0 <popcli+0x30> sti(); } } 80104dda: c9 leave 80104ddb: c3 ret 80104ddc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (mycpu()->ncli == 0 && mycpu()->intena) { 80104de0: e8 5b f4 ff ff call 80104240 <mycpu> 80104de5: 8b 80 a8 00 00 00 mov 0xa8(%eax),%eax 80104deb: 85 c0 test %eax,%eax 80104ded: 74 eb je 80104dda <popcli+0x2a> asm volatile ("sti"); 80104def: fb sti } 80104df0: c9 leave 80104df1: c3 ret panic("popcli - interruptible"); 80104df2: 83 ec 0c sub $0xc,%esp 80104df5: 68 e3 81 10 80 push $0x801081e3 80104dfa: e8 e1 b6 ff ff call 801004e0 <panic> panic("popcli"); 80104dff: 83 ec 0c sub $0xc,%esp 80104e02: 68 fa 81 10 80 push $0x801081fa 80104e07: e8 d4 b6 ff ff call 801004e0 <panic> 80104e0c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104e10 <holding>: int holding(struct spinlock *lock) { 80104e10: 55 push %ebp 80104e11: 89 e5 mov %esp,%ebp 80104e13: 56 push %esi 80104e14: 53 push %ebx 80104e15: 8b 75 08 mov 0x8(%ebp),%esi 80104e18: 31 db xor %ebx,%ebx pushcli(); 80104e1a: e8 51 ff ff ff call 80104d70 <pushcli> r = lock->locked && lock->cpu == mycpu(); 80104e1f: 8b 06 mov (%esi),%eax 80104e21: 85 c0 test %eax,%eax 80104e23: 74 10 je 80104e35 <holding+0x25> 80104e25: 8b 5e 08 mov 0x8(%esi),%ebx 80104e28: e8 13 f4 ff ff call 80104240 <mycpu> 80104e2d: 39 c3 cmp %eax,%ebx 80104e2f: 0f 94 c3 sete %bl 80104e32: 0f b6 db movzbl %bl,%ebx popcli(); 80104e35: e8 76 ff ff ff call 80104db0 <popcli> } 80104e3a: 89 d8 mov %ebx,%eax 80104e3c: 5b pop %ebx 80104e3d: 5e pop %esi 80104e3e: 5d pop %ebp 80104e3f: c3 ret 80104e40 <acquire>: void acquire(struct spinlock *lk) { 80104e40: 55 push %ebp 80104e41: 89 e5 mov %esp,%ebp 80104e43: 56 push %esi 80104e44: 53 push %ebx pushcli(); // disable interrupts to avoid deadlock. 80104e45: e8 26 ff ff ff call 80104d70 <pushcli> if (holding(lk)) { 80104e4a: 8b 5d 08 mov 0x8(%ebp),%ebx 80104e4d: 83 ec 0c sub $0xc,%esp 80104e50: 53 push %ebx 80104e51: e8 ba ff ff ff call 80104e10 <holding> 80104e56: 83 c4 10 add $0x10,%esp 80104e59: 85 c0 test %eax,%eax 80104e5b: 0f 85 83 00 00 00 jne 80104ee4 <acquire+0xa4> 80104e61: 89 c6 mov %eax,%esi asm volatile ("lock; xchgl %0, %1" : 80104e63: ba 01 00 00 00 mov $0x1,%edx 80104e68: eb 09 jmp 80104e73 <acquire+0x33> 80104e6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80104e70: 8b 5d 08 mov 0x8(%ebp),%ebx 80104e73: 89 d0 mov %edx,%eax 80104e75: f0 87 03 lock xchg %eax,(%ebx) while (xchg(&lk->locked, 1) != 0) { 80104e78: 85 c0 test %eax,%eax 80104e7a: 75 f4 jne 80104e70 <acquire+0x30> __sync_synchronize(); 80104e7c: f0 83 0c 24 00 lock orl $0x0,(%esp) lk->cpu = mycpu(); 80104e81: 8b 5d 08 mov 0x8(%ebp),%ebx 80104e84: e8 b7 f3 ff ff call 80104240 <mycpu> getcallerpcs(&lk, lk->pcs); 80104e89: 8d 53 0c lea 0xc(%ebx),%edx lk->cpu = mycpu(); 80104e8c: 89 43 08 mov %eax,0x8(%ebx) ebp = (uint*)v - 2; 80104e8f: 89 e8 mov %ebp,%eax 80104e91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if (ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff) { 80104e98: 8d 88 00 00 00 80 lea -0x80000000(%eax),%ecx 80104e9e: 81 f9 fe ff ff 7f cmp $0x7ffffffe,%ecx 80104ea4: 77 1a ja 80104ec0 <acquire+0x80> pcs[i] = ebp[1]; // saved %eip 80104ea6: 8b 48 04 mov 0x4(%eax),%ecx 80104ea9: 89 0c b2 mov %ecx,(%edx,%esi,4) for (i = 0; i < 10; i++) { 80104eac: 83 c6 01 add $0x1,%esi ebp = (uint*)ebp[0]; // saved %ebp 80104eaf: 8b 00 mov (%eax),%eax for (i = 0; i < 10; i++) { 80104eb1: 83 fe 0a cmp $0xa,%esi 80104eb4: 75 e2 jne 80104e98 <acquire+0x58> } 80104eb6: 8d 65 f8 lea -0x8(%ebp),%esp 80104eb9: 5b pop %ebx 80104eba: 5e pop %esi 80104ebb: 5d pop %ebp 80104ebc: c3 ret 80104ebd: 8d 76 00 lea 0x0(%esi),%esi 80104ec0: 8d 04 b2 lea (%edx,%esi,4),%eax 80104ec3: 83 c2 28 add $0x28,%edx 80104ec6: 8d 76 00 lea 0x0(%esi),%esi 80104ec9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi pcs[i] = 0; 80104ed0: c7 00 00 00 00 00 movl $0x0,(%eax) 80104ed6: 83 c0 04 add $0x4,%eax for (; i < 10; i++) { 80104ed9: 39 d0 cmp %edx,%eax 80104edb: 75 f3 jne 80104ed0 <acquire+0x90> } 80104edd: 8d 65 f8 lea -0x8(%ebp),%esp 80104ee0: 5b pop %ebx 80104ee1: 5e pop %esi 80104ee2: 5d pop %ebp 80104ee3: c3 ret panic("acquire"); 80104ee4: 83 ec 0c sub $0xc,%esp 80104ee7: 68 01 82 10 80 push $0x80108201 80104eec: e8 ef b5 ff ff call 801004e0 <panic> 80104ef1: eb 0d jmp 80104f00 <release> 80104ef3: 90 nop 80104ef4: 90 nop 80104ef5: 90 nop 80104ef6: 90 nop 80104ef7: 90 nop 80104ef8: 90 nop 80104ef9: 90 nop 80104efa: 90 nop 80104efb: 90 nop 80104efc: 90 nop 80104efd: 90 nop 80104efe: 90 nop 80104eff: 90 nop 80104f00 <release>: void release(struct spinlock *lk) { 80104f00: 55 push %ebp 80104f01: 89 e5 mov %esp,%ebp 80104f03: 53 push %ebx 80104f04: 83 ec 10 sub $0x10,%esp 80104f07: 8b 5d 08 mov 0x8(%ebp),%ebx if (!holding(lk)) { 80104f0a: 53 push %ebx 80104f0b: e8 00 ff ff ff call 80104e10 <holding> 80104f10: 83 c4 10 add $0x10,%esp 80104f13: 85 c0 test %eax,%eax 80104f15: 74 22 je 80104f39 <release+0x39> lk->pcs[0] = 0; 80104f17: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) lk->cpu = 0; 80104f1e: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) __sync_synchronize(); 80104f25: f0 83 0c 24 00 lock orl $0x0,(%esp) asm volatile ("movl $0, %0" : "+m" (lk->locked) :); 80104f2a: c7 03 00 00 00 00 movl $0x0,(%ebx) } 80104f30: 8b 5d fc mov -0x4(%ebp),%ebx 80104f33: c9 leave popcli(); 80104f34: e9 77 fe ff ff jmp 80104db0 <popcli> panic("release"); 80104f39: 83 ec 0c sub $0xc,%esp 80104f3c: 68 09 82 10 80 push $0x80108209 80104f41: e8 9a b5 ff ff call 801004e0 <panic> 80104f46: 66 90 xchg %ax,%ax 80104f48: 66 90 xchg %ax,%ax 80104f4a: 66 90 xchg %ax,%ax 80104f4c: 66 90 xchg %ax,%ax 80104f4e: 66 90 xchg %ax,%ax 80104f50 <memset>: #include "types.h" #include "x86.h" void* memset(void *dst, int c, uint n) { 80104f50: 55 push %ebp 80104f51: 89 e5 mov %esp,%ebp 80104f53: 57 push %edi 80104f54: 53 push %ebx 80104f55: 8b 55 08 mov 0x8(%ebp),%edx 80104f58: 8b 4d 10 mov 0x10(%ebp),%ecx if ((int)dst % 4 == 0 && n % 4 == 0) { 80104f5b: f6 c2 03 test $0x3,%dl 80104f5e: 75 05 jne 80104f65 <memset+0x15> 80104f60: f6 c1 03 test $0x3,%cl 80104f63: 74 13 je 80104f78 <memset+0x28> asm volatile ("cld; rep stosb" : 80104f65: 89 d7 mov %edx,%edi 80104f67: 8b 45 0c mov 0xc(%ebp),%eax 80104f6a: fc cld 80104f6b: f3 aa rep stos %al,%es:(%edi) } else { stosb(dst, c, n); } return dst; } 80104f6d: 5b pop %ebx 80104f6e: 89 d0 mov %edx,%eax 80104f70: 5f pop %edi 80104f71: 5d pop %ebp 80104f72: c3 ret 80104f73: 90 nop 80104f74: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c &= 0xFF; 80104f78: 0f b6 7d 0c movzbl 0xc(%ebp),%edi stosl(dst, (c << 24) | (c << 16) | (c << 8) | c, n / 4); 80104f7c: c1 e9 02 shr $0x2,%ecx 80104f7f: 89 f8 mov %edi,%eax 80104f81: 89 fb mov %edi,%ebx 80104f83: c1 e0 18 shl $0x18,%eax 80104f86: c1 e3 10 shl $0x10,%ebx 80104f89: 09 d8 or %ebx,%eax 80104f8b: 09 f8 or %edi,%eax 80104f8d: c1 e7 08 shl $0x8,%edi 80104f90: 09 f8 or %edi,%eax asm volatile ("cld; rep stosl" : 80104f92: 89 d7 mov %edx,%edi 80104f94: fc cld 80104f95: f3 ab rep stos %eax,%es:(%edi) } 80104f97: 5b pop %ebx 80104f98: 89 d0 mov %edx,%eax 80104f9a: 5f pop %edi 80104f9b: 5d pop %ebp 80104f9c: c3 ret 80104f9d: 8d 76 00 lea 0x0(%esi),%esi 80104fa0 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80104fa0: 55 push %ebp 80104fa1: 89 e5 mov %esp,%ebp 80104fa3: 57 push %edi 80104fa4: 56 push %esi 80104fa5: 53 push %ebx 80104fa6: 8b 5d 10 mov 0x10(%ebp),%ebx 80104fa9: 8b 75 08 mov 0x8(%ebp),%esi 80104fac: 8b 7d 0c mov 0xc(%ebp),%edi const uchar *s1, *s2; s1 = v1; s2 = v2; while (n-- > 0) { 80104faf: 85 db test %ebx,%ebx 80104fb1: 74 29 je 80104fdc <memcmp+0x3c> if (*s1 != *s2) { 80104fb3: 0f b6 16 movzbl (%esi),%edx 80104fb6: 0f b6 0f movzbl (%edi),%ecx 80104fb9: 38 d1 cmp %dl,%cl 80104fbb: 75 2b jne 80104fe8 <memcmp+0x48> 80104fbd: b8 01 00 00 00 mov $0x1,%eax 80104fc2: eb 14 jmp 80104fd8 <memcmp+0x38> 80104fc4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80104fc8: 0f b6 14 06 movzbl (%esi,%eax,1),%edx 80104fcc: 83 c0 01 add $0x1,%eax 80104fcf: 0f b6 4c 07 ff movzbl -0x1(%edi,%eax,1),%ecx 80104fd4: 38 ca cmp %cl,%dl 80104fd6: 75 10 jne 80104fe8 <memcmp+0x48> while (n-- > 0) { 80104fd8: 39 d8 cmp %ebx,%eax 80104fda: 75 ec jne 80104fc8 <memcmp+0x28> } s1++, s2++; } return 0; } 80104fdc: 5b pop %ebx return 0; 80104fdd: 31 c0 xor %eax,%eax } 80104fdf: 5e pop %esi 80104fe0: 5f pop %edi 80104fe1: 5d pop %ebp 80104fe2: c3 ret 80104fe3: 90 nop 80104fe4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return *s1 - *s2; 80104fe8: 0f b6 c2 movzbl %dl,%eax } 80104feb: 5b pop %ebx return *s1 - *s2; 80104fec: 29 c8 sub %ecx,%eax } 80104fee: 5e pop %esi 80104fef: 5f pop %edi 80104ff0: 5d pop %ebp 80104ff1: c3 ret 80104ff2: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80104ff9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105000 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80105000: 55 push %ebp 80105001: 89 e5 mov %esp,%ebp 80105003: 56 push %esi 80105004: 53 push %ebx 80105005: 8b 45 08 mov 0x8(%ebp),%eax 80105008: 8b 5d 0c mov 0xc(%ebp),%ebx 8010500b: 8b 75 10 mov 0x10(%ebp),%esi const char *s; char *d; s = src; d = dst; if (s < d && s + n > d) { 8010500e: 39 c3 cmp %eax,%ebx 80105010: 73 26 jae 80105038 <memmove+0x38> 80105012: 8d 0c 33 lea (%ebx,%esi,1),%ecx 80105015: 39 c8 cmp %ecx,%eax 80105017: 73 1f jae 80105038 <memmove+0x38> s += n; d += n; while (n-- > 0) { 80105019: 85 f6 test %esi,%esi 8010501b: 8d 56 ff lea -0x1(%esi),%edx 8010501e: 74 0f je 8010502f <memmove+0x2f> *--d = *--s; 80105020: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80105024: 88 0c 10 mov %cl,(%eax,%edx,1) while (n-- > 0) { 80105027: 83 ea 01 sub $0x1,%edx 8010502a: 83 fa ff cmp $0xffffffff,%edx 8010502d: 75 f1 jne 80105020 <memmove+0x20> *d++ = *s++; } } return dst; } 8010502f: 5b pop %ebx 80105030: 5e pop %esi 80105031: 5d pop %ebp 80105032: c3 ret 80105033: 90 nop 80105034: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while (n-- > 0) { 80105038: 31 d2 xor %edx,%edx 8010503a: 85 f6 test %esi,%esi 8010503c: 74 f1 je 8010502f <memmove+0x2f> 8010503e: 66 90 xchg %ax,%ax *d++ = *s++; 80105040: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 80105044: 88 0c 10 mov %cl,(%eax,%edx,1) 80105047: 83 c2 01 add $0x1,%edx while (n-- > 0) { 8010504a: 39 d6 cmp %edx,%esi 8010504c: 75 f2 jne 80105040 <memmove+0x40> } 8010504e: 5b pop %ebx 8010504f: 5e pop %esi 80105050: 5d pop %ebp 80105051: c3 ret 80105052: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105059: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105060 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 80105060: 55 push %ebp 80105061: 89 e5 mov %esp,%ebp return memmove(dst, src, n); } 80105063: 5d pop %ebp return memmove(dst, src, n); 80105064: eb 9a jmp 80105000 <memmove> 80105066: 8d 76 00 lea 0x0(%esi),%esi 80105069: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105070 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 80105070: 55 push %ebp 80105071: 89 e5 mov %esp,%ebp 80105073: 57 push %edi 80105074: 56 push %esi 80105075: 8b 7d 10 mov 0x10(%ebp),%edi 80105078: 53 push %ebx 80105079: 8b 4d 08 mov 0x8(%ebp),%ecx 8010507c: 8b 75 0c mov 0xc(%ebp),%esi while (n > 0 && *p && *p == *q) { 8010507f: 85 ff test %edi,%edi 80105081: 74 2f je 801050b2 <strncmp+0x42> 80105083: 0f b6 01 movzbl (%ecx),%eax 80105086: 0f b6 1e movzbl (%esi),%ebx 80105089: 84 c0 test %al,%al 8010508b: 74 37 je 801050c4 <strncmp+0x54> 8010508d: 38 c3 cmp %al,%bl 8010508f: 75 33 jne 801050c4 <strncmp+0x54> 80105091: 01 f7 add %esi,%edi 80105093: eb 13 jmp 801050a8 <strncmp+0x38> 80105095: 8d 76 00 lea 0x0(%esi),%esi 80105098: 0f b6 01 movzbl (%ecx),%eax 8010509b: 84 c0 test %al,%al 8010509d: 74 21 je 801050c0 <strncmp+0x50> 8010509f: 0f b6 1a movzbl (%edx),%ebx 801050a2: 89 d6 mov %edx,%esi 801050a4: 38 d8 cmp %bl,%al 801050a6: 75 1c jne 801050c4 <strncmp+0x54> n--, p++, q++; 801050a8: 8d 56 01 lea 0x1(%esi),%edx 801050ab: 83 c1 01 add $0x1,%ecx while (n > 0 && *p && *p == *q) { 801050ae: 39 fa cmp %edi,%edx 801050b0: 75 e6 jne 80105098 <strncmp+0x28> } if (n == 0) { return 0; } return (uchar) * p - (uchar) * q; } 801050b2: 5b pop %ebx return 0; 801050b3: 31 c0 xor %eax,%eax } 801050b5: 5e pop %esi 801050b6: 5f pop %edi 801050b7: 5d pop %ebp 801050b8: c3 ret 801050b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801050c0: 0f b6 5e 01 movzbl 0x1(%esi),%ebx return (uchar) * p - (uchar) * q; 801050c4: 29 d8 sub %ebx,%eax } 801050c6: 5b pop %ebx 801050c7: 5e pop %esi 801050c8: 5f pop %edi 801050c9: 5d pop %ebp 801050ca: c3 ret 801050cb: 90 nop 801050cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801050d0 <strncpy>: char* strncpy(char *s, const char *t, int n) { 801050d0: 55 push %ebp 801050d1: 89 e5 mov %esp,%ebp 801050d3: 56 push %esi 801050d4: 53 push %ebx 801050d5: 8b 45 08 mov 0x8(%ebp),%eax 801050d8: 8b 5d 0c mov 0xc(%ebp),%ebx 801050db: 8b 4d 10 mov 0x10(%ebp),%ecx char *os; os = s; while (n-- > 0 && (*s++ = *t++) != 0) { 801050de: 89 c2 mov %eax,%edx 801050e0: eb 19 jmp 801050fb <strncpy+0x2b> 801050e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801050e8: 83 c3 01 add $0x1,%ebx 801050eb: 0f b6 4b ff movzbl -0x1(%ebx),%ecx 801050ef: 83 c2 01 add $0x1,%edx 801050f2: 84 c9 test %cl,%cl 801050f4: 88 4a ff mov %cl,-0x1(%edx) 801050f7: 74 09 je 80105102 <strncpy+0x32> 801050f9: 89 f1 mov %esi,%ecx 801050fb: 85 c9 test %ecx,%ecx 801050fd: 8d 71 ff lea -0x1(%ecx),%esi 80105100: 7f e6 jg 801050e8 <strncpy+0x18> ; } while (n-- > 0) { 80105102: 31 c9 xor %ecx,%ecx 80105104: 85 f6 test %esi,%esi 80105106: 7e 17 jle 8010511f <strncpy+0x4f> 80105108: 90 nop 80105109: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi *s++ = 0; 80105110: c6 04 0a 00 movb $0x0,(%edx,%ecx,1) 80105114: 89 f3 mov %esi,%ebx 80105116: 83 c1 01 add $0x1,%ecx 80105119: 29 cb sub %ecx,%ebx while (n-- > 0) { 8010511b: 85 db test %ebx,%ebx 8010511d: 7f f1 jg 80105110 <strncpy+0x40> } return os; } 8010511f: 5b pop %ebx 80105120: 5e pop %esi 80105121: 5d pop %ebp 80105122: c3 ret 80105123: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80105129: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105130 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80105130: 55 push %ebp 80105131: 89 e5 mov %esp,%ebp 80105133: 56 push %esi 80105134: 53 push %ebx 80105135: 8b 4d 10 mov 0x10(%ebp),%ecx 80105138: 8b 45 08 mov 0x8(%ebp),%eax 8010513b: 8b 55 0c mov 0xc(%ebp),%edx char *os; os = s; if (n <= 0) { 8010513e: 85 c9 test %ecx,%ecx 80105140: 7e 26 jle 80105168 <safestrcpy+0x38> 80105142: 8d 74 0a ff lea -0x1(%edx,%ecx,1),%esi 80105146: 89 c1 mov %eax,%ecx 80105148: eb 17 jmp 80105161 <safestrcpy+0x31> 8010514a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi return os; } while (--n > 0 && (*s++ = *t++) != 0) { 80105150: 83 c2 01 add $0x1,%edx 80105153: 0f b6 5a ff movzbl -0x1(%edx),%ebx 80105157: 83 c1 01 add $0x1,%ecx 8010515a: 84 db test %bl,%bl 8010515c: 88 59 ff mov %bl,-0x1(%ecx) 8010515f: 74 04 je 80105165 <safestrcpy+0x35> 80105161: 39 f2 cmp %esi,%edx 80105163: 75 eb jne 80105150 <safestrcpy+0x20> ; } *s = 0; 80105165: c6 01 00 movb $0x0,(%ecx) return os; } 80105168: 5b pop %ebx 80105169: 5e pop %esi 8010516a: 5d pop %ebp 8010516b: c3 ret 8010516c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105170 <strlen>: int strlen(const char *s) { 80105170: 55 push %ebp int n; for (n = 0; s[n]; n++) { 80105171: 31 c0 xor %eax,%eax int strlen(const char *s) { 80105173: 89 e5 mov %esp,%ebp 80105175: 8b 55 08 mov 0x8(%ebp),%edx for (n = 0; s[n]; n++) { 80105178: 80 3a 00 cmpb $0x0,(%edx) 8010517b: 74 0c je 80105189 <strlen+0x19> 8010517d: 8d 76 00 lea 0x0(%esi),%esi 80105180: 83 c0 01 add $0x1,%eax 80105183: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1) 80105187: 75 f7 jne 80105180 <strlen+0x10> ; } return n; } 80105189: 5d pop %ebp 8010518a: c3 ret 8010518b <swtch>: # a struct context, and save its address in *old. # Switch stacks to new and pop previously-saved registers. .globl swtch swtch: movl 4(%esp), %eax 8010518b: 8b 44 24 04 mov 0x4(%esp),%eax movl 8(%esp), %edx 8010518f: 8b 54 24 08 mov 0x8(%esp),%edx # Save old callee-saved registers pushl %ebp 80105193: 55 push %ebp pushl %ebx 80105194: 53 push %ebx pushl %esi 80105195: 56 push %esi pushl %edi 80105196: 57 push %edi # Switch stacks movl %esp, (%eax) 80105197: 89 20 mov %esp,(%eax) movl %edx, %esp 80105199: 89 d4 mov %edx,%esp # Load new callee-saved registers popl %edi 8010519b: 5f pop %edi popl %esi 8010519c: 5e pop %esi popl %ebx 8010519d: 5b pop %ebx popl %ebp 8010519e: 5d pop %ebp ret 8010519f: c3 ret 801051a0 <fetchint>: // Arguments on the stack, from the user call to the C // library system call function. The saved user %esp points // to a saved program counter, and then the first argument. // Fetch the int at addr from the current process. int fetchint(uint addr, int *ip) { 801051a0: 55 push %ebp 801051a1: 89 e5 mov %esp,%ebp 801051a3: 53 push %ebx 801051a4: 83 ec 04 sub $0x4,%esp 801051a7: 8b 5d 08 mov 0x8(%ebp),%ebx struct proc *curproc = myproc(); 801051aa: e8 31 f1 ff ff call 801042e0 <myproc> if (addr >= curproc->sz || addr + 4 > curproc->sz) { 801051af: 8b 00 mov (%eax),%eax 801051b1: 39 d8 cmp %ebx,%eax 801051b3: 76 1b jbe 801051d0 <fetchint+0x30> 801051b5: 8d 53 04 lea 0x4(%ebx),%edx 801051b8: 39 d0 cmp %edx,%eax 801051ba: 72 14 jb 801051d0 <fetchint+0x30> return -1; } *ip = *(int*)(addr); 801051bc: 8b 45 0c mov 0xc(%ebp),%eax 801051bf: 8b 13 mov (%ebx),%edx 801051c1: 89 10 mov %edx,(%eax) return 0; 801051c3: 31 c0 xor %eax,%eax } 801051c5: 83 c4 04 add $0x4,%esp 801051c8: 5b pop %ebx 801051c9: 5d pop %ebp 801051ca: c3 ret 801051cb: 90 nop 801051cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801051d0: b8 ff ff ff ff mov $0xffffffff,%eax 801051d5: eb ee jmp 801051c5 <fetchint+0x25> 801051d7: 89 f6 mov %esi,%esi 801051d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801051e0 <fetchstr>: // Fetch the nul-terminated string at addr from the current process. // Doesn't actually copy the string - just sets *pp to point at it. // Returns length of string, not including nul. int fetchstr(uint addr, char **pp) { 801051e0: 55 push %ebp 801051e1: 89 e5 mov %esp,%ebp 801051e3: 53 push %ebx 801051e4: 83 ec 04 sub $0x4,%esp 801051e7: 8b 5d 08 mov 0x8(%ebp),%ebx char *s, *ep; struct proc *curproc = myproc(); 801051ea: e8 f1 f0 ff ff call 801042e0 <myproc> if (addr >= curproc->sz) { 801051ef: 39 18 cmp %ebx,(%eax) 801051f1: 76 29 jbe 8010521c <fetchstr+0x3c> return -1; } *pp = (char*)addr; 801051f3: 8b 4d 0c mov 0xc(%ebp),%ecx 801051f6: 89 da mov %ebx,%edx 801051f8: 89 19 mov %ebx,(%ecx) ep = (char*)curproc->sz; 801051fa: 8b 00 mov (%eax),%eax for (s = *pp; s < ep; s++) { 801051fc: 39 c3 cmp %eax,%ebx 801051fe: 73 1c jae 8010521c <fetchstr+0x3c> if (*s == 0) { 80105200: 80 3b 00 cmpb $0x0,(%ebx) 80105203: 75 10 jne 80105215 <fetchstr+0x35> 80105205: eb 39 jmp 80105240 <fetchstr+0x60> 80105207: 89 f6 mov %esi,%esi 80105209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105210: 80 3a 00 cmpb $0x0,(%edx) 80105213: 74 1b je 80105230 <fetchstr+0x50> for (s = *pp; s < ep; s++) { 80105215: 83 c2 01 add $0x1,%edx 80105218: 39 d0 cmp %edx,%eax 8010521a: 77 f4 ja 80105210 <fetchstr+0x30> return -1; 8010521c: b8 ff ff ff ff mov $0xffffffff,%eax return s - *pp; } } return -1; } 80105221: 83 c4 04 add $0x4,%esp 80105224: 5b pop %ebx 80105225: 5d pop %ebp 80105226: c3 ret 80105227: 89 f6 mov %esi,%esi 80105229: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105230: 83 c4 04 add $0x4,%esp 80105233: 89 d0 mov %edx,%eax 80105235: 29 d8 sub %ebx,%eax 80105237: 5b pop %ebx 80105238: 5d pop %ebp 80105239: c3 ret 8010523a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if (*s == 0) { 80105240: 31 c0 xor %eax,%eax return s - *pp; 80105242: eb dd jmp 80105221 <fetchstr+0x41> 80105244: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010524a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80105250 <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80105250: 55 push %ebp 80105251: 89 e5 mov %esp,%ebp 80105253: 56 push %esi 80105254: 53 push %ebx return fetchint((myproc()->tf->esp) + 4 + 4 * n, ip); 80105255: e8 86 f0 ff ff call 801042e0 <myproc> 8010525a: 8b 40 18 mov 0x18(%eax),%eax 8010525d: 8b 55 08 mov 0x8(%ebp),%edx 80105260: 8b 40 44 mov 0x44(%eax),%eax 80105263: 8d 1c 90 lea (%eax,%edx,4),%ebx struct proc *curproc = myproc(); 80105266: e8 75 f0 ff ff call 801042e0 <myproc> if (addr >= curproc->sz || addr + 4 > curproc->sz) { 8010526b: 8b 00 mov (%eax),%eax return fetchint((myproc()->tf->esp) + 4 + 4 * n, ip); 8010526d: 8d 73 04 lea 0x4(%ebx),%esi if (addr >= curproc->sz || addr + 4 > curproc->sz) { 80105270: 39 c6 cmp %eax,%esi 80105272: 73 1c jae 80105290 <argint+0x40> 80105274: 8d 53 08 lea 0x8(%ebx),%edx 80105277: 39 d0 cmp %edx,%eax 80105279: 72 15 jb 80105290 <argint+0x40> *ip = *(int*)(addr); 8010527b: 8b 45 0c mov 0xc(%ebp),%eax 8010527e: 8b 53 04 mov 0x4(%ebx),%edx 80105281: 89 10 mov %edx,(%eax) return 0; 80105283: 31 c0 xor %eax,%eax } 80105285: 5b pop %ebx 80105286: 5e pop %esi 80105287: 5d pop %ebp 80105288: c3 ret 80105289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105290: b8 ff ff ff ff mov $0xffffffff,%eax return fetchint((myproc()->tf->esp) + 4 + 4 * n, ip); 80105295: eb ee jmp 80105285 <argint+0x35> 80105297: 89 f6 mov %esi,%esi 80105299: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801052a0 <argptr>: // Fetch the nth word-sized system call argument as a pointer // to a block of memory of size bytes. Check that the pointer // lies within the process address space. int argptr(int n, char **pp, int size) { 801052a0: 55 push %ebp 801052a1: 89 e5 mov %esp,%ebp 801052a3: 56 push %esi 801052a4: 53 push %ebx 801052a5: 83 ec 10 sub $0x10,%esp 801052a8: 8b 5d 10 mov 0x10(%ebp),%ebx int i; struct proc *curproc = myproc(); 801052ab: e8 30 f0 ff ff call 801042e0 <myproc> 801052b0: 89 c6 mov %eax,%esi if (argint(n, &i) < 0) { 801052b2: 8d 45 f4 lea -0xc(%ebp),%eax 801052b5: 83 ec 08 sub $0x8,%esp 801052b8: 50 push %eax 801052b9: ff 75 08 pushl 0x8(%ebp) 801052bc: e8 8f ff ff ff call 80105250 <argint> return -1; } if (size < 0 || (uint)i >= curproc->sz || (uint)i + size > curproc->sz) { 801052c1: 83 c4 10 add $0x10,%esp 801052c4: 85 c0 test %eax,%eax 801052c6: 78 28 js 801052f0 <argptr+0x50> 801052c8: 85 db test %ebx,%ebx 801052ca: 78 24 js 801052f0 <argptr+0x50> 801052cc: 8b 16 mov (%esi),%edx 801052ce: 8b 45 f4 mov -0xc(%ebp),%eax 801052d1: 39 c2 cmp %eax,%edx 801052d3: 76 1b jbe 801052f0 <argptr+0x50> 801052d5: 01 c3 add %eax,%ebx 801052d7: 39 da cmp %ebx,%edx 801052d9: 72 15 jb 801052f0 <argptr+0x50> return -1; } *pp = (char*)i; 801052db: 8b 55 0c mov 0xc(%ebp),%edx 801052de: 89 02 mov %eax,(%edx) return 0; 801052e0: 31 c0 xor %eax,%eax } 801052e2: 8d 65 f8 lea -0x8(%ebp),%esp 801052e5: 5b pop %ebx 801052e6: 5e pop %esi 801052e7: 5d pop %ebp 801052e8: c3 ret 801052e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801052f0: b8 ff ff ff ff mov $0xffffffff,%eax 801052f5: eb eb jmp 801052e2 <argptr+0x42> 801052f7: 89 f6 mov %esi,%esi 801052f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105300 <argstr>: // Fetch the nth word-sized system call argument as a string pointer. // Check that the pointer is valid and the string is nul-terminated. // (There is no shared writable memory, so the string can't change // between this check and being used by the kernel.) int argstr(int n, char **pp) { 80105300: 55 push %ebp 80105301: 89 e5 mov %esp,%ebp 80105303: 83 ec 20 sub $0x20,%esp int addr; if (argint(n, &addr) < 0) { 80105306: 8d 45 f4 lea -0xc(%ebp),%eax 80105309: 50 push %eax 8010530a: ff 75 08 pushl 0x8(%ebp) 8010530d: e8 3e ff ff ff call 80105250 <argint> 80105312: 83 c4 10 add $0x10,%esp 80105315: 85 c0 test %eax,%eax 80105317: 78 17 js 80105330 <argstr+0x30> return -1; } return fetchstr(addr, pp); 80105319: 83 ec 08 sub $0x8,%esp 8010531c: ff 75 0c pushl 0xc(%ebp) 8010531f: ff 75 f4 pushl -0xc(%ebp) 80105322: e8 b9 fe ff ff call 801051e0 <fetchstr> 80105327: 83 c4 10 add $0x10,%esp } 8010532a: c9 leave 8010532b: c3 ret 8010532c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80105330: b8 ff ff ff ff mov $0xffffffff,%eax } 80105335: c9 leave 80105336: c3 ret 80105337: 89 f6 mov %esi,%esi 80105339: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105340 <syscall>: [SYS_clearscreen12h] sys_clearscreen12h, [SYS_videomodevga13] sys_videomodevga13, // TODO: Add your system call function to the OS syscall table. }; void syscall(void) { 80105340: 55 push %ebp 80105341: 89 e5 mov %esp,%ebp 80105343: 53 push %ebx 80105344: 83 ec 04 sub $0x4,%esp int num; struct proc *curproc = myproc(); 80105347: e8 94 ef ff ff call 801042e0 <myproc> 8010534c: 89 c3 mov %eax,%ebx num = curproc->tf->eax; 8010534e: 8b 40 18 mov 0x18(%eax),%eax 80105351: 8b 40 1c mov 0x1c(%eax),%eax if (num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80105354: 8d 50 ff lea -0x1(%eax),%edx 80105357: 83 fa 1c cmp $0x1c,%edx 8010535a: 77 1c ja 80105378 <syscall+0x38> 8010535c: 8b 14 85 40 82 10 80 mov -0x7fef7dc0(,%eax,4),%edx 80105363: 85 d2 test %edx,%edx 80105365: 74 11 je 80105378 <syscall+0x38> curproc->tf->eax = syscalls[num](); 80105367: ff d2 call *%edx 80105369: 8b 53 18 mov 0x18(%ebx),%edx 8010536c: 89 42 1c mov %eax,0x1c(%edx) else { cprintf("%d %s: unknown sys call %d\n", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } 8010536f: 8b 5d fc mov -0x4(%ebp),%ebx 80105372: c9 leave 80105373: c3 ret 80105374: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("%d %s: unknown sys call %d\n", 80105378: 50 push %eax curproc->pid, curproc->name, num); 80105379: 8d 43 6c lea 0x6c(%ebx),%eax cprintf("%d %s: unknown sys call %d\n", 8010537c: 50 push %eax 8010537d: ff 73 10 pushl 0x10(%ebx) 80105380: 68 11 82 10 80 push $0x80108211 80105385: e8 d6 b4 ff ff call 80100860 <cprintf> curproc->tf->eax = -1; 8010538a: 8b 43 18 mov 0x18(%ebx),%eax 8010538d: 83 c4 10 add $0x10,%esp 80105390: c7 40 1c ff ff ff ff movl $0xffffffff,0x1c(%eax) } 80105397: 8b 5d fc mov -0x4(%ebp),%ebx 8010539a: c9 leave 8010539b: c3 ret 8010539c: 66 90 xchg %ax,%ax 8010539e: 66 90 xchg %ax,%ax 801053a0 <create>: end_op(); return 0; } static struct inode* create(char *path, short type, short major, short minor) { 801053a0: 55 push %ebp 801053a1: 89 e5 mov %esp,%ebp 801053a3: 57 push %edi 801053a4: 56 push %esi 801053a5: 53 push %ebx struct inode *ip, *dp; char name[DIRSIZ]; if ((dp = nameiparent(path, name)) == 0) { 801053a6: 8d 75 da lea -0x26(%ebp),%esi static struct inode* create(char *path, short type, short major, short minor) { 801053a9: 83 ec 34 sub $0x34,%esp 801053ac: 89 4d d0 mov %ecx,-0x30(%ebp) 801053af: 8b 4d 08 mov 0x8(%ebp),%ecx if ((dp = nameiparent(path, name)) == 0) { 801053b2: 56 push %esi 801053b3: 50 push %eax static struct inode* create(char *path, short type, short major, short minor) { 801053b4: 89 55 d4 mov %edx,-0x2c(%ebp) 801053b7: 89 4d cc mov %ecx,-0x34(%ebp) if ((dp = nameiparent(path, name)) == 0) { 801053ba: e8 11 d6 ff ff call 801029d0 <nameiparent> 801053bf: 83 c4 10 add $0x10,%esp 801053c2: 85 c0 test %eax,%eax 801053c4: 0f 84 46 01 00 00 je 80105510 <create+0x170> return 0; } ilock(dp); 801053ca: 83 ec 0c sub $0xc,%esp 801053cd: 89 c3 mov %eax,%ebx 801053cf: 50 push %eax 801053d0: e8 7b cd ff ff call 80102150 <ilock> if ((ip = dirlookup(dp, name, 0)) != 0) { 801053d5: 83 c4 0c add $0xc,%esp 801053d8: 6a 00 push $0x0 801053da: 56 push %esi 801053db: 53 push %ebx 801053dc: e8 9f d2 ff ff call 80102680 <dirlookup> 801053e1: 83 c4 10 add $0x10,%esp 801053e4: 85 c0 test %eax,%eax 801053e6: 89 c7 mov %eax,%edi 801053e8: 74 36 je 80105420 <create+0x80> iunlockput(dp); 801053ea: 83 ec 0c sub $0xc,%esp 801053ed: 53 push %ebx 801053ee: e8 ed cf ff ff call 801023e0 <iunlockput> ilock(ip); 801053f3: 89 3c 24 mov %edi,(%esp) 801053f6: e8 55 cd ff ff call 80102150 <ilock> if (type == T_FILE && ip->type == T_FILE) { 801053fb: 83 c4 10 add $0x10,%esp 801053fe: 66 83 7d d4 02 cmpw $0x2,-0x2c(%ebp) 80105403: 0f 85 97 00 00 00 jne 801054a0 <create+0x100> 80105409: 66 83 7f 50 02 cmpw $0x2,0x50(%edi) 8010540e: 0f 85 8c 00 00 00 jne 801054a0 <create+0x100> } iunlockput(dp); return ip; } 80105414: 8d 65 f4 lea -0xc(%ebp),%esp 80105417: 89 f8 mov %edi,%eax 80105419: 5b pop %ebx 8010541a: 5e pop %esi 8010541b: 5f pop %edi 8010541c: 5d pop %ebp 8010541d: c3 ret 8010541e: 66 90 xchg %ax,%ax if ((ip = ialloc(dp->dev, type)) == 0) { 80105420: 0f bf 45 d4 movswl -0x2c(%ebp),%eax 80105424: 83 ec 08 sub $0x8,%esp 80105427: 50 push %eax 80105428: ff 33 pushl (%ebx) 8010542a: e8 b1 cb ff ff call 80101fe0 <ialloc> 8010542f: 83 c4 10 add $0x10,%esp 80105432: 85 c0 test %eax,%eax 80105434: 89 c7 mov %eax,%edi 80105436: 0f 84 e8 00 00 00 je 80105524 <create+0x184> ilock(ip); 8010543c: 83 ec 0c sub $0xc,%esp 8010543f: 50 push %eax 80105440: e8 0b cd ff ff call 80102150 <ilock> ip->major = major; 80105445: 0f b7 45 d0 movzwl -0x30(%ebp),%eax 80105449: 66 89 47 52 mov %ax,0x52(%edi) ip->minor = minor; 8010544d: 0f b7 45 cc movzwl -0x34(%ebp),%eax 80105451: 66 89 47 54 mov %ax,0x54(%edi) ip->nlink = 1; 80105455: b8 01 00 00 00 mov $0x1,%eax 8010545a: 66 89 47 56 mov %ax,0x56(%edi) iupdate(ip); 8010545e: 89 3c 24 mov %edi,(%esp) 80105461: e8 3a cc ff ff call 801020a0 <iupdate> if (type == T_DIR) { // Create . and .. entries. 80105466: 83 c4 10 add $0x10,%esp 80105469: 66 83 7d d4 01 cmpw $0x1,-0x2c(%ebp) 8010546e: 74 50 je 801054c0 <create+0x120> if (dirlink(dp, name, ip->inum) < 0) { 80105470: 83 ec 04 sub $0x4,%esp 80105473: ff 77 04 pushl 0x4(%edi) 80105476: 56 push %esi 80105477: 53 push %ebx 80105478: e8 73 d4 ff ff call 801028f0 <dirlink> 8010547d: 83 c4 10 add $0x10,%esp 80105480: 85 c0 test %eax,%eax 80105482: 0f 88 8f 00 00 00 js 80105517 <create+0x177> iunlockput(dp); 80105488: 83 ec 0c sub $0xc,%esp 8010548b: 53 push %ebx 8010548c: e8 4f cf ff ff call 801023e0 <iunlockput> return ip; 80105491: 83 c4 10 add $0x10,%esp } 80105494: 8d 65 f4 lea -0xc(%ebp),%esp 80105497: 89 f8 mov %edi,%eax 80105499: 5b pop %ebx 8010549a: 5e pop %esi 8010549b: 5f pop %edi 8010549c: 5d pop %ebp 8010549d: c3 ret 8010549e: 66 90 xchg %ax,%ax iunlockput(ip); 801054a0: 83 ec 0c sub $0xc,%esp 801054a3: 57 push %edi return 0; 801054a4: 31 ff xor %edi,%edi iunlockput(ip); 801054a6: e8 35 cf ff ff call 801023e0 <iunlockput> return 0; 801054ab: 83 c4 10 add $0x10,%esp } 801054ae: 8d 65 f4 lea -0xc(%ebp),%esp 801054b1: 89 f8 mov %edi,%eax 801054b3: 5b pop %ebx 801054b4: 5e pop %esi 801054b5: 5f pop %edi 801054b6: 5d pop %ebp 801054b7: c3 ret 801054b8: 90 nop 801054b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi dp->nlink++; // for ".." 801054c0: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(dp); 801054c5: 83 ec 0c sub $0xc,%esp 801054c8: 53 push %ebx 801054c9: e8 d2 cb ff ff call 801020a0 <iupdate> if (dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) { 801054ce: 83 c4 0c add $0xc,%esp 801054d1: ff 77 04 pushl 0x4(%edi) 801054d4: 68 d4 82 10 80 push $0x801082d4 801054d9: 57 push %edi 801054da: e8 11 d4 ff ff call 801028f0 <dirlink> 801054df: 83 c4 10 add $0x10,%esp 801054e2: 85 c0 test %eax,%eax 801054e4: 78 1c js 80105502 <create+0x162> 801054e6: 83 ec 04 sub $0x4,%esp 801054e9: ff 73 04 pushl 0x4(%ebx) 801054ec: 68 d3 82 10 80 push $0x801082d3 801054f1: 57 push %edi 801054f2: e8 f9 d3 ff ff call 801028f0 <dirlink> 801054f7: 83 c4 10 add $0x10,%esp 801054fa: 85 c0 test %eax,%eax 801054fc: 0f 89 6e ff ff ff jns 80105470 <create+0xd0> panic("create dots"); 80105502: 83 ec 0c sub $0xc,%esp 80105505: 68 c7 82 10 80 push $0x801082c7 8010550a: e8 d1 af ff ff call 801004e0 <panic> 8010550f: 90 nop return 0; 80105510: 31 ff xor %edi,%edi 80105512: e9 fd fe ff ff jmp 80105414 <create+0x74> panic("create: dirlink"); 80105517: 83 ec 0c sub $0xc,%esp 8010551a: 68 d6 82 10 80 push $0x801082d6 8010551f: e8 bc af ff ff call 801004e0 <panic> panic("create: ialloc"); 80105524: 83 ec 0c sub $0xc,%esp 80105527: 68 b8 82 10 80 push $0x801082b8 8010552c: e8 af af ff ff call 801004e0 <panic> 80105531: eb 0d jmp 80105540 <argfd.constprop.0> 80105533: 90 nop 80105534: 90 nop 80105535: 90 nop 80105536: 90 nop 80105537: 90 nop 80105538: 90 nop 80105539: 90 nop 8010553a: 90 nop 8010553b: 90 nop 8010553c: 90 nop 8010553d: 90 nop 8010553e: 90 nop 8010553f: 90 nop 80105540 <argfd.constprop.0>: static int argfd(int n, int *pfd, struct file **pf) { 80105540: 55 push %ebp 80105541: 89 e5 mov %esp,%ebp 80105543: 56 push %esi 80105544: 53 push %ebx 80105545: 89 c3 mov %eax,%ebx if (argint(n, &fd) < 0) { 80105547: 8d 45 f4 lea -0xc(%ebp),%eax static int argfd(int n, int *pfd, struct file **pf) { 8010554a: 89 d6 mov %edx,%esi 8010554c: 83 ec 18 sub $0x18,%esp if (argint(n, &fd) < 0) { 8010554f: 50 push %eax 80105550: 6a 00 push $0x0 80105552: e8 f9 fc ff ff call 80105250 <argint> 80105557: 83 c4 10 add $0x10,%esp 8010555a: 85 c0 test %eax,%eax 8010555c: 78 2a js 80105588 <argfd.constprop.0+0x48> if (fd < 0 || fd >= NOFILE || (f = myproc()->ofile[fd]) == 0) { 8010555e: 83 7d f4 0f cmpl $0xf,-0xc(%ebp) 80105562: 77 24 ja 80105588 <argfd.constprop.0+0x48> 80105564: e8 77 ed ff ff call 801042e0 <myproc> 80105569: 8b 55 f4 mov -0xc(%ebp),%edx 8010556c: 8b 44 90 28 mov 0x28(%eax,%edx,4),%eax 80105570: 85 c0 test %eax,%eax 80105572: 74 14 je 80105588 <argfd.constprop.0+0x48> if (pfd) { 80105574: 85 db test %ebx,%ebx 80105576: 74 02 je 8010557a <argfd.constprop.0+0x3a> *pfd = fd; 80105578: 89 13 mov %edx,(%ebx) *pf = f; 8010557a: 89 06 mov %eax,(%esi) return 0; 8010557c: 31 c0 xor %eax,%eax } 8010557e: 8d 65 f8 lea -0x8(%ebp),%esp 80105581: 5b pop %ebx 80105582: 5e pop %esi 80105583: 5d pop %ebp 80105584: c3 ret 80105585: 8d 76 00 lea 0x0(%esi),%esi return -1; 80105588: b8 ff ff ff ff mov $0xffffffff,%eax 8010558d: eb ef jmp 8010557e <argfd.constprop.0+0x3e> 8010558f: 90 nop 80105590 <sys_dup>: int sys_dup(void) { 80105590: 55 push %ebp if (argfd(0, 0, &f) < 0) { 80105591: 31 c0 xor %eax,%eax int sys_dup(void) { 80105593: 89 e5 mov %esp,%ebp 80105595: 56 push %esi 80105596: 53 push %ebx if (argfd(0, 0, &f) < 0) { 80105597: 8d 55 f4 lea -0xc(%ebp),%edx int sys_dup(void) { 8010559a: 83 ec 10 sub $0x10,%esp if (argfd(0, 0, &f) < 0) { 8010559d: e8 9e ff ff ff call 80105540 <argfd.constprop.0> 801055a2: 85 c0 test %eax,%eax 801055a4: 78 42 js 801055e8 <sys_dup+0x58> if ((fd = fdalloc(f)) < 0) { 801055a6: 8b 75 f4 mov -0xc(%ebp),%esi for (fd = 0; fd < NOFILE; fd++) { 801055a9: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 801055ab: e8 30 ed ff ff call 801042e0 <myproc> 801055b0: eb 0e jmp 801055c0 <sys_dup+0x30> 801055b2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi for (fd = 0; fd < NOFILE; fd++) { 801055b8: 83 c3 01 add $0x1,%ebx 801055bb: 83 fb 10 cmp $0x10,%ebx 801055be: 74 28 je 801055e8 <sys_dup+0x58> if (curproc->ofile[fd] == 0) { 801055c0: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 801055c4: 85 d2 test %edx,%edx 801055c6: 75 f0 jne 801055b8 <sys_dup+0x28> curproc->ofile[fd] = f; 801055c8: 89 74 98 28 mov %esi,0x28(%eax,%ebx,4) filedup(f); 801055cc: 83 ec 0c sub $0xc,%esp 801055cf: ff 75 f4 pushl -0xc(%ebp) 801055d2: e8 e9 c2 ff ff call 801018c0 <filedup> return fd; 801055d7: 83 c4 10 add $0x10,%esp } 801055da: 8d 65 f8 lea -0x8(%ebp),%esp 801055dd: 89 d8 mov %ebx,%eax 801055df: 5b pop %ebx 801055e0: 5e pop %esi 801055e1: 5d pop %ebp 801055e2: c3 ret 801055e3: 90 nop 801055e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 801055e8: 8d 65 f8 lea -0x8(%ebp),%esp return -1; 801055eb: bb ff ff ff ff mov $0xffffffff,%ebx } 801055f0: 89 d8 mov %ebx,%eax 801055f2: 5b pop %ebx 801055f3: 5e pop %esi 801055f4: 5d pop %ebp 801055f5: c3 ret 801055f6: 8d 76 00 lea 0x0(%esi),%esi 801055f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105600 <sys_read>: int sys_read(void) { 80105600: 55 push %ebp if (argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) { 80105601: 31 c0 xor %eax,%eax int sys_read(void) { 80105603: 89 e5 mov %esp,%ebp 80105605: 83 ec 18 sub $0x18,%esp if (argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) { 80105608: 8d 55 ec lea -0x14(%ebp),%edx 8010560b: e8 30 ff ff ff call 80105540 <argfd.constprop.0> 80105610: 85 c0 test %eax,%eax 80105612: 78 4c js 80105660 <sys_read+0x60> 80105614: 8d 45 f0 lea -0x10(%ebp),%eax 80105617: 83 ec 08 sub $0x8,%esp 8010561a: 50 push %eax 8010561b: 6a 02 push $0x2 8010561d: e8 2e fc ff ff call 80105250 <argint> 80105622: 83 c4 10 add $0x10,%esp 80105625: 85 c0 test %eax,%eax 80105627: 78 37 js 80105660 <sys_read+0x60> 80105629: 8d 45 f4 lea -0xc(%ebp),%eax 8010562c: 83 ec 04 sub $0x4,%esp 8010562f: ff 75 f0 pushl -0x10(%ebp) 80105632: 50 push %eax 80105633: 6a 01 push $0x1 80105635: e8 66 fc ff ff call 801052a0 <argptr> 8010563a: 83 c4 10 add $0x10,%esp 8010563d: 85 c0 test %eax,%eax 8010563f: 78 1f js 80105660 <sys_read+0x60> return fileread(f, p, n); 80105641: 83 ec 04 sub $0x4,%esp 80105644: ff 75 f0 pushl -0x10(%ebp) 80105647: ff 75 f4 pushl -0xc(%ebp) 8010564a: ff 75 ec pushl -0x14(%ebp) 8010564d: e8 de c3 ff ff call 80101a30 <fileread> 80105652: 83 c4 10 add $0x10,%esp } 80105655: c9 leave 80105656: c3 ret 80105657: 89 f6 mov %esi,%esi 80105659: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80105660: b8 ff ff ff ff mov $0xffffffff,%eax } 80105665: c9 leave 80105666: c3 ret 80105667: 89 f6 mov %esi,%esi 80105669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105670 <sys_write>: int sys_write(void) { 80105670: 55 push %ebp if (argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) { 80105671: 31 c0 xor %eax,%eax int sys_write(void) { 80105673: 89 e5 mov %esp,%ebp 80105675: 83 ec 18 sub $0x18,%esp if (argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) { 80105678: 8d 55 ec lea -0x14(%ebp),%edx 8010567b: e8 c0 fe ff ff call 80105540 <argfd.constprop.0> 80105680: 85 c0 test %eax,%eax 80105682: 78 4c js 801056d0 <sys_write+0x60> 80105684: 8d 45 f0 lea -0x10(%ebp),%eax 80105687: 83 ec 08 sub $0x8,%esp 8010568a: 50 push %eax 8010568b: 6a 02 push $0x2 8010568d: e8 be fb ff ff call 80105250 <argint> 80105692: 83 c4 10 add $0x10,%esp 80105695: 85 c0 test %eax,%eax 80105697: 78 37 js 801056d0 <sys_write+0x60> 80105699: 8d 45 f4 lea -0xc(%ebp),%eax 8010569c: 83 ec 04 sub $0x4,%esp 8010569f: ff 75 f0 pushl -0x10(%ebp) 801056a2: 50 push %eax 801056a3: 6a 01 push $0x1 801056a5: e8 f6 fb ff ff call 801052a0 <argptr> 801056aa: 83 c4 10 add $0x10,%esp 801056ad: 85 c0 test %eax,%eax 801056af: 78 1f js 801056d0 <sys_write+0x60> return filewrite(f, p, n); 801056b1: 83 ec 04 sub $0x4,%esp 801056b4: ff 75 f0 pushl -0x10(%ebp) 801056b7: ff 75 f4 pushl -0xc(%ebp) 801056ba: ff 75 ec pushl -0x14(%ebp) 801056bd: e8 fe c3 ff ff call 80101ac0 <filewrite> 801056c2: 83 c4 10 add $0x10,%esp } 801056c5: c9 leave 801056c6: c3 ret 801056c7: 89 f6 mov %esi,%esi 801056c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 801056d0: b8 ff ff ff ff mov $0xffffffff,%eax } 801056d5: c9 leave 801056d6: c3 ret 801056d7: 89 f6 mov %esi,%esi 801056d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801056e0 <sys_close>: int sys_close(void) { 801056e0: 55 push %ebp 801056e1: 89 e5 mov %esp,%ebp 801056e3: 83 ec 18 sub $0x18,%esp if (argfd(0, &fd, &f) < 0) { 801056e6: 8d 55 f4 lea -0xc(%ebp),%edx 801056e9: 8d 45 f0 lea -0x10(%ebp),%eax 801056ec: e8 4f fe ff ff call 80105540 <argfd.constprop.0> 801056f1: 85 c0 test %eax,%eax 801056f3: 78 2b js 80105720 <sys_close+0x40> myproc()->ofile[fd] = 0; 801056f5: e8 e6 eb ff ff call 801042e0 <myproc> 801056fa: 8b 55 f0 mov -0x10(%ebp),%edx fileclose(f); 801056fd: 83 ec 0c sub $0xc,%esp myproc()->ofile[fd] = 0; 80105700: c7 44 90 28 00 00 00 movl $0x0,0x28(%eax,%edx,4) 80105707: 00 fileclose(f); 80105708: ff 75 f4 pushl -0xc(%ebp) 8010570b: e8 00 c2 ff ff call 80101910 <fileclose> return 0; 80105710: 83 c4 10 add $0x10,%esp 80105713: 31 c0 xor %eax,%eax } 80105715: c9 leave 80105716: c3 ret 80105717: 89 f6 mov %esi,%esi 80105719: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi return -1; 80105720: b8 ff ff ff ff mov $0xffffffff,%eax } 80105725: c9 leave 80105726: c3 ret 80105727: 89 f6 mov %esi,%esi 80105729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105730 <sys_fstat>: int sys_fstat(void) { 80105730: 55 push %ebp if (argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) { 80105731: 31 c0 xor %eax,%eax int sys_fstat(void) { 80105733: 89 e5 mov %esp,%ebp 80105735: 83 ec 18 sub $0x18,%esp if (argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0) { 80105738: 8d 55 f0 lea -0x10(%ebp),%edx 8010573b: e8 00 fe ff ff call 80105540 <argfd.constprop.0> 80105740: 85 c0 test %eax,%eax 80105742: 78 2c js 80105770 <sys_fstat+0x40> 80105744: 8d 45 f4 lea -0xc(%ebp),%eax 80105747: 83 ec 04 sub $0x4,%esp 8010574a: 6a 14 push $0x14 8010574c: 50 push %eax 8010574d: 6a 01 push $0x1 8010574f: e8 4c fb ff ff call 801052a0 <argptr> 80105754: 83 c4 10 add $0x10,%esp 80105757: 85 c0 test %eax,%eax 80105759: 78 15 js 80105770 <sys_fstat+0x40> return filestat(f, st); 8010575b: 83 ec 08 sub $0x8,%esp 8010575e: ff 75 f4 pushl -0xc(%ebp) 80105761: ff 75 f0 pushl -0x10(%ebp) 80105764: e8 77 c2 ff ff call 801019e0 <filestat> 80105769: 83 c4 10 add $0x10,%esp } 8010576c: c9 leave 8010576d: c3 ret 8010576e: 66 90 xchg %ax,%ax return -1; 80105770: b8 ff ff ff ff mov $0xffffffff,%eax } 80105775: c9 leave 80105776: c3 ret 80105777: 89 f6 mov %esi,%esi 80105779: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105780 <cleanupsyslink>: void cleanupsyslink(struct inode * ip) { 80105780: 55 push %ebp 80105781: 89 e5 mov %esp,%ebp 80105783: 53 push %ebx 80105784: 83 ec 10 sub $0x10,%esp 80105787: 8b 5d 08 mov 0x8(%ebp),%ebx ilock(ip); 8010578a: 53 push %ebx 8010578b: e8 c0 c9 ff ff call 80102150 <ilock> ip->nlink--; 80105790: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 80105795: 89 1c 24 mov %ebx,(%esp) 80105798: e8 03 c9 ff ff call 801020a0 <iupdate> iunlockput(ip); 8010579d: 89 1c 24 mov %ebx,(%esp) 801057a0: e8 3b cc ff ff call 801023e0 <iunlockput> end_op(); 801057a5: 83 c4 10 add $0x10,%esp } 801057a8: 8b 5d fc mov -0x4(%ebp),%ebx 801057ab: c9 leave end_op(); 801057ac: e9 2f df ff ff jmp 801036e0 <end_op> 801057b1: eb 0d jmp 801057c0 <sys_link> 801057b3: 90 nop 801057b4: 90 nop 801057b5: 90 nop 801057b6: 90 nop 801057b7: 90 nop 801057b8: 90 nop 801057b9: 90 nop 801057ba: 90 nop 801057bb: 90 nop 801057bc: 90 nop 801057bd: 90 nop 801057be: 90 nop 801057bf: 90 nop 801057c0 <sys_link>: int sys_link(void) { 801057c0: 55 push %ebp 801057c1: 89 e5 mov %esp,%ebp 801057c3: 57 push %edi 801057c4: 56 push %esi 801057c5: 53 push %ebx if (argstr(0, &old) < 0 || argstr(1, &new) < 0) { 801057c6: 8d 45 d4 lea -0x2c(%ebp),%eax int sys_link(void) { 801057c9: 83 ec 34 sub $0x34,%esp if (argstr(0, &old) < 0 || argstr(1, &new) < 0) { 801057cc: 50 push %eax 801057cd: 6a 00 push $0x0 801057cf: e8 2c fb ff ff call 80105300 <argstr> 801057d4: 83 c4 10 add $0x10,%esp 801057d7: 85 c0 test %eax,%eax 801057d9: 0f 88 f1 00 00 00 js 801058d0 <sys_link+0x110> 801057df: 8d 45 d0 lea -0x30(%ebp),%eax 801057e2: 83 ec 08 sub $0x8,%esp 801057e5: 50 push %eax 801057e6: 6a 01 push $0x1 801057e8: e8 13 fb ff ff call 80105300 <argstr> 801057ed: 83 c4 10 add $0x10,%esp 801057f0: 85 c0 test %eax,%eax 801057f2: 0f 88 d8 00 00 00 js 801058d0 <sys_link+0x110> begin_op(); 801057f8: e8 73 de ff ff call 80103670 <begin_op> if ((ip = namei(old)) == 0) { 801057fd: 83 ec 0c sub $0xc,%esp 80105800: ff 75 d4 pushl -0x2c(%ebp) 80105803: e8 a8 d1 ff ff call 801029b0 <namei> 80105808: 83 c4 10 add $0x10,%esp 8010580b: 85 c0 test %eax,%eax 8010580d: 89 c3 mov %eax,%ebx 8010580f: 0f 84 da 00 00 00 je 801058ef <sys_link+0x12f> ilock(ip); 80105815: 83 ec 0c sub $0xc,%esp 80105818: 50 push %eax 80105819: e8 32 c9 ff ff call 80102150 <ilock> if (ip->type == T_DIR) { 8010581e: 83 c4 10 add $0x10,%esp 80105821: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105826: 0f 84 ab 00 00 00 je 801058d7 <sys_link+0x117> ip->nlink++; 8010582c: 66 83 43 56 01 addw $0x1,0x56(%ebx) iupdate(ip); 80105831: 83 ec 0c sub $0xc,%esp if ((dp = nameiparent(new, name)) == 0) { 80105834: 8d 7d da lea -0x26(%ebp),%edi iupdate(ip); 80105837: 53 push %ebx 80105838: e8 63 c8 ff ff call 801020a0 <iupdate> iunlock(ip); 8010583d: 89 1c 24 mov %ebx,(%esp) 80105840: e8 eb c9 ff ff call 80102230 <iunlock> if ((dp = nameiparent(new, name)) == 0) { 80105845: 58 pop %eax 80105846: 5a pop %edx 80105847: 57 push %edi 80105848: ff 75 d0 pushl -0x30(%ebp) 8010584b: e8 80 d1 ff ff call 801029d0 <nameiparent> 80105850: 83 c4 10 add $0x10,%esp 80105853: 85 c0 test %eax,%eax 80105855: 89 c6 mov %eax,%esi 80105857: 74 6a je 801058c3 <sys_link+0x103> ilock(dp); 80105859: 83 ec 0c sub $0xc,%esp 8010585c: 50 push %eax 8010585d: e8 ee c8 ff ff call 80102150 <ilock> if (dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0) { 80105862: 83 c4 10 add $0x10,%esp 80105865: 8b 03 mov (%ebx),%eax 80105867: 39 06 cmp %eax,(%esi) 80105869: 75 3d jne 801058a8 <sys_link+0xe8> 8010586b: 83 ec 04 sub $0x4,%esp 8010586e: ff 73 04 pushl 0x4(%ebx) 80105871: 57 push %edi 80105872: 56 push %esi 80105873: e8 78 d0 ff ff call 801028f0 <dirlink> 80105878: 83 c4 10 add $0x10,%esp 8010587b: 85 c0 test %eax,%eax 8010587d: 78 29 js 801058a8 <sys_link+0xe8> iunlockput(dp); 8010587f: 83 ec 0c sub $0xc,%esp 80105882: 56 push %esi 80105883: e8 58 cb ff ff call 801023e0 <iunlockput> iput(ip); 80105888: 89 1c 24 mov %ebx,(%esp) 8010588b: e8 f0 c9 ff ff call 80102280 <iput> end_op(); 80105890: e8 4b de ff ff call 801036e0 <end_op> return 0; 80105895: 83 c4 10 add $0x10,%esp 80105898: 31 c0 xor %eax,%eax } 8010589a: 8d 65 f4 lea -0xc(%ebp),%esp 8010589d: 5b pop %ebx 8010589e: 5e pop %esi 8010589f: 5f pop %edi 801058a0: 5d pop %ebp 801058a1: c3 ret 801058a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi iunlockput(dp); 801058a8: 83 ec 0c sub $0xc,%esp 801058ab: 56 push %esi 801058ac: e8 2f cb ff ff call 801023e0 <iunlockput> cleanupsyslink(ip); 801058b1: 89 1c 24 mov %ebx,(%esp) 801058b4: e8 c7 fe ff ff call 80105780 <cleanupsyslink> return -1; 801058b9: 83 c4 10 add $0x10,%esp 801058bc: b8 ff ff ff ff mov $0xffffffff,%eax 801058c1: eb d7 jmp 8010589a <sys_link+0xda> cleanupsyslink(ip); 801058c3: 83 ec 0c sub $0xc,%esp 801058c6: 53 push %ebx 801058c7: e8 b4 fe ff ff call 80105780 <cleanupsyslink> return -1; 801058cc: 83 c4 10 add $0x10,%esp 801058cf: 90 nop 801058d0: b8 ff ff ff ff mov $0xffffffff,%eax 801058d5: eb c3 jmp 8010589a <sys_link+0xda> iunlockput(ip); 801058d7: 83 ec 0c sub $0xc,%esp 801058da: 53 push %ebx 801058db: e8 00 cb ff ff call 801023e0 <iunlockput> end_op(); 801058e0: e8 fb dd ff ff call 801036e0 <end_op> return -1; 801058e5: 83 c4 10 add $0x10,%esp 801058e8: b8 ff ff ff ff mov $0xffffffff,%eax 801058ed: eb ab jmp 8010589a <sys_link+0xda> end_op(); 801058ef: e8 ec dd ff ff call 801036e0 <end_op> return -1; 801058f4: b8 ff ff ff ff mov $0xffffffff,%eax 801058f9: eb 9f jmp 8010589a <sys_link+0xda> 801058fb: 90 nop 801058fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105900 <sys_unlink>: int sys_unlink(void) { 80105900: 55 push %ebp 80105901: 89 e5 mov %esp,%ebp 80105903: 57 push %edi 80105904: 56 push %esi 80105905: 53 push %ebx if (argstr(0, &path) < 0) { 80105906: 8d 45 c0 lea -0x40(%ebp),%eax int sys_unlink(void) { 80105909: 83 ec 44 sub $0x44,%esp if (argstr(0, &path) < 0) { 8010590c: 50 push %eax 8010590d: 6a 00 push $0x0 8010590f: e8 ec f9 ff ff call 80105300 <argstr> 80105914: 83 c4 10 add $0x10,%esp 80105917: 85 c0 test %eax,%eax 80105919: 0f 88 52 01 00 00 js 80105a71 <sys_unlink+0x171> if ((dp = nameiparent(path, name)) == 0) { 8010591f: 8d 5d ca lea -0x36(%ebp),%ebx begin_op(); 80105922: e8 49 dd ff ff call 80103670 <begin_op> if ((dp = nameiparent(path, name)) == 0) { 80105927: 83 ec 08 sub $0x8,%esp 8010592a: 53 push %ebx 8010592b: ff 75 c0 pushl -0x40(%ebp) 8010592e: e8 9d d0 ff ff call 801029d0 <nameiparent> 80105933: 83 c4 10 add $0x10,%esp 80105936: 85 c0 test %eax,%eax 80105938: 89 c6 mov %eax,%esi 8010593a: 0f 84 7b 01 00 00 je 80105abb <sys_unlink+0x1bb> ilock(dp); 80105940: 83 ec 0c sub $0xc,%esp 80105943: 50 push %eax 80105944: e8 07 c8 ff ff call 80102150 <ilock> if (namecmp(name, ".") == 0 || namecmp(name, "..") == 0) { 80105949: 58 pop %eax 8010594a: 5a pop %edx 8010594b: 68 d4 82 10 80 push $0x801082d4 80105950: 53 push %ebx 80105951: e8 0a cd ff ff call 80102660 <namecmp> 80105956: 83 c4 10 add $0x10,%esp 80105959: 85 c0 test %eax,%eax 8010595b: 0f 84 3f 01 00 00 je 80105aa0 <sys_unlink+0x1a0> 80105961: 83 ec 08 sub $0x8,%esp 80105964: 68 d3 82 10 80 push $0x801082d3 80105969: 53 push %ebx 8010596a: e8 f1 cc ff ff call 80102660 <namecmp> 8010596f: 83 c4 10 add $0x10,%esp 80105972: 85 c0 test %eax,%eax 80105974: 0f 84 26 01 00 00 je 80105aa0 <sys_unlink+0x1a0> if ((ip = dirlookup(dp, name, &off)) == 0) { 8010597a: 8d 45 c4 lea -0x3c(%ebp),%eax 8010597d: 83 ec 04 sub $0x4,%esp 80105980: 50 push %eax 80105981: 53 push %ebx 80105982: 56 push %esi 80105983: e8 f8 cc ff ff call 80102680 <dirlookup> 80105988: 83 c4 10 add $0x10,%esp 8010598b: 85 c0 test %eax,%eax 8010598d: 89 c3 mov %eax,%ebx 8010598f: 0f 84 0b 01 00 00 je 80105aa0 <sys_unlink+0x1a0> ilock(ip); 80105995: 83 ec 0c sub $0xc,%esp 80105998: 50 push %eax 80105999: e8 b2 c7 ff ff call 80102150 <ilock> if (ip->nlink < 1) { 8010599e: 83 c4 10 add $0x10,%esp 801059a1: 66 83 7b 56 00 cmpw $0x0,0x56(%ebx) 801059a6: 0f 8e 2b 01 00 00 jle 80105ad7 <sys_unlink+0x1d7> if (ip->type == T_DIR && !isdirempty(ip)) { 801059ac: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 801059b1: 74 6d je 80105a20 <sys_unlink+0x120> memset(&de, 0, sizeof(de)); 801059b3: 8d 45 d8 lea -0x28(%ebp),%eax 801059b6: 83 ec 04 sub $0x4,%esp 801059b9: 6a 10 push $0x10 801059bb: 6a 00 push $0x0 801059bd: 50 push %eax 801059be: e8 8d f5 ff ff call 80104f50 <memset> if (writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) { 801059c3: 8d 45 d8 lea -0x28(%ebp),%eax 801059c6: 6a 10 push $0x10 801059c8: ff 75 c4 pushl -0x3c(%ebp) 801059cb: 50 push %eax 801059cc: 56 push %esi 801059cd: e8 5e cb ff ff call 80102530 <writei> 801059d2: 83 c4 20 add $0x20,%esp 801059d5: 83 f8 10 cmp $0x10,%eax 801059d8: 0f 85 06 01 00 00 jne 80105ae4 <sys_unlink+0x1e4> if (ip->type == T_DIR) { 801059de: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 801059e3: 0f 84 97 00 00 00 je 80105a80 <sys_unlink+0x180> iunlockput(dp); 801059e9: 83 ec 0c sub $0xc,%esp 801059ec: 56 push %esi 801059ed: e8 ee c9 ff ff call 801023e0 <iunlockput> ip->nlink--; 801059f2: 66 83 6b 56 01 subw $0x1,0x56(%ebx) iupdate(ip); 801059f7: 89 1c 24 mov %ebx,(%esp) 801059fa: e8 a1 c6 ff ff call 801020a0 <iupdate> iunlockput(ip); 801059ff: 89 1c 24 mov %ebx,(%esp) 80105a02: e8 d9 c9 ff ff call 801023e0 <iunlockput> end_op(); 80105a07: e8 d4 dc ff ff call 801036e0 <end_op> return 0; 80105a0c: 83 c4 10 add $0x10,%esp 80105a0f: 31 c0 xor %eax,%eax } 80105a11: 8d 65 f4 lea -0xc(%ebp),%esp 80105a14: 5b pop %ebx 80105a15: 5e pop %esi 80105a16: 5f pop %edi 80105a17: 5d pop %ebp 80105a18: c3 ret 80105a19: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for (off = 2 * sizeof(de); off < dp->size; off += sizeof(de)) { 80105a20: 83 7b 58 20 cmpl $0x20,0x58(%ebx) 80105a24: 76 8d jbe 801059b3 <sys_unlink+0xb3> 80105a26: bf 20 00 00 00 mov $0x20,%edi 80105a2b: eb 0f jmp 80105a3c <sys_unlink+0x13c> 80105a2d: 8d 76 00 lea 0x0(%esi),%esi 80105a30: 83 c7 10 add $0x10,%edi 80105a33: 3b 7b 58 cmp 0x58(%ebx),%edi 80105a36: 0f 83 77 ff ff ff jae 801059b3 <sys_unlink+0xb3> if (readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de)) { 80105a3c: 8d 45 d8 lea -0x28(%ebp),%eax 80105a3f: 6a 10 push $0x10 80105a41: 57 push %edi 80105a42: 50 push %eax 80105a43: 53 push %ebx 80105a44: e8 e7 c9 ff ff call 80102430 <readi> 80105a49: 83 c4 10 add $0x10,%esp 80105a4c: 83 f8 10 cmp $0x10,%eax 80105a4f: 75 79 jne 80105aca <sys_unlink+0x1ca> if (de.inum != 0) { 80105a51: 66 83 7d d8 00 cmpw $0x0,-0x28(%ebp) 80105a56: 74 d8 je 80105a30 <sys_unlink+0x130> iunlockput(ip); 80105a58: 83 ec 0c sub $0xc,%esp 80105a5b: 53 push %ebx 80105a5c: e8 7f c9 ff ff call 801023e0 <iunlockput> iunlockput(dp); 80105a61: 89 34 24 mov %esi,(%esp) 80105a64: e8 77 c9 ff ff call 801023e0 <iunlockput> end_op(); 80105a69: e8 72 dc ff ff call 801036e0 <end_op> return -1; 80105a6e: 83 c4 10 add $0x10,%esp } 80105a71: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80105a74: b8 ff ff ff ff mov $0xffffffff,%eax } 80105a79: 5b pop %ebx 80105a7a: 5e pop %esi 80105a7b: 5f pop %edi 80105a7c: 5d pop %ebp 80105a7d: c3 ret 80105a7e: 66 90 xchg %ax,%ax dp->nlink--; 80105a80: 66 83 6e 56 01 subw $0x1,0x56(%esi) iupdate(dp); 80105a85: 83 ec 0c sub $0xc,%esp 80105a88: 56 push %esi 80105a89: e8 12 c6 ff ff call 801020a0 <iupdate> 80105a8e: 83 c4 10 add $0x10,%esp 80105a91: e9 53 ff ff ff jmp 801059e9 <sys_unlink+0xe9> 80105a96: 8d 76 00 lea 0x0(%esi),%esi 80105a99: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(dp); 80105aa0: 83 ec 0c sub $0xc,%esp 80105aa3: 56 push %esi 80105aa4: e8 37 c9 ff ff call 801023e0 <iunlockput> end_op(); 80105aa9: e8 32 dc ff ff call 801036e0 <end_op> return -1; 80105aae: 83 c4 10 add $0x10,%esp 80105ab1: b8 ff ff ff ff mov $0xffffffff,%eax 80105ab6: e9 56 ff ff ff jmp 80105a11 <sys_unlink+0x111> end_op(); 80105abb: e8 20 dc ff ff call 801036e0 <end_op> return -1; 80105ac0: b8 ff ff ff ff mov $0xffffffff,%eax 80105ac5: e9 47 ff ff ff jmp 80105a11 <sys_unlink+0x111> panic("isdirempty: readi"); 80105aca: 83 ec 0c sub $0xc,%esp 80105acd: 68 f8 82 10 80 push $0x801082f8 80105ad2: e8 09 aa ff ff call 801004e0 <panic> panic("unlink: nlink < 1"); 80105ad7: 83 ec 0c sub $0xc,%esp 80105ada: 68 e6 82 10 80 push $0x801082e6 80105adf: e8 fc a9 ff ff call 801004e0 <panic> panic("unlink: writei"); 80105ae4: 83 ec 0c sub $0xc,%esp 80105ae7: 68 0a 83 10 80 push $0x8010830a 80105aec: e8 ef a9 ff ff call 801004e0 <panic> 80105af1: eb 0d jmp 80105b00 <sys_open> 80105af3: 90 nop 80105af4: 90 nop 80105af5: 90 nop 80105af6: 90 nop 80105af7: 90 nop 80105af8: 90 nop 80105af9: 90 nop 80105afa: 90 nop 80105afb: 90 nop 80105afc: 90 nop 80105afd: 90 nop 80105afe: 90 nop 80105aff: 90 nop 80105b00 <sys_open>: int sys_open(void) { 80105b00: 55 push %ebp 80105b01: 89 e5 mov %esp,%ebp 80105b03: 57 push %edi 80105b04: 56 push %esi 80105b05: 53 push %ebx char *path; int fd, omode; struct file *f; struct inode *ip; if (argstr(0, &path) < 0 || argint(1, &omode) < 0) { 80105b06: 8d 45 e0 lea -0x20(%ebp),%eax int sys_open(void) { 80105b09: 83 ec 24 sub $0x24,%esp if (argstr(0, &path) < 0 || argint(1, &omode) < 0) { 80105b0c: 50 push %eax 80105b0d: 6a 00 push $0x0 80105b0f: e8 ec f7 ff ff call 80105300 <argstr> 80105b14: 83 c4 10 add $0x10,%esp 80105b17: 85 c0 test %eax,%eax 80105b19: 0f 88 1d 01 00 00 js 80105c3c <sys_open+0x13c> 80105b1f: 8d 45 e4 lea -0x1c(%ebp),%eax 80105b22: 83 ec 08 sub $0x8,%esp 80105b25: 50 push %eax 80105b26: 6a 01 push $0x1 80105b28: e8 23 f7 ff ff call 80105250 <argint> 80105b2d: 83 c4 10 add $0x10,%esp 80105b30: 85 c0 test %eax,%eax 80105b32: 0f 88 04 01 00 00 js 80105c3c <sys_open+0x13c> return -1; } begin_op(); 80105b38: e8 33 db ff ff call 80103670 <begin_op> if (omode & O_CREATE) { 80105b3d: f6 45 e5 02 testb $0x2,-0x1b(%ebp) 80105b41: 0f 85 a9 00 00 00 jne 80105bf0 <sys_open+0xf0> end_op(); return -1; } } else { if ((ip = namei(path)) == 0) { 80105b47: 83 ec 0c sub $0xc,%esp 80105b4a: ff 75 e0 pushl -0x20(%ebp) 80105b4d: e8 5e ce ff ff call 801029b0 <namei> 80105b52: 83 c4 10 add $0x10,%esp 80105b55: 85 c0 test %eax,%eax 80105b57: 89 c6 mov %eax,%esi 80105b59: 0f 84 b2 00 00 00 je 80105c11 <sys_open+0x111> end_op(); return -1; } ilock(ip); 80105b5f: 83 ec 0c sub $0xc,%esp 80105b62: 50 push %eax 80105b63: e8 e8 c5 ff ff call 80102150 <ilock> if (ip->type == T_DIR && omode != O_RDONLY) { 80105b68: 83 c4 10 add $0x10,%esp 80105b6b: 66 83 7e 50 01 cmpw $0x1,0x50(%esi) 80105b70: 0f 84 aa 00 00 00 je 80105c20 <sys_open+0x120> end_op(); return -1; } } if ((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0) { 80105b76: e8 d5 bc ff ff call 80101850 <filealloc> 80105b7b: 85 c0 test %eax,%eax 80105b7d: 89 c7 mov %eax,%edi 80105b7f: 0f 84 a6 00 00 00 je 80105c2b <sys_open+0x12b> struct proc *curproc = myproc(); 80105b85: e8 56 e7 ff ff call 801042e0 <myproc> for (fd = 0; fd < NOFILE; fd++) { 80105b8a: 31 db xor %ebx,%ebx 80105b8c: eb 0e jmp 80105b9c <sys_open+0x9c> 80105b8e: 66 90 xchg %ax,%ax 80105b90: 83 c3 01 add $0x1,%ebx 80105b93: 83 fb 10 cmp $0x10,%ebx 80105b96: 0f 84 ac 00 00 00 je 80105c48 <sys_open+0x148> if (curproc->ofile[fd] == 0) { 80105b9c: 8b 54 98 28 mov 0x28(%eax,%ebx,4),%edx 80105ba0: 85 d2 test %edx,%edx 80105ba2: 75 ec jne 80105b90 <sys_open+0x90> } iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105ba4: 83 ec 0c sub $0xc,%esp curproc->ofile[fd] = f; 80105ba7: 89 7c 98 28 mov %edi,0x28(%eax,%ebx,4) iunlock(ip); 80105bab: 56 push %esi 80105bac: e8 7f c6 ff ff call 80102230 <iunlock> end_op(); 80105bb1: e8 2a db ff ff call 801036e0 <end_op> f->type = FD_INODE; 80105bb6: c7 07 02 00 00 00 movl $0x2,(%edi) f->ip = ip; f->off = 0; f->readable = !(omode & O_WRONLY); 80105bbc: 8b 55 e4 mov -0x1c(%ebp),%edx f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105bbf: 83 c4 10 add $0x10,%esp f->ip = ip; 80105bc2: 89 77 10 mov %esi,0x10(%edi) f->off = 0; 80105bc5: c7 47 14 00 00 00 00 movl $0x0,0x14(%edi) f->readable = !(omode & O_WRONLY); 80105bcc: 89 d0 mov %edx,%eax 80105bce: f7 d0 not %eax 80105bd0: 83 e0 01 and $0x1,%eax f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105bd3: 83 e2 03 and $0x3,%edx f->readable = !(omode & O_WRONLY); 80105bd6: 88 47 08 mov %al,0x8(%edi) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80105bd9: 0f 95 47 09 setne 0x9(%edi) return fd; } 80105bdd: 8d 65 f4 lea -0xc(%ebp),%esp 80105be0: 89 d8 mov %ebx,%eax 80105be2: 5b pop %ebx 80105be3: 5e pop %esi 80105be4: 5f pop %edi 80105be5: 5d pop %ebp 80105be6: c3 ret 80105be7: 89 f6 mov %esi,%esi 80105be9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi ip = create(path, T_FILE, 0, 0); 80105bf0: 83 ec 0c sub $0xc,%esp 80105bf3: 8b 45 e0 mov -0x20(%ebp),%eax 80105bf6: 31 c9 xor %ecx,%ecx 80105bf8: 6a 00 push $0x0 80105bfa: ba 02 00 00 00 mov $0x2,%edx 80105bff: e8 9c f7 ff ff call 801053a0 <create> if (ip == 0) { 80105c04: 83 c4 10 add $0x10,%esp 80105c07: 85 c0 test %eax,%eax ip = create(path, T_FILE, 0, 0); 80105c09: 89 c6 mov %eax,%esi if (ip == 0) { 80105c0b: 0f 85 65 ff ff ff jne 80105b76 <sys_open+0x76> end_op(); 80105c11: e8 ca da ff ff call 801036e0 <end_op> return -1; 80105c16: bb ff ff ff ff mov $0xffffffff,%ebx 80105c1b: eb c0 jmp 80105bdd <sys_open+0xdd> 80105c1d: 8d 76 00 lea 0x0(%esi),%esi if (ip->type == T_DIR && omode != O_RDONLY) { 80105c20: 8b 4d e4 mov -0x1c(%ebp),%ecx 80105c23: 85 c9 test %ecx,%ecx 80105c25: 0f 84 4b ff ff ff je 80105b76 <sys_open+0x76> iunlockput(ip); 80105c2b: 83 ec 0c sub $0xc,%esp 80105c2e: 56 push %esi 80105c2f: e8 ac c7 ff ff call 801023e0 <iunlockput> end_op(); 80105c34: e8 a7 da ff ff call 801036e0 <end_op> return -1; 80105c39: 83 c4 10 add $0x10,%esp 80105c3c: bb ff ff ff ff mov $0xffffffff,%ebx 80105c41: eb 9a jmp 80105bdd <sys_open+0xdd> 80105c43: 90 nop 80105c44: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi fileclose(f); 80105c48: 83 ec 0c sub $0xc,%esp 80105c4b: 57 push %edi 80105c4c: e8 bf bc ff ff call 80101910 <fileclose> 80105c51: 83 c4 10 add $0x10,%esp 80105c54: eb d5 jmp 80105c2b <sys_open+0x12b> 80105c56: 8d 76 00 lea 0x0(%esi),%esi 80105c59: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80105c60 <sys_mkdir>: int sys_mkdir(void) { 80105c60: 55 push %ebp 80105c61: 89 e5 mov %esp,%ebp 80105c63: 83 ec 18 sub $0x18,%esp char *path; struct inode *ip; begin_op(); 80105c66: e8 05 da ff ff call 80103670 <begin_op> if (argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0) { 80105c6b: 8d 45 f4 lea -0xc(%ebp),%eax 80105c6e: 83 ec 08 sub $0x8,%esp 80105c71: 50 push %eax 80105c72: 6a 00 push $0x0 80105c74: e8 87 f6 ff ff call 80105300 <argstr> 80105c79: 83 c4 10 add $0x10,%esp 80105c7c: 85 c0 test %eax,%eax 80105c7e: 78 30 js 80105cb0 <sys_mkdir+0x50> 80105c80: 83 ec 0c sub $0xc,%esp 80105c83: 8b 45 f4 mov -0xc(%ebp),%eax 80105c86: 31 c9 xor %ecx,%ecx 80105c88: 6a 00 push $0x0 80105c8a: ba 01 00 00 00 mov $0x1,%edx 80105c8f: e8 0c f7 ff ff call 801053a0 <create> 80105c94: 83 c4 10 add $0x10,%esp 80105c97: 85 c0 test %eax,%eax 80105c99: 74 15 je 80105cb0 <sys_mkdir+0x50> end_op(); return -1; } iunlockput(ip); 80105c9b: 83 ec 0c sub $0xc,%esp 80105c9e: 50 push %eax 80105c9f: e8 3c c7 ff ff call 801023e0 <iunlockput> end_op(); 80105ca4: e8 37 da ff ff call 801036e0 <end_op> return 0; 80105ca9: 83 c4 10 add $0x10,%esp 80105cac: 31 c0 xor %eax,%eax } 80105cae: c9 leave 80105caf: c3 ret end_op(); 80105cb0: e8 2b da ff ff call 801036e0 <end_op> return -1; 80105cb5: b8 ff ff ff ff mov $0xffffffff,%eax } 80105cba: c9 leave 80105cbb: c3 ret 80105cbc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105cc0 <sys_mknod>: int sys_mknod(void) { 80105cc0: 55 push %ebp 80105cc1: 89 e5 mov %esp,%ebp 80105cc3: 83 ec 18 sub $0x18,%esp struct inode *ip; char *path; int major, minor; begin_op(); 80105cc6: e8 a5 d9 ff ff call 80103670 <begin_op> if ((argstr(0, &path)) < 0 || 80105ccb: 8d 45 ec lea -0x14(%ebp),%eax 80105cce: 83 ec 08 sub $0x8,%esp 80105cd1: 50 push %eax 80105cd2: 6a 00 push $0x0 80105cd4: e8 27 f6 ff ff call 80105300 <argstr> 80105cd9: 83 c4 10 add $0x10,%esp 80105cdc: 85 c0 test %eax,%eax 80105cde: 78 60 js 80105d40 <sys_mknod+0x80> argint(1, &major) < 0 || 80105ce0: 8d 45 f0 lea -0x10(%ebp),%eax 80105ce3: 83 ec 08 sub $0x8,%esp 80105ce6: 50 push %eax 80105ce7: 6a 01 push $0x1 80105ce9: e8 62 f5 ff ff call 80105250 <argint> if ((argstr(0, &path)) < 0 || 80105cee: 83 c4 10 add $0x10,%esp 80105cf1: 85 c0 test %eax,%eax 80105cf3: 78 4b js 80105d40 <sys_mknod+0x80> argint(2, &minor) < 0 || 80105cf5: 8d 45 f4 lea -0xc(%ebp),%eax 80105cf8: 83 ec 08 sub $0x8,%esp 80105cfb: 50 push %eax 80105cfc: 6a 02 push $0x2 80105cfe: e8 4d f5 ff ff call 80105250 <argint> argint(1, &major) < 0 || 80105d03: 83 c4 10 add $0x10,%esp 80105d06: 85 c0 test %eax,%eax 80105d08: 78 36 js 80105d40 <sys_mknod+0x80> (ip = create(path, T_DEV, major, minor)) == 0) { 80105d0a: 0f bf 45 f4 movswl -0xc(%ebp),%eax argint(2, &minor) < 0 || 80105d0e: 83 ec 0c sub $0xc,%esp (ip = create(path, T_DEV, major, minor)) == 0) { 80105d11: 0f bf 4d f0 movswl -0x10(%ebp),%ecx argint(2, &minor) < 0 || 80105d15: ba 03 00 00 00 mov $0x3,%edx 80105d1a: 50 push %eax 80105d1b: 8b 45 ec mov -0x14(%ebp),%eax 80105d1e: e8 7d f6 ff ff call 801053a0 <create> 80105d23: 83 c4 10 add $0x10,%esp 80105d26: 85 c0 test %eax,%eax 80105d28: 74 16 je 80105d40 <sys_mknod+0x80> end_op(); return -1; } iunlockput(ip); 80105d2a: 83 ec 0c sub $0xc,%esp 80105d2d: 50 push %eax 80105d2e: e8 ad c6 ff ff call 801023e0 <iunlockput> end_op(); 80105d33: e8 a8 d9 ff ff call 801036e0 <end_op> return 0; 80105d38: 83 c4 10 add $0x10,%esp 80105d3b: 31 c0 xor %eax,%eax } 80105d3d: c9 leave 80105d3e: c3 ret 80105d3f: 90 nop end_op(); 80105d40: e8 9b d9 ff ff call 801036e0 <end_op> return -1; 80105d45: b8 ff ff ff ff mov $0xffffffff,%eax } 80105d4a: c9 leave 80105d4b: c3 ret 80105d4c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105d50 <sys_chdir>: int sys_chdir(void) { 80105d50: 55 push %ebp 80105d51: 89 e5 mov %esp,%ebp 80105d53: 56 push %esi 80105d54: 53 push %ebx 80105d55: 83 ec 10 sub $0x10,%esp char *path; struct inode *ip; struct proc *curproc = myproc(); 80105d58: e8 83 e5 ff ff call 801042e0 <myproc> 80105d5d: 89 c6 mov %eax,%esi begin_op(); 80105d5f: e8 0c d9 ff ff call 80103670 <begin_op> if (argstr(0, &path) < 0 || (ip = namei(path)) == 0) { 80105d64: 8d 45 f4 lea -0xc(%ebp),%eax 80105d67: 83 ec 08 sub $0x8,%esp 80105d6a: 50 push %eax 80105d6b: 6a 00 push $0x0 80105d6d: e8 8e f5 ff ff call 80105300 <argstr> 80105d72: 83 c4 10 add $0x10,%esp 80105d75: 85 c0 test %eax,%eax 80105d77: 78 77 js 80105df0 <sys_chdir+0xa0> 80105d79: 83 ec 0c sub $0xc,%esp 80105d7c: ff 75 f4 pushl -0xc(%ebp) 80105d7f: e8 2c cc ff ff call 801029b0 <namei> 80105d84: 83 c4 10 add $0x10,%esp 80105d87: 85 c0 test %eax,%eax 80105d89: 89 c3 mov %eax,%ebx 80105d8b: 74 63 je 80105df0 <sys_chdir+0xa0> end_op(); return -1; } ilock(ip); 80105d8d: 83 ec 0c sub $0xc,%esp 80105d90: 50 push %eax 80105d91: e8 ba c3 ff ff call 80102150 <ilock> if (ip->type != T_DIR) { 80105d96: 83 c4 10 add $0x10,%esp 80105d99: 66 83 7b 50 01 cmpw $0x1,0x50(%ebx) 80105d9e: 75 30 jne 80105dd0 <sys_chdir+0x80> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80105da0: 83 ec 0c sub $0xc,%esp 80105da3: 53 push %ebx 80105da4: e8 87 c4 ff ff call 80102230 <iunlock> iput(curproc->cwd); 80105da9: 58 pop %eax 80105daa: ff 76 68 pushl 0x68(%esi) 80105dad: e8 ce c4 ff ff call 80102280 <iput> end_op(); 80105db2: e8 29 d9 ff ff call 801036e0 <end_op> curproc->cwd = ip; 80105db7: 89 5e 68 mov %ebx,0x68(%esi) return 0; 80105dba: 83 c4 10 add $0x10,%esp 80105dbd: 31 c0 xor %eax,%eax } 80105dbf: 8d 65 f8 lea -0x8(%ebp),%esp 80105dc2: 5b pop %ebx 80105dc3: 5e pop %esi 80105dc4: 5d pop %ebp 80105dc5: c3 ret 80105dc6: 8d 76 00 lea 0x0(%esi),%esi 80105dc9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi iunlockput(ip); 80105dd0: 83 ec 0c sub $0xc,%esp 80105dd3: 53 push %ebx 80105dd4: e8 07 c6 ff ff call 801023e0 <iunlockput> end_op(); 80105dd9: e8 02 d9 ff ff call 801036e0 <end_op> return -1; 80105dde: 83 c4 10 add $0x10,%esp 80105de1: b8 ff ff ff ff mov $0xffffffff,%eax 80105de6: eb d7 jmp 80105dbf <sys_chdir+0x6f> 80105de8: 90 nop 80105de9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi end_op(); 80105df0: e8 eb d8 ff ff call 801036e0 <end_op> return -1; 80105df5: b8 ff ff ff ff mov $0xffffffff,%eax 80105dfa: eb c3 jmp 80105dbf <sys_chdir+0x6f> 80105dfc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105e00 <sys_exec>: int sys_exec(void) { 80105e00: 55 push %ebp 80105e01: 89 e5 mov %esp,%ebp 80105e03: 57 push %edi 80105e04: 56 push %esi 80105e05: 53 push %ebx char *path, *argv[MAXARG]; int i; uint uargv, uarg; if (argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0) { 80105e06: 8d 85 5c ff ff ff lea -0xa4(%ebp),%eax int sys_exec(void) { 80105e0c: 81 ec a4 00 00 00 sub $0xa4,%esp if (argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0) { 80105e12: 50 push %eax 80105e13: 6a 00 push $0x0 80105e15: e8 e6 f4 ff ff call 80105300 <argstr> 80105e1a: 83 c4 10 add $0x10,%esp 80105e1d: 85 c0 test %eax,%eax 80105e1f: 0f 88 87 00 00 00 js 80105eac <sys_exec+0xac> 80105e25: 8d 85 60 ff ff ff lea -0xa0(%ebp),%eax 80105e2b: 83 ec 08 sub $0x8,%esp 80105e2e: 50 push %eax 80105e2f: 6a 01 push $0x1 80105e31: e8 1a f4 ff ff call 80105250 <argint> 80105e36: 83 c4 10 add $0x10,%esp 80105e39: 85 c0 test %eax,%eax 80105e3b: 78 6f js 80105eac <sys_exec+0xac> return -1; } memset(argv, 0, sizeof(argv)); 80105e3d: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105e43: 83 ec 04 sub $0x4,%esp for (i = 0;; i++) { 80105e46: 31 db xor %ebx,%ebx memset(argv, 0, sizeof(argv)); 80105e48: 68 80 00 00 00 push $0x80 80105e4d: 6a 00 push $0x0 80105e4f: 8d bd 64 ff ff ff lea -0x9c(%ebp),%edi 80105e55: 50 push %eax 80105e56: e8 f5 f0 ff ff call 80104f50 <memset> 80105e5b: 83 c4 10 add $0x10,%esp 80105e5e: eb 2c jmp 80105e8c <sys_exec+0x8c> return -1; } if (fetchint(uargv + 4 * i, (int*)&uarg) < 0) { return -1; } if (uarg == 0) { 80105e60: 8b 85 64 ff ff ff mov -0x9c(%ebp),%eax 80105e66: 85 c0 test %eax,%eax 80105e68: 74 56 je 80105ec0 <sys_exec+0xc0> argv[i] = 0; break; } if (fetchstr(uarg, &argv[i]) < 0) { 80105e6a: 8d 8d 68 ff ff ff lea -0x98(%ebp),%ecx 80105e70: 83 ec 08 sub $0x8,%esp 80105e73: 8d 14 31 lea (%ecx,%esi,1),%edx 80105e76: 52 push %edx 80105e77: 50 push %eax 80105e78: e8 63 f3 ff ff call 801051e0 <fetchstr> 80105e7d: 83 c4 10 add $0x10,%esp 80105e80: 85 c0 test %eax,%eax 80105e82: 78 28 js 80105eac <sys_exec+0xac> for (i = 0;; i++) { 80105e84: 83 c3 01 add $0x1,%ebx if (i >= NELEM(argv)) { 80105e87: 83 fb 20 cmp $0x20,%ebx 80105e8a: 74 20 je 80105eac <sys_exec+0xac> if (fetchint(uargv + 4 * i, (int*)&uarg) < 0) { 80105e8c: 8b 85 60 ff ff ff mov -0xa0(%ebp),%eax 80105e92: 8d 34 9d 00 00 00 00 lea 0x0(,%ebx,4),%esi 80105e99: 83 ec 08 sub $0x8,%esp 80105e9c: 57 push %edi 80105e9d: 01 f0 add %esi,%eax 80105e9f: 50 push %eax 80105ea0: e8 fb f2 ff ff call 801051a0 <fetchint> 80105ea5: 83 c4 10 add $0x10,%esp 80105ea8: 85 c0 test %eax,%eax 80105eaa: 79 b4 jns 80105e60 <sys_exec+0x60> return -1; } } return exec(path, argv); } 80105eac: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80105eaf: b8 ff ff ff ff mov $0xffffffff,%eax } 80105eb4: 5b pop %ebx 80105eb5: 5e pop %esi 80105eb6: 5f pop %edi 80105eb7: 5d pop %ebp 80105eb8: c3 ret 80105eb9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return exec(path, argv); 80105ec0: 8d 85 68 ff ff ff lea -0x98(%ebp),%eax 80105ec6: 83 ec 08 sub $0x8,%esp argv[i] = 0; 80105ec9: c7 84 9d 68 ff ff ff movl $0x0,-0x98(%ebp,%ebx,4) 80105ed0: 00 00 00 00 return exec(path, argv); 80105ed4: 50 push %eax 80105ed5: ff b5 5c ff ff ff pushl -0xa4(%ebp) 80105edb: e8 d0 b5 ff ff call 801014b0 <exec> 80105ee0: 83 c4 10 add $0x10,%esp } 80105ee3: 8d 65 f4 lea -0xc(%ebp),%esp 80105ee6: 5b pop %ebx 80105ee7: 5e pop %esi 80105ee8: 5f pop %edi 80105ee9: 5d pop %ebp 80105eea: c3 ret 80105eeb: 90 nop 80105eec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105ef0 <sys_pipe>: int sys_pipe(void) { 80105ef0: 55 push %ebp 80105ef1: 89 e5 mov %esp,%ebp 80105ef3: 57 push %edi 80105ef4: 56 push %esi 80105ef5: 53 push %ebx int *fd; struct file *rf, *wf; int fd0, fd1; if (argptr(0, (void*)&fd, 2 * sizeof(fd[0])) < 0) { 80105ef6: 8d 45 dc lea -0x24(%ebp),%eax int sys_pipe(void) { 80105ef9: 83 ec 20 sub $0x20,%esp if (argptr(0, (void*)&fd, 2 * sizeof(fd[0])) < 0) { 80105efc: 6a 08 push $0x8 80105efe: 50 push %eax 80105eff: 6a 00 push $0x0 80105f01: e8 9a f3 ff ff call 801052a0 <argptr> 80105f06: 83 c4 10 add $0x10,%esp 80105f09: 85 c0 test %eax,%eax 80105f0b: 0f 88 ae 00 00 00 js 80105fbf <sys_pipe+0xcf> return -1; } if (pipealloc(&rf, &wf) < 0) { 80105f11: 8d 45 e4 lea -0x1c(%ebp),%eax 80105f14: 83 ec 08 sub $0x8,%esp 80105f17: 50 push %eax 80105f18: 8d 45 e0 lea -0x20(%ebp),%eax 80105f1b: 50 push %eax 80105f1c: e8 3f de ff ff call 80103d60 <pipealloc> 80105f21: 83 c4 10 add $0x10,%esp 80105f24: 85 c0 test %eax,%eax 80105f26: 0f 88 93 00 00 00 js 80105fbf <sys_pipe+0xcf> return -1; } fd0 = -1; if ((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0) { 80105f2c: 8b 7d e0 mov -0x20(%ebp),%edi for (fd = 0; fd < NOFILE; fd++) { 80105f2f: 31 db xor %ebx,%ebx struct proc *curproc = myproc(); 80105f31: e8 aa e3 ff ff call 801042e0 <myproc> 80105f36: eb 10 jmp 80105f48 <sys_pipe+0x58> 80105f38: 90 nop 80105f39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for (fd = 0; fd < NOFILE; fd++) { 80105f40: 83 c3 01 add $0x1,%ebx 80105f43: 83 fb 10 cmp $0x10,%ebx 80105f46: 74 60 je 80105fa8 <sys_pipe+0xb8> if (curproc->ofile[fd] == 0) { 80105f48: 8b 74 98 28 mov 0x28(%eax,%ebx,4),%esi 80105f4c: 85 f6 test %esi,%esi 80105f4e: 75 f0 jne 80105f40 <sys_pipe+0x50> curproc->ofile[fd] = f; 80105f50: 8d 73 08 lea 0x8(%ebx),%esi 80105f53: 89 7c b0 08 mov %edi,0x8(%eax,%esi,4) if ((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0) { 80105f57: 8b 7d e4 mov -0x1c(%ebp),%edi struct proc *curproc = myproc(); 80105f5a: e8 81 e3 ff ff call 801042e0 <myproc> for (fd = 0; fd < NOFILE; fd++) { 80105f5f: 31 d2 xor %edx,%edx 80105f61: eb 0d jmp 80105f70 <sys_pipe+0x80> 80105f63: 90 nop 80105f64: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80105f68: 83 c2 01 add $0x1,%edx 80105f6b: 83 fa 10 cmp $0x10,%edx 80105f6e: 74 28 je 80105f98 <sys_pipe+0xa8> if (curproc->ofile[fd] == 0) { 80105f70: 8b 4c 90 28 mov 0x28(%eax,%edx,4),%ecx 80105f74: 85 c9 test %ecx,%ecx 80105f76: 75 f0 jne 80105f68 <sys_pipe+0x78> curproc->ofile[fd] = f; 80105f78: 89 7c 90 28 mov %edi,0x28(%eax,%edx,4) } fileclose(rf); fileclose(wf); return -1; } fd[0] = fd0; 80105f7c: 8b 45 dc mov -0x24(%ebp),%eax 80105f7f: 89 18 mov %ebx,(%eax) fd[1] = fd1; 80105f81: 8b 45 dc mov -0x24(%ebp),%eax 80105f84: 89 50 04 mov %edx,0x4(%eax) return 0; 80105f87: 31 c0 xor %eax,%eax } 80105f89: 8d 65 f4 lea -0xc(%ebp),%esp 80105f8c: 5b pop %ebx 80105f8d: 5e pop %esi 80105f8e: 5f pop %edi 80105f8f: 5d pop %ebp 80105f90: c3 ret 80105f91: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi myproc()->ofile[fd0] = 0; 80105f98: e8 43 e3 ff ff call 801042e0 <myproc> 80105f9d: c7 44 b0 08 00 00 00 movl $0x0,0x8(%eax,%esi,4) 80105fa4: 00 80105fa5: 8d 76 00 lea 0x0(%esi),%esi fileclose(rf); 80105fa8: 83 ec 0c sub $0xc,%esp 80105fab: ff 75 e0 pushl -0x20(%ebp) 80105fae: e8 5d b9 ff ff call 80101910 <fileclose> fileclose(wf); 80105fb3: 58 pop %eax 80105fb4: ff 75 e4 pushl -0x1c(%ebp) 80105fb7: e8 54 b9 ff ff call 80101910 <fileclose> return -1; 80105fbc: 83 c4 10 add $0x10,%esp 80105fbf: b8 ff ff ff ff mov $0xffffffff,%eax 80105fc4: eb c3 jmp 80105f89 <sys_pipe+0x99> 80105fc6: 66 90 xchg %ax,%ax 80105fc8: 66 90 xchg %ax,%ax 80105fca: 66 90 xchg %ax,%ax 80105fcc: 66 90 xchg %ax,%ax 80105fce: 66 90 xchg %ax,%ax 80105fd0 <sys_fork>: #include "param.h" #include "memlayout.h" #include "mmu.h" #include "proc.h" int sys_fork(void) { 80105fd0: 55 push %ebp 80105fd1: 89 e5 mov %esp,%ebp return fork(); } 80105fd3: 5d pop %ebp return fork(); 80105fd4: e9 a7 e4 ff ff jmp 80104480 <fork> 80105fd9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80105fe0 <sys_exit>: int sys_exit(void) { 80105fe0: 55 push %ebp 80105fe1: 89 e5 mov %esp,%ebp 80105fe3: 83 ec 08 sub $0x8,%esp exit(); 80105fe6: e8 15 e7 ff ff call 80104700 <exit> return 0; // not reached } 80105feb: 31 c0 xor %eax,%eax 80105fed: c9 leave 80105fee: c3 ret 80105fef: 90 nop 80105ff0 <sys_wait>: int sys_wait(void) { 80105ff0: 55 push %ebp 80105ff1: 89 e5 mov %esp,%ebp return wait(); } 80105ff3: 5d pop %ebp return wait(); 80105ff4: e9 47 e9 ff ff jmp 80104940 <wait> 80105ff9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106000 <sys_kill>: int sys_kill(void) { 80106000: 55 push %ebp 80106001: 89 e5 mov %esp,%ebp 80106003: 83 ec 20 sub $0x20,%esp int pid; if (argint(0, &pid) < 0) { 80106006: 8d 45 f4 lea -0xc(%ebp),%eax 80106009: 50 push %eax 8010600a: 6a 00 push $0x0 8010600c: e8 3f f2 ff ff call 80105250 <argint> 80106011: 83 c4 10 add $0x10,%esp 80106014: 85 c0 test %eax,%eax 80106016: 78 18 js 80106030 <sys_kill+0x30> return -1; } return kill(pid); 80106018: 83 ec 0c sub $0xc,%esp 8010601b: ff 75 f4 pushl -0xc(%ebp) 8010601e: e8 6d ea ff ff call 80104a90 <kill> 80106023: 83 c4 10 add $0x10,%esp } 80106026: c9 leave 80106027: c3 ret 80106028: 90 nop 80106029: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80106030: b8 ff ff ff ff mov $0xffffffff,%eax } 80106035: c9 leave 80106036: c3 ret 80106037: 89 f6 mov %esi,%esi 80106039: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106040 <sys_getpid>: int sys_getpid(void) { 80106040: 55 push %ebp 80106041: 89 e5 mov %esp,%ebp 80106043: 83 ec 08 sub $0x8,%esp return myproc()->pid; 80106046: e8 95 e2 ff ff call 801042e0 <myproc> 8010604b: 8b 40 10 mov 0x10(%eax),%eax } 8010604e: c9 leave 8010604f: c3 ret 80106050 <sys_sbrk>: int sys_sbrk(void) { 80106050: 55 push %ebp 80106051: 89 e5 mov %esp,%ebp 80106053: 53 push %ebx int addr; int n; if (argint(0, &n) < 0) { 80106054: 8d 45 f4 lea -0xc(%ebp),%eax int sys_sbrk(void) { 80106057: 83 ec 1c sub $0x1c,%esp if (argint(0, &n) < 0) { 8010605a: 50 push %eax 8010605b: 6a 00 push $0x0 8010605d: e8 ee f1 ff ff call 80105250 <argint> 80106062: 83 c4 10 add $0x10,%esp 80106065: 85 c0 test %eax,%eax 80106067: 78 27 js 80106090 <sys_sbrk+0x40> return -1; } addr = myproc()->sz; 80106069: e8 72 e2 ff ff call 801042e0 <myproc> if (growproc(n) < 0) { 8010606e: 83 ec 0c sub $0xc,%esp addr = myproc()->sz; 80106071: 8b 18 mov (%eax),%ebx if (growproc(n) < 0) { 80106073: ff 75 f4 pushl -0xc(%ebp) 80106076: e8 85 e3 ff ff call 80104400 <growproc> 8010607b: 83 c4 10 add $0x10,%esp 8010607e: 85 c0 test %eax,%eax 80106080: 78 0e js 80106090 <sys_sbrk+0x40> return -1; } return addr; } 80106082: 89 d8 mov %ebx,%eax 80106084: 8b 5d fc mov -0x4(%ebp),%ebx 80106087: c9 leave 80106088: c3 ret 80106089: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 80106090: bb ff ff ff ff mov $0xffffffff,%ebx 80106095: eb eb jmp 80106082 <sys_sbrk+0x32> 80106097: 89 f6 mov %esi,%esi 80106099: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801060a0 <sys_sleep>: int sys_sleep(void) { 801060a0: 55 push %ebp 801060a1: 89 e5 mov %esp,%ebp 801060a3: 53 push %ebx int n; uint ticks0; if (argint(0, &n) < 0) { 801060a4: 8d 45 f4 lea -0xc(%ebp),%eax int sys_sleep(void) { 801060a7: 83 ec 1c sub $0x1c,%esp if (argint(0, &n) < 0) { 801060aa: 50 push %eax 801060ab: 6a 00 push $0x0 801060ad: e8 9e f1 ff ff call 80105250 <argint> 801060b2: 83 c4 10 add $0x10,%esp 801060b5: 85 c0 test %eax,%eax 801060b7: 0f 88 8a 00 00 00 js 80106147 <sys_sleep+0xa7> return -1; } acquire(&tickslock); 801060bd: 83 ec 0c sub $0xc,%esp 801060c0: 68 40 74 11 80 push $0x80117440 801060c5: e8 76 ed ff ff call 80104e40 <acquire> ticks0 = ticks; while (ticks - ticks0 < n) { 801060ca: 8b 55 f4 mov -0xc(%ebp),%edx 801060cd: 83 c4 10 add $0x10,%esp ticks0 = ticks; 801060d0: 8b 1d 80 7c 11 80 mov 0x80117c80,%ebx while (ticks - ticks0 < n) { 801060d6: 85 d2 test %edx,%edx 801060d8: 75 27 jne 80106101 <sys_sleep+0x61> 801060da: eb 54 jmp 80106130 <sys_sleep+0x90> 801060dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi if (myproc()->killed) { release(&tickslock); return -1; } sleep(&ticks, &tickslock); 801060e0: 83 ec 08 sub $0x8,%esp 801060e3: 68 40 74 11 80 push $0x80117440 801060e8: 68 80 7c 11 80 push $0x80117c80 801060ed: e8 8e e7 ff ff call 80104880 <sleep> while (ticks - ticks0 < n) { 801060f2: a1 80 7c 11 80 mov 0x80117c80,%eax 801060f7: 83 c4 10 add $0x10,%esp 801060fa: 29 d8 sub %ebx,%eax 801060fc: 3b 45 f4 cmp -0xc(%ebp),%eax 801060ff: 73 2f jae 80106130 <sys_sleep+0x90> if (myproc()->killed) { 80106101: e8 da e1 ff ff call 801042e0 <myproc> 80106106: 8b 40 24 mov 0x24(%eax),%eax 80106109: 85 c0 test %eax,%eax 8010610b: 74 d3 je 801060e0 <sys_sleep+0x40> release(&tickslock); 8010610d: 83 ec 0c sub $0xc,%esp 80106110: 68 40 74 11 80 push $0x80117440 80106115: e8 e6 ed ff ff call 80104f00 <release> return -1; 8010611a: 83 c4 10 add $0x10,%esp 8010611d: b8 ff ff ff ff mov $0xffffffff,%eax } release(&tickslock); return 0; } 80106122: 8b 5d fc mov -0x4(%ebp),%ebx 80106125: c9 leave 80106126: c3 ret 80106127: 89 f6 mov %esi,%esi 80106129: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi release(&tickslock); 80106130: 83 ec 0c sub $0xc,%esp 80106133: 68 40 74 11 80 push $0x80117440 80106138: e8 c3 ed ff ff call 80104f00 <release> return 0; 8010613d: 83 c4 10 add $0x10,%esp 80106140: 31 c0 xor %eax,%eax } 80106142: 8b 5d fc mov -0x4(%ebp),%ebx 80106145: c9 leave 80106146: c3 ret return -1; 80106147: b8 ff ff ff ff mov $0xffffffff,%eax 8010614c: eb f4 jmp 80106142 <sys_sleep+0xa2> 8010614e: 66 90 xchg %ax,%ax 80106150 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. int sys_uptime(void) { 80106150: 55 push %ebp 80106151: 89 e5 mov %esp,%ebp 80106153: 53 push %ebx 80106154: 83 ec 10 sub $0x10,%esp uint xticks; acquire(&tickslock); 80106157: 68 40 74 11 80 push $0x80117440 8010615c: e8 df ec ff ff call 80104e40 <acquire> xticks = ticks; 80106161: 8b 1d 80 7c 11 80 mov 0x80117c80,%ebx release(&tickslock); 80106167: c7 04 24 40 74 11 80 movl $0x80117440,(%esp) 8010616e: e8 8d ed ff ff call 80104f00 <release> return xticks; } 80106173: 89 d8 mov %ebx,%eax 80106175: 8b 5d fc mov -0x4(%ebp),%ebx 80106178: c9 leave 80106179: c3 ret 8010617a: 66 90 xchg %ax,%ax 8010617c: 66 90 xchg %ax,%ax 8010617e: 66 90 xchg %ax,%ax 80106180 <sys_getch>: #include "types.h" #include "defs.h" int sys_getch(void) { 80106180: 55 push %ebp 80106181: 89 e5 mov %esp,%ebp return consoleget(); } 80106183: 5d pop %ebp return consoleget(); 80106184: e9 87 a8 ff ff jmp 80100a10 <consoleget> 80106189: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106190 <sys_greeting>: int sys_greeting(void) { 80106190: 55 push %ebp 80106191: 89 e5 mov %esp,%ebp 80106193: 83 ec 14 sub $0x14,%esp cprintf("Hello, user\n"); 80106196: 68 19 83 10 80 push $0x80108319 8010619b: e8 c0 a6 ff ff call 80100860 <cprintf> return 0; } 801061a0: 31 c0 xor %eax,%eax 801061a2: c9 leave 801061a3: c3 ret 801061a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801061aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801061b0 <sys_videomodevga13>: int sys_videomodevga13(void) { 801061b0: 55 push %ebp 801061b1: 89 e5 mov %esp,%ebp 801061b3: 83 ec 14 sub $0x14,%esp consolevgamode(0x13); 801061b6: 6a 13 push $0x13 801061b8: e8 a3 ac ff ff call 80100e60 <consolevgamode> cprintf("VGA Mode Set to 0x13\n"); 801061bd: c7 04 24 26 83 10 80 movl $0x80108326,(%esp) 801061c4: e8 97 a6 ff ff call 80100860 <cprintf> return 0; } 801061c9: 31 c0 xor %eax,%eax 801061cb: c9 leave 801061cc: c3 ret 801061cd: 8d 76 00 lea 0x0(%esi),%esi 801061d0 <sys_videomodevga12>: int sys_videomodevga12(void) { 801061d0: 55 push %ebp 801061d1: 89 e5 mov %esp,%ebp 801061d3: 83 ec 14 sub $0x14,%esp consolevgamode(0x12); 801061d6: 6a 12 push $0x12 801061d8: e8 83 ac ff ff call 80100e60 <consolevgamode> cprintf("VGA Mode set to 0x12\n"); 801061dd: c7 04 24 3c 83 10 80 movl $0x8010833c,(%esp) 801061e4: e8 77 a6 ff ff call 80100860 <cprintf> return 0; } 801061e9: 31 c0 xor %eax,%eax 801061eb: c9 leave 801061ec: c3 ret 801061ed: 8d 76 00 lea 0x0(%esi),%esi 801061f0 <sys_videomodetext>: int sys_videomodetext(void) { 801061f0: 55 push %ebp 801061f1: 89 e5 mov %esp,%ebp 801061f3: 83 ec 14 sub $0x14,%esp cprintf("VGA Mode Set to 0x03\n"); 801061f6: 68 52 83 10 80 push $0x80108352 801061fb: e8 60 a6 ff ff call 80100860 <cprintf> consolevgamode(0x03); 80106200: c7 04 24 03 00 00 00 movl $0x3,(%esp) 80106207: e8 54 ac ff ff call 80100e60 <consolevgamode> return 0; } 8010620c: 31 c0 xor %eax,%eax 8010620e: c9 leave 8010620f: c3 ret 80106210 <sys_setspecificpixel>: //int x, int y, unsigned char VGA_colour int sys_setspecificpixel(void) { 80106210: 55 push %ebp 80106211: 89 e5 mov %esp,%ebp 80106213: 83 ec 20 sub $0x20,%esp int x; int y; int VGA_colour; argint(2, &VGA_colour); 80106216: 8d 45 f4 lea -0xc(%ebp),%eax 80106219: 50 push %eax 8010621a: 6a 02 push $0x2 8010621c: e8 2f f0 ff ff call 80105250 <argint> argint(1, &y); 80106221: 58 pop %eax 80106222: 8d 45 f0 lea -0x10(%ebp),%eax 80106225: 5a pop %edx 80106226: 50 push %eax 80106227: 6a 01 push $0x1 80106229: e8 22 f0 ff ff call 80105250 <argint> argint(0, &x); 8010622e: 59 pop %ecx 8010622f: 58 pop %eax 80106230: 8d 45 ec lea -0x14(%ebp),%eax 80106233: 50 push %eax 80106234: 6a 00 push $0x0 80106236: e8 15 f0 ff ff call 80105250 <argint> setpixel(x,y,VGA_colour); 8010623b: 83 c4 0c add $0xc,%esp 8010623e: ff 75 f4 pushl -0xc(%ebp) 80106241: ff 75 f0 pushl -0x10(%ebp) 80106244: ff 75 ec pushl -0x14(%ebp) 80106247: e8 a4 ad ff ff call 80100ff0 <setpixel> return 0; } 8010624c: 31 c0 xor %eax,%eax 8010624e: c9 leave 8010624f: c3 ret 80106250 <sys_clearscreen13h>: int sys_clearscreen13h(void) { 80106250: 55 push %ebp 80106251: 89 e5 mov %esp,%ebp 80106253: 83 ec 08 sub $0x8,%esp zeroFillScreen13h(); 80106256: e8 15 b1 ff ff call 80101370 <zeroFillScreen13h> return 0; } 8010625b: 31 c0 xor %eax,%eax 8010625d: c9 leave 8010625e: c3 ret 8010625f: 90 nop 80106260 <sys_clearscreen12h>: int sys_clearscreen12h(void) { 80106260: 55 push %ebp 80106261: 89 e5 mov %esp,%ebp 80106263: 83 ec 08 sub $0x8,%esp zeroFillScreen12h(); 80106266: e8 35 b1 ff ff call 801013a0 <zeroFillScreen12h> return 0; } 8010626b: 31 c0 xor %eax,%eax 8010626d: c9 leave 8010626e: c3 ret 8010626f <alltraps>: # vectors.S sends all traps here. .globl alltraps alltraps: # Build trap frame. pushl %ds 8010626f: 1e push %ds pushl %es 80106270: 06 push %es pushl %fs 80106271: 0f a0 push %fs pushl %gs 80106273: 0f a8 push %gs pushal 80106275: 60 pusha # Set up data segments. movw $(SEG_KDATA<<3), %ax 80106276: 66 b8 10 00 mov $0x10,%ax movw %ax, %ds 8010627a: 8e d8 mov %eax,%ds movw %ax, %es 8010627c: 8e c0 mov %eax,%es # Call trap(tf), where tf=%esp pushl %esp 8010627e: 54 push %esp call trap 8010627f: e8 cc 00 00 00 call 80106350 <trap> addl $4, %esp 80106284: 83 c4 04 add $0x4,%esp 80106287 <trapret>: # Return falls through to trapret... .globl trapret trapret: popal 80106287: 61 popa popl %gs 80106288: 0f a9 pop %gs popl %fs 8010628a: 0f a1 pop %fs popl %es 8010628c: 07 pop %es popl %ds 8010628d: 1f pop %ds addl $0x8, %esp # trapno and errcode 8010628e: 83 c4 08 add $0x8,%esp iret 80106291: cf iret 80106292: 66 90 xchg %ax,%ax 80106294: 66 90 xchg %ax,%ax 80106296: 66 90 xchg %ax,%ax 80106298: 66 90 xchg %ax,%ax 8010629a: 66 90 xchg %ax,%ax 8010629c: 66 90 xchg %ax,%ax 8010629e: 66 90 xchg %ax,%ax 801062a0 <tvinit>: struct gatedesc idt[256]; extern uint vectors[]; // in vectors.S: array of 256 entry pointers struct spinlock tickslock; uint ticks; void tvinit(void) { 801062a0: 55 push %ebp int i; for (i = 0; i < 256; i++) { 801062a1: 31 c0 xor %eax,%eax void tvinit(void) { 801062a3: 89 e5 mov %esp,%ebp 801062a5: 83 ec 08 sub $0x8,%esp 801062a8: 90 nop 801062a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi SETGATE(idt[i], 0, SEG_KCODE << 3, vectors[i], 0); 801062b0: 8b 14 85 08 c0 10 80 mov -0x7fef3ff8(,%eax,4),%edx 801062b7: c7 04 c5 82 74 11 80 movl $0x8e000008,-0x7fee8b7e(,%eax,8) 801062be: 08 00 00 8e 801062c2: 66 89 14 c5 80 74 11 mov %dx,-0x7fee8b80(,%eax,8) 801062c9: 80 801062ca: c1 ea 10 shr $0x10,%edx 801062cd: 66 89 14 c5 86 74 11 mov %dx,-0x7fee8b7a(,%eax,8) 801062d4: 80 for (i = 0; i < 256; i++) { 801062d5: 83 c0 01 add $0x1,%eax 801062d8: 3d 00 01 00 00 cmp $0x100,%eax 801062dd: 75 d1 jne 801062b0 <tvinit+0x10> } SETGATE(idt[T_SYSCALL], 1, SEG_KCODE << 3, vectors[T_SYSCALL], DPL_USER); 801062df: a1 08 c1 10 80 mov 0x8010c108,%eax initlock(&tickslock, "time"); 801062e4: 83 ec 08 sub $0x8,%esp SETGATE(idt[T_SYSCALL], 1, SEG_KCODE << 3, vectors[T_SYSCALL], DPL_USER); 801062e7: c7 05 82 76 11 80 08 movl $0xef000008,0x80117682 801062ee: 00 00 ef initlock(&tickslock, "time"); 801062f1: 68 68 83 10 80 push $0x80108368 801062f6: 68 40 74 11 80 push $0x80117440 SETGATE(idt[T_SYSCALL], 1, SEG_KCODE << 3, vectors[T_SYSCALL], DPL_USER); 801062fb: 66 a3 80 76 11 80 mov %ax,0x80117680 80106301: c1 e8 10 shr $0x10,%eax 80106304: 66 a3 86 76 11 80 mov %ax,0x80117686 initlock(&tickslock, "time"); 8010630a: e8 f1 e9 ff ff call 80104d00 <initlock> } 8010630f: 83 c4 10 add $0x10,%esp 80106312: c9 leave 80106313: c3 ret 80106314: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010631a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80106320 <idtinit>: void idtinit(void) { 80106320: 55 push %ebp pd[0] = size - 1; 80106321: b8 ff 07 00 00 mov $0x7ff,%eax 80106326: 89 e5 mov %esp,%ebp 80106328: 83 ec 10 sub $0x10,%esp 8010632b: 66 89 45 fa mov %ax,-0x6(%ebp) pd[1] = (uint)p; 8010632f: b8 80 74 11 80 mov $0x80117480,%eax 80106334: 66 89 45 fc mov %ax,-0x4(%ebp) pd[2] = (uint)p >> 16; 80106338: c1 e8 10 shr $0x10,%eax 8010633b: 66 89 45 fe mov %ax,-0x2(%ebp) asm volatile ("lidt (%0)" : : "r" (pd)); 8010633f: 8d 45 fa lea -0x6(%ebp),%eax 80106342: 0f 01 18 lidtl (%eax) lidt(idt, sizeof(idt)); } 80106345: c9 leave 80106346: c3 ret 80106347: 89 f6 mov %esi,%esi 80106349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106350 <trap>: void trap(struct trapframe *tf) { 80106350: 55 push %ebp 80106351: 89 e5 mov %esp,%ebp 80106353: 57 push %edi 80106354: 56 push %esi 80106355: 53 push %ebx 80106356: 83 ec 1c sub $0x1c,%esp 80106359: 8b 7d 08 mov 0x8(%ebp),%edi if (tf->trapno == T_SYSCALL) { 8010635c: 8b 47 30 mov 0x30(%edi),%eax 8010635f: 83 f8 40 cmp $0x40,%eax 80106362: 0f 84 f0 00 00 00 je 80106458 <trap+0x108> exit(); } return; } switch (tf->trapno) { 80106368: 83 e8 20 sub $0x20,%eax 8010636b: 83 f8 1f cmp $0x1f,%eax 8010636e: 77 10 ja 80106380 <trap+0x30> 80106370: ff 24 85 10 84 10 80 jmp *-0x7fef7bf0(,%eax,4) 80106377: 89 f6 mov %esi,%esi 80106379: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi lapiceoi(); break; default: if (myproc() == 0 || (tf->cs & 3) == 0) { 80106380: e8 5b df ff ff call 801042e0 <myproc> 80106385: 85 c0 test %eax,%eax 80106387: 8b 5f 38 mov 0x38(%edi),%ebx 8010638a: 0f 84 14 02 00 00 je 801065a4 <trap+0x254> 80106390: f6 47 3c 03 testb $0x3,0x3c(%edi) 80106394: 0f 84 0a 02 00 00 je 801065a4 <trap+0x254> return result; } static inline uint rcr2(void) { uint val; asm volatile ("movl %%cr2,%0" : "=r" (val)); 8010639a: 0f 20 d1 mov %cr2,%ecx 8010639d: 89 4d d8 mov %ecx,-0x28(%ebp) cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); } // In user space, assume process misbehaved. cprintf("pid %d %s: trap %d err %d on cpu %d " 801063a0: e8 1b df ff ff call 801042c0 <cpuid> 801063a5: 89 45 dc mov %eax,-0x24(%ebp) 801063a8: 8b 47 34 mov 0x34(%edi),%eax 801063ab: 8b 77 30 mov 0x30(%edi),%esi 801063ae: 89 45 e4 mov %eax,-0x1c(%ebp) "eip 0x%x addr 0x%x--kill proc\n", myproc()->pid, myproc()->name, tf->trapno, 801063b1: e8 2a df ff ff call 801042e0 <myproc> 801063b6: 89 45 e0 mov %eax,-0x20(%ebp) 801063b9: e8 22 df ff ff call 801042e0 <myproc> cprintf("pid %d %s: trap %d err %d on cpu %d " 801063be: 8b 4d d8 mov -0x28(%ebp),%ecx 801063c1: 8b 55 dc mov -0x24(%ebp),%edx 801063c4: 51 push %ecx 801063c5: 53 push %ebx 801063c6: 52 push %edx myproc()->pid, myproc()->name, tf->trapno, 801063c7: 8b 55 e0 mov -0x20(%ebp),%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 801063ca: ff 75 e4 pushl -0x1c(%ebp) 801063cd: 56 push %esi myproc()->pid, myproc()->name, tf->trapno, 801063ce: 83 c2 6c add $0x6c,%edx cprintf("pid %d %s: trap %d err %d on cpu %d " 801063d1: 52 push %edx 801063d2: ff 70 10 pushl 0x10(%eax) 801063d5: 68 cc 83 10 80 push $0x801083cc 801063da: e8 81 a4 ff ff call 80100860 <cprintf> tf->err, cpuid(), tf->eip, rcr2()); myproc()->killed = 1; 801063df: 83 c4 20 add $0x20,%esp 801063e2: e8 f9 de ff ff call 801042e0 <myproc> 801063e7: c7 40 24 01 00 00 00 movl $0x1,0x24(%eax) } // Force process exit if it has been killed and is in user space. // (If it is still executing in the kernel, let it keep running // until it gets to the regular system call return.) if (myproc() && myproc()->killed && (tf->cs & 3) == DPL_USER) { 801063ee: e8 ed de ff ff call 801042e0 <myproc> 801063f3: 85 c0 test %eax,%eax 801063f5: 74 1d je 80106414 <trap+0xc4> 801063f7: e8 e4 de ff ff call 801042e0 <myproc> 801063fc: 8b 50 24 mov 0x24(%eax),%edx 801063ff: 85 d2 test %edx,%edx 80106401: 74 11 je 80106414 <trap+0xc4> 80106403: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80106407: 83 e0 03 and $0x3,%eax 8010640a: 66 83 f8 03 cmp $0x3,%ax 8010640e: 0f 84 4c 01 00 00 je 80106560 <trap+0x210> exit(); } // Force process to give up CPU on clock tick. // If interrupts were on while locks held, would need to check nlock. if (myproc() && myproc()->state == RUNNING && 80106414: e8 c7 de ff ff call 801042e0 <myproc> 80106419: 85 c0 test %eax,%eax 8010641b: 74 0b je 80106428 <trap+0xd8> 8010641d: e8 be de ff ff call 801042e0 <myproc> 80106422: 83 78 0c 04 cmpl $0x4,0xc(%eax) 80106426: 74 68 je 80106490 <trap+0x140> tf->trapno == T_IRQ0 + IRQ_TIMER) { yield(); } // Check if the process has been killed since we yielded if (myproc() && myproc()->killed && (tf->cs & 3) == DPL_USER) { 80106428: e8 b3 de ff ff call 801042e0 <myproc> 8010642d: 85 c0 test %eax,%eax 8010642f: 74 19 je 8010644a <trap+0xfa> 80106431: e8 aa de ff ff call 801042e0 <myproc> 80106436: 8b 40 24 mov 0x24(%eax),%eax 80106439: 85 c0 test %eax,%eax 8010643b: 74 0d je 8010644a <trap+0xfa> 8010643d: 0f b7 47 3c movzwl 0x3c(%edi),%eax 80106441: 83 e0 03 and $0x3,%eax 80106444: 66 83 f8 03 cmp $0x3,%ax 80106448: 74 37 je 80106481 <trap+0x131> exit(); } } 8010644a: 8d 65 f4 lea -0xc(%ebp),%esp 8010644d: 5b pop %ebx 8010644e: 5e pop %esi 8010644f: 5f pop %edi 80106450: 5d pop %ebp 80106451: c3 ret 80106452: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if (myproc()->killed) { 80106458: e8 83 de ff ff call 801042e0 <myproc> 8010645d: 8b 58 24 mov 0x24(%eax),%ebx 80106460: 85 db test %ebx,%ebx 80106462: 0f 85 e8 00 00 00 jne 80106550 <trap+0x200> myproc()->tf = tf; 80106468: e8 73 de ff ff call 801042e0 <myproc> 8010646d: 89 78 18 mov %edi,0x18(%eax) syscall(); 80106470: e8 cb ee ff ff call 80105340 <syscall> if (myproc()->killed) { 80106475: e8 66 de ff ff call 801042e0 <myproc> 8010647a: 8b 48 24 mov 0x24(%eax),%ecx 8010647d: 85 c9 test %ecx,%ecx 8010647f: 74 c9 je 8010644a <trap+0xfa> } 80106481: 8d 65 f4 lea -0xc(%ebp),%esp 80106484: 5b pop %ebx 80106485: 5e pop %esi 80106486: 5f pop %edi 80106487: 5d pop %ebp exit(); 80106488: e9 73 e2 ff ff jmp 80104700 <exit> 8010648d: 8d 76 00 lea 0x0(%esi),%esi if (myproc() && myproc()->state == RUNNING && 80106490: 83 7f 30 20 cmpl $0x20,0x30(%edi) 80106494: 75 92 jne 80106428 <trap+0xd8> yield(); 80106496: e8 95 e3 ff ff call 80104830 <yield> 8010649b: eb 8b jmp 80106428 <trap+0xd8> 8010649d: 8d 76 00 lea 0x0(%esi),%esi if (cpuid() == 0) { 801064a0: e8 1b de ff ff call 801042c0 <cpuid> 801064a5: 85 c0 test %eax,%eax 801064a7: 0f 84 c3 00 00 00 je 80106570 <trap+0x220> lapiceoi(); 801064ad: e8 6e cd ff ff call 80103220 <lapiceoi> if (myproc() && myproc()->killed && (tf->cs & 3) == DPL_USER) { 801064b2: e8 29 de ff ff call 801042e0 <myproc> 801064b7: 85 c0 test %eax,%eax 801064b9: 0f 85 38 ff ff ff jne 801063f7 <trap+0xa7> 801064bf: e9 50 ff ff ff jmp 80106414 <trap+0xc4> 801064c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kbdintr(); 801064c8: e8 13 cc ff ff call 801030e0 <kbdintr> lapiceoi(); 801064cd: e8 4e cd ff ff call 80103220 <lapiceoi> if (myproc() && myproc()->killed && (tf->cs & 3) == DPL_USER) { 801064d2: e8 09 de ff ff call 801042e0 <myproc> 801064d7: 85 c0 test %eax,%eax 801064d9: 0f 85 18 ff ff ff jne 801063f7 <trap+0xa7> 801064df: e9 30 ff ff ff jmp 80106414 <trap+0xc4> 801064e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi uartintr(); 801064e8: e8 53 02 00 00 call 80106740 <uartintr> lapiceoi(); 801064ed: e8 2e cd ff ff call 80103220 <lapiceoi> if (myproc() && myproc()->killed && (tf->cs & 3) == DPL_USER) { 801064f2: e8 e9 dd ff ff call 801042e0 <myproc> 801064f7: 85 c0 test %eax,%eax 801064f9: 0f 85 f8 fe ff ff jne 801063f7 <trap+0xa7> 801064ff: e9 10 ff ff ff jmp 80106414 <trap+0xc4> 80106504: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi cprintf("cpu%d: spurious interrupt at %x:%x\n", 80106508: 0f b7 5f 3c movzwl 0x3c(%edi),%ebx 8010650c: 8b 77 38 mov 0x38(%edi),%esi 8010650f: e8 ac dd ff ff call 801042c0 <cpuid> 80106514: 56 push %esi 80106515: 53 push %ebx 80106516: 50 push %eax 80106517: 68 74 83 10 80 push $0x80108374 8010651c: e8 3f a3 ff ff call 80100860 <cprintf> lapiceoi(); 80106521: e8 fa cc ff ff call 80103220 <lapiceoi> break; 80106526: 83 c4 10 add $0x10,%esp if (myproc() && myproc()->killed && (tf->cs & 3) == DPL_USER) { 80106529: e8 b2 dd ff ff call 801042e0 <myproc> 8010652e: 85 c0 test %eax,%eax 80106530: 0f 85 c1 fe ff ff jne 801063f7 <trap+0xa7> 80106536: e9 d9 fe ff ff jmp 80106414 <trap+0xc4> 8010653b: 90 nop 8010653c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi ideintr(); 80106540: e8 0b c6 ff ff call 80102b50 <ideintr> 80106545: e9 63 ff ff ff jmp 801064ad <trap+0x15d> 8010654a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80106550: e8 ab e1 ff ff call 80104700 <exit> 80106555: e9 0e ff ff ff jmp 80106468 <trap+0x118> 8010655a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi exit(); 80106560: e8 9b e1 ff ff call 80104700 <exit> 80106565: e9 aa fe ff ff jmp 80106414 <trap+0xc4> 8010656a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi acquire(&tickslock); 80106570: 83 ec 0c sub $0xc,%esp 80106573: 68 40 74 11 80 push $0x80117440 80106578: e8 c3 e8 ff ff call 80104e40 <acquire> wakeup(&ticks); 8010657d: c7 04 24 80 7c 11 80 movl $0x80117c80,(%esp) ticks++; 80106584: 83 05 80 7c 11 80 01 addl $0x1,0x80117c80 wakeup(&ticks); 8010658b: e8 a0 e4 ff ff call 80104a30 <wakeup> release(&tickslock); 80106590: c7 04 24 40 74 11 80 movl $0x80117440,(%esp) 80106597: e8 64 e9 ff ff call 80104f00 <release> 8010659c: 83 c4 10 add $0x10,%esp 8010659f: e9 09 ff ff ff jmp 801064ad <trap+0x15d> 801065a4: 0f 20 d6 mov %cr2,%esi cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n", 801065a7: e8 14 dd ff ff call 801042c0 <cpuid> 801065ac: 83 ec 0c sub $0xc,%esp 801065af: 56 push %esi 801065b0: 53 push %ebx 801065b1: 50 push %eax 801065b2: ff 77 30 pushl 0x30(%edi) 801065b5: 68 98 83 10 80 push $0x80108398 801065ba: e8 a1 a2 ff ff call 80100860 <cprintf> panic("trap"); 801065bf: 83 c4 14 add $0x14,%esp 801065c2: 68 6d 83 10 80 push $0x8010836d 801065c7: e8 14 9f ff ff call 801004e0 <panic> 801065cc: 66 90 xchg %ax,%ax 801065ce: 66 90 xchg %ax,%ax 801065d0 <uartgetc>: } outb(COM1 + 0, c); } static int uartgetc(void) { if (!uart) { 801065d0: a1 bc c5 10 80 mov 0x8010c5bc,%eax static int uartgetc(void) { 801065d5: 55 push %ebp 801065d6: 89 e5 mov %esp,%ebp if (!uart) { 801065d8: 85 c0 test %eax,%eax 801065da: 74 1c je 801065f8 <uartgetc+0x28> asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 801065dc: ba fd 03 00 00 mov $0x3fd,%edx 801065e1: ec in (%dx),%al return -1; } if (!(inb(COM1 + 5) & 0x01)) { 801065e2: a8 01 test $0x1,%al 801065e4: 74 12 je 801065f8 <uartgetc+0x28> 801065e6: ba f8 03 00 00 mov $0x3f8,%edx 801065eb: ec in (%dx),%al return -1; } return inb(COM1 + 0); 801065ec: 0f b6 c0 movzbl %al,%eax } 801065ef: 5d pop %ebp 801065f0: c3 ret 801065f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi return -1; 801065f8: b8 ff ff ff ff mov $0xffffffff,%eax } 801065fd: 5d pop %ebp 801065fe: c3 ret 801065ff: 90 nop 80106600 <uartputc.part.0>: void uartputc(int c) { 80106600: 55 push %ebp 80106601: 89 e5 mov %esp,%ebp 80106603: 57 push %edi 80106604: 56 push %esi 80106605: 53 push %ebx 80106606: 89 c7 mov %eax,%edi 80106608: bb 80 00 00 00 mov $0x80,%ebx 8010660d: be fd 03 00 00 mov $0x3fd,%esi 80106612: 83 ec 0c sub $0xc,%esp 80106615: eb 1b jmp 80106632 <uartputc.part.0+0x32> 80106617: 89 f6 mov %esi,%esi 80106619: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi microdelay(10); 80106620: 83 ec 0c sub $0xc,%esp 80106623: 6a 0a push $0xa 80106625: e8 16 cc ff ff call 80103240 <microdelay> for (i = 0; i < 128 && !(inb(COM1 + 5) & 0x20); i++) { 8010662a: 83 c4 10 add $0x10,%esp 8010662d: 83 eb 01 sub $0x1,%ebx 80106630: 74 07 je 80106639 <uartputc.part.0+0x39> 80106632: 89 f2 mov %esi,%edx 80106634: ec in (%dx),%al 80106635: a8 20 test $0x20,%al 80106637: 74 e7 je 80106620 <uartputc.part.0+0x20> asm volatile ("out %0,%1" : : "a" (data), "d" (port)); 80106639: ba f8 03 00 00 mov $0x3f8,%edx 8010663e: 89 f8 mov %edi,%eax 80106640: ee out %al,(%dx) } 80106641: 8d 65 f4 lea -0xc(%ebp),%esp 80106644: 5b pop %ebx 80106645: 5e pop %esi 80106646: 5f pop %edi 80106647: 5d pop %ebp 80106648: c3 ret 80106649: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106650 <uartinit>: void uartinit(void) { 80106650: 55 push %ebp 80106651: 31 c9 xor %ecx,%ecx 80106653: 89 c8 mov %ecx,%eax 80106655: 89 e5 mov %esp,%ebp 80106657: 57 push %edi 80106658: 56 push %esi 80106659: 53 push %ebx 8010665a: bb fa 03 00 00 mov $0x3fa,%ebx 8010665f: 89 da mov %ebx,%edx 80106661: 83 ec 0c sub $0xc,%esp 80106664: ee out %al,(%dx) 80106665: bf fb 03 00 00 mov $0x3fb,%edi 8010666a: b8 80 ff ff ff mov $0xffffff80,%eax 8010666f: 89 fa mov %edi,%edx 80106671: ee out %al,(%dx) 80106672: b8 0c 00 00 00 mov $0xc,%eax 80106677: ba f8 03 00 00 mov $0x3f8,%edx 8010667c: ee out %al,(%dx) 8010667d: be f9 03 00 00 mov $0x3f9,%esi 80106682: 89 c8 mov %ecx,%eax 80106684: 89 f2 mov %esi,%edx 80106686: ee out %al,(%dx) 80106687: b8 03 00 00 00 mov $0x3,%eax 8010668c: 89 fa mov %edi,%edx 8010668e: ee out %al,(%dx) 8010668f: ba fc 03 00 00 mov $0x3fc,%edx 80106694: 89 c8 mov %ecx,%eax 80106696: ee out %al,(%dx) 80106697: b8 01 00 00 00 mov $0x1,%eax 8010669c: 89 f2 mov %esi,%edx 8010669e: ee out %al,(%dx) asm volatile ("in %1,%0" : "=a" (data) : "d" (port)); 8010669f: ba fd 03 00 00 mov $0x3fd,%edx 801066a4: ec in (%dx),%al if (inb(COM1 + 5) == 0xFF) { 801066a5: 3c ff cmp $0xff,%al 801066a7: 74 5a je 80106703 <uartinit+0xb3> uart = 1; 801066a9: c7 05 bc c5 10 80 01 movl $0x1,0x8010c5bc 801066b0: 00 00 00 801066b3: 89 da mov %ebx,%edx 801066b5: ec in (%dx),%al 801066b6: ba f8 03 00 00 mov $0x3f8,%edx 801066bb: ec in (%dx),%al ioapicenable(IRQ_COM1, 0); 801066bc: 83 ec 08 sub $0x8,%esp for (p = "xv6...\n"; *p; p++) { 801066bf: bb 90 84 10 80 mov $0x80108490,%ebx ioapicenable(IRQ_COM1, 0); 801066c4: 6a 00 push $0x0 801066c6: 6a 04 push $0x4 801066c8: e8 d3 c6 ff ff call 80102da0 <ioapicenable> 801066cd: 83 c4 10 add $0x10,%esp for (p = "xv6...\n"; *p; p++) { 801066d0: b8 78 00 00 00 mov $0x78,%eax 801066d5: eb 13 jmp 801066ea <uartinit+0x9a> 801066d7: 89 f6 mov %esi,%esi 801066d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801066e0: 83 c3 01 add $0x1,%ebx 801066e3: 0f be 03 movsbl (%ebx),%eax 801066e6: 84 c0 test %al,%al 801066e8: 74 19 je 80106703 <uartinit+0xb3> if (!uart) { 801066ea: 8b 15 bc c5 10 80 mov 0x8010c5bc,%edx 801066f0: 85 d2 test %edx,%edx 801066f2: 74 ec je 801066e0 <uartinit+0x90> for (p = "xv6...\n"; *p; p++) { 801066f4: 83 c3 01 add $0x1,%ebx 801066f7: e8 04 ff ff ff call 80106600 <uartputc.part.0> 801066fc: 0f be 03 movsbl (%ebx),%eax 801066ff: 84 c0 test %al,%al 80106701: 75 e7 jne 801066ea <uartinit+0x9a> } 80106703: 8d 65 f4 lea -0xc(%ebp),%esp 80106706: 5b pop %ebx 80106707: 5e pop %esi 80106708: 5f pop %edi 80106709: 5d pop %ebp 8010670a: c3 ret 8010670b: 90 nop 8010670c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80106710 <uartputc>: if (!uart) { 80106710: 8b 15 bc c5 10 80 mov 0x8010c5bc,%edx void uartputc(int c) { 80106716: 55 push %ebp 80106717: 89 e5 mov %esp,%ebp if (!uart) { 80106719: 85 d2 test %edx,%edx void uartputc(int c) { 8010671b: 8b 45 08 mov 0x8(%ebp),%eax if (!uart) { 8010671e: 74 10 je 80106730 <uartputc+0x20> } 80106720: 5d pop %ebp 80106721: e9 da fe ff ff jmp 80106600 <uartputc.part.0> 80106726: 8d 76 00 lea 0x0(%esi),%esi 80106729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106730: 5d pop %ebp 80106731: c3 ret 80106732: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80106739: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80106740 <uartintr>: void uartintr(void) { 80106740: 55 push %ebp 80106741: 89 e5 mov %esp,%ebp 80106743: 83 ec 14 sub $0x14,%esp consoleintr(uartgetc); 80106746: 68 d0 65 10 80 push $0x801065d0 8010674b: e8 10 a3 ff ff call 80100a60 <consoleintr> } 80106750: 83 c4 10 add $0x10,%esp 80106753: c9 leave 80106754: c3 ret 80106755 <vector0>: # generated by vectors.pl - do not edit # handlers .globl alltraps .globl vector0 vector0: pushl $0 80106755: 6a 00 push $0x0 pushl $0 80106757: 6a 00 push $0x0 jmp alltraps 80106759: e9 11 fb ff ff jmp 8010626f <alltraps> 8010675e <vector1>: .globl vector1 vector1: pushl $0 8010675e: 6a 00 push $0x0 pushl $1 80106760: 6a 01 push $0x1 jmp alltraps 80106762: e9 08 fb ff ff jmp 8010626f <alltraps> 80106767 <vector2>: .globl vector2 vector2: pushl $0 80106767: 6a 00 push $0x0 pushl $2 80106769: 6a 02 push $0x2 jmp alltraps 8010676b: e9 ff fa ff ff jmp 8010626f <alltraps> 80106770 <vector3>: .globl vector3 vector3: pushl $0 80106770: 6a 00 push $0x0 pushl $3 80106772: 6a 03 push $0x3 jmp alltraps 80106774: e9 f6 fa ff ff jmp 8010626f <alltraps> 80106779 <vector4>: .globl vector4 vector4: pushl $0 80106779: 6a 00 push $0x0 pushl $4 8010677b: 6a 04 push $0x4 jmp alltraps 8010677d: e9 ed fa ff ff jmp 8010626f <alltraps> 80106782 <vector5>: .globl vector5 vector5: pushl $0 80106782: 6a 00 push $0x0 pushl $5 80106784: 6a 05 push $0x5 jmp alltraps 80106786: e9 e4 fa ff ff jmp 8010626f <alltraps> 8010678b <vector6>: .globl vector6 vector6: pushl $0 8010678b: 6a 00 push $0x0 pushl $6 8010678d: 6a 06 push $0x6 jmp alltraps 8010678f: e9 db fa ff ff jmp 8010626f <alltraps> 80106794 <vector7>: .globl vector7 vector7: pushl $0 80106794: 6a 00 push $0x0 pushl $7 80106796: 6a 07 push $0x7 jmp alltraps 80106798: e9 d2 fa ff ff jmp 8010626f <alltraps> 8010679d <vector8>: .globl vector8 vector8: pushl $8 8010679d: 6a 08 push $0x8 jmp alltraps 8010679f: e9 cb fa ff ff jmp 8010626f <alltraps> 801067a4 <vector9>: .globl vector9 vector9: pushl $0 801067a4: 6a 00 push $0x0 pushl $9 801067a6: 6a 09 push $0x9 jmp alltraps 801067a8: e9 c2 fa ff ff jmp 8010626f <alltraps> 801067ad <vector10>: .globl vector10 vector10: pushl $10 801067ad: 6a 0a push $0xa jmp alltraps 801067af: e9 bb fa ff ff jmp 8010626f <alltraps> 801067b4 <vector11>: .globl vector11 vector11: pushl $11 801067b4: 6a 0b push $0xb jmp alltraps 801067b6: e9 b4 fa ff ff jmp 8010626f <alltraps> 801067bb <vector12>: .globl vector12 vector12: pushl $12 801067bb: 6a 0c push $0xc jmp alltraps 801067bd: e9 ad fa ff ff jmp 8010626f <alltraps> 801067c2 <vector13>: .globl vector13 vector13: pushl $13 801067c2: 6a 0d push $0xd jmp alltraps 801067c4: e9 a6 fa ff ff jmp 8010626f <alltraps> 801067c9 <vector14>: .globl vector14 vector14: pushl $14 801067c9: 6a 0e push $0xe jmp alltraps 801067cb: e9 9f fa ff ff jmp 8010626f <alltraps> 801067d0 <vector15>: .globl vector15 vector15: pushl $0 801067d0: 6a 00 push $0x0 pushl $15 801067d2: 6a 0f push $0xf jmp alltraps 801067d4: e9 96 fa ff ff jmp 8010626f <alltraps> 801067d9 <vector16>: .globl vector16 vector16: pushl $0 801067d9: 6a 00 push $0x0 pushl $16 801067db: 6a 10 push $0x10 jmp alltraps 801067dd: e9 8d fa ff ff jmp 8010626f <alltraps> 801067e2 <vector17>: .globl vector17 vector17: pushl $17 801067e2: 6a 11 push $0x11 jmp alltraps 801067e4: e9 86 fa ff ff jmp 8010626f <alltraps> 801067e9 <vector18>: .globl vector18 vector18: pushl $0 801067e9: 6a 00 push $0x0 pushl $18 801067eb: 6a 12 push $0x12 jmp alltraps 801067ed: e9 7d fa ff ff jmp 8010626f <alltraps> 801067f2 <vector19>: .globl vector19 vector19: pushl $0 801067f2: 6a 00 push $0x0 pushl $19 801067f4: 6a 13 push $0x13 jmp alltraps 801067f6: e9 74 fa ff ff jmp 8010626f <alltraps> 801067fb <vector20>: .globl vector20 vector20: pushl $0 801067fb: 6a 00 push $0x0 pushl $20 801067fd: 6a 14 push $0x14 jmp alltraps 801067ff: e9 6b fa ff ff jmp 8010626f <alltraps> 80106804 <vector21>: .globl vector21 vector21: pushl $0 80106804: 6a 00 push $0x0 pushl $21 80106806: 6a 15 push $0x15 jmp alltraps 80106808: e9 62 fa ff ff jmp 8010626f <alltraps> 8010680d <vector22>: .globl vector22 vector22: pushl $0 8010680d: 6a 00 push $0x0 pushl $22 8010680f: 6a 16 push $0x16 jmp alltraps 80106811: e9 59 fa ff ff jmp 8010626f <alltraps> 80106816 <vector23>: .globl vector23 vector23: pushl $0 80106816: 6a 00 push $0x0 pushl $23 80106818: 6a 17 push $0x17 jmp alltraps 8010681a: e9 50 fa ff ff jmp 8010626f <alltraps> 8010681f <vector24>: .globl vector24 vector24: pushl $0 8010681f: 6a 00 push $0x0 pushl $24 80106821: 6a 18 push $0x18 jmp alltraps 80106823: e9 47 fa ff ff jmp 8010626f <alltraps> 80106828 <vector25>: .globl vector25 vector25: pushl $0 80106828: 6a 00 push $0x0 pushl $25 8010682a: 6a 19 push $0x19 jmp alltraps 8010682c: e9 3e fa ff ff jmp 8010626f <alltraps> 80106831 <vector26>: .globl vector26 vector26: pushl $0 80106831: 6a 00 push $0x0 pushl $26 80106833: 6a 1a push $0x1a jmp alltraps 80106835: e9 35 fa ff ff jmp 8010626f <alltraps> 8010683a <vector27>: .globl vector27 vector27: pushl $0 8010683a: 6a 00 push $0x0 pushl $27 8010683c: 6a 1b push $0x1b jmp alltraps 8010683e: e9 2c fa ff ff jmp 8010626f <alltraps> 80106843 <vector28>: .globl vector28 vector28: pushl $0 80106843: 6a 00 push $0x0 pushl $28 80106845: 6a 1c push $0x1c jmp alltraps 80106847: e9 23 fa ff ff jmp 8010626f <alltraps> 8010684c <vector29>: .globl vector29 vector29: pushl $0 8010684c: 6a 00 push $0x0 pushl $29 8010684e: 6a 1d push $0x1d jmp alltraps 80106850: e9 1a fa ff ff jmp 8010626f <alltraps> 80106855 <vector30>: .globl vector30 vector30: pushl $0 80106855: 6a 00 push $0x0 pushl $30 80106857: 6a 1e push $0x1e jmp alltraps 80106859: e9 11 fa ff ff jmp 8010626f <alltraps> 8010685e <vector31>: .globl vector31 vector31: pushl $0 8010685e: 6a 00 push $0x0 pushl $31 80106860: 6a 1f push $0x1f jmp alltraps 80106862: e9 08 fa ff ff jmp 8010626f <alltraps> 80106867 <vector32>: .globl vector32 vector32: pushl $0 80106867: 6a 00 push $0x0 pushl $32 80106869: 6a 20 push $0x20 jmp alltraps 8010686b: e9 ff f9 ff ff jmp 8010626f <alltraps> 80106870 <vector33>: .globl vector33 vector33: pushl $0 80106870: 6a 00 push $0x0 pushl $33 80106872: 6a 21 push $0x21 jmp alltraps 80106874: e9 f6 f9 ff ff jmp 8010626f <alltraps> 80106879 <vector34>: .globl vector34 vector34: pushl $0 80106879: 6a 00 push $0x0 pushl $34 8010687b: 6a 22 push $0x22 jmp alltraps 8010687d: e9 ed f9 ff ff jmp 8010626f <alltraps> 80106882 <vector35>: .globl vector35 vector35: pushl $0 80106882: 6a 00 push $0x0 pushl $35 80106884: 6a 23 push $0x23 jmp alltraps 80106886: e9 e4 f9 ff ff jmp 8010626f <alltraps> 8010688b <vector36>: .globl vector36 vector36: pushl $0 8010688b: 6a 00 push $0x0 pushl $36 8010688d: 6a 24 push $0x24 jmp alltraps 8010688f: e9 db f9 ff ff jmp 8010626f <alltraps> 80106894 <vector37>: .globl vector37 vector37: pushl $0 80106894: 6a 00 push $0x0 pushl $37 80106896: 6a 25 push $0x25 jmp alltraps 80106898: e9 d2 f9 ff ff jmp 8010626f <alltraps> 8010689d <vector38>: .globl vector38 vector38: pushl $0 8010689d: 6a 00 push $0x0 pushl $38 8010689f: 6a 26 push $0x26 jmp alltraps 801068a1: e9 c9 f9 ff ff jmp 8010626f <alltraps> 801068a6 <vector39>: .globl vector39 vector39: pushl $0 801068a6: 6a 00 push $0x0 pushl $39 801068a8: 6a 27 push $0x27 jmp alltraps 801068aa: e9 c0 f9 ff ff jmp 8010626f <alltraps> 801068af <vector40>: .globl vector40 vector40: pushl $0 801068af: 6a 00 push $0x0 pushl $40 801068b1: 6a 28 push $0x28 jmp alltraps 801068b3: e9 b7 f9 ff ff jmp 8010626f <alltraps> 801068b8 <vector41>: .globl vector41 vector41: pushl $0 801068b8: 6a 00 push $0x0 pushl $41 801068ba: 6a 29 push $0x29 jmp alltraps 801068bc: e9 ae f9 ff ff jmp 8010626f <alltraps> 801068c1 <vector42>: .globl vector42 vector42: pushl $0 801068c1: 6a 00 push $0x0 pushl $42 801068c3: 6a 2a push $0x2a jmp alltraps 801068c5: e9 a5 f9 ff ff jmp 8010626f <alltraps> 801068ca <vector43>: .globl vector43 vector43: pushl $0 801068ca: 6a 00 push $0x0 pushl $43 801068cc: 6a 2b push $0x2b jmp alltraps 801068ce: e9 9c f9 ff ff jmp 8010626f <alltraps> 801068d3 <vector44>: .globl vector44 vector44: pushl $0 801068d3: 6a 00 push $0x0 pushl $44 801068d5: 6a 2c push $0x2c jmp alltraps 801068d7: e9 93 f9 ff ff jmp 8010626f <alltraps> 801068dc <vector45>: .globl vector45 vector45: pushl $0 801068dc: 6a 00 push $0x0 pushl $45 801068de: 6a 2d push $0x2d jmp alltraps 801068e0: e9 8a f9 ff ff jmp 8010626f <alltraps> 801068e5 <vector46>: .globl vector46 vector46: pushl $0 801068e5: 6a 00 push $0x0 pushl $46 801068e7: 6a 2e push $0x2e jmp alltraps 801068e9: e9 81 f9 ff ff jmp 8010626f <alltraps> 801068ee <vector47>: .globl vector47 vector47: pushl $0 801068ee: 6a 00 push $0x0 pushl $47 801068f0: 6a 2f push $0x2f jmp alltraps 801068f2: e9 78 f9 ff ff jmp 8010626f <alltraps> 801068f7 <vector48>: .globl vector48 vector48: pushl $0 801068f7: 6a 00 push $0x0 pushl $48 801068f9: 6a 30 push $0x30 jmp alltraps 801068fb: e9 6f f9 ff ff jmp 8010626f <alltraps> 80106900 <vector49>: .globl vector49 vector49: pushl $0 80106900: 6a 00 push $0x0 pushl $49 80106902: 6a 31 push $0x31 jmp alltraps 80106904: e9 66 f9 ff ff jmp 8010626f <alltraps> 80106909 <vector50>: .globl vector50 vector50: pushl $0 80106909: 6a 00 push $0x0 pushl $50 8010690b: 6a 32 push $0x32 jmp alltraps 8010690d: e9 5d f9 ff ff jmp 8010626f <alltraps> 80106912 <vector51>: .globl vector51 vector51: pushl $0 80106912: 6a 00 push $0x0 pushl $51 80106914: 6a 33 push $0x33 jmp alltraps 80106916: e9 54 f9 ff ff jmp 8010626f <alltraps> 8010691b <vector52>: .globl vector52 vector52: pushl $0 8010691b: 6a 00 push $0x0 pushl $52 8010691d: 6a 34 push $0x34 jmp alltraps 8010691f: e9 4b f9 ff ff jmp 8010626f <alltraps> 80106924 <vector53>: .globl vector53 vector53: pushl $0 80106924: 6a 00 push $0x0 pushl $53 80106926: 6a 35 push $0x35 jmp alltraps 80106928: e9 42 f9 ff ff jmp 8010626f <alltraps> 8010692d <vector54>: .globl vector54 vector54: pushl $0 8010692d: 6a 00 push $0x0 pushl $54 8010692f: 6a 36 push $0x36 jmp alltraps 80106931: e9 39 f9 ff ff jmp 8010626f <alltraps> 80106936 <vector55>: .globl vector55 vector55: pushl $0 80106936: 6a 00 push $0x0 pushl $55 80106938: 6a 37 push $0x37 jmp alltraps 8010693a: e9 30 f9 ff ff jmp 8010626f <alltraps> 8010693f <vector56>: .globl vector56 vector56: pushl $0 8010693f: 6a 00 push $0x0 pushl $56 80106941: 6a 38 push $0x38 jmp alltraps 80106943: e9 27 f9 ff ff jmp 8010626f <alltraps> 80106948 <vector57>: .globl vector57 vector57: pushl $0 80106948: 6a 00 push $0x0 pushl $57 8010694a: 6a 39 push $0x39 jmp alltraps 8010694c: e9 1e f9 ff ff jmp 8010626f <alltraps> 80106951 <vector58>: .globl vector58 vector58: pushl $0 80106951: 6a 00 push $0x0 pushl $58 80106953: 6a 3a push $0x3a jmp alltraps 80106955: e9 15 f9 ff ff jmp 8010626f <alltraps> 8010695a <vector59>: .globl vector59 vector59: pushl $0 8010695a: 6a 00 push $0x0 pushl $59 8010695c: 6a 3b push $0x3b jmp alltraps 8010695e: e9 0c f9 ff ff jmp 8010626f <alltraps> 80106963 <vector60>: .globl vector60 vector60: pushl $0 80106963: 6a 00 push $0x0 pushl $60 80106965: 6a 3c push $0x3c jmp alltraps 80106967: e9 03 f9 ff ff jmp 8010626f <alltraps> 8010696c <vector61>: .globl vector61 vector61: pushl $0 8010696c: 6a 00 push $0x0 pushl $61 8010696e: 6a 3d push $0x3d jmp alltraps 80106970: e9 fa f8 ff ff jmp 8010626f <alltraps> 80106975 <vector62>: .globl vector62 vector62: pushl $0 80106975: 6a 00 push $0x0 pushl $62 80106977: 6a 3e push $0x3e jmp alltraps 80106979: e9 f1 f8 ff ff jmp 8010626f <alltraps> 8010697e <vector63>: .globl vector63 vector63: pushl $0 8010697e: 6a 00 push $0x0 pushl $63 80106980: 6a 3f push $0x3f jmp alltraps 80106982: e9 e8 f8 ff ff jmp 8010626f <alltraps> 80106987 <vector64>: .globl vector64 vector64: pushl $0 80106987: 6a 00 push $0x0 pushl $64 80106989: 6a 40 push $0x40 jmp alltraps 8010698b: e9 df f8 ff ff jmp 8010626f <alltraps> 80106990 <vector65>: .globl vector65 vector65: pushl $0 80106990: 6a 00 push $0x0 pushl $65 80106992: 6a 41 push $0x41 jmp alltraps 80106994: e9 d6 f8 ff ff jmp 8010626f <alltraps> 80106999 <vector66>: .globl vector66 vector66: pushl $0 80106999: 6a 00 push $0x0 pushl $66 8010699b: 6a 42 push $0x42 jmp alltraps 8010699d: e9 cd f8 ff ff jmp 8010626f <alltraps> 801069a2 <vector67>: .globl vector67 vector67: pushl $0 801069a2: 6a 00 push $0x0 pushl $67 801069a4: 6a 43 push $0x43 jmp alltraps 801069a6: e9 c4 f8 ff ff jmp 8010626f <alltraps> 801069ab <vector68>: .globl vector68 vector68: pushl $0 801069ab: 6a 00 push $0x0 pushl $68 801069ad: 6a 44 push $0x44 jmp alltraps 801069af: e9 bb f8 ff ff jmp 8010626f <alltraps> 801069b4 <vector69>: .globl vector69 vector69: pushl $0 801069b4: 6a 00 push $0x0 pushl $69 801069b6: 6a 45 push $0x45 jmp alltraps 801069b8: e9 b2 f8 ff ff jmp 8010626f <alltraps> 801069bd <vector70>: .globl vector70 vector70: pushl $0 801069bd: 6a 00 push $0x0 pushl $70 801069bf: 6a 46 push $0x46 jmp alltraps 801069c1: e9 a9 f8 ff ff jmp 8010626f <alltraps> 801069c6 <vector71>: .globl vector71 vector71: pushl $0 801069c6: 6a 00 push $0x0 pushl $71 801069c8: 6a 47 push $0x47 jmp alltraps 801069ca: e9 a0 f8 ff ff jmp 8010626f <alltraps> 801069cf <vector72>: .globl vector72 vector72: pushl $0 801069cf: 6a 00 push $0x0 pushl $72 801069d1: 6a 48 push $0x48 jmp alltraps 801069d3: e9 97 f8 ff ff jmp 8010626f <alltraps> 801069d8 <vector73>: .globl vector73 vector73: pushl $0 801069d8: 6a 00 push $0x0 pushl $73 801069da: 6a 49 push $0x49 jmp alltraps 801069dc: e9 8e f8 ff ff jmp 8010626f <alltraps> 801069e1 <vector74>: .globl vector74 vector74: pushl $0 801069e1: 6a 00 push $0x0 pushl $74 801069e3: 6a 4a push $0x4a jmp alltraps 801069e5: e9 85 f8 ff ff jmp 8010626f <alltraps> 801069ea <vector75>: .globl vector75 vector75: pushl $0 801069ea: 6a 00 push $0x0 pushl $75 801069ec: 6a 4b push $0x4b jmp alltraps 801069ee: e9 7c f8 ff ff jmp 8010626f <alltraps> 801069f3 <vector76>: .globl vector76 vector76: pushl $0 801069f3: 6a 00 push $0x0 pushl $76 801069f5: 6a 4c push $0x4c jmp alltraps 801069f7: e9 73 f8 ff ff jmp 8010626f <alltraps> 801069fc <vector77>: .globl vector77 vector77: pushl $0 801069fc: 6a 00 push $0x0 pushl $77 801069fe: 6a 4d push $0x4d jmp alltraps 80106a00: e9 6a f8 ff ff jmp 8010626f <alltraps> 80106a05 <vector78>: .globl vector78 vector78: pushl $0 80106a05: 6a 00 push $0x0 pushl $78 80106a07: 6a 4e push $0x4e jmp alltraps 80106a09: e9 61 f8 ff ff jmp 8010626f <alltraps> 80106a0e <vector79>: .globl vector79 vector79: pushl $0 80106a0e: 6a 00 push $0x0 pushl $79 80106a10: 6a 4f push $0x4f jmp alltraps 80106a12: e9 58 f8 ff ff jmp 8010626f <alltraps> 80106a17 <vector80>: .globl vector80 vector80: pushl $0 80106a17: 6a 00 push $0x0 pushl $80 80106a19: 6a 50 push $0x50 jmp alltraps 80106a1b: e9 4f f8 ff ff jmp 8010626f <alltraps> 80106a20 <vector81>: .globl vector81 vector81: pushl $0 80106a20: 6a 00 push $0x0 pushl $81 80106a22: 6a 51 push $0x51 jmp alltraps 80106a24: e9 46 f8 ff ff jmp 8010626f <alltraps> 80106a29 <vector82>: .globl vector82 vector82: pushl $0 80106a29: 6a 00 push $0x0 pushl $82 80106a2b: 6a 52 push $0x52 jmp alltraps 80106a2d: e9 3d f8 ff ff jmp 8010626f <alltraps> 80106a32 <vector83>: .globl vector83 vector83: pushl $0 80106a32: 6a 00 push $0x0 pushl $83 80106a34: 6a 53 push $0x53 jmp alltraps 80106a36: e9 34 f8 ff ff jmp 8010626f <alltraps> 80106a3b <vector84>: .globl vector84 vector84: pushl $0 80106a3b: 6a 00 push $0x0 pushl $84 80106a3d: 6a 54 push $0x54 jmp alltraps 80106a3f: e9 2b f8 ff ff jmp 8010626f <alltraps> 80106a44 <vector85>: .globl vector85 vector85: pushl $0 80106a44: 6a 00 push $0x0 pushl $85 80106a46: 6a 55 push $0x55 jmp alltraps 80106a48: e9 22 f8 ff ff jmp 8010626f <alltraps> 80106a4d <vector86>: .globl vector86 vector86: pushl $0 80106a4d: 6a 00 push $0x0 pushl $86 80106a4f: 6a 56 push $0x56 jmp alltraps 80106a51: e9 19 f8 ff ff jmp 8010626f <alltraps> 80106a56 <vector87>: .globl vector87 vector87: pushl $0 80106a56: 6a 00 push $0x0 pushl $87 80106a58: 6a 57 push $0x57 jmp alltraps 80106a5a: e9 10 f8 ff ff jmp 8010626f <alltraps> 80106a5f <vector88>: .globl vector88 vector88: pushl $0 80106a5f: 6a 00 push $0x0 pushl $88 80106a61: 6a 58 push $0x58 jmp alltraps 80106a63: e9 07 f8 ff ff jmp 8010626f <alltraps> 80106a68 <vector89>: .globl vector89 vector89: pushl $0 80106a68: 6a 00 push $0x0 pushl $89 80106a6a: 6a 59 push $0x59 jmp alltraps 80106a6c: e9 fe f7 ff ff jmp 8010626f <alltraps> 80106a71 <vector90>: .globl vector90 vector90: pushl $0 80106a71: 6a 00 push $0x0 pushl $90 80106a73: 6a 5a push $0x5a jmp alltraps 80106a75: e9 f5 f7 ff ff jmp 8010626f <alltraps> 80106a7a <vector91>: .globl vector91 vector91: pushl $0 80106a7a: 6a 00 push $0x0 pushl $91 80106a7c: 6a 5b push $0x5b jmp alltraps 80106a7e: e9 ec f7 ff ff jmp 8010626f <alltraps> 80106a83 <vector92>: .globl vector92 vector92: pushl $0 80106a83: 6a 00 push $0x0 pushl $92 80106a85: 6a 5c push $0x5c jmp alltraps 80106a87: e9 e3 f7 ff ff jmp 8010626f <alltraps> 80106a8c <vector93>: .globl vector93 vector93: pushl $0 80106a8c: 6a 00 push $0x0 pushl $93 80106a8e: 6a 5d push $0x5d jmp alltraps 80106a90: e9 da f7 ff ff jmp 8010626f <alltraps> 80106a95 <vector94>: .globl vector94 vector94: pushl $0 80106a95: 6a 00 push $0x0 pushl $94 80106a97: 6a 5e push $0x5e jmp alltraps 80106a99: e9 d1 f7 ff ff jmp 8010626f <alltraps> 80106a9e <vector95>: .globl vector95 vector95: pushl $0 80106a9e: 6a 00 push $0x0 pushl $95 80106aa0: 6a 5f push $0x5f jmp alltraps 80106aa2: e9 c8 f7 ff ff jmp 8010626f <alltraps> 80106aa7 <vector96>: .globl vector96 vector96: pushl $0 80106aa7: 6a 00 push $0x0 pushl $96 80106aa9: 6a 60 push $0x60 jmp alltraps 80106aab: e9 bf f7 ff ff jmp 8010626f <alltraps> 80106ab0 <vector97>: .globl vector97 vector97: pushl $0 80106ab0: 6a 00 push $0x0 pushl $97 80106ab2: 6a 61 push $0x61 jmp alltraps 80106ab4: e9 b6 f7 ff ff jmp 8010626f <alltraps> 80106ab9 <vector98>: .globl vector98 vector98: pushl $0 80106ab9: 6a 00 push $0x0 pushl $98 80106abb: 6a 62 push $0x62 jmp alltraps 80106abd: e9 ad f7 ff ff jmp 8010626f <alltraps> 80106ac2 <vector99>: .globl vector99 vector99: pushl $0 80106ac2: 6a 00 push $0x0 pushl $99 80106ac4: 6a 63 push $0x63 jmp alltraps 80106ac6: e9 a4 f7 ff ff jmp 8010626f <alltraps> 80106acb <vector100>: .globl vector100 vector100: pushl $0 80106acb: 6a 00 push $0x0 pushl $100 80106acd: 6a 64 push $0x64 jmp alltraps 80106acf: e9 9b f7 ff ff jmp 8010626f <alltraps> 80106ad4 <vector101>: .globl vector101 vector101: pushl $0 80106ad4: 6a 00 push $0x0 pushl $101 80106ad6: 6a 65 push $0x65 jmp alltraps 80106ad8: e9 92 f7 ff ff jmp 8010626f <alltraps> 80106add <vector102>: .globl vector102 vector102: pushl $0 80106add: 6a 00 push $0x0 pushl $102 80106adf: 6a 66 push $0x66 jmp alltraps 80106ae1: e9 89 f7 ff ff jmp 8010626f <alltraps> 80106ae6 <vector103>: .globl vector103 vector103: pushl $0 80106ae6: 6a 00 push $0x0 pushl $103 80106ae8: 6a 67 push $0x67 jmp alltraps 80106aea: e9 80 f7 ff ff jmp 8010626f <alltraps> 80106aef <vector104>: .globl vector104 vector104: pushl $0 80106aef: 6a 00 push $0x0 pushl $104 80106af1: 6a 68 push $0x68 jmp alltraps 80106af3: e9 77 f7 ff ff jmp 8010626f <alltraps> 80106af8 <vector105>: .globl vector105 vector105: pushl $0 80106af8: 6a 00 push $0x0 pushl $105 80106afa: 6a 69 push $0x69 jmp alltraps 80106afc: e9 6e f7 ff ff jmp 8010626f <alltraps> 80106b01 <vector106>: .globl vector106 vector106: pushl $0 80106b01: 6a 00 push $0x0 pushl $106 80106b03: 6a 6a push $0x6a jmp alltraps 80106b05: e9 65 f7 ff ff jmp 8010626f <alltraps> 80106b0a <vector107>: .globl vector107 vector107: pushl $0 80106b0a: 6a 00 push $0x0 pushl $107 80106b0c: 6a 6b push $0x6b jmp alltraps 80106b0e: e9 5c f7 ff ff jmp 8010626f <alltraps> 80106b13 <vector108>: .globl vector108 vector108: pushl $0 80106b13: 6a 00 push $0x0 pushl $108 80106b15: 6a 6c push $0x6c jmp alltraps 80106b17: e9 53 f7 ff ff jmp 8010626f <alltraps> 80106b1c <vector109>: .globl vector109 vector109: pushl $0 80106b1c: 6a 00 push $0x0 pushl $109 80106b1e: 6a 6d push $0x6d jmp alltraps 80106b20: e9 4a f7 ff ff jmp 8010626f <alltraps> 80106b25 <vector110>: .globl vector110 vector110: pushl $0 80106b25: 6a 00 push $0x0 pushl $110 80106b27: 6a 6e push $0x6e jmp alltraps 80106b29: e9 41 f7 ff ff jmp 8010626f <alltraps> 80106b2e <vector111>: .globl vector111 vector111: pushl $0 80106b2e: 6a 00 push $0x0 pushl $111 80106b30: 6a 6f push $0x6f jmp alltraps 80106b32: e9 38 f7 ff ff jmp 8010626f <alltraps> 80106b37 <vector112>: .globl vector112 vector112: pushl $0 80106b37: 6a 00 push $0x0 pushl $112 80106b39: 6a 70 push $0x70 jmp alltraps 80106b3b: e9 2f f7 ff ff jmp 8010626f <alltraps> 80106b40 <vector113>: .globl vector113 vector113: pushl $0 80106b40: 6a 00 push $0x0 pushl $113 80106b42: 6a 71 push $0x71 jmp alltraps 80106b44: e9 26 f7 ff ff jmp 8010626f <alltraps> 80106b49 <vector114>: .globl vector114 vector114: pushl $0 80106b49: 6a 00 push $0x0 pushl $114 80106b4b: 6a 72 push $0x72 jmp alltraps 80106b4d: e9 1d f7 ff ff jmp 8010626f <alltraps> 80106b52 <vector115>: .globl vector115 vector115: pushl $0 80106b52: 6a 00 push $0x0 pushl $115 80106b54: 6a 73 push $0x73 jmp alltraps 80106b56: e9 14 f7 ff ff jmp 8010626f <alltraps> 80106b5b <vector116>: .globl vector116 vector116: pushl $0 80106b5b: 6a 00 push $0x0 pushl $116 80106b5d: 6a 74 push $0x74 jmp alltraps 80106b5f: e9 0b f7 ff ff jmp 8010626f <alltraps> 80106b64 <vector117>: .globl vector117 vector117: pushl $0 80106b64: 6a 00 push $0x0 pushl $117 80106b66: 6a 75 push $0x75 jmp alltraps 80106b68: e9 02 f7 ff ff jmp 8010626f <alltraps> 80106b6d <vector118>: .globl vector118 vector118: pushl $0 80106b6d: 6a 00 push $0x0 pushl $118 80106b6f: 6a 76 push $0x76 jmp alltraps 80106b71: e9 f9 f6 ff ff jmp 8010626f <alltraps> 80106b76 <vector119>: .globl vector119 vector119: pushl $0 80106b76: 6a 00 push $0x0 pushl $119 80106b78: 6a 77 push $0x77 jmp alltraps 80106b7a: e9 f0 f6 ff ff jmp 8010626f <alltraps> 80106b7f <vector120>: .globl vector120 vector120: pushl $0 80106b7f: 6a 00 push $0x0 pushl $120 80106b81: 6a 78 push $0x78 jmp alltraps 80106b83: e9 e7 f6 ff ff jmp 8010626f <alltraps> 80106b88 <vector121>: .globl vector121 vector121: pushl $0 80106b88: 6a 00 push $0x0 pushl $121 80106b8a: 6a 79 push $0x79 jmp alltraps 80106b8c: e9 de f6 ff ff jmp 8010626f <alltraps> 80106b91 <vector122>: .globl vector122 vector122: pushl $0 80106b91: 6a 00 push $0x0 pushl $122 80106b93: 6a 7a push $0x7a jmp alltraps 80106b95: e9 d5 f6 ff ff jmp 8010626f <alltraps> 80106b9a <vector123>: .globl vector123 vector123: pushl $0 80106b9a: 6a 00 push $0x0 pushl $123 80106b9c: 6a 7b push $0x7b jmp alltraps 80106b9e: e9 cc f6 ff ff jmp 8010626f <alltraps> 80106ba3 <vector124>: .globl vector124 vector124: pushl $0 80106ba3: 6a 00 push $0x0 pushl $124 80106ba5: 6a 7c push $0x7c jmp alltraps 80106ba7: e9 c3 f6 ff ff jmp 8010626f <alltraps> 80106bac <vector125>: .globl vector125 vector125: pushl $0 80106bac: 6a 00 push $0x0 pushl $125 80106bae: 6a 7d push $0x7d jmp alltraps 80106bb0: e9 ba f6 ff ff jmp 8010626f <alltraps> 80106bb5 <vector126>: .globl vector126 vector126: pushl $0 80106bb5: 6a 00 push $0x0 pushl $126 80106bb7: 6a 7e push $0x7e jmp alltraps 80106bb9: e9 b1 f6 ff ff jmp 8010626f <alltraps> 80106bbe <vector127>: .globl vector127 vector127: pushl $0 80106bbe: 6a 00 push $0x0 pushl $127 80106bc0: 6a 7f push $0x7f jmp alltraps 80106bc2: e9 a8 f6 ff ff jmp 8010626f <alltraps> 80106bc7 <vector128>: .globl vector128 vector128: pushl $0 80106bc7: 6a 00 push $0x0 pushl $128 80106bc9: 68 80 00 00 00 push $0x80 jmp alltraps 80106bce: e9 9c f6 ff ff jmp 8010626f <alltraps> 80106bd3 <vector129>: .globl vector129 vector129: pushl $0 80106bd3: 6a 00 push $0x0 pushl $129 80106bd5: 68 81 00 00 00 push $0x81 jmp alltraps 80106bda: e9 90 f6 ff ff jmp 8010626f <alltraps> 80106bdf <vector130>: .globl vector130 vector130: pushl $0 80106bdf: 6a 00 push $0x0 pushl $130 80106be1: 68 82 00 00 00 push $0x82 jmp alltraps 80106be6: e9 84 f6 ff ff jmp 8010626f <alltraps> 80106beb <vector131>: .globl vector131 vector131: pushl $0 80106beb: 6a 00 push $0x0 pushl $131 80106bed: 68 83 00 00 00 push $0x83 jmp alltraps 80106bf2: e9 78 f6 ff ff jmp 8010626f <alltraps> 80106bf7 <vector132>: .globl vector132 vector132: pushl $0 80106bf7: 6a 00 push $0x0 pushl $132 80106bf9: 68 84 00 00 00 push $0x84 jmp alltraps 80106bfe: e9 6c f6 ff ff jmp 8010626f <alltraps> 80106c03 <vector133>: .globl vector133 vector133: pushl $0 80106c03: 6a 00 push $0x0 pushl $133 80106c05: 68 85 00 00 00 push $0x85 jmp alltraps 80106c0a: e9 60 f6 ff ff jmp 8010626f <alltraps> 80106c0f <vector134>: .globl vector134 vector134: pushl $0 80106c0f: 6a 00 push $0x0 pushl $134 80106c11: 68 86 00 00 00 push $0x86 jmp alltraps 80106c16: e9 54 f6 ff ff jmp 8010626f <alltraps> 80106c1b <vector135>: .globl vector135 vector135: pushl $0 80106c1b: 6a 00 push $0x0 pushl $135 80106c1d: 68 87 00 00 00 push $0x87 jmp alltraps 80106c22: e9 48 f6 ff ff jmp 8010626f <alltraps> 80106c27 <vector136>: .globl vector136 vector136: pushl $0 80106c27: 6a 00 push $0x0 pushl $136 80106c29: 68 88 00 00 00 push $0x88 jmp alltraps 80106c2e: e9 3c f6 ff ff jmp 8010626f <alltraps> 80106c33 <vector137>: .globl vector137 vector137: pushl $0 80106c33: 6a 00 push $0x0 pushl $137 80106c35: 68 89 00 00 00 push $0x89 jmp alltraps 80106c3a: e9 30 f6 ff ff jmp 8010626f <alltraps> 80106c3f <vector138>: .globl vector138 vector138: pushl $0 80106c3f: 6a 00 push $0x0 pushl $138 80106c41: 68 8a 00 00 00 push $0x8a jmp alltraps 80106c46: e9 24 f6 ff ff jmp 8010626f <alltraps> 80106c4b <vector139>: .globl vector139 vector139: pushl $0 80106c4b: 6a 00 push $0x0 pushl $139 80106c4d: 68 8b 00 00 00 push $0x8b jmp alltraps 80106c52: e9 18 f6 ff ff jmp 8010626f <alltraps> 80106c57 <vector140>: .globl vector140 vector140: pushl $0 80106c57: 6a 00 push $0x0 pushl $140 80106c59: 68 8c 00 00 00 push $0x8c jmp alltraps 80106c5e: e9 0c f6 ff ff jmp 8010626f <alltraps> 80106c63 <vector141>: .globl vector141 vector141: pushl $0 80106c63: 6a 00 push $0x0 pushl $141 80106c65: 68 8d 00 00 00 push $0x8d jmp alltraps 80106c6a: e9 00 f6 ff ff jmp 8010626f <alltraps> 80106c6f <vector142>: .globl vector142 vector142: pushl $0 80106c6f: 6a 00 push $0x0 pushl $142 80106c71: 68 8e 00 00 00 push $0x8e jmp alltraps 80106c76: e9 f4 f5 ff ff jmp 8010626f <alltraps> 80106c7b <vector143>: .globl vector143 vector143: pushl $0 80106c7b: 6a 00 push $0x0 pushl $143 80106c7d: 68 8f 00 00 00 push $0x8f jmp alltraps 80106c82: e9 e8 f5 ff ff jmp 8010626f <alltraps> 80106c87 <vector144>: .globl vector144 vector144: pushl $0 80106c87: 6a 00 push $0x0 pushl $144 80106c89: 68 90 00 00 00 push $0x90 jmp alltraps 80106c8e: e9 dc f5 ff ff jmp 8010626f <alltraps> 80106c93 <vector145>: .globl vector145 vector145: pushl $0 80106c93: 6a 00 push $0x0 pushl $145 80106c95: 68 91 00 00 00 push $0x91 jmp alltraps 80106c9a: e9 d0 f5 ff ff jmp 8010626f <alltraps> 80106c9f <vector146>: .globl vector146 vector146: pushl $0 80106c9f: 6a 00 push $0x0 pushl $146 80106ca1: 68 92 00 00 00 push $0x92 jmp alltraps 80106ca6: e9 c4 f5 ff ff jmp 8010626f <alltraps> 80106cab <vector147>: .globl vector147 vector147: pushl $0 80106cab: 6a 00 push $0x0 pushl $147 80106cad: 68 93 00 00 00 push $0x93 jmp alltraps 80106cb2: e9 b8 f5 ff ff jmp 8010626f <alltraps> 80106cb7 <vector148>: .globl vector148 vector148: pushl $0 80106cb7: 6a 00 push $0x0 pushl $148 80106cb9: 68 94 00 00 00 push $0x94 jmp alltraps 80106cbe: e9 ac f5 ff ff jmp 8010626f <alltraps> 80106cc3 <vector149>: .globl vector149 vector149: pushl $0 80106cc3: 6a 00 push $0x0 pushl $149 80106cc5: 68 95 00 00 00 push $0x95 jmp alltraps 80106cca: e9 a0 f5 ff ff jmp 8010626f <alltraps> 80106ccf <vector150>: .globl vector150 vector150: pushl $0 80106ccf: 6a 00 push $0x0 pushl $150 80106cd1: 68 96 00 00 00 push $0x96 jmp alltraps 80106cd6: e9 94 f5 ff ff jmp 8010626f <alltraps> 80106cdb <vector151>: .globl vector151 vector151: pushl $0 80106cdb: 6a 00 push $0x0 pushl $151 80106cdd: 68 97 00 00 00 push $0x97 jmp alltraps 80106ce2: e9 88 f5 ff ff jmp 8010626f <alltraps> 80106ce7 <vector152>: .globl vector152 vector152: pushl $0 80106ce7: 6a 00 push $0x0 pushl $152 80106ce9: 68 98 00 00 00 push $0x98 jmp alltraps 80106cee: e9 7c f5 ff ff jmp 8010626f <alltraps> 80106cf3 <vector153>: .globl vector153 vector153: pushl $0 80106cf3: 6a 00 push $0x0 pushl $153 80106cf5: 68 99 00 00 00 push $0x99 jmp alltraps 80106cfa: e9 70 f5 ff ff jmp 8010626f <alltraps> 80106cff <vector154>: .globl vector154 vector154: pushl $0 80106cff: 6a 00 push $0x0 pushl $154 80106d01: 68 9a 00 00 00 push $0x9a jmp alltraps 80106d06: e9 64 f5 ff ff jmp 8010626f <alltraps> 80106d0b <vector155>: .globl vector155 vector155: pushl $0 80106d0b: 6a 00 push $0x0 pushl $155 80106d0d: 68 9b 00 00 00 push $0x9b jmp alltraps 80106d12: e9 58 f5 ff ff jmp 8010626f <alltraps> 80106d17 <vector156>: .globl vector156 vector156: pushl $0 80106d17: 6a 00 push $0x0 pushl $156 80106d19: 68 9c 00 00 00 push $0x9c jmp alltraps 80106d1e: e9 4c f5 ff ff jmp 8010626f <alltraps> 80106d23 <vector157>: .globl vector157 vector157: pushl $0 80106d23: 6a 00 push $0x0 pushl $157 80106d25: 68 9d 00 00 00 push $0x9d jmp alltraps 80106d2a: e9 40 f5 ff ff jmp 8010626f <alltraps> 80106d2f <vector158>: .globl vector158 vector158: pushl $0 80106d2f: 6a 00 push $0x0 pushl $158 80106d31: 68 9e 00 00 00 push $0x9e jmp alltraps 80106d36: e9 34 f5 ff ff jmp 8010626f <alltraps> 80106d3b <vector159>: .globl vector159 vector159: pushl $0 80106d3b: 6a 00 push $0x0 pushl $159 80106d3d: 68 9f 00 00 00 push $0x9f jmp alltraps 80106d42: e9 28 f5 ff ff jmp 8010626f <alltraps> 80106d47 <vector160>: .globl vector160 vector160: pushl $0 80106d47: 6a 00 push $0x0 pushl $160 80106d49: 68 a0 00 00 00 push $0xa0 jmp alltraps 80106d4e: e9 1c f5 ff ff jmp 8010626f <alltraps> 80106d53 <vector161>: .globl vector161 vector161: pushl $0 80106d53: 6a 00 push $0x0 pushl $161 80106d55: 68 a1 00 00 00 push $0xa1 jmp alltraps 80106d5a: e9 10 f5 ff ff jmp 8010626f <alltraps> 80106d5f <vector162>: .globl vector162 vector162: pushl $0 80106d5f: 6a 00 push $0x0 pushl $162 80106d61: 68 a2 00 00 00 push $0xa2 jmp alltraps 80106d66: e9 04 f5 ff ff jmp 8010626f <alltraps> 80106d6b <vector163>: .globl vector163 vector163: pushl $0 80106d6b: 6a 00 push $0x0 pushl $163 80106d6d: 68 a3 00 00 00 push $0xa3 jmp alltraps 80106d72: e9 f8 f4 ff ff jmp 8010626f <alltraps> 80106d77 <vector164>: .globl vector164 vector164: pushl $0 80106d77: 6a 00 push $0x0 pushl $164 80106d79: 68 a4 00 00 00 push $0xa4 jmp alltraps 80106d7e: e9 ec f4 ff ff jmp 8010626f <alltraps> 80106d83 <vector165>: .globl vector165 vector165: pushl $0 80106d83: 6a 00 push $0x0 pushl $165 80106d85: 68 a5 00 00 00 push $0xa5 jmp alltraps 80106d8a: e9 e0 f4 ff ff jmp 8010626f <alltraps> 80106d8f <vector166>: .globl vector166 vector166: pushl $0 80106d8f: 6a 00 push $0x0 pushl $166 80106d91: 68 a6 00 00 00 push $0xa6 jmp alltraps 80106d96: e9 d4 f4 ff ff jmp 8010626f <alltraps> 80106d9b <vector167>: .globl vector167 vector167: pushl $0 80106d9b: 6a 00 push $0x0 pushl $167 80106d9d: 68 a7 00 00 00 push $0xa7 jmp alltraps 80106da2: e9 c8 f4 ff ff jmp 8010626f <alltraps> 80106da7 <vector168>: .globl vector168 vector168: pushl $0 80106da7: 6a 00 push $0x0 pushl $168 80106da9: 68 a8 00 00 00 push $0xa8 jmp alltraps 80106dae: e9 bc f4 ff ff jmp 8010626f <alltraps> 80106db3 <vector169>: .globl vector169 vector169: pushl $0 80106db3: 6a 00 push $0x0 pushl $169 80106db5: 68 a9 00 00 00 push $0xa9 jmp alltraps 80106dba: e9 b0 f4 ff ff jmp 8010626f <alltraps> 80106dbf <vector170>: .globl vector170 vector170: pushl $0 80106dbf: 6a 00 push $0x0 pushl $170 80106dc1: 68 aa 00 00 00 push $0xaa jmp alltraps 80106dc6: e9 a4 f4 ff ff jmp 8010626f <alltraps> 80106dcb <vector171>: .globl vector171 vector171: pushl $0 80106dcb: 6a 00 push $0x0 pushl $171 80106dcd: 68 ab 00 00 00 push $0xab jmp alltraps 80106dd2: e9 98 f4 ff ff jmp 8010626f <alltraps> 80106dd7 <vector172>: .globl vector172 vector172: pushl $0 80106dd7: 6a 00 push $0x0 pushl $172 80106dd9: 68 ac 00 00 00 push $0xac jmp alltraps 80106dde: e9 8c f4 ff ff jmp 8010626f <alltraps> 80106de3 <vector173>: .globl vector173 vector173: pushl $0 80106de3: 6a 00 push $0x0 pushl $173 80106de5: 68 ad 00 00 00 push $0xad jmp alltraps 80106dea: e9 80 f4 ff ff jmp 8010626f <alltraps> 80106def <vector174>: .globl vector174 vector174: pushl $0 80106def: 6a 00 push $0x0 pushl $174 80106df1: 68 ae 00 00 00 push $0xae jmp alltraps 80106df6: e9 74 f4 ff ff jmp 8010626f <alltraps> 80106dfb <vector175>: .globl vector175 vector175: pushl $0 80106dfb: 6a 00 push $0x0 pushl $175 80106dfd: 68 af 00 00 00 push $0xaf jmp alltraps 80106e02: e9 68 f4 ff ff jmp 8010626f <alltraps> 80106e07 <vector176>: .globl vector176 vector176: pushl $0 80106e07: 6a 00 push $0x0 pushl $176 80106e09: 68 b0 00 00 00 push $0xb0 jmp alltraps 80106e0e: e9 5c f4 ff ff jmp 8010626f <alltraps> 80106e13 <vector177>: .globl vector177 vector177: pushl $0 80106e13: 6a 00 push $0x0 pushl $177 80106e15: 68 b1 00 00 00 push $0xb1 jmp alltraps 80106e1a: e9 50 f4 ff ff jmp 8010626f <alltraps> 80106e1f <vector178>: .globl vector178 vector178: pushl $0 80106e1f: 6a 00 push $0x0 pushl $178 80106e21: 68 b2 00 00 00 push $0xb2 jmp alltraps 80106e26: e9 44 f4 ff ff jmp 8010626f <alltraps> 80106e2b <vector179>: .globl vector179 vector179: pushl $0 80106e2b: 6a 00 push $0x0 pushl $179 80106e2d: 68 b3 00 00 00 push $0xb3 jmp alltraps 80106e32: e9 38 f4 ff ff jmp 8010626f <alltraps> 80106e37 <vector180>: .globl vector180 vector180: pushl $0 80106e37: 6a 00 push $0x0 pushl $180 80106e39: 68 b4 00 00 00 push $0xb4 jmp alltraps 80106e3e: e9 2c f4 ff ff jmp 8010626f <alltraps> 80106e43 <vector181>: .globl vector181 vector181: pushl $0 80106e43: 6a 00 push $0x0 pushl $181 80106e45: 68 b5 00 00 00 push $0xb5 jmp alltraps 80106e4a: e9 20 f4 ff ff jmp 8010626f <alltraps> 80106e4f <vector182>: .globl vector182 vector182: pushl $0 80106e4f: 6a 00 push $0x0 pushl $182 80106e51: 68 b6 00 00 00 push $0xb6 jmp alltraps 80106e56: e9 14 f4 ff ff jmp 8010626f <alltraps> 80106e5b <vector183>: .globl vector183 vector183: pushl $0 80106e5b: 6a 00 push $0x0 pushl $183 80106e5d: 68 b7 00 00 00 push $0xb7 jmp alltraps 80106e62: e9 08 f4 ff ff jmp 8010626f <alltraps> 80106e67 <vector184>: .globl vector184 vector184: pushl $0 80106e67: 6a 00 push $0x0 pushl $184 80106e69: 68 b8 00 00 00 push $0xb8 jmp alltraps 80106e6e: e9 fc f3 ff ff jmp 8010626f <alltraps> 80106e73 <vector185>: .globl vector185 vector185: pushl $0 80106e73: 6a 00 push $0x0 pushl $185 80106e75: 68 b9 00 00 00 push $0xb9 jmp alltraps 80106e7a: e9 f0 f3 ff ff jmp 8010626f <alltraps> 80106e7f <vector186>: .globl vector186 vector186: pushl $0 80106e7f: 6a 00 push $0x0 pushl $186 80106e81: 68 ba 00 00 00 push $0xba jmp alltraps 80106e86: e9 e4 f3 ff ff jmp 8010626f <alltraps> 80106e8b <vector187>: .globl vector187 vector187: pushl $0 80106e8b: 6a 00 push $0x0 pushl $187 80106e8d: 68 bb 00 00 00 push $0xbb jmp alltraps 80106e92: e9 d8 f3 ff ff jmp 8010626f <alltraps> 80106e97 <vector188>: .globl vector188 vector188: pushl $0 80106e97: 6a 00 push $0x0 pushl $188 80106e99: 68 bc 00 00 00 push $0xbc jmp alltraps 80106e9e: e9 cc f3 ff ff jmp 8010626f <alltraps> 80106ea3 <vector189>: .globl vector189 vector189: pushl $0 80106ea3: 6a 00 push $0x0 pushl $189 80106ea5: 68 bd 00 00 00 push $0xbd jmp alltraps 80106eaa: e9 c0 f3 ff ff jmp 8010626f <alltraps> 80106eaf <vector190>: .globl vector190 vector190: pushl $0 80106eaf: 6a 00 push $0x0 pushl $190 80106eb1: 68 be 00 00 00 push $0xbe jmp alltraps 80106eb6: e9 b4 f3 ff ff jmp 8010626f <alltraps> 80106ebb <vector191>: .globl vector191 vector191: pushl $0 80106ebb: 6a 00 push $0x0 pushl $191 80106ebd: 68 bf 00 00 00 push $0xbf jmp alltraps 80106ec2: e9 a8 f3 ff ff jmp 8010626f <alltraps> 80106ec7 <vector192>: .globl vector192 vector192: pushl $0 80106ec7: 6a 00 push $0x0 pushl $192 80106ec9: 68 c0 00 00 00 push $0xc0 jmp alltraps 80106ece: e9 9c f3 ff ff jmp 8010626f <alltraps> 80106ed3 <vector193>: .globl vector193 vector193: pushl $0 80106ed3: 6a 00 push $0x0 pushl $193 80106ed5: 68 c1 00 00 00 push $0xc1 jmp alltraps 80106eda: e9 90 f3 ff ff jmp 8010626f <alltraps> 80106edf <vector194>: .globl vector194 vector194: pushl $0 80106edf: 6a 00 push $0x0 pushl $194 80106ee1: 68 c2 00 00 00 push $0xc2 jmp alltraps 80106ee6: e9 84 f3 ff ff jmp 8010626f <alltraps> 80106eeb <vector195>: .globl vector195 vector195: pushl $0 80106eeb: 6a 00 push $0x0 pushl $195 80106eed: 68 c3 00 00 00 push $0xc3 jmp alltraps 80106ef2: e9 78 f3 ff ff jmp 8010626f <alltraps> 80106ef7 <vector196>: .globl vector196 vector196: pushl $0 80106ef7: 6a 00 push $0x0 pushl $196 80106ef9: 68 c4 00 00 00 push $0xc4 jmp alltraps 80106efe: e9 6c f3 ff ff jmp 8010626f <alltraps> 80106f03 <vector197>: .globl vector197 vector197: pushl $0 80106f03: 6a 00 push $0x0 pushl $197 80106f05: 68 c5 00 00 00 push $0xc5 jmp alltraps 80106f0a: e9 60 f3 ff ff jmp 8010626f <alltraps> 80106f0f <vector198>: .globl vector198 vector198: pushl $0 80106f0f: 6a 00 push $0x0 pushl $198 80106f11: 68 c6 00 00 00 push $0xc6 jmp alltraps 80106f16: e9 54 f3 ff ff jmp 8010626f <alltraps> 80106f1b <vector199>: .globl vector199 vector199: pushl $0 80106f1b: 6a 00 push $0x0 pushl $199 80106f1d: 68 c7 00 00 00 push $0xc7 jmp alltraps 80106f22: e9 48 f3 ff ff jmp 8010626f <alltraps> 80106f27 <vector200>: .globl vector200 vector200: pushl $0 80106f27: 6a 00 push $0x0 pushl $200 80106f29: 68 c8 00 00 00 push $0xc8 jmp alltraps 80106f2e: e9 3c f3 ff ff jmp 8010626f <alltraps> 80106f33 <vector201>: .globl vector201 vector201: pushl $0 80106f33: 6a 00 push $0x0 pushl $201 80106f35: 68 c9 00 00 00 push $0xc9 jmp alltraps 80106f3a: e9 30 f3 ff ff jmp 8010626f <alltraps> 80106f3f <vector202>: .globl vector202 vector202: pushl $0 80106f3f: 6a 00 push $0x0 pushl $202 80106f41: 68 ca 00 00 00 push $0xca jmp alltraps 80106f46: e9 24 f3 ff ff jmp 8010626f <alltraps> 80106f4b <vector203>: .globl vector203 vector203: pushl $0 80106f4b: 6a 00 push $0x0 pushl $203 80106f4d: 68 cb 00 00 00 push $0xcb jmp alltraps 80106f52: e9 18 f3 ff ff jmp 8010626f <alltraps> 80106f57 <vector204>: .globl vector204 vector204: pushl $0 80106f57: 6a 00 push $0x0 pushl $204 80106f59: 68 cc 00 00 00 push $0xcc jmp alltraps 80106f5e: e9 0c f3 ff ff jmp 8010626f <alltraps> 80106f63 <vector205>: .globl vector205 vector205: pushl $0 80106f63: 6a 00 push $0x0 pushl $205 80106f65: 68 cd 00 00 00 push $0xcd jmp alltraps 80106f6a: e9 00 f3 ff ff jmp 8010626f <alltraps> 80106f6f <vector206>: .globl vector206 vector206: pushl $0 80106f6f: 6a 00 push $0x0 pushl $206 80106f71: 68 ce 00 00 00 push $0xce jmp alltraps 80106f76: e9 f4 f2 ff ff jmp 8010626f <alltraps> 80106f7b <vector207>: .globl vector207 vector207: pushl $0 80106f7b: 6a 00 push $0x0 pushl $207 80106f7d: 68 cf 00 00 00 push $0xcf jmp alltraps 80106f82: e9 e8 f2 ff ff jmp 8010626f <alltraps> 80106f87 <vector208>: .globl vector208 vector208: pushl $0 80106f87: 6a 00 push $0x0 pushl $208 80106f89: 68 d0 00 00 00 push $0xd0 jmp alltraps 80106f8e: e9 dc f2 ff ff jmp 8010626f <alltraps> 80106f93 <vector209>: .globl vector209 vector209: pushl $0 80106f93: 6a 00 push $0x0 pushl $209 80106f95: 68 d1 00 00 00 push $0xd1 jmp alltraps 80106f9a: e9 d0 f2 ff ff jmp 8010626f <alltraps> 80106f9f <vector210>: .globl vector210 vector210: pushl $0 80106f9f: 6a 00 push $0x0 pushl $210 80106fa1: 68 d2 00 00 00 push $0xd2 jmp alltraps 80106fa6: e9 c4 f2 ff ff jmp 8010626f <alltraps> 80106fab <vector211>: .globl vector211 vector211: pushl $0 80106fab: 6a 00 push $0x0 pushl $211 80106fad: 68 d3 00 00 00 push $0xd3 jmp alltraps 80106fb2: e9 b8 f2 ff ff jmp 8010626f <alltraps> 80106fb7 <vector212>: .globl vector212 vector212: pushl $0 80106fb7: 6a 00 push $0x0 pushl $212 80106fb9: 68 d4 00 00 00 push $0xd4 jmp alltraps 80106fbe: e9 ac f2 ff ff jmp 8010626f <alltraps> 80106fc3 <vector213>: .globl vector213 vector213: pushl $0 80106fc3: 6a 00 push $0x0 pushl $213 80106fc5: 68 d5 00 00 00 push $0xd5 jmp alltraps 80106fca: e9 a0 f2 ff ff jmp 8010626f <alltraps> 80106fcf <vector214>: .globl vector214 vector214: pushl $0 80106fcf: 6a 00 push $0x0 pushl $214 80106fd1: 68 d6 00 00 00 push $0xd6 jmp alltraps 80106fd6: e9 94 f2 ff ff jmp 8010626f <alltraps> 80106fdb <vector215>: .globl vector215 vector215: pushl $0 80106fdb: 6a 00 push $0x0 pushl $215 80106fdd: 68 d7 00 00 00 push $0xd7 jmp alltraps 80106fe2: e9 88 f2 ff ff jmp 8010626f <alltraps> 80106fe7 <vector216>: .globl vector216 vector216: pushl $0 80106fe7: 6a 00 push $0x0 pushl $216 80106fe9: 68 d8 00 00 00 push $0xd8 jmp alltraps 80106fee: e9 7c f2 ff ff jmp 8010626f <alltraps> 80106ff3 <vector217>: .globl vector217 vector217: pushl $0 80106ff3: 6a 00 push $0x0 pushl $217 80106ff5: 68 d9 00 00 00 push $0xd9 jmp alltraps 80106ffa: e9 70 f2 ff ff jmp 8010626f <alltraps> 80106fff <vector218>: .globl vector218 vector218: pushl $0 80106fff: 6a 00 push $0x0 pushl $218 80107001: 68 da 00 00 00 push $0xda jmp alltraps 80107006: e9 64 f2 ff ff jmp 8010626f <alltraps> 8010700b <vector219>: .globl vector219 vector219: pushl $0 8010700b: 6a 00 push $0x0 pushl $219 8010700d: 68 db 00 00 00 push $0xdb jmp alltraps 80107012: e9 58 f2 ff ff jmp 8010626f <alltraps> 80107017 <vector220>: .globl vector220 vector220: pushl $0 80107017: 6a 00 push $0x0 pushl $220 80107019: 68 dc 00 00 00 push $0xdc jmp alltraps 8010701e: e9 4c f2 ff ff jmp 8010626f <alltraps> 80107023 <vector221>: .globl vector221 vector221: pushl $0 80107023: 6a 00 push $0x0 pushl $221 80107025: 68 dd 00 00 00 push $0xdd jmp alltraps 8010702a: e9 40 f2 ff ff jmp 8010626f <alltraps> 8010702f <vector222>: .globl vector222 vector222: pushl $0 8010702f: 6a 00 push $0x0 pushl $222 80107031: 68 de 00 00 00 push $0xde jmp alltraps 80107036: e9 34 f2 ff ff jmp 8010626f <alltraps> 8010703b <vector223>: .globl vector223 vector223: pushl $0 8010703b: 6a 00 push $0x0 pushl $223 8010703d: 68 df 00 00 00 push $0xdf jmp alltraps 80107042: e9 28 f2 ff ff jmp 8010626f <alltraps> 80107047 <vector224>: .globl vector224 vector224: pushl $0 80107047: 6a 00 push $0x0 pushl $224 80107049: 68 e0 00 00 00 push $0xe0 jmp alltraps 8010704e: e9 1c f2 ff ff jmp 8010626f <alltraps> 80107053 <vector225>: .globl vector225 vector225: pushl $0 80107053: 6a 00 push $0x0 pushl $225 80107055: 68 e1 00 00 00 push $0xe1 jmp alltraps 8010705a: e9 10 f2 ff ff jmp 8010626f <alltraps> 8010705f <vector226>: .globl vector226 vector226: pushl $0 8010705f: 6a 00 push $0x0 pushl $226 80107061: 68 e2 00 00 00 push $0xe2 jmp alltraps 80107066: e9 04 f2 ff ff jmp 8010626f <alltraps> 8010706b <vector227>: .globl vector227 vector227: pushl $0 8010706b: 6a 00 push $0x0 pushl $227 8010706d: 68 e3 00 00 00 push $0xe3 jmp alltraps 80107072: e9 f8 f1 ff ff jmp 8010626f <alltraps> 80107077 <vector228>: .globl vector228 vector228: pushl $0 80107077: 6a 00 push $0x0 pushl $228 80107079: 68 e4 00 00 00 push $0xe4 jmp alltraps 8010707e: e9 ec f1 ff ff jmp 8010626f <alltraps> 80107083 <vector229>: .globl vector229 vector229: pushl $0 80107083: 6a 00 push $0x0 pushl $229 80107085: 68 e5 00 00 00 push $0xe5 jmp alltraps 8010708a: e9 e0 f1 ff ff jmp 8010626f <alltraps> 8010708f <vector230>: .globl vector230 vector230: pushl $0 8010708f: 6a 00 push $0x0 pushl $230 80107091: 68 e6 00 00 00 push $0xe6 jmp alltraps 80107096: e9 d4 f1 ff ff jmp 8010626f <alltraps> 8010709b <vector231>: .globl vector231 vector231: pushl $0 8010709b: 6a 00 push $0x0 pushl $231 8010709d: 68 e7 00 00 00 push $0xe7 jmp alltraps 801070a2: e9 c8 f1 ff ff jmp 8010626f <alltraps> 801070a7 <vector232>: .globl vector232 vector232: pushl $0 801070a7: 6a 00 push $0x0 pushl $232 801070a9: 68 e8 00 00 00 push $0xe8 jmp alltraps 801070ae: e9 bc f1 ff ff jmp 8010626f <alltraps> 801070b3 <vector233>: .globl vector233 vector233: pushl $0 801070b3: 6a 00 push $0x0 pushl $233 801070b5: 68 e9 00 00 00 push $0xe9 jmp alltraps 801070ba: e9 b0 f1 ff ff jmp 8010626f <alltraps> 801070bf <vector234>: .globl vector234 vector234: pushl $0 801070bf: 6a 00 push $0x0 pushl $234 801070c1: 68 ea 00 00 00 push $0xea jmp alltraps 801070c6: e9 a4 f1 ff ff jmp 8010626f <alltraps> 801070cb <vector235>: .globl vector235 vector235: pushl $0 801070cb: 6a 00 push $0x0 pushl $235 801070cd: 68 eb 00 00 00 push $0xeb jmp alltraps 801070d2: e9 98 f1 ff ff jmp 8010626f <alltraps> 801070d7 <vector236>: .globl vector236 vector236: pushl $0 801070d7: 6a 00 push $0x0 pushl $236 801070d9: 68 ec 00 00 00 push $0xec jmp alltraps 801070de: e9 8c f1 ff ff jmp 8010626f <alltraps> 801070e3 <vector237>: .globl vector237 vector237: pushl $0 801070e3: 6a 00 push $0x0 pushl $237 801070e5: 68 ed 00 00 00 push $0xed jmp alltraps 801070ea: e9 80 f1 ff ff jmp 8010626f <alltraps> 801070ef <vector238>: .globl vector238 vector238: pushl $0 801070ef: 6a 00 push $0x0 pushl $238 801070f1: 68 ee 00 00 00 push $0xee jmp alltraps 801070f6: e9 74 f1 ff ff jmp 8010626f <alltraps> 801070fb <vector239>: .globl vector239 vector239: pushl $0 801070fb: 6a 00 push $0x0 pushl $239 801070fd: 68 ef 00 00 00 push $0xef jmp alltraps 80107102: e9 68 f1 ff ff jmp 8010626f <alltraps> 80107107 <vector240>: .globl vector240 vector240: pushl $0 80107107: 6a 00 push $0x0 pushl $240 80107109: 68 f0 00 00 00 push $0xf0 jmp alltraps 8010710e: e9 5c f1 ff ff jmp 8010626f <alltraps> 80107113 <vector241>: .globl vector241 vector241: pushl $0 80107113: 6a 00 push $0x0 pushl $241 80107115: 68 f1 00 00 00 push $0xf1 jmp alltraps 8010711a: e9 50 f1 ff ff jmp 8010626f <alltraps> 8010711f <vector242>: .globl vector242 vector242: pushl $0 8010711f: 6a 00 push $0x0 pushl $242 80107121: 68 f2 00 00 00 push $0xf2 jmp alltraps 80107126: e9 44 f1 ff ff jmp 8010626f <alltraps> 8010712b <vector243>: .globl vector243 vector243: pushl $0 8010712b: 6a 00 push $0x0 pushl $243 8010712d: 68 f3 00 00 00 push $0xf3 jmp alltraps 80107132: e9 38 f1 ff ff jmp 8010626f <alltraps> 80107137 <vector244>: .globl vector244 vector244: pushl $0 80107137: 6a 00 push $0x0 pushl $244 80107139: 68 f4 00 00 00 push $0xf4 jmp alltraps 8010713e: e9 2c f1 ff ff jmp 8010626f <alltraps> 80107143 <vector245>: .globl vector245 vector245: pushl $0 80107143: 6a 00 push $0x0 pushl $245 80107145: 68 f5 00 00 00 push $0xf5 jmp alltraps 8010714a: e9 20 f1 ff ff jmp 8010626f <alltraps> 8010714f <vector246>: .globl vector246 vector246: pushl $0 8010714f: 6a 00 push $0x0 pushl $246 80107151: 68 f6 00 00 00 push $0xf6 jmp alltraps 80107156: e9 14 f1 ff ff jmp 8010626f <alltraps> 8010715b <vector247>: .globl vector247 vector247: pushl $0 8010715b: 6a 00 push $0x0 pushl $247 8010715d: 68 f7 00 00 00 push $0xf7 jmp alltraps 80107162: e9 08 f1 ff ff jmp 8010626f <alltraps> 80107167 <vector248>: .globl vector248 vector248: pushl $0 80107167: 6a 00 push $0x0 pushl $248 80107169: 68 f8 00 00 00 push $0xf8 jmp alltraps 8010716e: e9 fc f0 ff ff jmp 8010626f <alltraps> 80107173 <vector249>: .globl vector249 vector249: pushl $0 80107173: 6a 00 push $0x0 pushl $249 80107175: 68 f9 00 00 00 push $0xf9 jmp alltraps 8010717a: e9 f0 f0 ff ff jmp 8010626f <alltraps> 8010717f <vector250>: .globl vector250 vector250: pushl $0 8010717f: 6a 00 push $0x0 pushl $250 80107181: 68 fa 00 00 00 push $0xfa jmp alltraps 80107186: e9 e4 f0 ff ff jmp 8010626f <alltraps> 8010718b <vector251>: .globl vector251 vector251: pushl $0 8010718b: 6a 00 push $0x0 pushl $251 8010718d: 68 fb 00 00 00 push $0xfb jmp alltraps 80107192: e9 d8 f0 ff ff jmp 8010626f <alltraps> 80107197 <vector252>: .globl vector252 vector252: pushl $0 80107197: 6a 00 push $0x0 pushl $252 80107199: 68 fc 00 00 00 push $0xfc jmp alltraps 8010719e: e9 cc f0 ff ff jmp 8010626f <alltraps> 801071a3 <vector253>: .globl vector253 vector253: pushl $0 801071a3: 6a 00 push $0x0 pushl $253 801071a5: 68 fd 00 00 00 push $0xfd jmp alltraps 801071aa: e9 c0 f0 ff ff jmp 8010626f <alltraps> 801071af <vector254>: .globl vector254 vector254: pushl $0 801071af: 6a 00 push $0x0 pushl $254 801071b1: 68 fe 00 00 00 push $0xfe jmp alltraps 801071b6: e9 b4 f0 ff ff jmp 8010626f <alltraps> 801071bb <vector255>: .globl vector255 vector255: pushl $0 801071bb: 6a 00 push $0x0 pushl $255 801071bd: 68 ff 00 00 00 push $0xff jmp alltraps 801071c2: e9 a8 f0 ff ff jmp 8010626f <alltraps> 801071c7: 66 90 xchg %ax,%ax 801071c9: 66 90 xchg %ax,%ax 801071cb: 66 90 xchg %ax,%ax 801071cd: 66 90 xchg %ax,%ax 801071cf: 90 nop 801071d0 <walkpgdir>: } // Return the address of the PTE in page table pgdir // that corresponds to virtual address va. If alloc!=0, // create any required page table pages. static pte_t * walkpgdir(pde_t *pgdir, const void *va, int alloc) { 801071d0: 55 push %ebp 801071d1: 89 e5 mov %esp,%ebp 801071d3: 57 push %edi 801071d4: 56 push %esi 801071d5: 53 push %ebx pde_t *pde; pte_t *pgtab; pde = &pgdir[PDX(va)]; 801071d6: 89 d3 mov %edx,%ebx static pte_t * walkpgdir(pde_t *pgdir, const void *va, int alloc) { 801071d8: 89 d7 mov %edx,%edi pde = &pgdir[PDX(va)]; 801071da: c1 eb 16 shr $0x16,%ebx 801071dd: 8d 34 98 lea (%eax,%ebx,4),%esi static pte_t * walkpgdir(pde_t *pgdir, const void *va, int alloc) { 801071e0: 83 ec 0c sub $0xc,%esp if (*pde & PTE_P) { 801071e3: 8b 06 mov (%esi),%eax 801071e5: a8 01 test $0x1,%al 801071e7: 74 27 je 80107210 <walkpgdir+0x40> pgtab = (pte_t*)P2V(PTE_ADDR(*pde)); 801071e9: 25 00 f0 ff ff and $0xfffff000,%eax 801071ee: 8d 98 00 00 00 80 lea -0x80000000(%eax),%ebx // The permissions here are overly generous, but they can // be further restricted by the permissions in the page table // entries, if necessary. *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; } return &pgtab[PTX(va)]; 801071f4: c1 ef 0a shr $0xa,%edi } 801071f7: 8d 65 f4 lea -0xc(%ebp),%esp return &pgtab[PTX(va)]; 801071fa: 89 fa mov %edi,%edx 801071fc: 81 e2 fc 0f 00 00 and $0xffc,%edx 80107202: 8d 04 13 lea (%ebx,%edx,1),%eax } 80107205: 5b pop %ebx 80107206: 5e pop %esi 80107207: 5f pop %edi 80107208: 5d pop %ebp 80107209: c3 ret 8010720a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if (!alloc || (pgtab = (pte_t*)kalloc()) == 0) { 80107210: 85 c9 test %ecx,%ecx 80107212: 74 2c je 80107240 <walkpgdir+0x70> 80107214: e8 77 bd ff ff call 80102f90 <kalloc> 80107219: 85 c0 test %eax,%eax 8010721b: 89 c3 mov %eax,%ebx 8010721d: 74 21 je 80107240 <walkpgdir+0x70> memset(pgtab, 0, PGSIZE); 8010721f: 83 ec 04 sub $0x4,%esp 80107222: 68 00 10 00 00 push $0x1000 80107227: 6a 00 push $0x0 80107229: 50 push %eax 8010722a: e8 21 dd ff ff call 80104f50 <memset> *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U; 8010722f: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 80107235: 83 c4 10 add $0x10,%esp 80107238: 83 c8 07 or $0x7,%eax 8010723b: 89 06 mov %eax,(%esi) 8010723d: eb b5 jmp 801071f4 <walkpgdir+0x24> 8010723f: 90 nop } 80107240: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80107243: 31 c0 xor %eax,%eax } 80107245: 5b pop %ebx 80107246: 5e pop %esi 80107247: 5f pop %edi 80107248: 5d pop %ebp 80107249: c3 ret 8010724a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107250 <mappages>: // Create PTEs for virtual addresses starting at va that refer to // physical addresses starting at pa. va and size might not // be page-aligned. static int mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm) { 80107250: 55 push %ebp 80107251: 89 e5 mov %esp,%ebp 80107253: 57 push %edi 80107254: 56 push %esi 80107255: 53 push %ebx char *a, *last; pte_t *pte; a = (char*)PGROUNDDOWN((uint)va); 80107256: 89 d3 mov %edx,%ebx 80107258: 81 e3 00 f0 ff ff and $0xfffff000,%ebx static int mappages(pde_t *pgdir, void *va, uint size, uint pa, int perm) { 8010725e: 83 ec 1c sub $0x1c,%esp 80107261: 89 45 e4 mov %eax,-0x1c(%ebp) last = (char*)PGROUNDDOWN(((uint)va) + size - 1); 80107264: 8d 44 0a ff lea -0x1(%edx,%ecx,1),%eax 80107268: 8b 7d 08 mov 0x8(%ebp),%edi 8010726b: 25 00 f0 ff ff and $0xfffff000,%eax 80107270: 89 45 e0 mov %eax,-0x20(%ebp) return -1; } if (*pte & PTE_P) { panic("remap"); } *pte = pa | perm | PTE_P; 80107273: 8b 45 0c mov 0xc(%ebp),%eax 80107276: 29 df sub %ebx,%edi 80107278: 83 c8 01 or $0x1,%eax 8010727b: 89 45 dc mov %eax,-0x24(%ebp) 8010727e: eb 15 jmp 80107295 <mappages+0x45> if (*pte & PTE_P) { 80107280: f6 00 01 testb $0x1,(%eax) 80107283: 75 45 jne 801072ca <mappages+0x7a> *pte = pa | perm | PTE_P; 80107285: 0b 75 dc or -0x24(%ebp),%esi if (a == last) { 80107288: 3b 5d e0 cmp -0x20(%ebp),%ebx *pte = pa | perm | PTE_P; 8010728b: 89 30 mov %esi,(%eax) if (a == last) { 8010728d: 74 31 je 801072c0 <mappages+0x70> break; } a += PGSIZE; 8010728f: 81 c3 00 10 00 00 add $0x1000,%ebx if ((pte = walkpgdir(pgdir, a, 1)) == 0) { 80107295: 8b 45 e4 mov -0x1c(%ebp),%eax 80107298: b9 01 00 00 00 mov $0x1,%ecx 8010729d: 89 da mov %ebx,%edx 8010729f: 8d 34 3b lea (%ebx,%edi,1),%esi 801072a2: e8 29 ff ff ff call 801071d0 <walkpgdir> 801072a7: 85 c0 test %eax,%eax 801072a9: 75 d5 jne 80107280 <mappages+0x30> pa += PGSIZE; } return 0; } 801072ab: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 801072ae: b8 ff ff ff ff mov $0xffffffff,%eax } 801072b3: 5b pop %ebx 801072b4: 5e pop %esi 801072b5: 5f pop %edi 801072b6: 5d pop %ebp 801072b7: c3 ret 801072b8: 90 nop 801072b9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801072c0: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 801072c3: 31 c0 xor %eax,%eax } 801072c5: 5b pop %ebx 801072c6: 5e pop %esi 801072c7: 5f pop %edi 801072c8: 5d pop %ebp 801072c9: c3 ret panic("remap"); 801072ca: 83 ec 0c sub $0xc,%esp 801072cd: 68 98 84 10 80 push $0x80108498 801072d2: e8 09 92 ff ff call 801004e0 <panic> 801072d7: 89 f6 mov %esi,%esi 801072d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801072e0 <deallocuvm.part.0>: // Deallocate user pages to bring the process size from oldsz to // newsz. oldsz and newsz need not be page-aligned, nor does newsz // need to be less than oldsz. oldsz can be larger than the actual // process size. Returns the new process size. int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 801072e0: 55 push %ebp 801072e1: 89 e5 mov %esp,%ebp 801072e3: 57 push %edi 801072e4: 56 push %esi 801072e5: 53 push %ebx if (newsz >= oldsz) { return oldsz; } a = PGROUNDUP(newsz); 801072e6: 8d 99 ff 0f 00 00 lea 0xfff(%ecx),%ebx int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 801072ec: 89 c7 mov %eax,%edi a = PGROUNDUP(newsz); 801072ee: 81 e3 00 f0 ff ff and $0xfffff000,%ebx int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 801072f4: 83 ec 1c sub $0x1c,%esp 801072f7: 89 4d e0 mov %ecx,-0x20(%ebp) for (; a < oldsz; a += PGSIZE) { 801072fa: 39 d3 cmp %edx,%ebx 801072fc: 73 66 jae 80107364 <deallocuvm.part.0+0x84> 801072fe: 89 d6 mov %edx,%esi 80107300: eb 3d jmp 8010733f <deallocuvm.part.0+0x5f> 80107302: 8d b6 00 00 00 00 lea 0x0(%esi),%esi pte = walkpgdir(pgdir, (char*)a, 0); if (!pte) { a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; } else if ((*pte & PTE_P) != 0) { 80107308: 8b 10 mov (%eax),%edx 8010730a: f6 c2 01 test $0x1,%dl 8010730d: 74 26 je 80107335 <deallocuvm.part.0+0x55> pa = PTE_ADDR(*pte); if (pa == 0) { 8010730f: 81 e2 00 f0 ff ff and $0xfffff000,%edx 80107315: 74 58 je 8010736f <deallocuvm.part.0+0x8f> panic("kfree"); } char *v = P2V(pa); kfree(v); 80107317: 83 ec 0c sub $0xc,%esp char *v = P2V(pa); 8010731a: 81 c2 00 00 00 80 add $0x80000000,%edx 80107320: 89 45 e4 mov %eax,-0x1c(%ebp) kfree(v); 80107323: 52 push %edx 80107324: e8 b7 ba ff ff call 80102de0 <kfree> *pte = 0; 80107329: 8b 45 e4 mov -0x1c(%ebp),%eax 8010732c: 83 c4 10 add $0x10,%esp 8010732f: c7 00 00 00 00 00 movl $0x0,(%eax) for (; a < oldsz; a += PGSIZE) { 80107335: 81 c3 00 10 00 00 add $0x1000,%ebx 8010733b: 39 f3 cmp %esi,%ebx 8010733d: 73 25 jae 80107364 <deallocuvm.part.0+0x84> pte = walkpgdir(pgdir, (char*)a, 0); 8010733f: 31 c9 xor %ecx,%ecx 80107341: 89 da mov %ebx,%edx 80107343: 89 f8 mov %edi,%eax 80107345: e8 86 fe ff ff call 801071d0 <walkpgdir> if (!pte) { 8010734a: 85 c0 test %eax,%eax 8010734c: 75 ba jne 80107308 <deallocuvm.part.0+0x28> a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE; 8010734e: 81 e3 00 00 c0 ff and $0xffc00000,%ebx 80107354: 81 c3 00 f0 3f 00 add $0x3ff000,%ebx for (; a < oldsz; a += PGSIZE) { 8010735a: 81 c3 00 10 00 00 add $0x1000,%ebx 80107360: 39 f3 cmp %esi,%ebx 80107362: 72 db jb 8010733f <deallocuvm.part.0+0x5f> } } return newsz; } 80107364: 8b 45 e0 mov -0x20(%ebp),%eax 80107367: 8d 65 f4 lea -0xc(%ebp),%esp 8010736a: 5b pop %ebx 8010736b: 5e pop %esi 8010736c: 5f pop %edi 8010736d: 5d pop %ebp 8010736e: c3 ret panic("kfree"); 8010736f: 83 ec 0c sub $0xc,%esp 80107372: 68 b6 7d 10 80 push $0x80107db6 80107377: e8 64 91 ff ff call 801004e0 <panic> 8010737c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 80107380 <seginit>: void seginit(void) { 80107380: 55 push %ebp 80107381: 89 e5 mov %esp,%ebp 80107383: 83 ec 18 sub $0x18,%esp c = &cpus[cpuid()]; 80107386: e8 35 cf ff ff call 801042c0 <cpuid> 8010738b: 69 c0 b0 00 00 00 imul $0xb0,%eax,%eax pd[0] = size - 1; 80107391: ba 2f 00 00 00 mov $0x2f,%edx 80107396: 66 89 55 f2 mov %dx,-0xe(%ebp) c->gdt[SEG_KCODE] = SEG(STA_X | STA_R, 0, 0xffffffff, 0); 8010739a: c7 80 d8 4f 11 80 ff movl $0xffff,-0x7feeb028(%eax) 801073a1: ff 00 00 801073a4: c7 80 dc 4f 11 80 00 movl $0xcf9a00,-0x7feeb024(%eax) 801073ab: 9a cf 00 c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); 801073ae: c7 80 e0 4f 11 80 ff movl $0xffff,-0x7feeb020(%eax) 801073b5: ff 00 00 801073b8: c7 80 e4 4f 11 80 00 movl $0xcf9200,-0x7feeb01c(%eax) 801073bf: 92 cf 00 c->gdt[SEG_UCODE] = SEG(STA_X | STA_R, 0, 0xffffffff, DPL_USER); 801073c2: c7 80 e8 4f 11 80 ff movl $0xffff,-0x7feeb018(%eax) 801073c9: ff 00 00 801073cc: c7 80 ec 4f 11 80 00 movl $0xcffa00,-0x7feeb014(%eax) 801073d3: fa cf 00 c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); 801073d6: c7 80 f0 4f 11 80 ff movl $0xffff,-0x7feeb010(%eax) 801073dd: ff 00 00 801073e0: c7 80 f4 4f 11 80 00 movl $0xcff200,-0x7feeb00c(%eax) 801073e7: f2 cf 00 lgdt(c->gdt, sizeof(c->gdt)); 801073ea: 05 d0 4f 11 80 add $0x80114fd0,%eax pd[1] = (uint)p; 801073ef: 66 89 45 f4 mov %ax,-0xc(%ebp) pd[2] = (uint)p >> 16; 801073f3: c1 e8 10 shr $0x10,%eax 801073f6: 66 89 45 f6 mov %ax,-0xa(%ebp) asm volatile ("lgdt (%0)" : : "r" (pd)); 801073fa: 8d 45 f2 lea -0xe(%ebp),%eax 801073fd: 0f 01 10 lgdtl (%eax) } 80107400: c9 leave 80107401: c3 ret 80107402: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107409: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107410 <switchkvm>: lcr3(V2P(kpgdir)); // switch to the kernel page table 80107410: a1 84 7c 11 80 mov 0x80117c84,%eax void switchkvm(void) { 80107415: 55 push %ebp 80107416: 89 e5 mov %esp,%ebp lcr3(V2P(kpgdir)); // switch to the kernel page table 80107418: 05 00 00 00 80 add $0x80000000,%eax return val; } static inline void lcr3(uint val) { asm volatile ("movl %0,%%cr3" : : "r" (val)); 8010741d: 0f 22 d8 mov %eax,%cr3 } 80107420: 5d pop %ebp 80107421: c3 ret 80107422: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107429: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107430 <switchuvm>: void switchuvm(struct proc *p) { 80107430: 55 push %ebp 80107431: 89 e5 mov %esp,%ebp 80107433: 57 push %edi 80107434: 56 push %esi 80107435: 53 push %ebx 80107436: 83 ec 1c sub $0x1c,%esp 80107439: 8b 5d 08 mov 0x8(%ebp),%ebx if (p == 0) { 8010743c: 85 db test %ebx,%ebx 8010743e: 0f 84 cb 00 00 00 je 8010750f <switchuvm+0xdf> if (p->kstack == 0) { 80107444: 8b 43 08 mov 0x8(%ebx),%eax 80107447: 85 c0 test %eax,%eax 80107449: 0f 84 da 00 00 00 je 80107529 <switchuvm+0xf9> if (p->pgdir == 0) { 8010744f: 8b 43 04 mov 0x4(%ebx),%eax 80107452: 85 c0 test %eax,%eax 80107454: 0f 84 c2 00 00 00 je 8010751c <switchuvm+0xec> pushcli(); 8010745a: e8 11 d9 ff ff call 80104d70 <pushcli> mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 8010745f: e8 dc cd ff ff call 80104240 <mycpu> 80107464: 89 c6 mov %eax,%esi 80107466: e8 d5 cd ff ff call 80104240 <mycpu> 8010746b: 89 c7 mov %eax,%edi 8010746d: e8 ce cd ff ff call 80104240 <mycpu> 80107472: 89 45 e4 mov %eax,-0x1c(%ebp) 80107475: 83 c7 08 add $0x8,%edi 80107478: e8 c3 cd ff ff call 80104240 <mycpu> 8010747d: 8b 4d e4 mov -0x1c(%ebp),%ecx 80107480: 83 c0 08 add $0x8,%eax 80107483: ba 67 00 00 00 mov $0x67,%edx 80107488: c1 e8 18 shr $0x18,%eax 8010748b: 66 89 96 98 00 00 00 mov %dx,0x98(%esi) 80107492: 66 89 be 9a 00 00 00 mov %di,0x9a(%esi) 80107499: 88 86 9f 00 00 00 mov %al,0x9f(%esi) mycpu()->ts.iomb = (ushort) 0xFFFF; 8010749f: bf ff ff ff ff mov $0xffffffff,%edi mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts, 801074a4: 83 c1 08 add $0x8,%ecx 801074a7: c1 e9 10 shr $0x10,%ecx 801074aa: 88 8e 9c 00 00 00 mov %cl,0x9c(%esi) 801074b0: b9 99 40 00 00 mov $0x4099,%ecx 801074b5: 66 89 8e 9d 00 00 00 mov %cx,0x9d(%esi) mycpu()->ts.ss0 = SEG_KDATA << 3; 801074bc: be 10 00 00 00 mov $0x10,%esi mycpu()->gdt[SEG_TSS].s = 0; 801074c1: e8 7a cd ff ff call 80104240 <mycpu> 801074c6: 80 a0 9d 00 00 00 ef andb $0xef,0x9d(%eax) mycpu()->ts.ss0 = SEG_KDATA << 3; 801074cd: e8 6e cd ff ff call 80104240 <mycpu> 801074d2: 66 89 70 10 mov %si,0x10(%eax) mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE; 801074d6: 8b 73 08 mov 0x8(%ebx),%esi 801074d9: e8 62 cd ff ff call 80104240 <mycpu> 801074de: 81 c6 00 10 00 00 add $0x1000,%esi 801074e4: 89 70 0c mov %esi,0xc(%eax) mycpu()->ts.iomb = (ushort) 0xFFFF; 801074e7: e8 54 cd ff ff call 80104240 <mycpu> 801074ec: 66 89 78 6e mov %di,0x6e(%eax) asm volatile ("ltr %0" : : "r" (sel)); 801074f0: b8 28 00 00 00 mov $0x28,%eax 801074f5: 0f 00 d8 ltr %ax lcr3(V2P(p->pgdir)); // switch to process's address space 801074f8: 8b 43 04 mov 0x4(%ebx),%eax 801074fb: 05 00 00 00 80 add $0x80000000,%eax asm volatile ("movl %0,%%cr3" : : "r" (val)); 80107500: 0f 22 d8 mov %eax,%cr3 } 80107503: 8d 65 f4 lea -0xc(%ebp),%esp 80107506: 5b pop %ebx 80107507: 5e pop %esi 80107508: 5f pop %edi 80107509: 5d pop %ebp popcli(); 8010750a: e9 a1 d8 ff ff jmp 80104db0 <popcli> panic("switchuvm: no process"); 8010750f: 83 ec 0c sub $0xc,%esp 80107512: 68 9e 84 10 80 push $0x8010849e 80107517: e8 c4 8f ff ff call 801004e0 <panic> panic("switchuvm: no pgdir"); 8010751c: 83 ec 0c sub $0xc,%esp 8010751f: 68 c9 84 10 80 push $0x801084c9 80107524: e8 b7 8f ff ff call 801004e0 <panic> panic("switchuvm: no kstack"); 80107529: 83 ec 0c sub $0xc,%esp 8010752c: 68 b4 84 10 80 push $0x801084b4 80107531: e8 aa 8f ff ff call 801004e0 <panic> 80107536: 8d 76 00 lea 0x0(%esi),%esi 80107539: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107540 <inituvm>: void inituvm(pde_t *pgdir, char *init, uint sz) { 80107540: 55 push %ebp 80107541: 89 e5 mov %esp,%ebp 80107543: 57 push %edi 80107544: 56 push %esi 80107545: 53 push %ebx 80107546: 83 ec 1c sub $0x1c,%esp 80107549: 8b 75 10 mov 0x10(%ebp),%esi 8010754c: 8b 45 08 mov 0x8(%ebp),%eax 8010754f: 8b 7d 0c mov 0xc(%ebp),%edi if (sz >= PGSIZE) { 80107552: 81 fe ff 0f 00 00 cmp $0xfff,%esi void inituvm(pde_t *pgdir, char *init, uint sz) { 80107558: 89 45 e4 mov %eax,-0x1c(%ebp) if (sz >= PGSIZE) { 8010755b: 77 49 ja 801075a6 <inituvm+0x66> mem = kalloc(); 8010755d: e8 2e ba ff ff call 80102f90 <kalloc> memset(mem, 0, PGSIZE); 80107562: 83 ec 04 sub $0x4,%esp mem = kalloc(); 80107565: 89 c3 mov %eax,%ebx memset(mem, 0, PGSIZE); 80107567: 68 00 10 00 00 push $0x1000 8010756c: 6a 00 push $0x0 8010756e: 50 push %eax 8010756f: e8 dc d9 ff ff call 80104f50 <memset> mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W | PTE_U); 80107574: 58 pop %eax 80107575: 8d 83 00 00 00 80 lea -0x80000000(%ebx),%eax 8010757b: b9 00 10 00 00 mov $0x1000,%ecx 80107580: 5a pop %edx 80107581: 6a 06 push $0x6 80107583: 50 push %eax 80107584: 31 d2 xor %edx,%edx 80107586: 8b 45 e4 mov -0x1c(%ebp),%eax 80107589: e8 c2 fc ff ff call 80107250 <mappages> memmove(mem, init, sz); 8010758e: 89 75 10 mov %esi,0x10(%ebp) 80107591: 89 7d 0c mov %edi,0xc(%ebp) 80107594: 83 c4 10 add $0x10,%esp 80107597: 89 5d 08 mov %ebx,0x8(%ebp) } 8010759a: 8d 65 f4 lea -0xc(%ebp),%esp 8010759d: 5b pop %ebx 8010759e: 5e pop %esi 8010759f: 5f pop %edi 801075a0: 5d pop %ebp memmove(mem, init, sz); 801075a1: e9 5a da ff ff jmp 80105000 <memmove> panic("inituvm: more than a page"); 801075a6: 83 ec 0c sub $0xc,%esp 801075a9: 68 dd 84 10 80 push $0x801084dd 801075ae: e8 2d 8f ff ff call 801004e0 <panic> 801075b3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801075b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801075c0 <loaduvm>: int loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz) { 801075c0: 55 push %ebp 801075c1: 89 e5 mov %esp,%ebp 801075c3: 57 push %edi 801075c4: 56 push %esi 801075c5: 53 push %ebx 801075c6: 83 ec 0c sub $0xc,%esp if ((uint) addr % PGSIZE != 0) { 801075c9: f7 45 0c ff 0f 00 00 testl $0xfff,0xc(%ebp) 801075d0: 0f 85 91 00 00 00 jne 80107667 <loaduvm+0xa7> for (i = 0; i < sz; i += PGSIZE) { 801075d6: 8b 75 18 mov 0x18(%ebp),%esi 801075d9: 31 db xor %ebx,%ebx 801075db: 85 f6 test %esi,%esi 801075dd: 75 1a jne 801075f9 <loaduvm+0x39> 801075df: eb 6f jmp 80107650 <loaduvm+0x90> 801075e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 801075e8: 81 c3 00 10 00 00 add $0x1000,%ebx 801075ee: 81 ee 00 10 00 00 sub $0x1000,%esi 801075f4: 39 5d 18 cmp %ebx,0x18(%ebp) 801075f7: 76 57 jbe 80107650 <loaduvm+0x90> if ((pte = walkpgdir(pgdir, addr + i, 0)) == 0) { 801075f9: 8b 55 0c mov 0xc(%ebp),%edx 801075fc: 8b 45 08 mov 0x8(%ebp),%eax 801075ff: 31 c9 xor %ecx,%ecx 80107601: 01 da add %ebx,%edx 80107603: e8 c8 fb ff ff call 801071d0 <walkpgdir> 80107608: 85 c0 test %eax,%eax 8010760a: 74 4e je 8010765a <loaduvm+0x9a> pa = PTE_ADDR(*pte); 8010760c: 8b 00 mov (%eax),%eax if (readi(ip, P2V(pa), offset + i, n) != n) { 8010760e: 8b 4d 14 mov 0x14(%ebp),%ecx if (sz - i < PGSIZE) { 80107611: bf 00 10 00 00 mov $0x1000,%edi pa = PTE_ADDR(*pte); 80107616: 25 00 f0 ff ff and $0xfffff000,%eax if (sz - i < PGSIZE) { 8010761b: 81 fe ff 0f 00 00 cmp $0xfff,%esi 80107621: 0f 46 fe cmovbe %esi,%edi if (readi(ip, P2V(pa), offset + i, n) != n) { 80107624: 01 d9 add %ebx,%ecx 80107626: 05 00 00 00 80 add $0x80000000,%eax 8010762b: 57 push %edi 8010762c: 51 push %ecx 8010762d: 50 push %eax 8010762e: ff 75 10 pushl 0x10(%ebp) 80107631: e8 fa ad ff ff call 80102430 <readi> 80107636: 83 c4 10 add $0x10,%esp 80107639: 39 f8 cmp %edi,%eax 8010763b: 74 ab je 801075e8 <loaduvm+0x28> } 8010763d: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80107640: b8 ff ff ff ff mov $0xffffffff,%eax } 80107645: 5b pop %ebx 80107646: 5e pop %esi 80107647: 5f pop %edi 80107648: 5d pop %ebp 80107649: c3 ret 8010764a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107650: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80107653: 31 c0 xor %eax,%eax } 80107655: 5b pop %ebx 80107656: 5e pop %esi 80107657: 5f pop %edi 80107658: 5d pop %ebp 80107659: c3 ret panic("loaduvm: address should exist"); 8010765a: 83 ec 0c sub $0xc,%esp 8010765d: 68 f7 84 10 80 push $0x801084f7 80107662: e8 79 8e ff ff call 801004e0 <panic> panic("loaduvm: addr must be page aligned"); 80107667: 83 ec 0c sub $0xc,%esp 8010766a: 68 98 85 10 80 push $0x80108598 8010766f: e8 6c 8e ff ff call 801004e0 <panic> 80107674: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8010767a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 80107680 <allocuvm>: int allocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 80107680: 55 push %ebp 80107681: 89 e5 mov %esp,%ebp 80107683: 57 push %edi 80107684: 56 push %esi 80107685: 53 push %ebx 80107686: 83 ec 1c sub $0x1c,%esp if (newsz >= KERNBASE) { 80107689: 8b 7d 10 mov 0x10(%ebp),%edi 8010768c: 85 ff test %edi,%edi 8010768e: 0f 88 8e 00 00 00 js 80107722 <allocuvm+0xa2> if (newsz < oldsz) { 80107694: 3b 7d 0c cmp 0xc(%ebp),%edi 80107697: 0f 82 93 00 00 00 jb 80107730 <allocuvm+0xb0> a = PGROUNDUP(oldsz); 8010769d: 8b 45 0c mov 0xc(%ebp),%eax 801076a0: 8d 98 ff 0f 00 00 lea 0xfff(%eax),%ebx 801076a6: 81 e3 00 f0 ff ff and $0xfffff000,%ebx for (; a < newsz; a += PGSIZE) { 801076ac: 39 5d 10 cmp %ebx,0x10(%ebp) 801076af: 0f 86 7e 00 00 00 jbe 80107733 <allocuvm+0xb3> 801076b5: 89 7d e4 mov %edi,-0x1c(%ebp) 801076b8: 8b 7d 08 mov 0x8(%ebp),%edi 801076bb: eb 42 jmp 801076ff <allocuvm+0x7f> 801076bd: 8d 76 00 lea 0x0(%esi),%esi memset(mem, 0, PGSIZE); 801076c0: 83 ec 04 sub $0x4,%esp 801076c3: 68 00 10 00 00 push $0x1000 801076c8: 6a 00 push $0x0 801076ca: 50 push %eax 801076cb: e8 80 d8 ff ff call 80104f50 <memset> if (mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W | PTE_U) < 0) { 801076d0: 58 pop %eax 801076d1: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 801076d7: b9 00 10 00 00 mov $0x1000,%ecx 801076dc: 5a pop %edx 801076dd: 6a 06 push $0x6 801076df: 50 push %eax 801076e0: 89 da mov %ebx,%edx 801076e2: 89 f8 mov %edi,%eax 801076e4: e8 67 fb ff ff call 80107250 <mappages> 801076e9: 83 c4 10 add $0x10,%esp 801076ec: 85 c0 test %eax,%eax 801076ee: 78 50 js 80107740 <allocuvm+0xc0> for (; a < newsz; a += PGSIZE) { 801076f0: 81 c3 00 10 00 00 add $0x1000,%ebx 801076f6: 39 5d 10 cmp %ebx,0x10(%ebp) 801076f9: 0f 86 81 00 00 00 jbe 80107780 <allocuvm+0x100> mem = kalloc(); 801076ff: e8 8c b8 ff ff call 80102f90 <kalloc> if (mem == 0) { 80107704: 85 c0 test %eax,%eax mem = kalloc(); 80107706: 89 c6 mov %eax,%esi if (mem == 0) { 80107708: 75 b6 jne 801076c0 <allocuvm+0x40> cprintf("allocuvm out of memory\n"); 8010770a: 83 ec 0c sub $0xc,%esp 8010770d: 68 15 85 10 80 push $0x80108515 80107712: e8 49 91 ff ff call 80100860 <cprintf> if (newsz >= oldsz) { 80107717: 83 c4 10 add $0x10,%esp 8010771a: 8b 45 0c mov 0xc(%ebp),%eax 8010771d: 39 45 10 cmp %eax,0x10(%ebp) 80107720: 77 6e ja 80107790 <allocuvm+0x110> } 80107722: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80107725: 31 ff xor %edi,%edi } 80107727: 89 f8 mov %edi,%eax 80107729: 5b pop %ebx 8010772a: 5e pop %esi 8010772b: 5f pop %edi 8010772c: 5d pop %ebp 8010772d: c3 ret 8010772e: 66 90 xchg %ax,%ax return oldsz; 80107730: 8b 7d 0c mov 0xc(%ebp),%edi } 80107733: 8d 65 f4 lea -0xc(%ebp),%esp 80107736: 89 f8 mov %edi,%eax 80107738: 5b pop %ebx 80107739: 5e pop %esi 8010773a: 5f pop %edi 8010773b: 5d pop %ebp 8010773c: c3 ret 8010773d: 8d 76 00 lea 0x0(%esi),%esi cprintf("allocuvm out of memory (2)\n"); 80107740: 83 ec 0c sub $0xc,%esp 80107743: 68 2d 85 10 80 push $0x8010852d 80107748: e8 13 91 ff ff call 80100860 <cprintf> if (newsz >= oldsz) { 8010774d: 83 c4 10 add $0x10,%esp 80107750: 8b 45 0c mov 0xc(%ebp),%eax 80107753: 39 45 10 cmp %eax,0x10(%ebp) 80107756: 76 0d jbe 80107765 <allocuvm+0xe5> 80107758: 89 c1 mov %eax,%ecx 8010775a: 8b 55 10 mov 0x10(%ebp),%edx 8010775d: 8b 45 08 mov 0x8(%ebp),%eax 80107760: e8 7b fb ff ff call 801072e0 <deallocuvm.part.0> kfree(mem); 80107765: 83 ec 0c sub $0xc,%esp return 0; 80107768: 31 ff xor %edi,%edi kfree(mem); 8010776a: 56 push %esi 8010776b: e8 70 b6 ff ff call 80102de0 <kfree> return 0; 80107770: 83 c4 10 add $0x10,%esp } 80107773: 8d 65 f4 lea -0xc(%ebp),%esp 80107776: 89 f8 mov %edi,%eax 80107778: 5b pop %ebx 80107779: 5e pop %esi 8010777a: 5f pop %edi 8010777b: 5d pop %ebp 8010777c: c3 ret 8010777d: 8d 76 00 lea 0x0(%esi),%esi 80107780: 8b 7d e4 mov -0x1c(%ebp),%edi 80107783: 8d 65 f4 lea -0xc(%ebp),%esp 80107786: 5b pop %ebx 80107787: 89 f8 mov %edi,%eax 80107789: 5e pop %esi 8010778a: 5f pop %edi 8010778b: 5d pop %ebp 8010778c: c3 ret 8010778d: 8d 76 00 lea 0x0(%esi),%esi 80107790: 89 c1 mov %eax,%ecx 80107792: 8b 55 10 mov 0x10(%ebp),%edx 80107795: 8b 45 08 mov 0x8(%ebp),%eax return 0; 80107798: 31 ff xor %edi,%edi 8010779a: e8 41 fb ff ff call 801072e0 <deallocuvm.part.0> 8010779f: eb 92 jmp 80107733 <allocuvm+0xb3> 801077a1: eb 0d jmp 801077b0 <deallocuvm> 801077a3: 90 nop 801077a4: 90 nop 801077a5: 90 nop 801077a6: 90 nop 801077a7: 90 nop 801077a8: 90 nop 801077a9: 90 nop 801077aa: 90 nop 801077ab: 90 nop 801077ac: 90 nop 801077ad: 90 nop 801077ae: 90 nop 801077af: 90 nop 801077b0 <deallocuvm>: int deallocuvm(pde_t *pgdir, uint oldsz, uint newsz) { 801077b0: 55 push %ebp 801077b1: 89 e5 mov %esp,%ebp 801077b3: 8b 55 0c mov 0xc(%ebp),%edx 801077b6: 8b 4d 10 mov 0x10(%ebp),%ecx 801077b9: 8b 45 08 mov 0x8(%ebp),%eax if (newsz >= oldsz) { 801077bc: 39 d1 cmp %edx,%ecx 801077be: 73 10 jae 801077d0 <deallocuvm+0x20> } 801077c0: 5d pop %ebp 801077c1: e9 1a fb ff ff jmp 801072e0 <deallocuvm.part.0> 801077c6: 8d 76 00 lea 0x0(%esi),%esi 801077c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801077d0: 89 d0 mov %edx,%eax 801077d2: 5d pop %ebp 801077d3: c3 ret 801077d4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 801077da: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 801077e0 <freevm>: // Free a page table and all the physical memory pages // in the user part. void freevm(pde_t *pgdir) { 801077e0: 55 push %ebp 801077e1: 89 e5 mov %esp,%ebp 801077e3: 57 push %edi 801077e4: 56 push %esi 801077e5: 53 push %ebx 801077e6: 83 ec 0c sub $0xc,%esp 801077e9: 8b 75 08 mov 0x8(%ebp),%esi uint i; if (pgdir == 0) { 801077ec: 85 f6 test %esi,%esi 801077ee: 74 59 je 80107849 <freevm+0x69> 801077f0: 31 c9 xor %ecx,%ecx 801077f2: ba 00 00 00 80 mov $0x80000000,%edx 801077f7: 89 f0 mov %esi,%eax 801077f9: e8 e2 fa ff ff call 801072e0 <deallocuvm.part.0> 801077fe: 89 f3 mov %esi,%ebx 80107800: 8d be 00 10 00 00 lea 0x1000(%esi),%edi 80107806: eb 0f jmp 80107817 <freevm+0x37> 80107808: 90 nop 80107809: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107810: 83 c3 04 add $0x4,%ebx panic("freevm: no pgdir"); } deallocuvm(pgdir, KERNBASE, 0); for (i = 0; i < NPDENTRIES; i++) { 80107813: 39 fb cmp %edi,%ebx 80107815: 74 23 je 8010783a <freevm+0x5a> if (pgdir[i] & PTE_P) { 80107817: 8b 03 mov (%ebx),%eax 80107819: a8 01 test $0x1,%al 8010781b: 74 f3 je 80107810 <freevm+0x30> char * v = P2V(PTE_ADDR(pgdir[i])); 8010781d: 25 00 f0 ff ff and $0xfffff000,%eax kfree(v); 80107822: 83 ec 0c sub $0xc,%esp 80107825: 83 c3 04 add $0x4,%ebx char * v = P2V(PTE_ADDR(pgdir[i])); 80107828: 05 00 00 00 80 add $0x80000000,%eax kfree(v); 8010782d: 50 push %eax 8010782e: e8 ad b5 ff ff call 80102de0 <kfree> 80107833: 83 c4 10 add $0x10,%esp for (i = 0; i < NPDENTRIES; i++) { 80107836: 39 fb cmp %edi,%ebx 80107838: 75 dd jne 80107817 <freevm+0x37> } } kfree((char*)pgdir); 8010783a: 89 75 08 mov %esi,0x8(%ebp) } 8010783d: 8d 65 f4 lea -0xc(%ebp),%esp 80107840: 5b pop %ebx 80107841: 5e pop %esi 80107842: 5f pop %edi 80107843: 5d pop %ebp kfree((char*)pgdir); 80107844: e9 97 b5 ff ff jmp 80102de0 <kfree> panic("freevm: no pgdir"); 80107849: 83 ec 0c sub $0xc,%esp 8010784c: 68 49 85 10 80 push $0x80108549 80107851: e8 8a 8c ff ff call 801004e0 <panic> 80107856: 8d 76 00 lea 0x0(%esi),%esi 80107859: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 80107860 <setupkvm>: pde_t*setupkvm(void) { 80107860: 55 push %ebp 80107861: 89 e5 mov %esp,%ebp 80107863: 56 push %esi 80107864: 53 push %ebx if ((pgdir = (pde_t*)kalloc()) == 0) { 80107865: e8 26 b7 ff ff call 80102f90 <kalloc> 8010786a: 85 c0 test %eax,%eax 8010786c: 89 c6 mov %eax,%esi 8010786e: 74 42 je 801078b2 <setupkvm+0x52> memset(pgdir, 0, PGSIZE); 80107870: 83 ec 04 sub $0x4,%esp for (k = kmap; k < &kmap[NELEM(kmap)]; k++) { 80107873: bb 20 c4 10 80 mov $0x8010c420,%ebx memset(pgdir, 0, PGSIZE); 80107878: 68 00 10 00 00 push $0x1000 8010787d: 6a 00 push $0x0 8010787f: 50 push %eax 80107880: e8 cb d6 ff ff call 80104f50 <memset> 80107885: 83 c4 10 add $0x10,%esp (uint)k->phys_start, k->perm) < 0) { 80107888: 8b 43 04 mov 0x4(%ebx),%eax if (mappages(pgdir, k->virt, k->phys_end - k->phys_start, 8010788b: 8b 4b 08 mov 0x8(%ebx),%ecx 8010788e: 83 ec 08 sub $0x8,%esp 80107891: 8b 13 mov (%ebx),%edx 80107893: ff 73 0c pushl 0xc(%ebx) 80107896: 50 push %eax 80107897: 29 c1 sub %eax,%ecx 80107899: 89 f0 mov %esi,%eax 8010789b: e8 b0 f9 ff ff call 80107250 <mappages> 801078a0: 83 c4 10 add $0x10,%esp 801078a3: 85 c0 test %eax,%eax 801078a5: 78 19 js 801078c0 <setupkvm+0x60> for (k = kmap; k < &kmap[NELEM(kmap)]; k++) { 801078a7: 83 c3 10 add $0x10,%ebx 801078aa: 81 fb 60 c4 10 80 cmp $0x8010c460,%ebx 801078b0: 75 d6 jne 80107888 <setupkvm+0x28> } 801078b2: 8d 65 f8 lea -0x8(%ebp),%esp 801078b5: 89 f0 mov %esi,%eax 801078b7: 5b pop %ebx 801078b8: 5e pop %esi 801078b9: 5d pop %ebp 801078ba: c3 ret 801078bb: 90 nop 801078bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi freevm(pgdir); 801078c0: 83 ec 0c sub $0xc,%esp 801078c3: 56 push %esi return 0; 801078c4: 31 f6 xor %esi,%esi freevm(pgdir); 801078c6: e8 15 ff ff ff call 801077e0 <freevm> return 0; 801078cb: 83 c4 10 add $0x10,%esp } 801078ce: 8d 65 f8 lea -0x8(%ebp),%esp 801078d1: 89 f0 mov %esi,%eax 801078d3: 5b pop %ebx 801078d4: 5e pop %esi 801078d5: 5d pop %ebp 801078d6: c3 ret 801078d7: 89 f6 mov %esi,%esi 801078d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 801078e0 <kvmalloc>: void kvmalloc(void) { 801078e0: 55 push %ebp 801078e1: 89 e5 mov %esp,%ebp 801078e3: 83 ec 08 sub $0x8,%esp kpgdir = setupkvm(); 801078e6: e8 75 ff ff ff call 80107860 <setupkvm> 801078eb: a3 84 7c 11 80 mov %eax,0x80117c84 lcr3(V2P(kpgdir)); // switch to the kernel page table 801078f0: 05 00 00 00 80 add $0x80000000,%eax 801078f5: 0f 22 d8 mov %eax,%cr3 } 801078f8: c9 leave 801078f9: c3 ret 801078fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 80107900 <clearpteu>: // Clear PTE_U on a page. Used to create an inaccessible // page beneath the user stack. void clearpteu(pde_t *pgdir, char *uva) { 80107900: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107901: 31 c9 xor %ecx,%ecx void clearpteu(pde_t *pgdir, char *uva) { 80107903: 89 e5 mov %esp,%ebp 80107905: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80107908: 8b 55 0c mov 0xc(%ebp),%edx 8010790b: 8b 45 08 mov 0x8(%ebp),%eax 8010790e: e8 bd f8 ff ff call 801071d0 <walkpgdir> if (pte == 0) { 80107913: 85 c0 test %eax,%eax 80107915: 74 05 je 8010791c <clearpteu+0x1c> panic("clearpteu"); } *pte &= ~PTE_U; 80107917: 83 20 fb andl $0xfffffffb,(%eax) } 8010791a: c9 leave 8010791b: c3 ret panic("clearpteu"); 8010791c: 83 ec 0c sub $0xc,%esp 8010791f: 68 5a 85 10 80 push $0x8010855a 80107924: e8 b7 8b ff ff call 801004e0 <panic> 80107929: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107930 <copyuvm>: // Given a parent process's page table, create a copy // of it for a child. pde_t* copyuvm(pde_t *pgdir, uint sz) { 80107930: 55 push %ebp 80107931: 89 e5 mov %esp,%ebp 80107933: 57 push %edi 80107934: 56 push %esi 80107935: 53 push %ebx 80107936: 83 ec 1c sub $0x1c,%esp pde_t *d; pte_t *pte; uint pa, i, flags; char *mem; if ((d = setupkvm()) == 0) { 80107939: e8 22 ff ff ff call 80107860 <setupkvm> 8010793e: 85 c0 test %eax,%eax 80107940: 89 45 e0 mov %eax,-0x20(%ebp) 80107943: 0f 84 9f 00 00 00 je 801079e8 <copyuvm+0xb8> return 0; } for (i = 0; i < sz; i += PGSIZE) { 80107949: 8b 5d 0c mov 0xc(%ebp),%ebx 8010794c: 85 db test %ebx,%ebx 8010794e: 0f 84 94 00 00 00 je 801079e8 <copyuvm+0xb8> 80107954: 31 ff xor %edi,%edi 80107956: eb 4a jmp 801079a2 <copyuvm+0x72> 80107958: 90 nop 80107959: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi flags = PTE_FLAGS(*pte); if ((mem = kalloc()) == 0) { freevm(d); return 0; } memmove(mem, (char*)P2V(pa), PGSIZE); 80107960: 83 ec 04 sub $0x4,%esp 80107963: 81 c3 00 00 00 80 add $0x80000000,%ebx 80107969: 68 00 10 00 00 push $0x1000 8010796e: 53 push %ebx 8010796f: 50 push %eax 80107970: e8 8b d6 ff ff call 80105000 <memmove> if (mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0) { 80107975: 8d 86 00 00 00 80 lea -0x80000000(%esi),%eax 8010797b: 5a pop %edx 8010797c: 59 pop %ecx 8010797d: ff 75 e4 pushl -0x1c(%ebp) 80107980: 50 push %eax 80107981: b9 00 10 00 00 mov $0x1000,%ecx 80107986: 8b 45 e0 mov -0x20(%ebp),%eax 80107989: 89 fa mov %edi,%edx 8010798b: e8 c0 f8 ff ff call 80107250 <mappages> 80107990: 83 c4 10 add $0x10,%esp 80107993: 85 c0 test %eax,%eax 80107995: 78 61 js 801079f8 <copyuvm+0xc8> for (i = 0; i < sz; i += PGSIZE) { 80107997: 81 c7 00 10 00 00 add $0x1000,%edi 8010799d: 39 7d 0c cmp %edi,0xc(%ebp) 801079a0: 76 46 jbe 801079e8 <copyuvm+0xb8> if ((pte = walkpgdir(pgdir, (void *) i, 0)) == 0) { 801079a2: 8b 45 08 mov 0x8(%ebp),%eax 801079a5: 31 c9 xor %ecx,%ecx 801079a7: 89 fa mov %edi,%edx 801079a9: e8 22 f8 ff ff call 801071d0 <walkpgdir> 801079ae: 85 c0 test %eax,%eax 801079b0: 74 7a je 80107a2c <copyuvm+0xfc> if (!(*pte & PTE_P)) { 801079b2: 8b 00 mov (%eax),%eax 801079b4: a8 01 test $0x1,%al 801079b6: 74 67 je 80107a1f <copyuvm+0xef> pa = PTE_ADDR(*pte); 801079b8: 89 c3 mov %eax,%ebx flags = PTE_FLAGS(*pte); 801079ba: 25 ff 0f 00 00 and $0xfff,%eax pa = PTE_ADDR(*pte); 801079bf: 81 e3 00 f0 ff ff and $0xfffff000,%ebx flags = PTE_FLAGS(*pte); 801079c5: 89 45 e4 mov %eax,-0x1c(%ebp) if ((mem = kalloc()) == 0) { 801079c8: e8 c3 b5 ff ff call 80102f90 <kalloc> 801079cd: 85 c0 test %eax,%eax 801079cf: 89 c6 mov %eax,%esi 801079d1: 75 8d jne 80107960 <copyuvm+0x30> freevm(d); 801079d3: 83 ec 0c sub $0xc,%esp 801079d6: ff 75 e0 pushl -0x20(%ebp) 801079d9: e8 02 fe ff ff call 801077e0 <freevm> return 0; 801079de: 83 c4 10 add $0x10,%esp 801079e1: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) freevm(d); return 0; } } return d; } 801079e8: 8b 45 e0 mov -0x20(%ebp),%eax 801079eb: 8d 65 f4 lea -0xc(%ebp),%esp 801079ee: 5b pop %ebx 801079ef: 5e pop %esi 801079f0: 5f pop %edi 801079f1: 5d pop %ebp 801079f2: c3 ret 801079f3: 90 nop 801079f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi kfree(mem); 801079f8: 83 ec 0c sub $0xc,%esp 801079fb: 56 push %esi 801079fc: e8 df b3 ff ff call 80102de0 <kfree> freevm(d); 80107a01: 58 pop %eax 80107a02: ff 75 e0 pushl -0x20(%ebp) 80107a05: e8 d6 fd ff ff call 801077e0 <freevm> return 0; 80107a0a: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) 80107a11: 83 c4 10 add $0x10,%esp } 80107a14: 8b 45 e0 mov -0x20(%ebp),%eax 80107a17: 8d 65 f4 lea -0xc(%ebp),%esp 80107a1a: 5b pop %ebx 80107a1b: 5e pop %esi 80107a1c: 5f pop %edi 80107a1d: 5d pop %ebp 80107a1e: c3 ret panic("copyuvm: page not present"); 80107a1f: 83 ec 0c sub $0xc,%esp 80107a22: 68 7e 85 10 80 push $0x8010857e 80107a27: e8 b4 8a ff ff call 801004e0 <panic> panic("copyuvm: pte should exist"); 80107a2c: 83 ec 0c sub $0xc,%esp 80107a2f: 68 64 85 10 80 push $0x80108564 80107a34: e8 a7 8a ff ff call 801004e0 <panic> 80107a39: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107a40 <uva2ka>: // Map user virtual address to kernel address. char*uva2ka(pde_t *pgdir, char *uva) { 80107a40: 55 push %ebp pte_t *pte; pte = walkpgdir(pgdir, uva, 0); 80107a41: 31 c9 xor %ecx,%ecx char*uva2ka(pde_t *pgdir, char *uva) { 80107a43: 89 e5 mov %esp,%ebp 80107a45: 83 ec 08 sub $0x8,%esp pte = walkpgdir(pgdir, uva, 0); 80107a48: 8b 55 0c mov 0xc(%ebp),%edx 80107a4b: 8b 45 08 mov 0x8(%ebp),%eax 80107a4e: e8 7d f7 ff ff call 801071d0 <walkpgdir> if ((*pte & PTE_P) == 0) { 80107a53: 8b 00 mov (%eax),%eax } if ((*pte & PTE_U) == 0) { return 0; } return (char*)P2V(PTE_ADDR(*pte)); } 80107a55: c9 leave if ((*pte & PTE_U) == 0) { 80107a56: 89 c2 mov %eax,%edx return (char*)P2V(PTE_ADDR(*pte)); 80107a58: 25 00 f0 ff ff and $0xfffff000,%eax if ((*pte & PTE_U) == 0) { 80107a5d: 83 e2 05 and $0x5,%edx return (char*)P2V(PTE_ADDR(*pte)); 80107a60: 05 00 00 00 80 add $0x80000000,%eax 80107a65: 83 fa 05 cmp $0x5,%edx 80107a68: ba 00 00 00 00 mov $0x0,%edx 80107a6d: 0f 45 c2 cmovne %edx,%eax } 80107a70: c3 ret 80107a71: eb 0d jmp 80107a80 <copyout> 80107a73: 90 nop 80107a74: 90 nop 80107a75: 90 nop 80107a76: 90 nop 80107a77: 90 nop 80107a78: 90 nop 80107a79: 90 nop 80107a7a: 90 nop 80107a7b: 90 nop 80107a7c: 90 nop 80107a7d: 90 nop 80107a7e: 90 nop 80107a7f: 90 nop 80107a80 <copyout>: // Copy len bytes from p to user address va in page table pgdir. // Most useful when pgdir is not the current page table. // uva2ka ensures this only works for PTE_U pages. int copyout(pde_t *pgdir, uint va, void *p, uint len) { 80107a80: 55 push %ebp 80107a81: 89 e5 mov %esp,%ebp 80107a83: 57 push %edi 80107a84: 56 push %esi 80107a85: 53 push %ebx 80107a86: 83 ec 1c sub $0x1c,%esp 80107a89: 8b 5d 14 mov 0x14(%ebp),%ebx 80107a8c: 8b 55 0c mov 0xc(%ebp),%edx 80107a8f: 8b 7d 10 mov 0x10(%ebp),%edi char *buf, *pa0; uint n, va0; buf = (char*)p; while (len > 0) { 80107a92: 85 db test %ebx,%ebx 80107a94: 75 40 jne 80107ad6 <copyout+0x56> 80107a96: eb 70 jmp 80107b08 <copyout+0x88> 80107a98: 90 nop 80107a99: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi va0 = (uint)PGROUNDDOWN(va); pa0 = uva2ka(pgdir, (char*)va0); if (pa0 == 0) { return -1; } n = PGSIZE - (va - va0); 80107aa0: 8b 55 e4 mov -0x1c(%ebp),%edx 80107aa3: 89 f1 mov %esi,%ecx 80107aa5: 29 d1 sub %edx,%ecx 80107aa7: 81 c1 00 10 00 00 add $0x1000,%ecx 80107aad: 39 d9 cmp %ebx,%ecx 80107aaf: 0f 47 cb cmova %ebx,%ecx if (n > len) { n = len; } memmove(pa0 + (va - va0), buf, n); 80107ab2: 29 f2 sub %esi,%edx 80107ab4: 83 ec 04 sub $0x4,%esp 80107ab7: 01 d0 add %edx,%eax 80107ab9: 51 push %ecx 80107aba: 57 push %edi 80107abb: 50 push %eax 80107abc: 89 4d e4 mov %ecx,-0x1c(%ebp) 80107abf: e8 3c d5 ff ff call 80105000 <memmove> len -= n; buf += n; 80107ac4: 8b 4d e4 mov -0x1c(%ebp),%ecx while (len > 0) { 80107ac7: 83 c4 10 add $0x10,%esp va = va0 + PGSIZE; 80107aca: 8d 96 00 10 00 00 lea 0x1000(%esi),%edx buf += n; 80107ad0: 01 cf add %ecx,%edi while (len > 0) { 80107ad2: 29 cb sub %ecx,%ebx 80107ad4: 74 32 je 80107b08 <copyout+0x88> va0 = (uint)PGROUNDDOWN(va); 80107ad6: 89 d6 mov %edx,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107ad8: 83 ec 08 sub $0x8,%esp va0 = (uint)PGROUNDDOWN(va); 80107adb: 89 55 e4 mov %edx,-0x1c(%ebp) 80107ade: 81 e6 00 f0 ff ff and $0xfffff000,%esi pa0 = uva2ka(pgdir, (char*)va0); 80107ae4: 56 push %esi 80107ae5: ff 75 08 pushl 0x8(%ebp) 80107ae8: e8 53 ff ff ff call 80107a40 <uva2ka> if (pa0 == 0) { 80107aed: 83 c4 10 add $0x10,%esp 80107af0: 85 c0 test %eax,%eax 80107af2: 75 ac jne 80107aa0 <copyout+0x20> } return 0; } 80107af4: 8d 65 f4 lea -0xc(%ebp),%esp return -1; 80107af7: b8 ff ff ff ff mov $0xffffffff,%eax } 80107afc: 5b pop %ebx 80107afd: 5e pop %esi 80107afe: 5f pop %edi 80107aff: 5d pop %ebp 80107b00: c3 ret 80107b01: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 80107b08: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 80107b0b: 31 c0 xor %eax,%eax } 80107b0d: 5b pop %ebx 80107b0e: 5e pop %esi 80107b0f: 5f pop %edi 80107b10: 5d pop %ebp 80107b11: c3 ret
P6/data_P6/testpoint/testpoint18.asm
alxzzhou/BUAA_CO_2020
1
163274
<filename>P6/data_P6/testpoint/testpoint18.asm ori $1, $0, 1 ori $2, $0, 1 ori $3, $0, 11 ori $4, $0, 12 sw $1, 0($0) sw $3, 4($0) sw $4, 8($0) sw $2, 12($0) sw $4, 16($0) sw $1, 20($0) sw $2, 24($0) sw $2, 28($0) sw $3, 32($0) sw $1, 36($0) sw $4, 40($0) sw $1, 44($0) sw $2, 48($0) sw $3, 52($0) sw $2, 56($0) sw $2, 60($0) sw $1, 64($0) sw $1, 68($0) sw $4, 72($0) sw $1, 76($0) sw $3, 80($0) sw $2, 84($0) sw $2, 88($0) sw $4, 92($0) sw $1, 96($0) sw $1, 100($0) sw $2, 104($0) sw $1, 108($0) sw $4, 112($0) sw $3, 116($0) sw $1, 120($0) sw $2, 124($0) subu $1, $2, $2 lw $1, 0($1) sltu $1, $2, $1 beq $1, $1, TAG1 TAG1: lui $1, 3 sll $0, $0, 0 sll $0, $0, 0 mflo $1 TAG2: mflo $4 lui $1, 0 lh $3, 0($1) sb $1, 0($1) TAG3: multu $3, $3 lui $3, 0 mthi $3 sllv $3, $3, $3 TAG4: mtlo $3 sub $3, $3, $3 bgez $3, TAG5 multu $3, $3 TAG5: mflo $3 mflo $3 sh $3, 0($3) sb $3, 0($3) TAG6: lw $4, 0($3) lui $1, 7 sll $0, $0, 0 sll $0, $0, 0 TAG7: div $1, $1 sll $0, $0, 0 addiu $3, $1, 14 xor $3, $3, $1 TAG8: lui $2, 7 mflo $4 sb $3, 0($4) sltu $1, $2, $2 TAG9: lui $3, 11 sll $0, $0, 0 slti $3, $1, 10 mfhi $3 TAG10: mult $3, $3 mthi $3 mflo $3 andi $2, $3, 10 TAG11: bgez $2, TAG12 mfhi $4 ori $4, $4, 7 beq $4, $2, TAG12 TAG12: mtlo $4 bltz $4, TAG13 sltu $1, $4, $4 srl $2, $1, 0 TAG13: mflo $1 lui $1, 14 bne $1, $2, TAG14 mfhi $3 TAG14: sub $3, $3, $3 ori $4, $3, 14 multu $4, $3 addiu $4, $3, 0 TAG15: lb $4, 0($4) mult $4, $4 bgez $4, TAG16 mflo $4 TAG16: mflo $1 sb $4, 0($4) mthi $1 beq $1, $4, TAG17 TAG17: lui $3, 13 addu $3, $1, $1 mthi $1 bne $1, $3, TAG18 TAG18: lb $2, 0($3) lui $4, 12 mtlo $4 sltu $2, $3, $3 TAG19: bgez $2, TAG20 sub $1, $2, $2 blez $2, TAG20 ori $1, $1, 12 TAG20: srav $1, $1, $1 lhu $2, 0($1) addu $3, $2, $2 bgtz $2, TAG21 TAG21: mtlo $3 bne $3, $3, TAG22 mtlo $3 nor $3, $3, $3 TAG22: srl $2, $3, 0 lui $1, 9 mtlo $2 mfhi $1 TAG23: add $3, $1, $1 sh $3, 0($3) mflo $4 mflo $3 TAG24: mtlo $3 lbu $4, 7169($3) lui $3, 6 mtlo $3 TAG25: mflo $3 mflo $1 sll $0, $0, 0 mthi $3 TAG26: sll $0, $0, 0 lui $3, 1 sra $1, $3, 0 sll $0, $0, 0 TAG27: bne $1, $1, TAG28 lui $3, 0 mfhi $4 mfhi $2 TAG28: mflo $4 mtlo $4 bgtz $2, TAG29 divu $2, $2 TAG29: mflo $2 lui $1, 10 lb $4, 0($2) beq $2, $4, TAG30 TAG30: mtlo $4 mthi $4 ori $4, $4, 6 bne $4, $4, TAG31 TAG31: lb $1, 0($4) bgez $4, TAG32 addiu $1, $4, 2 lui $1, 15 TAG32: sh $1, 0($1) multu $1, $1 mult $1, $1 mfhi $4 TAG33: lui $3, 15 sll $0, $0, 0 lbu $2, 0($4) lui $4, 9 TAG34: divu $4, $4 sll $0, $0, 0 sll $0, $0, 0 mtlo $4 TAG35: sh $2, 0($2) multu $2, $2 mult $2, $2 sw $2, 0($2) TAG36: mtlo $2 ori $2, $2, 4 sltu $4, $2, $2 xor $4, $4, $2 TAG37: lbu $2, 0($4) xori $2, $2, 5 lui $1, 7 blez $4, TAG38 TAG38: subu $1, $1, $1 add $2, $1, $1 mtlo $2 sra $2, $1, 9 TAG39: blez $2, TAG40 lb $4, 0($2) sb $4, 0($2) subu $3, $2, $2 TAG40: bltz $3, TAG41 mtlo $3 div $3, $3 mthi $3 TAG41: xor $1, $3, $3 beq $3, $1, TAG42 sll $0, $0, 0 bgtz $3, TAG42 TAG42: div $3, $3 mfhi $4 bltz $3, TAG43 multu $3, $4 TAG43: bltz $4, TAG44 lui $3, 6 mthi $3 lui $4, 2 TAG44: xor $2, $4, $4 bltz $2, TAG45 sw $2, 0($2) mflo $2 TAG45: mfhi $2 bne $2, $2, TAG46 sll $0, $0, 0 lui $2, 5 TAG46: mtlo $2 blez $2, TAG47 lui $1, 1 lui $2, 5 TAG47: bltz $2, TAG48 addiu $3, $2, 3 sll $0, $0, 0 lui $3, 15 TAG48: bne $3, $3, TAG49 mtlo $3 mfhi $4 bltz $4, TAG49 TAG49: sll $0, $0, 0 mtlo $4 mflo $2 sll $0, $0, 0 TAG50: multu $2, $2 xori $4, $2, 7 slt $3, $4, $4 srl $2, $2, 15 TAG51: subu $1, $2, $2 bne $2, $1, TAG52 addiu $2, $2, 9 srlv $2, $2, $2 TAG52: sb $2, 0($2) bgtz $2, TAG53 mflo $2 divu $2, $2 TAG53: bne $2, $2, TAG54 sb $2, 0($2) addiu $1, $2, 4 mult $2, $2 TAG54: lui $2, 7 mthi $1 mflo $2 mtlo $2 TAG55: mtlo $2 addiu $3, $2, 13 beq $2, $2, TAG56 sh $3, 0($2) TAG56: div $3, $3 bne $3, $3, TAG57 sb $3, 0($3) lb $3, 0($3) TAG57: blez $3, TAG58 lui $3, 13 beq $3, $3, TAG58 mflo $4 TAG58: lui $4, 7 sll $0, $0, 0 mflo $4 multu $4, $4 TAG59: multu $4, $4 sllv $2, $4, $4 mflo $3 lbu $4, 0($3) TAG60: sh $4, 0($4) nor $3, $4, $4 lbu $4, 0($4) lb $3, 0($4) TAG61: blez $3, TAG62 subu $3, $3, $3 mtlo $3 mflo $3 TAG62: srav $1, $3, $3 mtlo $1 bgtz $3, TAG63 mult $1, $3 TAG63: mflo $2 lb $4, 0($1) mult $4, $4 bgez $4, TAG64 TAG64: sh $4, 0($4) lui $1, 12 lui $3, 8 sb $3, 0($4) TAG65: blez $3, TAG66 multu $3, $3 mfhi $4 sra $1, $3, 8 TAG66: sh $1, -2048($1) srl $1, $1, 0 lui $1, 1 mtlo $1 TAG67: bltz $1, TAG68 lui $3, 10 srl $2, $3, 15 beq $2, $2, TAG68 TAG68: sb $2, 0($2) sb $2, 0($2) bne $2, $2, TAG69 sltu $3, $2, $2 TAG69: lw $1, 0($3) sh $1, -2048($1) divu $3, $1 sltu $2, $1, $1 TAG70: lb $1, 0($2) add $1, $1, $1 beq $1, $2, TAG71 addiu $4, $1, 2 TAG71: divu $4, $4 srav $4, $4, $4 xori $1, $4, 7 sw $4, 0($4) TAG72: sll $1, $1, 10 sw $1, -7168($1) sltu $4, $1, $1 multu $1, $4 TAG73: bgez $4, TAG74 lui $1, 8 sb $4, 0($1) bltz $4, TAG74 TAG74: sll $0, $0, 0 sll $0, $0, 0 ori $3, $3, 14 ori $3, $1, 10 TAG75: mfhi $3 lw $2, 0($3) sb $2, 0($3) lui $2, 7 TAG76: srav $2, $2, $2 divu $2, $2 sll $0, $0, 0 sll $0, $0, 0 TAG77: lui $3, 11 lui $1, 13 andi $3, $3, 10 bne $3, $1, TAG78 TAG78: mthi $3 mult $3, $3 bgtz $3, TAG79 lui $4, 10 TAG79: sll $0, $0, 0 sb $4, 0($3) mflo $4 srl $2, $4, 8 TAG80: bne $2, $2, TAG81 addi $4, $2, 4 mtlo $2 lhu $1, 0($4) TAG81: divu $1, $1 beq $1, $1, TAG82 lb $4, 0($1) xori $4, $4, 1 TAG82: mtlo $4 bne $4, $4, TAG83 sb $4, 0($4) beq $4, $4, TAG83 TAG83: mflo $4 bne $4, $4, TAG84 mthi $4 bgez $4, TAG84 TAG84: sltu $3, $4, $4 sw $4, 0($3) mtlo $4 bgtz $4, TAG85 TAG85: lhu $3, 0($3) lui $4, 6 sh $4, 0($3) bne $3, $3, TAG86 TAG86: mthi $4 sll $0, $0, 0 addu $2, $1, $4 mflo $1 TAG87: slt $3, $1, $1 lui $3, 15 subu $2, $1, $3 mfhi $2 TAG88: sll $0, $0, 0 div $2, $2 mult $2, $2 lui $4, 4 TAG89: mflo $1 bltz $4, TAG90 multu $1, $4 mfhi $1 TAG90: mfhi $4 multu $4, $1 sb $4, 0($4) addi $4, $1, 3 TAG91: sltu $2, $4, $4 sb $2, 0($2) bltz $4, TAG92 multu $2, $4 TAG92: mtlo $2 bgez $2, TAG93 sllv $4, $2, $2 or $1, $4, $2 TAG93: lui $1, 0 srlv $2, $1, $1 beq $2, $1, TAG94 lui $4, 11 TAG94: lui $3, 5 sll $0, $0, 0 bltz $4, TAG95 sll $0, $0, 0 TAG95: bne $3, $3, TAG96 or $4, $3, $3 lui $4, 8 mult $4, $4 TAG96: sll $0, $0, 0 mthi $4 addu $4, $4, $4 blez $4, TAG97 TAG97: addiu $2, $4, 14 mult $4, $2 sll $0, $0, 0 mflo $2 TAG98: lui $1, 12 sra $3, $1, 2 lui $4, 4 srav $2, $1, $4 TAG99: bgez $2, TAG100 mfhi $4 lui $2, 10 bgez $4, TAG100 TAG100: mfhi $4 mfhi $2 divu $2, $2 lui $1, 13 TAG101: mfhi $3 mflo $2 ori $4, $2, 0 lui $2, 2 TAG102: bltz $2, TAG103 srl $2, $2, 13 mtlo $2 lui $4, 3 TAG103: lui $3, 6 slt $3, $4, $3 slti $4, $3, 7 srav $1, $3, $3 TAG104: blez $1, TAG105 slti $3, $1, 3 srl $2, $3, 8 ori $4, $3, 13 TAG105: xor $4, $4, $4 mtlo $4 bne $4, $4, TAG106 mthi $4 TAG106: lw $1, 0($4) multu $1, $4 sb $1, 0($4) lh $2, 0($1) TAG107: sb $2, 0($2) or $3, $2, $2 and $4, $3, $2 sltiu $3, $3, 6 TAG108: sb $3, 0($3) div $3, $3 bltz $3, TAG109 mflo $2 TAG109: lui $3, 7 mthi $2 xori $1, $3, 2 lb $1, 0($2) TAG110: mflo $3 lui $2, 1 sllv $4, $1, $1 subu $2, $1, $4 TAG111: sb $2, 1($2) bgtz $2, TAG112 mfhi $2 lui $2, 12 TAG112: srl $4, $2, 11 lui $4, 13 srl $3, $4, 12 beq $4, $4, TAG113 TAG113: mfhi $3 lb $1, 0($3) bne $3, $3, TAG114 lbu $1, 0($1) TAG114: mflo $4 mfhi $1 bne $4, $1, TAG115 slti $3, $1, 8 TAG115: mthi $3 mflo $3 mfhi $4 sb $3, 0($3) TAG116: mtlo $4 bgez $4, TAG117 lbu $1, 0($4) beq $4, $1, TAG117 TAG117: lb $2, 0($1) divu $1, $1 beq $1, $1, TAG118 sb $1, 0($1) TAG118: sb $2, 0($2) mfhi $2 andi $1, $2, 10 bne $2, $1, TAG119 TAG119: mult $1, $1 mflo $4 ori $4, $4, 14 mflo $3 TAG120: mult $3, $3 mtlo $3 slt $2, $3, $3 beq $3, $3, TAG121 TAG121: mflo $1 mfhi $3 lui $4, 12 blez $1, TAG122 TAG122: andi $1, $4, 1 sll $0, $0, 0 sltu $4, $1, $4 mtlo $4 TAG123: mflo $4 mflo $3 mthi $3 lui $1, 2 TAG124: blez $1, TAG125 mflo $3 lui $2, 5 mflo $4 TAG125: bgtz $4, TAG126 nor $2, $4, $4 bltz $2, TAG126 mtlo $2 TAG126: mfhi $2 bltz $2, TAG127 mtlo $2 lui $1, 13 TAG127: beq $1, $1, TAG128 lui $2, 5 bne $2, $2, TAG128 sra $4, $2, 3 TAG128: mtlo $4 bgtz $4, TAG129 mtlo $4 sh $4, 0($4) TAG129: ori $2, $4, 14 sb $4, 0($2) lbu $1, 0($4) addiu $2, $2, 6 TAG130: lui $3, 5 bgtz $2, TAG131 slti $2, $3, 8 bltz $2, TAG131 TAG131: lui $1, 10 srl $4, $1, 0 divu $1, $4 blez $1, TAG132 TAG132: mflo $4 lbu $2, 0($4) mfhi $3 lw $4, 0($3) TAG133: div $4, $4 divu $4, $4 sra $3, $4, 7 xori $1, $3, 0 TAG134: srl $1, $1, 14 beq $1, $1, TAG135 srl $3, $1, 1 mfhi $4 TAG135: sll $1, $4, 14 mtlo $4 sll $0, $0, 0 mflo $4 TAG136: mfhi $4 ori $1, $4, 7 lh $2, 0($4) sltiu $3, $4, 11 TAG137: sb $3, 0($3) beq $3, $3, TAG138 mtlo $3 mthi $3 TAG138: slti $2, $3, 11 mfhi $2 blez $2, TAG139 multu $3, $2 TAG139: bne $2, $2, TAG140 mthi $2 mtlo $2 bgtz $2, TAG140 TAG140: lui $4, 0 sb $2, 0($2) blez $4, TAG141 sltu $4, $2, $4 TAG141: blez $4, TAG142 lui $3, 3 addiu $3, $3, 5 mfhi $4 TAG142: lui $1, 10 multu $4, $4 bgez $4, TAG143 andi $3, $4, 14 TAG143: andi $3, $3, 15 lui $1, 0 bgtz $3, TAG144 mflo $2 TAG144: lb $3, 0($2) lui $4, 2 bgez $3, TAG145 mthi $4 TAG145: sll $0, $0, 0 bltz $4, TAG146 divu $4, $4 mult $4, $4 TAG146: sll $0, $0, 0 lui $2, 3 subu $2, $2, $4 beq $4, $2, TAG147 TAG147: lui $2, 7 mflo $4 sll $0, $0, 0 bne $2, $2, TAG148 TAG148: mtlo $2 divu $2, $2 sll $0, $0, 0 sll $0, $0, 0 TAG149: lui $4, 9 addiu $1, $4, 7 multu $1, $4 slt $4, $1, $1 TAG150: xori $1, $4, 1 lb $4, 0($1) or $4, $4, $4 lui $3, 13 TAG151: div $3, $3 mtlo $3 multu $3, $3 sll $0, $0, 0 TAG152: lui $4, 9 beq $4, $3, TAG153 xor $4, $4, $4 mthi $4 TAG153: mthi $4 mflo $4 mult $4, $4 sra $2, $4, 3 TAG154: sw $2, 0($2) lbu $2, 0($2) mfhi $3 lui $3, 5 TAG155: lui $2, 8 sll $0, $0, 0 bgez $3, TAG156 mfhi $4 TAG156: addi $4, $4, 11 lbu $2, 0($4) sb $2, 0($4) mflo $2 TAG157: mult $2, $2 sb $2, 0($2) multu $2, $2 mult $2, $2 TAG158: bne $2, $2, TAG159 subu $2, $2, $2 mflo $2 mtlo $2 TAG159: and $3, $2, $2 mult $2, $2 sb $3, 0($3) bgez $2, TAG160 TAG160: sh $3, 0($3) slt $1, $3, $3 mflo $3 lb $1, 0($3) TAG161: srlv $2, $1, $1 multu $1, $2 lui $1, 9 mflo $4 TAG162: ori $4, $4, 2 ori $1, $4, 12 slt $2, $1, $4 srlv $2, $2, $4 TAG163: lui $2, 5 srlv $1, $2, $2 srav $2, $2, $2 or $4, $2, $2 TAG164: srl $4, $4, 2 mthi $4 mtlo $4 sll $0, $0, 0 TAG165: lui $3, 6 divu $3, $4 lui $4, 6 bltz $4, TAG166 TAG166: sll $0, $0, 0 lui $2, 2 mfhi $4 mthi $4 TAG167: sll $0, $0, 0 mflo $2 mtlo $2 mflo $1 TAG168: beq $1, $1, TAG169 mfhi $3 sw $3, 0($3) and $2, $1, $3 TAG169: divu $2, $2 lh $3, 0($2) divu $2, $3 bgez $3, TAG170 TAG170: mtlo $3 sb $3, 0($3) bgtz $3, TAG171 lb $4, 0($3) TAG171: srl $1, $4, 4 sll $3, $1, 13 lui $4, 7 mthi $4 TAG172: lui $2, 14 bne $4, $4, TAG173 lui $4, 4 mtlo $2 TAG173: mfhi $1 sll $0, $0, 0 sll $0, $0, 0 addu $2, $2, $4 TAG174: lui $3, 7 divu $2, $3 sll $0, $0, 0 bne $2, $2, TAG175 TAG175: srlv $1, $2, $2 mthi $1 mtlo $1 sll $0, $0, 0 TAG176: sll $0, $0, 0 sll $0, $0, 0 mult $2, $1 lui $3, 9 TAG177: lui $2, 12 sll $0, $0, 0 blez $3, TAG178 div $3, $3 TAG178: addiu $4, $2, 6 lui $3, 6 sll $0, $0, 0 bgez $4, TAG179 TAG179: sll $0, $0, 0 sll $0, $0, 0 mthi $2 bgtz $2, TAG180 TAG180: mtlo $2 mthi $2 multu $2, $2 and $4, $2, $2 TAG181: addu $3, $4, $4 sll $0, $0, 0 lui $4, 6 andi $3, $4, 4 TAG182: lb $4, 0($3) lbu $2, 0($3) addi $4, $3, 9 mtlo $2 TAG183: lb $1, 0($4) sll $1, $1, 13 beq $1, $1, TAG184 lui $3, 3 TAG184: or $2, $3, $3 lui $2, 6 mtlo $2 sll $0, $0, 0 TAG185: beq $3, $3, TAG186 lui $2, 9 mthi $3 ori $2, $2, 1 TAG186: sra $2, $2, 14 mthi $2 multu $2, $2 mfhi $3 TAG187: subu $2, $3, $3 bgtz $3, TAG188 mflo $3 blez $2, TAG188 TAG188: addu $2, $3, $3 mflo $4 lui $3, 15 slti $1, $3, 2 TAG189: lh $3, 0($1) sltiu $4, $1, 7 div $3, $4 mfhi $2 TAG190: sb $2, 0($2) blez $2, TAG191 lh $1, 0($2) mtlo $1 TAG191: mthi $1 lui $2, 2 lui $4, 0 andi $2, $1, 15 TAG192: beq $2, $2, TAG193 mthi $2 beq $2, $2, TAG193 mthi $2 TAG193: sh $2, 0($2) lui $1, 0 sll $3, $1, 13 beq $3, $2, TAG194 TAG194: sh $3, 0($3) mtlo $3 and $3, $3, $3 srlv $3, $3, $3 TAG195: lui $1, 5 sll $0, $0, 0 lui $2, 2 srav $3, $1, $3 TAG196: beq $3, $3, TAG197 mfhi $1 nor $2, $3, $1 mthi $1 TAG197: srl $4, $2, 7 bne $4, $2, TAG198 mflo $2 mfhi $2 TAG198: lbu $1, 0($2) addu $3, $1, $2 bgtz $2, TAG199 sllv $1, $3, $1 TAG199: lui $3, 11 mtlo $1 sll $1, $1, 3 beq $3, $1, TAG200 TAG200: mthi $1 sw $1, 0($1) mthi $1 beq $1, $1, TAG201 TAG201: slti $4, $1, 3 mflo $3 bgez $3, TAG202 lui $1, 6 TAG202: mthi $1 mtlo $1 bgez $1, TAG203 mfhi $3 TAG203: div $3, $3 xori $3, $3, 13 bne $3, $3, TAG204 addiu $2, $3, 13 TAG204: mtlo $2 mfhi $2 andi $4, $2, 14 sh $2, 0($4) TAG205: mult $4, $4 lbu $1, 0($4) srl $1, $4, 14 xor $3, $1, $1 TAG206: srl $4, $3, 13 beq $3, $3, TAG207 multu $4, $4 lui $3, 15 TAG207: addiu $4, $3, 12 bgez $4, TAG208 lbu $2, 0($4) lb $3, 0($3) TAG208: bgtz $3, TAG209 lui $2, 11 multu $3, $3 addiu $1, $3, 5 TAG209: addiu $3, $1, 2 mtlo $1 mfhi $4 lui $4, 2 TAG210: sll $0, $0, 0 or $1, $1, $1 ori $3, $1, 3 mult $1, $3 TAG211: lui $3, 7 multu $3, $3 mfhi $2 srav $4, $3, $2 TAG212: multu $4, $4 bltz $4, TAG213 lb $1, 0($4) blez $1, TAG213 TAG213: sra $4, $1, 15 mthi $1 lui $2, 10 mult $2, $4 TAG214: mfhi $2 beq $2, $2, TAG215 mult $2, $2 slti $2, $2, 13 TAG215: sb $2, 0($2) blez $2, TAG216 mult $2, $2 mtlo $2 TAG216: mflo $4 beq $2, $2, TAG217 xor $1, $2, $2 mult $1, $2 TAG217: mfhi $1 addu $4, $1, $1 bgez $4, TAG218 mfhi $1 TAG218: bltz $1, TAG219 sltiu $2, $1, 9 sub $2, $2, $1 srlv $4, $2, $2 TAG219: andi $1, $4, 13 lui $4, 5 beq $4, $4, TAG220 sll $0, $0, 0 TAG220: sltu $3, $4, $4 lui $2, 8 mflo $3 beq $2, $4, TAG221 TAG221: multu $3, $3 mthi $3 lui $2, 4 mtlo $3 TAG222: mflo $4 beq $2, $2, TAG223 mflo $1 sb $4, 0($4) TAG223: beq $1, $1, TAG224 lb $1, 0($1) sh $1, 0($1) xor $2, $1, $1 TAG224: sllv $2, $2, $2 sll $0, $0, 0 sll $0, $0, 0 sll $0, $0, 0 TAG225: mthi $1 mult $1, $1 mult $1, $1 andi $3, $1, 12 TAG226: sw $3, 0($3) lbu $3, 0($3) bne $3, $3, TAG227 sltiu $4, $3, 13 TAG227: sltu $4, $4, $4 lh $1, 0($4) bltz $4, TAG228 mflo $1 TAG228: lb $3, 0($1) beq $3, $3, TAG229 mfhi $3 sw $3, 0($1) TAG229: and $1, $3, $3 sh $3, 0($1) mflo $1 andi $2, $1, 0 TAG230: bltz $2, TAG231 lui $3, 6 bne $3, $3, TAG231 sll $0, $0, 0 TAG231: mult $4, $4 multu $4, $4 sub $4, $4, $4 bgez $4, TAG232 TAG232: lw $2, 0($4) lui $2, 8 lui $1, 14 lui $2, 10 TAG233: bltz $2, TAG234 mtlo $2 addu $2, $2, $2 sll $0, $0, 0 TAG234: sra $2, $4, 6 mfhi $3 sll $3, $3, 8 sw $3, 0($2) TAG235: mtlo $3 mtlo $3 sh $3, 0($3) mflo $4 TAG236: multu $4, $4 bgtz $4, TAG237 nor $1, $4, $4 lui $4, 13 TAG237: lui $3, 2 mtlo $4 sll $0, $0, 0 mflo $4 TAG238: slt $4, $4, $4 bne $4, $4, TAG239 sb $4, 0($4) mtlo $4 TAG239: lui $4, 7 sll $0, $0, 0 mthi $4 mflo $2 TAG240: lhu $3, 0($2) beq $3, $3, TAG241 mult $3, $2 add $1, $3, $2 TAG241: mthi $1 lh $2, 1($1) lb $2, 1($1) bgez $2, TAG242 TAG242: mult $2, $2 mfhi $3 addu $1, $2, $3 mfhi $4 TAG243: sltiu $3, $4, 4 mtlo $3 lui $3, 9 mthi $3 TAG244: xori $2, $3, 4 sll $0, $0, 0 lui $3, 14 mtlo $3 TAG245: sll $0, $0, 0 addiu $3, $3, 0 sll $0, $0, 0 sll $0, $0, 0 TAG246: andi $3, $2, 11 xori $1, $3, 13 lui $1, 5 mtlo $3 TAG247: mflo $1 sh $1, 0($1) lh $3, 0($1) nor $1, $1, $1 TAG248: lui $4, 10 bgez $4, TAG249 subu $3, $1, $1 lui $2, 13 TAG249: mfhi $3 sll $0, $0, 0 mflo $4 sll $0, $0, 0 TAG250: mflo $1 mfhi $1 mthi $1 mfhi $3 TAG251: beq $3, $3, TAG252 mult $3, $3 lui $4, 10 addu $2, $3, $4 TAG252: sll $0, $0, 0 xori $2, $2, 10 mfhi $3 mfhi $2 TAG253: lui $4, 15 addu $2, $2, $2 andi $3, $4, 14 beq $2, $2, TAG254 TAG254: mult $3, $3 bgtz $3, TAG255 lbu $1, 0($3) mflo $1 TAG255: mtlo $1 multu $1, $1 lw $1, 0($1) lui $1, 12 TAG256: srl $4, $1, 12 lui $3, 8 lbu $1, -192($4) bgtz $1, TAG257 TAG257: mtlo $1 lui $3, 1 multu $1, $1 mflo $4 TAG258: mfhi $1 addiu $4, $1, 13 beq $1, $4, TAG259 sw $4, 0($1) TAG259: beq $4, $4, TAG260 divu $4, $4 bne $4, $4, TAG260 or $1, $4, $4 TAG260: multu $1, $1 bne $1, $1, TAG261 lui $2, 11 bne $1, $1, TAG261 TAG261: lui $2, 4 sll $0, $0, 0 beq $2, $2, TAG262 mthi $2 TAG262: bne $2, $2, TAG263 sll $0, $0, 0 srlv $1, $2, $2 mflo $2 TAG263: mtlo $2 lui $1, 2 sw $2, 0($2) bgtz $1, TAG264 TAG264: lui $2, 8 bltz $1, TAG265 div $1, $1 addu $2, $2, $2 TAG265: mflo $4 lui $4, 3 mflo $1 mthi $2 TAG266: lbu $1, 0($1) mthi $1 sh $1, 0($1) bne $1, $1, TAG267 TAG267: mflo $4 bgtz $1, TAG268 sll $4, $1, 5 sw $4, 0($1) TAG268: sw $4, 0($4) blez $4, TAG269 lui $2, 6 sw $4, 0($2) TAG269: multu $2, $2 xor $3, $2, $2 sll $0, $0, 0 addu $4, $3, $2 TAG270: mflo $3 lui $4, 12 xor $4, $4, $3 sh $4, 0($3) TAG271: mtlo $4 sll $0, $0, 0 mfhi $2 xor $1, $4, $4 TAG272: mflo $3 mtlo $3 lh $1, 0($1) lui $3, 2 TAG273: mflo $2 lui $3, 3 mtlo $2 bne $3, $3, TAG274 TAG274: lui $3, 9 lui $3, 7 srav $3, $3, $3 div $3, $3 TAG275: lui $2, 1 mflo $1 beq $2, $1, TAG276 or $2, $1, $2 TAG276: bgez $2, TAG277 sll $0, $0, 0 lh $1, 0($2) mthi $2 TAG277: mthi $1 blez $1, TAG278 mtlo $1 lb $1, 0($1) TAG278: sb $1, 0($1) lhu $3, 0($1) multu $1, $1 mfhi $1 TAG279: lw $3, 0($1) xor $3, $1, $3 lb $2, 0($3) mfhi $2 TAG280: mult $2, $2 sh $2, 0($2) lbu $1, 0($2) lui $3, 0 TAG281: multu $3, $3 lui $4, 14 sw $4, 0($3) lb $4, 0($3) TAG282: andi $1, $4, 2 and $2, $4, $1 sw $1, 0($2) mflo $4 TAG283: mfhi $3 addu $4, $4, $3 addi $1, $3, 3 lui $3, 3 TAG284: sll $0, $0, 0 andi $1, $3, 11 mthi $1 mfhi $3 TAG285: sb $3, 0($3) lbu $1, 0($3) mfhi $2 sll $2, $1, 5 TAG286: lb $3, 0($2) lbu $1, 0($2) mflo $2 multu $2, $1 TAG287: slti $1, $2, 10 lb $1, 0($1) mtlo $2 mfhi $1 TAG288: lui $4, 0 lui $2, 8 mtlo $2 lui $1, 11 TAG289: subu $4, $1, $1 lui $2, 7 sllv $2, $2, $1 mflo $3 TAG290: addu $3, $3, $3 sll $0, $0, 0 bgez $3, TAG291 sll $0, $0, 0 TAG291: mflo $4 srlv $1, $4, $4 mflo $3 sll $0, $0, 0 TAG292: sll $0, $0, 0 multu $2, $2 mfhi $3 beq $2, $3, TAG293 TAG293: mtlo $3 bne $3, $3, TAG294 lui $3, 7 subu $1, $3, $3 TAG294: mtlo $1 bne $1, $1, TAG295 lbu $4, 0($1) mfhi $4 TAG295: lui $4, 10 lui $3, 5 beq $3, $4, TAG296 divu $4, $3 TAG296: sll $0, $0, 0 sll $0, $0, 0 andi $3, $3, 9 lb $3, 0($1) TAG297: lb $2, 0($3) bne $2, $2, TAG298 multu $2, $3 bgez $3, TAG298 TAG298: addi $4, $2, 0 mfhi $1 bltz $1, TAG299 mflo $1 TAG299: sltiu $4, $1, 1 mfhi $4 multu $4, $4 xori $2, $4, 13 TAG300: mtlo $2 lbu $2, 0($2) beq $2, $2, TAG301 lbu $4, 0($2) TAG301: sb $4, 0($4) multu $4, $4 xori $2, $4, 7 lbu $1, 0($2) TAG302: bne $1, $1, TAG303 lbu $1, 0($1) bne $1, $1, TAG303 addu $3, $1, $1 TAG303: multu $3, $3 mfhi $4 mthi $3 mult $4, $3 TAG304: mflo $1 mtlo $1 bne $4, $4, TAG305 mthi $1 TAG305: bne $1, $1, TAG306 slti $2, $1, 3 bltz $2, TAG306 sb $1, 0($2) TAG306: mflo $4 div $2, $2 bgtz $4, TAG307 div $2, $2 TAG307: mfhi $2 slti $4, $2, 0 lui $3, 13 lui $1, 2 TAG308: sll $0, $0, 0 sll $0, $0, 0 sh $1, 0($2) sll $0, $0, 0 TAG309: addi $4, $2, 0 mult $2, $4 lb $3, 0($4) slti $1, $4, 6 TAG310: addiu $4, $1, 0 lbu $1, 0($1) blez $4, TAG311 srl $3, $1, 4 TAG311: sh $3, 0($3) bltz $3, TAG312 lb $3, 0($3) mthi $3 TAG312: mtlo $3 bne $3, $3, TAG313 xor $3, $3, $3 beq $3, $3, TAG313 TAG313: mtlo $3 mthi $3 lui $1, 4 sh $1, 0($3) TAG314: slt $2, $1, $1 mtlo $1 lbu $4, 0($2) lb $3, 0($4) TAG315: mtlo $3 blez $3, TAG316 lui $3, 8 sltiu $3, $3, 7 TAG316: sll $0, $0, 0 multu $3, $3 lui $4, 3 bgez $3, TAG317 TAG317: div $4, $4 mtlo $4 nor $1, $4, $4 mtlo $4 TAG318: mflo $3 mtlo $3 ori $3, $3, 11 beq $3, $3, TAG319 TAG319: sll $0, $0, 0 sltiu $3, $3, 1 mtlo $3 sra $1, $3, 9 TAG320: lbu $3, 0($1) sb $3, 0($3) slti $2, $3, 4 sll $4, $1, 8 TAG321: mthi $4 bne $4, $4, TAG322 mfhi $4 addi $3, $4, 15 TAG322: divu $3, $3 bltz $3, TAG323 sra $4, $3, 7 lui $1, 4 TAG323: lui $2, 7 bgtz $1, TAG324 mthi $2 xor $2, $1, $1 TAG324: bne $2, $2, TAG325 mthi $2 slt $4, $2, $2 sllv $4, $4, $2 TAG325: lui $4, 5 mflo $1 sllv $4, $1, $4 sb $4, 0($4) TAG326: sb $4, 0($4) mflo $2 sb $2, 0($4) beq $2, $4, TAG327 TAG327: lbu $1, 0($2) mtlo $1 sb $1, 0($2) bltz $2, TAG328 TAG328: divu $1, $1 sltiu $2, $1, 0 mthi $2 lui $4, 5 TAG329: mult $4, $4 mflo $2 sltu $1, $2, $2 mthi $4 TAG330: bgez $1, TAG331 srlv $3, $1, $1 bltz $1, TAG331 mflo $4 TAG331: bne $4, $4, TAG332 sll $0, $0, 0 lui $1, 1 slt $1, $1, $4 TAG332: lui $3, 8 mflo $2 sb $2, 0($1) mthi $3 TAG333: lb $4, 0($2) lw $3, 0($2) mthi $4 xori $1, $3, 9 TAG334: subu $2, $1, $1 sb $2, 0($1) mtlo $1 lui $4, 15 TAG335: lui $1, 12 multu $1, $4 sll $0, $0, 0 bgtz $1, TAG336 TAG336: sll $0, $0, 0 bgez $1, TAG337 divu $1, $1 beq $1, $1, TAG337 TAG337: mtlo $1 sll $0, $0, 0 sll $2, $1, 5 beq $2, $1, TAG338 TAG338: srl $1, $2, 15 beq $2, $1, TAG339 addiu $2, $1, 15 bltz $1, TAG339 TAG339: subu $4, $2, $2 andi $1, $2, 4 bne $1, $4, TAG340 mthi $4 TAG340: mthi $1 addiu $1, $1, 15 bne $1, $1, TAG341 sb $1, 0($1) TAG341: sb $1, 0($1) blez $1, TAG342 and $2, $1, $1 srl $3, $2, 11 TAG342: blez $3, TAG343 mthi $3 lui $1, 7 lui $1, 11 TAG343: beq $1, $1, TAG344 multu $1, $1 slt $1, $1, $1 sb $1, 0($1) TAG344: subu $4, $1, $1 and $3, $1, $1 bgez $4, TAG345 mfhi $2 TAG345: blez $2, TAG346 lui $2, 8 beq $2, $2, TAG346 xor $3, $2, $2 TAG346: sb $3, 0($3) mflo $3 mthi $3 multu $3, $3 TAG347: multu $3, $3 mflo $3 lui $2, 8 lui $1, 13 TAG348: or $1, $1, $1 sll $0, $0, 0 mflo $4 mflo $2 TAG349: mult $2, $2 srlv $4, $2, $2 sll $0, $0, 0 bgtz $4, TAG350 TAG350: addu $3, $2, $2 sltiu $1, $2, 0 mflo $4 bgtz $1, TAG351 TAG351: lui $3, 2 beq $3, $4, TAG352 sltiu $2, $4, 0 mthi $3 TAG352: sh $2, 0($2) lbu $4, 0($2) mthi $4 multu $4, $4 TAG353: bne $4, $4, TAG354 ori $1, $4, 8 mflo $4 xori $4, $4, 11 TAG354: sltiu $2, $4, 10 srav $4, $4, $4 beq $2, $4, TAG355 mult $4, $4 TAG355: lui $2, 15 mflo $4 mfhi $4 beq $2, $4, TAG356 TAG356: mflo $4 lbu $2, 0($4) sb $4, 0($4) bne $4, $4, TAG357 TAG357: xori $2, $2, 13 subu $4, $2, $2 xor $3, $4, $2 multu $2, $4 TAG358: sb $3, 0($3) andi $3, $3, 13 bne $3, $3, TAG359 mthi $3 TAG359: lui $2, 14 bne $2, $2, TAG360 slti $3, $2, 1 srl $3, $3, 11 TAG360: lb $4, 0($3) bltz $3, TAG361 addu $2, $3, $4 sw $4, 0($2) TAG361: mtlo $2 andi $2, $2, 8 lb $4, 0($2) sltu $4, $4, $2 TAG362: mult $4, $4 sh $4, 0($4) lui $2, 10 sh $2, 0($4) TAG363: sll $0, $0, 0 mult $2, $2 addiu $1, $2, 6 sll $0, $0, 0 TAG364: xori $2, $4, 13 mult $4, $4 sb $4, 0($4) div $2, $2 TAG365: mult $2, $2 sb $2, 0($2) mtlo $2 lui $3, 14 TAG366: lui $1, 7 blez $1, TAG367 addiu $4, $1, 13 lui $4, 1 TAG367: lui $3, 13 sll $0, $0, 0 sll $0, $0, 0 mtlo $4 TAG368: sllv $1, $3, $3 mtlo $1 sll $0, $0, 0 sll $0, $0, 0 TAG369: bltz $3, TAG370 div $3, $3 andi $1, $3, 5 bgtz $1, TAG370 TAG370: sltu $4, $1, $1 mtlo $1 nor $4, $4, $1 lui $1, 15 TAG371: mtlo $1 bltz $1, TAG372 sra $4, $1, 4 bgtz $4, TAG372 TAG372: mthi $4 blez $4, TAG373 sll $0, $0, 0 addu $4, $4, $4 TAG373: addu $1, $4, $4 sll $0, $0, 0 blez $2, TAG374 divu $4, $2 TAG374: multu $2, $2 divu $2, $2 sb $2, 0($2) div $2, $2 TAG375: multu $2, $2 lbu $2, 0($2) lui $4, 13 multu $4, $2 TAG376: mfhi $3 sll $0, $0, 0 mtlo $1 divu $3, $1 TAG377: mtlo $1 addiu $1, $1, 14 div $1, $1 mflo $1 TAG378: bne $1, $1, TAG379 multu $1, $1 div $1, $1 mtlo $1 TAG379: bne $1, $1, TAG380 sb $1, 0($1) addiu $3, $1, 15 mflo $4 TAG380: addiu $4, $4, 11 beq $4, $4, TAG381 lui $4, 15 andi $1, $4, 15 TAG381: lui $4, 2 sll $0, $0, 0 mtlo $4 mtlo $1 TAG382: bgtz $4, TAG383 sll $0, $0, 0 lh $1, 0($4) bltz $4, TAG383 TAG383: sltu $3, $1, $1 lbu $3, 0($1) bgez $3, TAG384 lui $1, 13 TAG384: addiu $1, $1, 3 mflo $4 lui $1, 5 subu $4, $1, $4 TAG385: lui $3, 7 bgtz $4, TAG386 div $3, $3 bne $4, $4, TAG386 TAG386: multu $3, $3 sll $0, $0, 0 sll $0, $0, 0 sllv $4, $1, $3 TAG387: blez $4, TAG388 mult $4, $4 addiu $1, $4, 11 mfhi $1 TAG388: mthi $1 blez $1, TAG389 mflo $4 xori $3, $4, 9 TAG389: mflo $3 sra $1, $3, 7 andi $1, $3, 11 mfhi $2 TAG390: bgtz $2, TAG391 mult $2, $2 lui $3, 11 lhu $3, 0($3) TAG391: beq $3, $3, TAG392 mtlo $3 bne $3, $3, TAG392 lui $3, 7 TAG392: beq $3, $3, TAG393 mult $3, $3 sb $3, 0($3) mfhi $2 TAG393: lbu $3, 0($2) sltiu $3, $3, 5 beq $3, $3, TAG394 mflo $4 TAG394: mflo $2 bgez $4, TAG395 lhu $4, 0($2) sw $2, 0($4) TAG395: addiu $2, $4, 9 addu $4, $2, $2 lb $3, -530($4) lui $4, 1 TAG396: div $4, $4 sll $0, $0, 0 beq $4, $4, TAG397 sll $0, $0, 0 TAG397: subu $2, $4, $4 lui $1, 11 lui $3, 4 sll $0, $0, 0 TAG398: div $3, $3 lui $4, 9 slti $2, $4, 7 sh $4, 0($2) TAG399: mtlo $2 subu $3, $2, $2 beq $2, $2, TAG400 mtlo $2 TAG400: mflo $1 sh $1, 0($3) xor $1, $3, $1 lui $3, 1 TAG401: bgtz $3, TAG402 sll $0, $0, 0 lw $3, 0($1) bne $3, $3, TAG402 TAG402: sll $0, $0, 0 sll $0, $0, 0 bne $4, $4, TAG403 sll $0, $0, 0 TAG403: lui $3, 6 sll $0, $0, 0 sll $0, $0, 0 divu $4, $3 TAG404: sll $0, $0, 0 mthi $3 sh $3, 0($2) sra $2, $2, 11 TAG405: lhu $2, 0($2) srav $3, $2, $2 blez $2, TAG406 mthi $2 TAG406: sh $3, 0($3) mult $3, $3 subu $2, $3, $3 nor $4, $3, $2 TAG407: mtlo $4 div $4, $4 mthi $4 bltz $4, TAG408 TAG408: or $4, $4, $4 lh $1, 1($4) lui $1, 5 lui $3, 11 TAG409: mult $3, $3 bgez $3, TAG410 sll $0, $0, 0 bgtz $3, TAG410 TAG410: lui $4, 8 bne $4, $4, TAG411 div $3, $3 mflo $2 TAG411: bgtz $2, TAG412 sb $2, 0($2) lui $3, 0 bltz $2, TAG412 TAG412: sll $0, $0, 0 sltiu $1, $3, 10 sh $1, 0($1) mflo $4 TAG413: mthi $4 addu $3, $4, $4 blez $4, TAG414 subu $2, $4, $3 TAG414: bne $2, $2, TAG415 sw $2, 1($2) lui $4, 11 blez $4, TAG415 TAG415: mflo $3 lbu $2, 0($3) mtlo $2 lbu $1, -255($2) TAG416: bne $1, $1, TAG417 lui $4, 5 slt $1, $1, $1 mtlo $1 TAG417: lui $3, 13 mflo $1 lw $4, 0($1) bgtz $1, TAG418 TAG418: sllv $2, $4, $4 mfhi $2 or $4, $2, $2 lui $1, 3 TAG419: beq $1, $1, TAG420 lui $2, 5 bne $1, $1, TAG420 mfhi $1 TAG420: xori $2, $1, 7 blez $1, TAG421 multu $2, $1 xori $4, $1, 13 TAG421: subu $3, $4, $4 bgtz $3, TAG422 andi $4, $4, 2 mtlo $4 TAG422: lb $2, 0($4) subu $3, $2, $2 mfhi $1 mflo $4 TAG423: srl $4, $4, 2 add $3, $4, $4 addu $1, $4, $4 multu $4, $4 TAG424: mtlo $1 beq $1, $1, TAG425 lui $1, 5 lw $4, 0($1) TAG425: bltz $4, TAG426 multu $4, $4 mflo $3 addiu $3, $3, 4 TAG426: bne $3, $3, TAG427 multu $3, $3 beq $3, $3, TAG427 lb $3, 0($3) TAG427: mthi $3 lb $3, 0($3) addu $3, $3, $3 mflo $1 TAG428: lhu $4, 0($1) srav $1, $4, $1 lui $3, 8 lui $3, 1 TAG429: sll $0, $0, 0 beq $3, $3, TAG430 mthi $3 div $3, $3 TAG430: slt $1, $3, $3 bltz $1, TAG431 multu $3, $1 andi $1, $3, 2 TAG431: beq $1, $1, TAG432 sw $1, 0($1) lui $3, 14 sllv $1, $3, $3 TAG432: multu $1, $1 sh $1, 0($1) sw $1, 0($1) bltz $1, TAG433 TAG433: mflo $2 lhu $2, 0($1) blez $2, TAG434 srav $4, $2, $1 TAG434: beq $4, $4, TAG435 sw $4, 0($4) mthi $4 bne $4, $4, TAG435 TAG435: sb $4, 0($4) lw $1, 0($4) andi $1, $1, 1 mthi $4 TAG436: mflo $4 lh $2, 0($1) lui $3, 9 srl $2, $2, 15 TAG437: mult $2, $2 or $4, $2, $2 multu $4, $2 beq $2, $4, TAG438 TAG438: mult $4, $4 sw $4, 0($4) sltiu $1, $4, 3 addi $4, $4, 6 TAG439: mult $4, $4 sltu $4, $4, $4 sh $4, 0($4) multu $4, $4 TAG440: lb $4, 0($4) multu $4, $4 sh $4, 0($4) sw $4, 0($4) TAG441: sb $4, 0($4) lbu $3, 0($4) lw $3, 0($3) multu $3, $4 TAG442: subu $1, $3, $3 lui $3, 1 sll $0, $0, 0 mfhi $3 TAG443: bgtz $3, TAG444 multu $3, $3 sh $3, 0($3) bgtz $3, TAG444 TAG444: lui $4, 2 sb $4, 0($3) sh $4, 0($3) nor $3, $4, $4 TAG445: ori $1, $3, 9 or $4, $1, $1 bgtz $3, TAG446 mtlo $3 TAG446: srav $4, $4, $4 lbu $1, 1($4) and $3, $4, $1 lw $2, 0($3) TAG447: lui $4, 3 bltz $4, TAG448 sll $0, $0, 0 sra $2, $4, 1 TAG448: sll $0, $0, 0 ori $4, $2, 9 slt $1, $4, $2 lui $2, 7 TAG449: lui $4, 8 sll $0, $0, 0 sll $0, $0, 0 lui $1, 8 TAG450: divu $1, $1 ori $2, $1, 11 mthi $1 divu $1, $1 TAG451: mflo $2 mtlo $2 beq $2, $2, TAG452 sb $2, 0($2) TAG452: srl $1, $2, 9 multu $2, $1 sb $1, 0($2) div $1, $2 TAG453: mult $1, $1 mult $1, $1 mult $1, $1 addi $3, $1, 13 TAG454: xori $2, $3, 0 beq $2, $2, TAG455 lui $4, 15 bltz $4, TAG455 TAG455: sll $0, $0, 0 mflo $2 sll $0, $0, 0 bne $2, $2, TAG456 TAG456: multu $1, $1 sh $1, 0($1) bne $1, $1, TAG457 ori $3, $1, 8 TAG457: mthi $3 xor $4, $3, $3 srlv $4, $3, $3 lui $4, 0 TAG458: bltz $4, TAG459 mtlo $4 lui $3, 13 multu $4, $4 TAG459: beq $3, $3, TAG460 lui $4, 11 addu $2, $3, $4 mtlo $3 TAG460: mthi $2 lui $1, 1 mtlo $2 sll $0, $0, 0 TAG461: sltiu $3, $3, 14 beq $3, $3, TAG462 subu $1, $3, $3 mtlo $3 TAG462: bne $1, $1, TAG463 mfhi $2 mult $1, $1 mult $2, $1 TAG463: bne $2, $2, TAG464 sb $2, 0($2) sltu $3, $2, $2 mthi $2 TAG464: mflo $1 sllv $2, $1, $1 sh $1, 0($1) mtlo $1 TAG465: or $1, $2, $2 sb $1, 0($2) sub $2, $2, $1 mult $2, $2 TAG466: lbu $1, 0($2) nor $1, $2, $1 srav $3, $1, $2 lui $4, 3 TAG467: mtlo $4 mfhi $4 multu $4, $4 beq $4, $4, TAG468 TAG468: lh $3, 0($4) mult $3, $4 lbu $4, 0($3) srlv $4, $3, $3 TAG469: sra $1, $4, 14 sllv $3, $4, $4 subu $4, $1, $3 lbu $4, 0($4) TAG470: lbu $1, 0($4) sb $1, 0($1) mthi $4 mfhi $4 TAG471: xor $1, $4, $4 lui $3, 9 sb $4, 0($4) xor $3, $4, $1 TAG472: mult $3, $3 mfhi $3 lui $1, 12 lui $2, 13 TAG473: multu $2, $2 srl $4, $2, 13 beq $2, $2, TAG474 mthi $4 TAG474: beq $4, $4, TAG475 mfhi $4 lh $4, 0($4) lui $1, 9 TAG475: mflo $3 mtlo $1 multu $1, $1 lui $1, 11 TAG476: mthi $1 sll $0, $0, 0 div $1, $1 sll $0, $0, 0 TAG477: sll $0, $0, 0 mfhi $2 beq $2, $2, TAG478 mfhi $3 TAG478: mflo $2 lui $4, 2 div $2, $4 blez $2, TAG479 TAG479: mfhi $4 mfhi $2 mult $4, $4 ori $4, $4, 8 TAG480: srlv $2, $4, $4 sb $2, 0($2) bltz $4, TAG481 srl $1, $4, 10 TAG481: lh $4, 0($1) lui $3, 6 mfhi $2 bne $4, $3, TAG482 TAG482: and $3, $2, $2 bgez $3, TAG483 lw $1, 0($2) lw $4, 0($1) TAG483: sb $4, 0($4) mflo $4 mthi $4 mflo $3 TAG484: multu $3, $3 sb $3, 0($3) sb $3, 0($3) mfhi $1 TAG485: blez $1, TAG486 lw $2, 0($1) mtlo $1 mtlo $2 TAG486: mflo $2 mtlo $2 sb $2, 0($2) sra $1, $2, 10 TAG487: beq $1, $1, TAG488 mthi $1 beq $1, $1, TAG488 sh $1, 0($1) TAG488: mthi $1 subu $2, $1, $1 mtlo $2 sh $1, 0($2) TAG489: bgez $2, TAG490 lui $3, 3 bgez $3, TAG490 multu $3, $2 TAG490: bne $3, $3, TAG491 mtlo $3 slti $4, $3, 12 lui $2, 13 TAG491: sll $0, $0, 0 beq $4, $2, TAG492 mtlo $4 srav $1, $2, $2 TAG492: mthi $1 mfhi $1 sll $0, $0, 0 subu $4, $2, $1 TAG493: mtlo $4 mfhi $4 sll $0, $0, 0 bltz $4, TAG494 TAG494: sll $0, $0, 0 subu $4, $3, $3 or $1, $4, $4 sll $0, $0, 0 TAG495: bltz $3, TAG496 mflo $2 multu $2, $2 mtlo $3 TAG496: addi $1, $2, 5 slt $4, $1, $1 lui $3, 9 srlv $3, $4, $1 TAG497: bne $3, $3, TAG498 sb $3, 0($3) mflo $4 mult $3, $3 TAG498: multu $4, $4 srl $2, $4, 11 lui $2, 6 sll $0, $0, 0 TAG499: lui $2, 6 div $2, $2 ori $1, $2, 0 div $2, $2 TAG500: ori $2, $1, 2 sra $4, $1, 4 bgtz $1, TAG501 mtlo $4 TAG501: subu $3, $4, $4 lbu $3, -24576($4) lhu $4, 0($3) lh $1, 0($3) TAG502: mthi $1 addiu $3, $1, 11 mult $1, $1 mthi $3 TAG503: divu $3, $3 or $2, $3, $3 lui $2, 10 mflo $4 TAG504: addu $2, $4, $4 lui $4, 7 sll $0, $0, 0 subu $3, $2, $4 TAG505: bgez $3, TAG506 mult $3, $3 srav $3, $3, $3 bltz $3, TAG506 TAG506: xori $3, $3, 1 mthi $3 beq $3, $3, TAG507 sltu $1, $3, $3 TAG507: lhu $2, 0($1) lw $2, 0($2) multu $1, $2 sb $1, 0($2) TAG508: sh $2, 0($2) sw $2, 0($2) blez $2, TAG509 mfhi $3 TAG509: sh $3, 0($3) sh $3, 0($3) mfhi $3 sh $3, 0($3) TAG510: blez $3, TAG511 slt $3, $3, $3 blez $3, TAG511 mtlo $3 TAG511: beq $3, $3, TAG512 sb $3, 0($3) sw $3, 0($3) mflo $2 TAG512: sll $3, $2, 15 sw $2, 0($3) or $4, $3, $3 lw $2, 0($2) TAG513: sub $1, $2, $2 mflo $3 bne $2, $3, TAG514 lb $3, 0($1) TAG514: bgez $3, TAG515 mflo $2 sh $2, 0($3) sh $2, 0($2) TAG515: sw $2, 0($2) bgez $2, TAG516 or $2, $2, $2 beq $2, $2, TAG516 TAG516: lui $1, 0 mtlo $1 bgez $1, TAG517 mtlo $1 TAG517: mult $1, $1 mtlo $1 xor $1, $1, $1 mthi $1 TAG518: blez $1, TAG519 multu $1, $1 beq $1, $1, TAG519 addiu $1, $1, 7 TAG519: beq $1, $1, TAG520 xori $4, $1, 7 lbu $2, 0($1) mthi $2 TAG520: lbu $3, 0($2) subu $3, $2, $2 bgtz $3, TAG521 sh $3, 0($3) TAG521: mtlo $3 lui $1, 11 mult $3, $1 mfhi $2 TAG522: lh $2, 0($2) multu $2, $2 blez $2, TAG523 sw $2, 0($2) TAG523: lui $3, 6 mtlo $2 lui $3, 7 lw $1, 0($2) TAG524: mfhi $1 mfhi $2 slt $1, $1, $1 multu $2, $1 TAG525: beq $1, $1, TAG526 mtlo $1 sh $1, 0($1) lw $4, 0($1) TAG526: lbu $3, 0($4) xori $2, $3, 9 mflo $2 beq $4, $2, TAG527 TAG527: lui $2, 2 beq $2, $2, TAG528 subu $1, $2, $2 sw $2, 0($2) TAG528: addi $1, $1, 2 lui $1, 2 sll $0, $0, 0 lui $4, 0 TAG529: bgez $4, TAG530 lw $3, 0($4) lui $1, 9 lui $4, 0 TAG530: sltu $4, $4, $4 addu $3, $4, $4 or $4, $4, $3 xori $3, $4, 3 TAG531: sb $3, 0($3) sll $1, $3, 3 sltiu $3, $3, 5 sll $4, $1, 2 TAG532: slti $4, $4, 3 bgez $4, TAG533 mthi $4 bne $4, $4, TAG533 TAG533: srl $3, $4, 10 bgez $4, TAG534 mtlo $3 addi $4, $3, 1 TAG534: sllv $3, $4, $4 mtlo $4 bne $4, $3, TAG535 mult $3, $4 TAG535: mtlo $3 or $2, $3, $3 mult $2, $3 beq $3, $2, TAG536 TAG536: add $3, $2, $2 lui $4, 12 lui $4, 10 sh $4, 0($2) TAG537: sll $0, $0, 0 mtlo $2 lui $2, 0 sltu $4, $4, $2 TAG538: lh $1, 0($4) mthi $1 lui $4, 15 srav $4, $1, $4 TAG539: sb $4, 0($4) mult $4, $4 subu $1, $4, $4 multu $1, $4 TAG540: bne $1, $1, TAG541 mfhi $4 beq $4, $4, TAG541 lui $4, 3 TAG541: lui $2, 5 srav $4, $2, $2 slti $4, $4, 15 slti $2, $4, 14 TAG542: sb $2, 0($2) mflo $1 sw $1, 0($1) blez $1, TAG543 TAG543: multu $1, $1 sw $1, 0($1) mflo $4 mult $4, $4 TAG544: sltiu $4, $4, 10 mflo $4 slt $1, $4, $4 sw $4, 0($4) TAG545: sra $4, $1, 8 lui $4, 13 multu $1, $4 lui $1, 8 TAG546: sll $0, $0, 0 mtlo $2 beq $2, $2, TAG547 mthi $2 TAG547: mult $2, $2 mflo $2 lbu $2, 0($2) mthi $2 TAG548: lb $2, 0($2) bne $2, $2, TAG549 sh $2, 0($2) sw $2, 0($2) TAG549: mfhi $1 sra $1, $1, 14 xori $1, $1, 8 beq $1, $1, TAG550 TAG550: lh $3, 0($1) or $3, $1, $1 div $3, $3 mtlo $3 TAG551: mthi $3 sw $3, 0($3) mflo $3 beq $3, $3, TAG552 TAG552: mult $3, $3 blez $3, TAG553 lui $4, 15 bgez $3, TAG553 TAG553: mthi $4 bltz $4, TAG554 sll $0, $0, 0 srav $4, $4, $4 TAG554: bne $4, $4, TAG555 mfhi $3 lui $4, 0 mult $4, $4 TAG555: slti $1, $4, 3 multu $1, $1 nor $1, $1, $1 div $1, $1 TAG556: sll $0, $0, 0 sltu $3, $1, $1 bgez $1, TAG557 slti $4, $1, 1 TAG557: sb $4, 0($4) beq $4, $4, TAG558 xori $1, $4, 8 beq $4, $4, TAG558 TAG558: sb $1, 0($1) div $1, $1 lui $2, 2 lbu $3, 0($1) TAG559: bltz $3, TAG560 sltu $1, $3, $3 sltu $4, $1, $1 add $1, $1, $1 TAG560: sb $1, 0($1) mflo $2 sra $4, $1, 2 srlv $2, $4, $1 TAG561: mfhi $1 multu $1, $2 lui $1, 13 sll $0, $0, 0 TAG562: sb $3, 0($3) nor $3, $3, $3 sb $3, 10($3) lui $2, 1 TAG563: sll $0, $0, 0 mflo $1 bltz $2, TAG564 sb $1, 0($4) TAG564: lui $3, 0 multu $1, $1 lhu $3, 0($3) mfhi $1 TAG565: mult $1, $1 bgez $1, TAG566 mflo $2 divu $2, $2 TAG566: ori $2, $2, 3 slti $3, $2, 3 lui $1, 5 lui $4, 7 TAG567: mtlo $4 sll $0, $0, 0 beq $4, $4, TAG568 lui $2, 9 TAG568: bgtz $2, TAG569 sll $0, $0, 0 mthi $2 lui $4, 13 TAG569: mthi $4 srlv $1, $4, $4 bgtz $4, TAG570 lui $1, 11 TAG570: mflo $1 addu $4, $1, $1 beq $1, $1, TAG571 mthi $1 TAG571: mfhi $2 beq $4, $2, TAG572 and $2, $4, $2 div $4, $2 TAG572: bne $2, $2, TAG573 multu $2, $2 addu $3, $2, $2 beq $3, $2, TAG573 TAG573: sll $0, $0, 0 bgez $3, TAG574 sll $0, $0, 0 lui $1, 3 TAG574: bgtz $1, TAG575 addiu $2, $1, 3 mfhi $4 beq $2, $2, TAG575 TAG575: sll $0, $0, 0 sll $0, $0, 0 beq $2, $4, TAG576 mult $2, $2 TAG576: mtlo $2 beq $2, $2, TAG577 mfhi $2 mfhi $4 TAG577: slti $4, $4, 4 lb $1, 0($4) bne $4, $1, TAG578 lb $2, 0($4) TAG578: sb $2, 0($2) and $1, $2, $2 nor $1, $2, $2 lb $2, 1($1) TAG579: sll $4, $2, 7 lb $2, 0($4) sllv $2, $2, $2 lui $2, 6 TAG580: bgez $2, TAG581 ori $2, $2, 3 lh $1, 0($2) bne $2, $2, TAG581 TAG581: multu $1, $1 bgez $1, TAG582 mtlo $1 nor $2, $1, $1 TAG582: sll $2, $2, 15 multu $2, $2 mthi $2 subu $1, $2, $2 TAG583: lb $1, 0($1) lui $1, 7 bgtz $1, TAG584 sll $0, $0, 0 TAG584: mflo $4 mtlo $4 mtlo $4 lui $4, 13 TAG585: addiu $4, $4, 7 lui $4, 9 sll $0, $0, 0 addu $2, $4, $4 TAG586: sltiu $4, $2, 11 sll $0, $0, 0 andi $1, $2, 9 mult $2, $2 TAG587: bne $1, $1, TAG588 lui $4, 7 beq $1, $4, TAG588 mtlo $1 TAG588: sll $0, $0, 0 lui $3, 6 slt $1, $4, $4 mflo $3 TAG589: mthi $3 blez $3, TAG590 mtlo $3 sw $3, 0($3) TAG590: and $4, $3, $3 mult $4, $4 sra $2, $4, 12 multu $4, $3 TAG591: xori $2, $2, 10 mtlo $2 mthi $2 lb $2, 0($2) TAG592: lb $2, 0($2) andi $4, $2, 15 sb $4, 0($2) subu $3, $2, $2 TAG593: lhu $3, 0($3) blez $3, TAG594 mflo $2 mtlo $3 TAG594: mflo $3 andi $4, $3, 10 mult $2, $4 mtlo $2 TAG595: sra $2, $4, 14 mult $4, $2 lui $2, 1 slti $4, $2, 6 TAG596: mtlo $4 mfhi $3 sh $3, 0($4) addi $1, $3, 10 TAG597: xor $4, $1, $1 subu $1, $1, $4 beq $1, $1, TAG598 lhu $2, 0($4) TAG598: beq $2, $2, TAG599 mult $2, $2 blez $2, TAG599 lui $2, 10 TAG599: beq $2, $2, TAG600 lb $4, 0($2) addi $1, $4, 4 sra $4, $2, 3 TAG600: beq $4, $4, TAG601 mflo $2 lbu $1, 0($2) beq $4, $4, TAG601 TAG601: mtlo $1 beq $1, $1, TAG602 srl $1, $1, 1 bne $1, $1, TAG602 TAG602: lbu $2, 0($1) bltz $1, TAG603 addiu $1, $1, 12 lhu $3, 0($2) TAG603: sw $3, 0($3) blez $3, TAG604 addi $3, $3, 5 lui $3, 12 TAG604: slt $2, $3, $3 mfhi $4 lui $1, 5 bgtz $3, TAG605 TAG605: sll $0, $0, 0 addu $1, $1, $1 bne $1, $1, TAG606 sll $0, $0, 0 TAG606: mfhi $4 lui $1, 5 mfhi $1 or $2, $1, $4 TAG607: mthi $2 mthi $2 sb $2, 0($2) srlv $4, $2, $2 TAG608: sw $4, 0($4) mthi $4 bgtz $4, TAG609 sra $3, $4, 10 TAG609: mfhi $3 lui $4, 10 sll $0, $0, 0 addiu $4, $4, 1 TAG610: mtlo $4 lui $1, 0 multu $1, $1 beq $1, $1, TAG611 TAG611: sb $1, 0($1) beq $1, $1, TAG612 xor $4, $1, $1 lui $3, 10 TAG612: bgtz $3, TAG613 lb $4, 0($3) beq $4, $4, TAG613 mult $4, $3 TAG613: beq $4, $4, TAG614 mfhi $2 lui $1, 9 lh $2, 0($4) TAG614: sw $2, 0($2) addu $3, $2, $2 bltz $3, TAG615 lbu $3, 0($3) TAG615: mfhi $2 multu $3, $3 bne $2, $3, TAG616 sltu $4, $2, $3 TAG616: mthi $4 lw $2, 0($4) bgtz $4, TAG617 lbu $2, 0($4) TAG617: sh $2, 0($2) mult $2, $2 bne $2, $2, TAG618 sw $2, 0($2) TAG618: multu $2, $2 mfhi $3 multu $3, $3 mthi $3 TAG619: mtlo $3 sltiu $1, $3, 6 mult $3, $3 lbu $4, 0($3) TAG620: lui $2, 7 sll $0, $0, 0 multu $4, $2 mfhi $2 TAG621: bgez $2, TAG622 mult $2, $2 mfhi $3 or $4, $3, $3 TAG622: mflo $4 blez $4, TAG623 slti $3, $4, 13 mtlo $3 TAG623: sb $3, 0($3) mfhi $1 lui $1, 11 mthi $3 TAG624: sll $4, $1, 0 slt $4, $1, $4 lui $1, 10 bltz $1, TAG625 TAG625: ori $1, $1, 15 beq $1, $1, TAG626 srav $2, $1, $1 slt $4, $1, $1 TAG626: bgez $4, TAG627 sra $3, $4, 9 mflo $1 bgez $1, TAG627 TAG627: multu $1, $1 sltiu $1, $1, 1 sh $1, 0($1) bne $1, $1, TAG628 TAG628: mfhi $2 add $4, $1, $1 mtlo $4 subu $1, $2, $1 TAG629: mfhi $2 lui $4, 9 mtlo $4 mflo $1 TAG630: mthi $1 bgtz $1, TAG631 mfhi $4 div $4, $1 TAG631: sll $0, $0, 0 beq $4, $4, TAG632 mtlo $4 sh $4, 0($4) TAG632: blez $4, TAG633 sll $0, $0, 0 bne $4, $4, TAG633 mthi $4 TAG633: sll $0, $0, 0 bgtz $4, TAG634 mfhi $3 sw $4, 0($3) TAG634: addiu $2, $3, 15 lui $4, 4 srl $3, $2, 5 sw $4, -18432($3) TAG635: sw $3, -18432($3) bltz $3, TAG636 divu $3, $3 lui $3, 9 TAG636: blez $3, TAG637 mfhi $1 bgtz $1, TAG637 lui $1, 13 TAG637: subu $4, $1, $1 beq $4, $1, TAG638 sllv $2, $4, $4 mflo $3 TAG638: bne $3, $3, TAG639 lbu $2, 0($3) mthi $3 lh $1, 0($2) TAG639: lui $3, 9 multu $3, $3 bne $3, $3, TAG640 lui $2, 8 TAG640: mthi $2 sll $0, $0, 0 addu $4, $2, $2 srlv $3, $4, $2 TAG641: sll $0, $0, 0 div $3, $3 subu $3, $3, $3 bne $3, $3, TAG642 TAG642: mult $3, $3 sw $3, 0($3) lui $4, 3 beq $4, $3, TAG643 TAG643: mthi $4 lui $3, 14 bgtz $3, TAG644 mult $4, $3 TAG644: mfhi $3 lhu $1, 0($3) lh $1, 0($3) bgez $1, TAG645 TAG645: mthi $1 beq $1, $1, TAG646 mthi $1 beq $1, $1, TAG646 TAG646: srlv $1, $1, $1 multu $1, $1 mtlo $1 mult $1, $1 TAG647: mfhi $4 mult $1, $1 blez $4, TAG648 lw $1, 0($1) TAG648: bne $1, $1, TAG649 mflo $1 xori $3, $1, 4 beq $1, $3, TAG649 TAG649: mfhi $3 mfhi $4 mtlo $3 subu $4, $3, $3 TAG650: multu $4, $4 beq $4, $4, TAG651 sltiu $4, $4, 5 srav $2, $4, $4 TAG651: lui $1, 7 sll $0, $0, 0 srl $2, $4, 14 multu $2, $1 TAG652: beq $2, $2, TAG653 lui $2, 6 bgez $2, TAG653 sra $3, $2, 6 TAG653: multu $3, $3 bne $3, $3, TAG654 sw $3, 0($3) srl $4, $3, 3 TAG654: lh $2, 0($4) bne $4, $4, TAG655 lbu $4, 0($2) mtlo $4 TAG655: mfhi $1 ori $3, $4, 3 mflo $3 bne $3, $3, TAG656 TAG656: addi $2, $3, 4 bne $2, $3, TAG657 ori $1, $3, 7 bne $2, $2, TAG657 TAG657: ori $3, $1, 5 lbu $2, 0($3) lb $2, 0($3) mflo $1 TAG658: lui $2, 4 lui $3, 15 mfhi $1 mthi $2 TAG659: lui $4, 7 sll $0, $0, 0 mfhi $3 sb $3, 0($1) TAG660: addiu $1, $3, 3 sll $0, $0, 0 blez $3, TAG661 sll $0, $0, 0 TAG661: slt $4, $2, $2 bne $4, $4, TAG662 xori $4, $4, 8 blez $2, TAG662 TAG662: sw $4, 0($4) multu $4, $4 mflo $2 mthi $4 TAG663: ori $1, $2, 3 bgtz $2, TAG664 mthi $2 mtlo $2 TAG664: srlv $2, $1, $1 mthi $1 sb $2, 0($1) slti $3, $1, 6 TAG665: andi $4, $3, 1 lhu $3, 0($4) mthi $3 mflo $3 TAG666: mtlo $3 lbu $2, 0($3) bgtz $3, TAG667 mtlo $3 TAG667: mthi $2 mthi $2 bne $2, $2, TAG668 srlv $1, $2, $2 TAG668: mthi $1 add $3, $1, $1 srav $2, $3, $3 bgtz $3, TAG669 TAG669: sll $2, $2, 11 bgez $2, TAG670 mthi $2 mthi $2 TAG670: sh $2, 0($2) sb $2, 0($2) sb $2, 0($2) mfhi $2 TAG671: sh $2, 0($2) srlv $3, $2, $2 mthi $2 multu $3, $2 TAG672: sb $3, 0($3) mthi $3 xori $3, $3, 14 mfhi $2 TAG673: lui $4, 1 mtlo $4 lui $1, 9 mult $1, $1 TAG674: mtlo $1 mfhi $1 lui $3, 6 mthi $1 TAG675: sll $0, $0, 0 bne $3, $3, TAG676 mflo $4 sll $0, $0, 0 TAG676: div $1, $1 blez $1, TAG677 sb $1, 0($1) lb $4, 0($1) TAG677: lb $1, 0($4) sb $1, 0($1) sb $1, 0($4) mfhi $3 TAG678: bgez $3, TAG679 sh $3, 0($3) lhu $2, 0($3) bne $3, $3, TAG679 TAG679: sub $2, $2, $2 xor $2, $2, $2 xor $2, $2, $2 mthi $2 TAG680: mflo $3 mthi $2 bltz $3, TAG681 mthi $2 TAG681: sb $3, 0($3) lb $1, 0($3) sb $1, 0($3) srl $1, $1, 14 TAG682: bne $1, $1, TAG683 mflo $4 lui $4, 10 srlv $4, $4, $1 TAG683: mfhi $3 beq $3, $3, TAG684 lui $3, 3 sw $4, 0($3) TAG684: nor $2, $3, $3 andi $2, $2, 11 sb $3, 0($2) div $2, $2 TAG685: ori $2, $2, 2 or $1, $2, $2 mflo $1 bgtz $2, TAG686 TAG686: sb $1, 0($1) addiu $1, $1, 6 addiu $3, $1, 8 lb $3, 0($1) TAG687: mthi $3 lh $4, 0($3) divu $3, $4 sw $4, -256($4) TAG688: sb $4, -256($4) bne $4, $4, TAG689 lw $3, -256($4) mtlo $4 TAG689: sll $0, $0, 0 srl $3, $4, 0 andi $1, $3, 3 lh $3, -256($4) TAG690: mfhi $1 srav $3, $3, $3 mfhi $3 addi $4, $1, 15 TAG691: subu $1, $4, $4 mthi $4 multu $1, $1 mtlo $4 TAG692: lui $3, 1 mtlo $1 divu $1, $3 sll $0, $0, 0 TAG693: bltz $1, TAG694 lui $1, 3 mflo $4 sll $0, $0, 0 TAG694: lui $1, 7 bgez $1, TAG695 srav $4, $3, $1 bgtz $3, TAG695 TAG695: multu $4, $4 beq $4, $4, TAG696 addu $1, $4, $4 div $1, $1 TAG696: lui $3, 6 mult $3, $1 sll $4, $1, 13 mult $4, $1 TAG697: mtlo $4 mthi $4 xori $4, $4, 6 mfhi $2 TAG698: mthi $2 sra $2, $2, 4 xori $3, $2, 13 blez $2, TAG699 TAG699: mfhi $3 sll $0, $0, 0 mflo $2 sll $0, $0, 0 TAG700: sll $0, $0, 0 lui $2, 9 mfhi $4 sll $0, $0, 0 TAG701: or $1, $4, $4 sll $0, $0, 0 blez $4, TAG702 sll $0, $0, 0 TAG702: mtlo $1 and $2, $1, $1 mtlo $1 mthi $2 TAG703: andi $4, $2, 11 bgtz $2, TAG704 multu $2, $2 lui $4, 4 TAG704: lui $2, 0 mflo $4 lhu $2, 0($4) multu $4, $2 TAG705: bgez $2, TAG706 multu $2, $2 sltiu $4, $2, 5 sb $4, 0($2) TAG706: lhu $2, 0($4) sb $2, -256($2) lui $2, 3 bltz $2, TAG707 TAG707: lui $1, 9 sll $0, $0, 0 mflo $3 sll $0, $0, 0 TAG708: mflo $4 sll $0, $0, 0 sll $0, $0, 0 beq $3, $2, TAG709 TAG709: sll $0, $0, 0 bgez $3, TAG710 div $3, $3 add $1, $3, $3 TAG710: andi $4, $1, 1 sll $0, $0, 0 bgtz $1, TAG711 mult $1, $1 TAG711: sll $0, $0, 0 addu $1, $1, $1 bne $1, $1, TAG712 ori $1, $1, 10 TAG712: lui $1, 11 sll $0, $0, 0 sll $0, $0, 0 mflo $2 TAG713: slti $1, $2, 5 mult $2, $2 xor $3, $1, $2 beq $1, $2, TAG714 TAG714: mthi $3 lui $4, 4 subu $3, $4, $3 srav $1, $3, $3 TAG715: lb $4, 0($1) mthi $1 bne $1, $1, TAG716 sb $4, 0($1) TAG716: mtlo $4 lw $2, 0($4) lhu $3, -256($2) bgtz $4, TAG717 TAG717: mtlo $3 lui $2, 7 lb $3, -256($3) lui $1, 9 TAG718: blez $1, TAG719 sll $0, $0, 0 sltu $2, $1, $1 sll $0, $0, 0 TAG719: mthi $2 lui $3, 13 lui $1, 5 beq $2, $1, TAG720 TAG720: sll $0, $0, 0 xor $3, $1, $1 addiu $2, $3, 5 sh $2, 0($3) TAG721: or $3, $2, $2 mtlo $2 bgtz $3, TAG722 lbu $3, 0($2) TAG722: lw $2, 0($3) lb $2, 0($2) andi $2, $3, 9 slt $3, $2, $2 TAG723: sw $3, 0($3) lb $3, 0($3) mtlo $3 mfhi $1 TAG724: mthi $1 bne $1, $1, TAG725 andi $2, $1, 10 bltz $2, TAG725 TAG725: sw $2, 0($2) lui $4, 9 beq $4, $2, TAG726 mfhi $4 TAG726: lb $1, 0($4) blez $1, TAG727 sra $2, $4, 12 srav $1, $2, $2 TAG727: bgtz $1, TAG728 sllv $1, $1, $1 beq $1, $1, TAG728 and $3, $1, $1 TAG728: mthi $3 beq $3, $3, TAG729 sra $1, $3, 8 lbu $1, 0($3) TAG729: sb $1, 0($1) multu $1, $1 blez $1, TAG730 sh $1, 0($1) TAG730: bltz $1, TAG731 sb $1, 0($1) mthi $1 sw $1, 0($1) TAG731: add $4, $1, $1 multu $1, $4 blez $1, TAG732 lui $4, 13 TAG732: srlv $3, $4, $4 mfhi $3 addu $2, $3, $3 sw $4, 0($3) TAG733: lui $1, 5 mult $2, $2 sra $1, $1, 8 div $1, $1 TAG734: sll $0, $0, 0 divu $1, $1 bgez $1, TAG735 srav $1, $1, $1 TAG735: div $1, $1 lui $1, 3 sll $0, $0, 0 mfhi $1 TAG736: mtlo $1 slti $2, $1, 8 beq $1, $1, TAG737 mthi $1 TAG737: lui $3, 5 bne $2, $3, TAG738 lui $4, 0 slt $1, $4, $3 TAG738: andi $3, $1, 12 andi $3, $1, 10 blez $3, TAG739 add $1, $3, $1 TAG739: bgtz $1, TAG740 mfhi $4 lb $3, 0($1) mfhi $2 TAG740: blez $2, TAG741 sh $2, 0($2) addu $4, $2, $2 divu $2, $4 TAG741: sh $4, 0($4) mthi $4 beq $4, $4, TAG742 lui $4, 11 TAG742: sll $0, $0, 0 bne $4, $4, TAG743 divu $4, $4 addiu $2, $4, 9 TAG743: sll $0, $0, 0 mult $2, $3 mflo $4 xor $1, $4, $3 TAG744: lui $2, 9 lh $2, 0($1) lui $3, 8 mtlo $3 TAG745: divu $3, $3 mthi $3 sll $0, $0, 0 sll $0, $0, 0 TAG746: lhu $3, 0($4) sh $4, 0($4) lb $1, 0($3) beq $3, $3, TAG747 TAG747: xor $2, $1, $1 bgez $1, TAG748 sra $4, $1, 0 mtlo $2 TAG748: lui $1, 9 mfhi $4 mtlo $4 xor $2, $4, $1 TAG749: mthi $2 bltz $2, TAG750 mult $2, $2 mtlo $2 TAG750: nop nop test_end: beq $0, $0, test_end nop
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_515.asm
ljhsiun2/medusa
9
11753
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %r8 push %rax push %rdx push %rsi lea addresses_WT_ht+0x13262, %rsi nop nop nop nop add $62205, %r15 movb (%rsi), %r8b add %rdx, %rdx lea addresses_UC_ht+0x1a98e, %r8 clflush (%r8) nop inc %rdx mov $0x6162636465666768, %rax movq %rax, %xmm6 movups %xmm6, (%r8) nop nop nop add $25158, %r8 lea addresses_D_ht+0x6c1e, %r10 nop xor %r14, %r14 movw $0x6162, (%r10) nop cmp $12046, %r14 lea addresses_WC_ht+0x1859e, %rax nop nop nop nop nop and $6223, %r8 mov $0x6162636465666768, %r10 movq %r10, %xmm5 movups %xmm5, (%rax) nop nop nop nop cmp $24098, %rsi lea addresses_normal_ht+0x175d2, %r10 nop nop nop nop nop xor %r8, %r8 mov (%r10), %r14 nop nop and $11662, %rsi lea addresses_WT_ht+0x1dd7c, %r15 nop add %rax, %rax movw $0x6162, (%r15) nop nop nop nop lfence lea addresses_WC_ht+0xbefe, %rdx nop nop nop nop sub $53751, %rax movups (%rdx), %xmm3 vpextrq $0, %xmm3, %rsi dec %r10 lea addresses_WT_ht+0xec7e, %rsi clflush (%rsi) nop nop nop cmp $9668, %r8 mov (%rsi), %eax nop sub $1055, %rax pop %rsi pop %rdx pop %rax pop %r8 pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r8 push %rbp push %rcx push %rdx push %rsi // Store lea addresses_WT+0xa59e, %rbp sub $1642, %r11 movl $0x51525354, (%rbp) nop nop nop nop add $46510, %rsi // Store lea addresses_A+0x17d9e, %r12 sub $31554, %rsi movb $0x51, (%r12) nop nop inc %r11 // Load lea addresses_UC+0x1bf9a, %r12 sub $22155, %rbp movb (%r12), %cl nop dec %r11 // Load lea addresses_PSE+0xed9e, %rdx nop nop nop nop add %r8, %r8 movb (%rdx), %r11b nop nop nop nop sub %r12, %r12 // Faulty Load lea addresses_PSE+0xed9e, %rcx nop nop nop mfence movb (%rcx), %r12b lea oracles, %rcx and $0xff, %r12 shlq $12, %r12 mov (%rcx,%r12,1), %r12 pop %rsi pop %rdx pop %rcx pop %rbp pop %r8 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4}} {'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 */
test/Fail/Issue4435-1.agda
cruhland/agda
1,989
4098
module Issue4435-1 where record ⊤ : Set where -- Declarations. data Foo (a : Set) : Set Bar : {a : Set} → Foo a → Set -- Definitions. data Foo a : Set where c1 : Foo a c2 : (x : Foo a) (y : Bar x → Foo a) → Foo a Bar c1 = ⊤ Bar (c2 a b) = (x : Bar a) → Bar (b x)
nicolai/pseudotruncations/Preliminary-definitions.agda
nicolaikraus/HoTT-Agda
1
8182
{-# OPTIONS --without-K #-} open import lib.Basics -- open import lib.NType2 -- open import lib.PathGroupoid open import lib.types.Bool open import lib.types.IteratedSuspension open import lib.types.Lift open import lib.types.LoopSpace open import lib.types.Nat open import lib.types.Paths open import lib.types.Pi open import lib.types.Pointed open import lib.types.Sigma open import lib.types.Suspension open import lib.types.TLevel open import lib.types.Unit module nicolai.pseudotruncations.Preliminary-definitions where -- definition of weak constancy wconst : ∀ {i j} {A : Type i} {B : Type j} → (A → B) → Type (lmax i j) wconst {A = A} f = (a₁ a₂ : A) → f a₁ == f a₂ {- Pointed maps (without the 'point') -} _→̇_ : ∀ {i j} ( : Ptd i) (B̂ : Ptd j) → Type _  →̇ B̂ = fst ( ⊙→ B̂) {- It is useful to have a lemma which allows to construct equalities between pointed types. Of course, we know that such an equality is a pair of equalities; however, transporting a function can make things more tedious than necessary! -} make-=-∙ : ∀ {i j} { : Ptd i} {B̂ : Ptd j} (f̂ ĝ :  →̇ B̂) (p : fst f̂ == fst ĝ) → ! (app= p (snd Â)) ∙ snd f̂ == snd ĝ → f̂ == ĝ make-=-∙ (f , p) (.f , q) idp t = pair= idp t {- A lemma that allows to prove that the value of a map between pointed maps, at some given point, is some given point. This would otherwise be an involved nesting of transports/ PathOvers. -} →̇-maps-to : ∀ {i} { B̂ Ĉ D̂ : Ptd i} (F̂ : ( →̇ B̂) → (Ĉ →̇ D̂)) (f̂ :  →̇ B̂) (ĝ : Ĉ →̇ D̂) (p : fst (F̂ f̂) == (fst ĝ)) (q : (app= p (snd Ĉ)) ∙ (snd ĝ) == snd (F̂ f̂)) → F̂ f̂ == ĝ →̇-maps-to F̂ f̂ (.(fst (F̂ f̂)) , .(snd (F̂ f̂))) idp idp = idp {- Also trivial: make pointed equivalences from an ordinary equality -} coe-equiv∙ : ∀ {i} { B̂ : Ptd i} → ( == B̂) →  ⊙≃ B̂ coe-equiv∙ idp = (idf _ , idp) , idf-is-equiv _ module _ {i} where {- Of course, spheres are defined in the library. Unfortunately, they do not play well together with iterated suspension. If f is an endofunction, one can define [f^Sn] either as [f^n ∘ f] or as [f ∘ f^n]. It turns out that it is much more convenient if one chooses different possibilites for Ω and for Σ (suspension), as the adjunction can then be handled much more directly. In summary: It's best to redefine spheres. -} ⊙Susp-iter' : (n : ℕ) ( : Ptd i) → Ptd i ⊙Susp-iter' O  =  ⊙Susp-iter' (S n)  = ⊙Susp-iter' n (⊙Susp Â) {- compare: definition of iterated Ω ⊙Ω-iter : (n : ℕ) ( : Ptd i) → Ptd i ⊙Ω-iter O  =  ⊙Ω-iter (S n)  = ⊙Ω (⊙Ω-iter n Â) -} ⊙Sphere' : (n : ℕ) → Ptd i ⊙Sphere' n = ⊙Susp-iter' n (⊙Lift ⊙Bool) Sphere' : (n : ℕ) → Type i Sphere' = fst ∘ ⊙Sphere' nor' : (n : ℕ) → Sphere' n nor' = snd ∘ ⊙Sphere' {- Unfortunately, we will sometimes still need the "other" behaviour of the sphere. Thus, we show at least the following: -} ⊙Susp-iter : (n : ℕ) ( : Ptd i) → Ptd i ⊙Susp-iter O  =  ⊙Susp-iter (S n)  = ⊙Susp (⊙Susp-iter n Â) ⊙Sphere* : (n : ℕ) → Ptd i ⊙Sphere* n = ⊙Susp-iter n (⊙Lift ⊙Bool) Sphere* : (n : ℕ) → Type i Sphere* = fst ∘ ⊙Sphere* {- Of course, this proof could be done for all endofunctions. -} susp-iter= : (n : ℕ) ( : Ptd i) → ⊙Susp-iter' n  == ⊙Susp-iter n  susp-iter= O  = idp susp-iter= (S O)  = idp susp-iter= (S (S n))  = ⊙Susp-iter' (S (S n))  =⟨ susp-iter= (S n) (⊙Susp Â) ⟩ ⊙Susp (⊙Susp-iter n (⊙Susp Â)) =⟨ ap ⊙Susp (! (susp-iter= n (⊙Susp Â))) ⟩ ⊙Susp (⊙Susp-iter' (S n) Â) =⟨ ap ⊙Susp (susp-iter= (S n) Â) ⟩ ⊙Susp-iter (S (S n))  ∎ {- Thus, we have for the spheres: -} ⊙Spheres= : (n : ℕ) → ⊙Sphere' n == ⊙Sphere* n ⊙Spheres= n = susp-iter= n (⊙Lift ⊙Bool) Spheres= : (n : ℕ) → Sphere' n == Sphere* n Spheres= n = ap fst (⊙Spheres= n) {- Also, we have this: -} susp'-switch : (n : ℕ) → ⊙Sphere' (S n) == ⊙Susp (⊙Sphere' n) susp'-switch n = (⊙Spheres= (S n)) ∙ (ap ⊙Susp (! (⊙Spheres= n)))
language/PlantLang.g4
sampottinger/PlantLang
0
676
grammar PlantLang; WHITE_SPACE: [ \u000B\t\r\n] -> channel(HIDDEN); STEM_: 's' 't' 'e' 'm'; SKIP_: 's' 'k' 'i' 'p'; BRANCH_: 'b' 'r' 'a' 'n' 'c' 'h'; CHOOSE_: 'c' 'h' 'o' 'o' 's' 'e'; REPLACE_: 'r' 'e' 'p' 'l' 'a' 'c' 'e'; FRAC_: 'f' 'r' 'a' 'c'; LOOP_: 'l' 'o' 'o' 'p'; KLOOP_: 'k' 'l' 'o' 'o' 'p'; ROTATE_: 'r' 'o' 't' 'a' 't' 'e'; ABS_: 'a' 'b' 's'; REL_: 'r' 'e' 'l'; WIDTH_: 'w' 'i' 'd' 't' 'h'; DEG_: 'd' 'e' 'g'; PI_: 'p' 'i'; PERIOD_ : '.'; ITER_: 'i' 't' 'e' 'r'; REMAIN_: 'r' 'e' 'm' 'a' 'i' 'n'; RAND_: 'r' 'a' 'n' 'd'; X_: 'm' 'o' 'u' 's' 'e' 'X'; Y_: 'm' 'o' 'u' 's' 'e' 'Y'; DUR_: 'd' 'u' 'r'; MILLIS_: 'm' 'i' 'l' 'l' 'i' 's'; SEC_: 's' 'e' 'c'; MIN_: 'm' 'i' 'n'; HOUR_: 'h' 'o' 'u' 'r'; DAY_: 'd' 'a' 'y'; MONTH_: 'm' 'o' 'n' 't' 'h'; YEAR_: 'y' 'e' 'a' 'r'; SIN_: 's' 'i' 'n'; SPEED_: 's' 'p' 'e' 'e' 'd'; START_: 's' 't' 'a' 'r' 't'; COLOR_: 'c' 'o' 'l' 'o' 'r'; FLOWER_: 'f' 'l' 'o' 'w' 'e' 'r'; TRANS_: 't' 'r' 'a' 'n' 's'; HEX_CODE_: '#' [A-F0-9]+; FLOAT_: [0-9]+ '.' [0-9]+; INTEGER_: [0-9]+; LPAREN_: '('; RPAREN_: ')'; MULT_: '*'; DIV_: '/'; ADD_: '+'; SUB_: '-'; POW_: '^'; dynamic: (X_ | Y_ | DUR_ | SIN_ | RAND_); date: (MILLIS_ | SEC_ | MIN_ | HOUR_ | DAY_ | MONTH_ | YEAR_); iter: (PERIOD_)* ITER_; remain: (PERIOD_)* REMAIN_; number: (iter | dynamic | date | remain)* (ADD_ | SUB_)? (FLOAT_ | INTEGER_); expression: number # simpleExpression | expression op=(MULT_ | DIV_ | POW_) expression # multiplyExpression | expression op=(ADD_ | SUB_) expression # additionExpression | LPAREN_ expression RPAREN_ # parenExpression ; speed: SPEED_ target=expression (START_ expression)?; stem: STEM_ distance=expression; skip: SKIP_ distance=expression; width: WIDTH_ target=expression units=(ABS_ | REL_); rotate: ROTATE_ target=expression units=(DEG_ | PI_); color: COLOR_ target=HEX_CODE_ (TRANS_ expression)?; flower: FLOWER_ radius=expression; branch: BRANCH_ '>' program ('>' program)*; choose: CHOOSE_ INTEGER_ (REPLACE_)? '>' program ('>' program)*; frac: FRAC_ INTEGER_ '>' program; loop: LOOP_ INTEGER_ '>' program; kloop: KLOOP_ INTEGER_ '>' program; command: skip | stem | branch | choose | frac | loop | kloop | width | rotate | color | flower | speed; program: command ('|' command)* ';';
test/Succeed/Issue481PonderMaster.agda
cruhland/agda
1,989
16661
<gh_stars>1000+ open import Issue481PonderBase open import Issue481PonderImportMe as as module Issue481PonderMaster where module M = as as as
tmss.asm
billyrayvalentine/asm68k-megadrive-helloworld
4
85409
/* * tmss.asm * Written for use with GNU AS * Copyright © 2020 <NAME> <github.com/billyrayvalentine> * 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 COPYING file for more details. */ tmss: move.b 0xA10001, d0 andi.b #0x0F, d0 /* AND the last 4 bits, skip if 0 (Model 1) */ beq 1f move.l #SEGA_STRING, a1 move.l (a1), 0xA14000 /* Write 'SEGA' to 0xA14000 */ 1: rts
judge.asm
dreamingPainter/c64-snake
1
94609
<filename>judge.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 日期:2021-4-11 ; 食物:crnd $51 ; 墙:cblk $66 ; 像素:csnk ; 蛇头 (shead) ; 键入方向d(8bit)-> ; 宽38 高23 ;;;;;;;;;;;;;;;;;;;;撞墙伪码;;;;;;;;;;;;;;;;;;;;;;;;; ; ((shead) 与 d(new)运算)的位置的内容 CMP cblk ; 忘了 = ->sec ; 忘了 = ->clc ;;;;;;;;;;;;;;;;;;;撞自己伪码;;;;;;;;;;;;;;;;;;;;;;;; ; ((shead) 与 d(new)运算)的位置的内容 CMP csnk ; 忘了 = ->sev ; 忘了 = ->clc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; judgeout 判断是否出界/撞到自身 ; 是->sec 即进位标志置1 ; 否->clc 即进位标志置0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;关于指令cmp: ;;相等Z=1;不等Z=0 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; judgeout: .scope lda d ;;方向向上 cmp #go_u beq _gup ;;方向向下 cmp #go_d beq _gdown ;;方向向左 cmp #go_l beq _gleft ;;方向向右 cmp #go_r beq _gright jmp _End1 ;什么都没有撞 ;是否撞墙;是否考虑溢出情况;撞墙撞自己要不要分开写? _gup: ;地址-40?实现:/减法/地址跳跃 lda shead sec sbc #40 sta _ptr lda shead+1 sbc #0 sta _ptr+1 ldy #0 lda (_ptr),y cmp #cblk beq _End2 jmp _selfx _gdown: ldy #40 ;地址+40,好像有问题,这个(shead)是蛇头地址的地址了 拟修改:lda (取低位用啥来着)(shead),sec, adc #40, lda (shead),y cmp #cblk beq _End2 jmp _selfx _gleft: lda shead sec sbc #1 sta _ptr lda shead+1 sbc #0 sta _ptr+1 ldy #0 lda (_ptr),y cmp #cblk beq _End2 jmp _selfx _gright:ldy #1 ;地址+1,好像有问题,这个(shead) 拟修改:lda (取低位用啥来着)(shead),sec,adc # lda (shead),y cmp #cblk beq _End2 _selfx: cmp #csnk beq _End2 ;蛇没死 _End1: clc rts ;蛇死了 _End2: sec rts .scend ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; judgefood 判断是否吃到食物 ; 是->sec 即进位标志置1 ; 否->clc 即进位标志置0 ;;;;;;;;;;;;;;;;;;;;;;;食物伪码;;;;;;;;;;;;;;;;;;;;;;; ; ((shead) 与 d(new)运算)的位置的内容 CMP crnd ; 忘了 = ->sec ; 忘了 = ->clc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; judgefood: .scope lda d ;;方向向上 cmp #go_u beq _gup ;;方向向下 cmp #go_d beq _gdown ;;方向向左 cmp #go_l beq _gleft ;;方向向右 cmp #go_r beq _gright jmp _End1 ;输入了一个无效字符,,,,,? ;是否撞墙;是否考虑溢出情况-不用;撞墙撞自己要不要分开写? _gup: lda shead sec sbc #40 sta _ptr lda shead+1 sbc #0 sta _ptr+1 ldy #0 lda (_ptr),y cmp #crnd beq _End2 bne _End1 _gdown: ldy #40 ;地址+40 lda (shead),y cmp #crnd beq _End2 bne _End1 _gleft: lda shead sec sbc #1 sta _ptr lda shead+1 sbc #0 sta _ptr+1 ldy #0 lda (_ptr),y cmp #crnd beq _End2 bne _End1 _gright:ldy #1 ;地址+1 lda (shead),y cmp #crnd beq _End2 ;没吃到 _End1: clc rts ;吃到了 _End2: sec rts .scend
base/ntos/ex/amd64/hifreqlk.asm
npocmaka/Windows-Server-2003
17
179600
<reponame>npocmaka/Windows-Server-2003 title "Global SpinLock declerations" ;++ ; ;Copyright (c) 2000 Microsoft Corporation ; ; Module Name: ; ; hifreqlk.asm ; ; Abstract: ; ; High frequency system spin locks are declared in this module. Each spin ; lock is placed in its own cache line on MP systems. ; ; Author: ; ; <NAME> (davec) 22-Jun-2000 ; ;Revision History: ; ;-- include ksamd64.inc ifdef NT_UP ALIGN_VALUE equ 16 else ALIGN_VALUE equ 128 endif ; ; Define spin lock generation macro. ; SPINLOCK macro SpinLockName align ALIGN_VALUE public SpinLockName SpinLockName dq 0 endm ; ; Define variable generation macro. ; ULONG64 macro VariableName align ALIGN_VALUE public VariableName VariableName dq 0 endm _DATA$00 SEGMENT PAGE 'DATA' ; ; The Initial PCR must be the first allocation in the section so it will be ; page aligned. ; public KiInitialPCR KiInitialPCR db ProcessorControlRegisterLength dup (0) ; ; Static SpinLocks from ntos\cc ; SPINLOCK CcMasterSpinLock SPINLOCK CcWorkQueueSpinLock SPINLOCK CcVacbSpinLock SPINLOCK CcDeferredWriteSpinLock SPINLOCK CcDebugTraceLock SPINLOCK CcBcbSpinLock ; ; Static SpinLocks from ntos\ex ; SPINLOCK NonPagedPoolLock SPINLOCK ExpResourceSpinLock ; ; Static SpinLocks from ntos\io ; SPINLOCK IopCompletionLock SPINLOCK IopCancelSpinLock SPINLOCK IopVpbSpinLock SPINLOCK IopDatabaseLock SPINLOCK IopErrorLogLock SPINLOCK IopTimerLock SPINLOCK IoStatisticsLock ; ; Static SpinLocks from ntos\kd ; SPINLOCK KdpDebuggerLock ; ; Static SpinLocks from ntos\ke ; SPINLOCK KiDispatcherLock SPINLOCK KiFreezeExecutionLock SPINLOCK KiFreezeLockBackup SPINLOCK KiNMILock SPINLOCK KiProfileLock ULONG64 KiHardwareTrigger ; ; Static SpinLocks from ntos\mm ; SPINLOCK MmPfnLock SPINLOCK MmSystemSpaceLock SPINLOCK MmNonPagedPoolLock ; ; Static SpinLocks from ntos\ps ; SPINLOCK PspEventPairLock SPINLOCK PsLoadedModuleSpinLock ; ; Static SpinLocks from ntos\fsrtl ; SPINLOCK FsRtlStrucSupSpinLock ; ; Static SpinLocks from base\fs\ntfs ; SPINLOCK NtfsStructLock ; ; Static SpinLocks from net\sockets\winsock2\wsp ; SPINLOCK AfdWorkQueueSpinLock ; ; These variables are referenced together and are defined in a single cache ; line to reduce sharing on MP systems. ; ; KiIdleSummary - This is the set of processors which are idle. It is ; used by the ready thread code to speed up the search for a thread ; to preempt when a thread becomes runnable. ; align ALIGN_VALUE public KiIdleSummary KiIdleSummary dq 0 ; ; PoSleepingSummary - Set of processors which currently sleep (ie stop) ; when idle. ; public PoSleepingSummary PoSleepingSummary dq 0 ; ; KiTbFlushTimeStamp - This is the TB flush entire time stamp counter. ; ; This variable is in it own cache line to reduce false sharing on MP systems. ; align ALIGN_VALUE public KiTbFlushTimeStamp KiTbFlushTimeStamp dd 0 ; ; These variables are referenced together and are defined in a single cache ; line to reduce sharing on MP systems. ; ; KiTimeIncrementReciprocal - This is the reciprocal fraction of the time ; increment value that is specified by the HAL when the system is ; booted. ; align ALIGN_VALUE public KiTimeIncrementReciprocal KiTimeIncrementReciprocal dq 0 ; ; KiTimeIncrementShiftCount - This is the shift count that corresponds to ; the time increment reciprocal value. ; public KiTimeIncrementShiftCount KiTimeIncrementShiftCount dd 0 ; ; KeMaximumIncrement - This is the maximum time between clock interrupts ; in 100ns units that is supported by the host HAL. ; public KeMaximumIncrement KeMaximumIncrement dd 0 ; ; KeTimeAdjustment - This is the actual number of 100ns units that are to ; be added to the system time at each interval timer interupt. This ; value is copied from KeTimeIncrement at system start up and can be ; later modified via the set system information service. ; timer table entries. ; public KeTimeAdjustment KeTimeAdjustment dd 0 ; ; KiTickOffset - This is the number of 100ns units remaining before a tick ; is added to the tick count and the system time is updated. ; public KiTickOffset KiTickOffset dd 0 ; ; These variables are referenced together and are defined in a single cache ; line to reduce sharing on MP systems. ; ; KiMaximumDpcQueueDepth - This is used to control how many DPCs can be ; queued before a DPC of medium importance will trigger a dispatch ; interrupt. ; align ALIGN_VALUE public KiMaximumDpcQueueDepth KiMaximumDpcQueueDepth dd 4 ; ; KiMinimumDpcRate - This is the rate of DPC requests per clock tick that ; must be exceeded before DPC batching of medium importance DPCs ; will occur. ; public KiMinimumDpcRate KiMinimumDpcRate dd 3 ; ; KiAdjustDpcThreshold - This is the threshold used by the clock interrupt ; routine to control the rate at which the processor's DPC queue depth ; is dynamically adjusted. ; public KiAdjustDpcThreshold KiAdjustDpcThreshold dd 20 ; ; KiIdealDpcRate - This is used to control the aggressiveness of the DPC ; rate adjusting algorithm when decrementing the queue depth. As long ; as the DPC rate for the last tick is greater than this rate, the ; DPC queue depth will not be decremented. ; public KiIdealDpcRate KiIdealDpcRate dd 20 ; ; MmPaeMask - This is the value used to mask upper bits of a PAE PTE. ; ; This variable is in it own cache line to reduce false sharing on MP systems. ; align ALIGN_VALUE public MmPaeMask MmPaeMask dq 0 public MmPaeErrMask MmPaeErrMask dd 0 ; ; MmPfnDereferenceSListHead - This is used to store free blocks used for ; deferred PFN reference count releasing. ; ; This variable is in it own cache line to reduce false sharing on MP systems. ; align ALIGN_VALUE public MmPfnDereferenceSListHead MmPfnDereferenceSListHead dq 2 dup (0) ; ; MmPfnDeferredList - This is used to queue items that need reference count ; decrement processing. ; ; This variable is in it own cache line to reduce false sharing on MP systems. ; align ALIGN_VALUE public MmPfnDeferredList MmPfnDeferredList dq 0 ; ; MmSystemLockPagesCount - This is the count of the number of locked pages ; in the system. ; align ALIGN_VALUE public MmSystemLockPagesCount MmSystemLockPagesCount dq 0 align ALIGN_VALUE _DATA$00 ends end
engine/events/pokerus/check_pokerus.asm
Dev727/ancientplatinum
28
104828
_CheckPokerus: ; Return carry if a monster in your party has Pokerus ; Get number of monsters to iterate over ld a, [wPartyCount] and a jr z, .NoPokerus ld b, a ; Check each monster in the party for Pokerus ld hl, wPartyMon1PokerusStatus ld de, PARTYMON_STRUCT_LENGTH .Check: ld a, [hl] and $0f ; only the bottom nybble is used jr nz, .HasPokerus ; Next PartyMon add hl, de dec b jr nz, .Check .NoPokerus: and a ret .HasPokerus: scf ret
programs/oeis/008/A008513.asm
jmorken/loda
1
19157
; A008513: Number of points on surface of 6-dimensional cube. ; 0,64,728,4032,14896,42560,102024,215488,413792,737856,1240120,1985984,3055248,4543552,6563816,9247680,12746944,17235008,22908312,29987776,38720240,49379904,62269768,77723072,96104736,117812800,143279864,172974528,207402832,247109696,292680360,344741824,403964288,471062592,546797656,631977920,727460784,834154048,953017352,1085063616,1231360480,1393031744,1571258808,1767282112,1982402576,2217983040,2475449704,2756293568,3062071872,3394409536,3755000600,4145609664,4568073328,5024301632,5516279496,6046068160,6615806624,7227713088,7884086392,8587307456,9339840720,10144235584,11003127848,11919241152,12895388416,13934473280,15039491544,16213532608,17459780912,18781517376,20182120840,21665069504,23233942368,24892420672,26644289336,28493438400,30443864464,32499672128,34665075432,36944399296,39342080960,41862671424,44510836888,47291360192,50209142256,53269203520,56476685384,59836851648,63355089952,67036913216,70887961080,74914001344,79120931408,83514779712,88101707176,92888008640,97880114304,103084591168,108508144472,114157619136,120040001200,126162419264,132532145928,139156599232,146043344096,153200093760,160634711224,168355210688,176369758992,184686677056,193314441320,202261685184,211537200448,221149938752,231109013016,241423698880,252103436144,263157830208,274596653512,286429846976,298667521440,311319959104,324397614968,337911118272,351871273936,366289064000,381175649064,396542369728,412400748032,428762488896,445639481560,463043801024,480987709488,499483657792,518544286856,538182429120,558411109984,579243549248,600693162552,622773562816,645498561680,668882170944,692938604008,717682277312,743127811776,769290034240,796183978904,823824888768,852228217072,881409628736,911385001800,942170428864,973782218528,1006236896832,1039551208696,1073742119360,1108826815824,1144822708288,1181747431592,1219618846656,1258455041920,1298274334784,1339095273048,1380936636352,1423817437616,1467756924480,1512774580744,1558890127808,1606123526112,1654494976576,1704024922040,1754734048704,1806643287568,1859773815872,1914147058536,1969784689600,2026708633664,2084941067328,2144504420632,2205421378496,2267714882160,2331408130624,2396524582088,2463087955392,2531122231456,2600651654720,2671700734584,2744294246848,2818457235152,2894215012416,2971593162280,3050617540544,3131314276608,3213709774912,3297830716376,3383704059840,3471357043504,3560817186368,3652112289672,3745270438336,3840320002400,3937289638464,4036208291128,4137105194432,4240009873296,4344952144960,4451962120424,4561070205888,4672307104192,4785703816256,4901291642520,5019102184384,5139167345648,5261519333952,5386190662216,5513214150080,5642622925344,5774450425408,5908730398712,6045496906176,6184784322640,6326627338304,6471060960168,6618120513472,6767841643136,6920260315200,7075412818264,7233335764928,7394066093232,7557641068096,7724098282760,7893475660224,8065811454688,8241144252992,8419512976056,8600956880320,8785515559184,8973228944448,9164137307752,9358281262016,9555701762880,9756440110144,9960537949208,10168037272512,10378980420976,10593410085440,10811369308104,11032901483968,11258050362272,11486860047936 mov $2,12 mov $5,$0 mov $6,$0 lpb $2 add $1,$5 sub $2,1 lpe mov $3,$6 lpb $3 sub $3,1 add $4,$5 lpe mov $3,$6 mov $5,$4 mov $4,0 lpb $3 sub $3,1 add $4,$5 lpe mov $2,40 mov $5,$4 lpb $2 add $1,$5 sub $2,1 lpe mov $3,$6 mov $4,0 lpb $3 sub $3,1 add $4,$5 lpe mov $3,$6 mov $5,$4 mov $4,0 lpb $3 sub $3,1 add $4,$5 lpe mov $2,12 mov $5,$4 lpb $2 add $1,$5 sub $2,1 lpe
oeis/013/A013766.asm
neoneye/loda-programs
11
8643
<filename>oeis/013/A013766.asm ; A013766: 20^(3n+1). ; Submitted by <NAME> ; 20,160000,1280000000,10240000000000,81920000000000000,655360000000000000000,5242880000000000000000000,41943040000000000000000000000,335544320000000000000000000000000,2684354560000000000000000000000000000,21474836480000000000000000000000000000000,171798691840000000000000000000000000000000000,1374389534720000000000000000000000000000000000000,10995116277760000000000000000000000000000000000000000,87960930222080000000000000000000000000000000000000000000 mov $2,8000 pow $2,$0 mov $0,$2 mul $0,20
agda/PLRTree/Insert/Heap.agda
bgbianchi/sorting
6
11427
<filename>agda/PLRTree/Insert/Heap.agda open import Relation.Binary.Core module PLRTree.Insert.Heap {A : Set} (_≤_ : A → A → Set) (tot≤ : Total _≤_) (trans≤ : Transitive _≤_) where open import Data.Sum open import Order.Total _≤_ tot≤ open import PLRTree {A} open import PLRTree.Compound {A} open import PLRTree.Insert _≤_ tot≤ open import PLRTree.Insert.Properties _≤_ tot≤ open import PLRTree.Heap _≤_ open import PLRTree.Heap.Properties _≤_ trans≤ lemma-insert-≤* : {x y : A}{t : PLRTree} → x ≤ y → x ≤* t → x ≤* insert y t lemma-insert-≤* {y = y} x≤y (lf≤* x) = nd≤* x≤y (lf≤* x) (lf≤* x) lemma-insert-≤* {y = y} x≤y (nd≤* {perfect} {x} {z} {l} {r} x≤z x≤*l x≤*r) with tot≤ y z | l | r ... | inj₁ y≤z | leaf | leaf = nd≤* x≤y (nd≤* x≤z x≤*r x≤*r) x≤*r ... | inj₁ y≤z | node _ _ _ _ | leaf = nd≤* x≤y (lemma-insert-≤* x≤z x≤*l) x≤*r ... | inj₁ y≤z | leaf | node _ _ _ _ = nd≤* x≤y (nd≤* x≤z x≤*l x≤*l) x≤*r ... | inj₁ y≤z | node _ _ _ _ | node _ _ _ _ = nd≤* x≤y (lemma-insert-≤* x≤z x≤*l) x≤*r ... | inj₂ z≤y | leaf | leaf = nd≤* x≤z (nd≤* x≤y x≤*r x≤*r) x≤*r ... | inj₂ z≤y | node _ _ _ _ | leaf = nd≤* x≤z (lemma-insert-≤* x≤y x≤*l) x≤*r ... | inj₂ z≤y | leaf | node _ _ _ _ = nd≤* x≤z (nd≤* x≤y x≤*l x≤*l) x≤*r ... | inj₂ z≤y | node _ _ _ _ | node _ _ _ _ = nd≤* x≤z (lemma-insert-≤* x≤y x≤*l) x≤*r lemma-insert-≤* {y = y} x≤y (nd≤* {left} {x} {z} {l} {r} x≤z x≤*l x≤*r) with tot≤ y z ... | inj₁ y≤z with insert z l | lemma-insert-≤* (trans≤ x≤y y≤z) x≤*l | lemma-insert-compound z l ... | node perfect z' l' r' | x≤*lᵢ | compound = nd≤* x≤y x≤*lᵢ x≤*r ... | node right z' l' r' | x≤*lᵢ | compound = nd≤* x≤y x≤*lᵢ x≤*r ... | node left z' l' r' | x≤*lᵢ | compound = nd≤* x≤y x≤*lᵢ x≤*r lemma-insert-≤* {y = y} x≤y (nd≤* {left} {x} {z} {l} {r} x≤z x≤*l x≤*r) | inj₂ z≤y with insert y l | lemma-insert-≤* x≤y x≤*l | lemma-insert-compound y l ... | node perfect y' l' r' | x≤*lᵢ | compound = nd≤* x≤z x≤*lᵢ x≤*r ... | node right y' l' r' | x≤*lᵢ | compound = nd≤* x≤z x≤*lᵢ x≤*r ... | node left y' l' r' | x≤*lᵢ | compound = nd≤* x≤z x≤*lᵢ x≤*r lemma-insert-≤* {y = y} x≤y (nd≤* {right} {x} {z} {l} {r} x≤z x≤*l x≤*r) with tot≤ y z ... | inj₁ y≤z with insert z r | lemma-insert-≤* (trans≤ x≤y y≤z) x≤*r | lemma-insert-compound z r ... | node perfect z' l' r' | x≤*rᵢ | compound = nd≤* x≤y x≤*l x≤*rᵢ ... | node right z' l' r' | x≤*rᵢ | compound = nd≤* x≤y x≤*l x≤*rᵢ ... | node left z' l' r' | x≤*rᵢ | compound = nd≤* x≤y x≤*l x≤*rᵢ lemma-insert-≤* {y = y} x≤y (nd≤* {right} {x} {z} {l} {r} x≤z x≤*l x≤*r) | inj₂ z≤y with insert y r | lemma-insert-≤* x≤y x≤*r | lemma-insert-compound y r ... | node perfect y' l' r' | x≤*rᵢ | compound = nd≤* x≤z x≤*l x≤*rᵢ ... | node right y' l' r' | x≤*rᵢ | compound = nd≤* x≤z x≤*l x≤*rᵢ ... | node left y' l' r' | x≤*rᵢ | compound = nd≤* x≤z x≤*l x≤*rᵢ lemma-insert-≤*' : {x y : A}{t : PLRTree} → x ≤ y → y ≤* t → x ≤* insert y t lemma-insert-≤*' x≤y y≤*t = lemma-≤-≤* x≤y (lemma-insert-≤* refl≤ y≤*t) lemma-insert-heap : {t : PLRTree}(x : A) → Heap t → Heap (insert x t) lemma-insert-heap x leaf = node (lf≤* x) (lf≤* x) leaf leaf lemma-insert-heap x (node {perfect} {y} {l} {r} y≤*l y≤*r hl hr) with tot≤ x y | l | r ... | inj₁ x≤y | leaf | leaf = node (nd≤* x≤y (lf≤* x) (lf≤* x)) (lf≤* x) (node (lf≤* y) (lf≤* y) leaf leaf) leaf ... | inj₁ x≤y | node _ _ _ _ | leaf = node (lemma-insert-≤*' x≤y y≤*l) (lf≤* x) (lemma-insert-heap y hl) hr ... | inj₁ x≤y | leaf | node _ _ _ _ = node (nd≤* x≤y (lf≤* x) (lf≤* x)) (lemma-≤-≤* x≤y y≤*r) (node y≤*l y≤*l hl hl) hr ... | inj₁ x≤y | node _ _ _ _ | node _ _ _ _ = node (lemma-insert-≤*' x≤y y≤*l) (lemma-≤-≤* x≤y y≤*r) (lemma-insert-heap y hl) hr ... | inj₂ y≤x | leaf | leaf = node (nd≤* y≤x (lf≤* y) (lf≤* y)) (lf≤* y) (node (lf≤* x) (lf≤* x) leaf leaf) leaf ... | inj₂ y≤x | node _ _ _ _ | leaf = node (lemma-insert-≤* y≤x y≤*l) y≤*r (lemma-insert-heap x hl) hr ... | inj₂ y≤x | leaf | node _ _ _ _ = node (nd≤* y≤x y≤*l y≤*l) y≤*r (lemma-insert-heap x hl) hr ... | inj₂ y≤x | node _ _ _ _ | node _ _ _ _ = node (lemma-insert-≤* y≤x y≤*l) y≤*r (lemma-insert-heap x hl) hr lemma-insert-heap x (node {left} {y} {l} {r} y≤*l y≤*r hl hr) with tot≤ x y ... | inj₁ x≤y with insert y l | lemma-insert-heap y hl | lemma-insert-≤*' x≤y y≤*l | lemma-insert-compound y l ... | node perfect y' l' r' | hlᵢ | x≤*lᵢ | compound = node x≤*lᵢ (lemma-≤-≤* x≤y y≤*r) hlᵢ hr ... | node right y' l' r' | hlᵢ | x≤*lᵢ | compound = node x≤*lᵢ (lemma-≤-≤* x≤y y≤*r) hlᵢ hr ... | node left y' l' r' | hlᵢ | x≤*lᵢ | compound = node x≤*lᵢ (lemma-≤-≤* x≤y y≤*r) hlᵢ hr lemma-insert-heap x (node {left} {y} {l} {r} y≤*l y≤*r hl hr) | inj₂ y≤x with insert x l | lemma-insert-heap x hl | lemma-insert-≤* y≤x y≤*l | lemma-insert-compound x l ... | node perfect y' l' r' | hlᵢ | y≤*lᵢ | compound = node y≤*lᵢ y≤*r hlᵢ hr ... | node right y' l' r' | hlᵢ | y≤*lᵢ | compound = node y≤*lᵢ y≤*r hlᵢ hr ... | node left y' l' r' | hlᵢ | y≤*lᵢ | compound = node y≤*lᵢ y≤*r hlᵢ hr lemma-insert-heap x (node {right} {y} {l} {r} y≤*l y≤*r hl hr) with tot≤ x y ... | inj₁ x≤y with insert y r | lemma-insert-heap y hr | lemma-insert-≤*' x≤y y≤*r | lemma-insert-compound y r ... | node perfect y' l' r' | hrᵢ | x≤*rᵢ | compound = node (lemma-≤-≤* x≤y y≤*l) x≤*rᵢ hl hrᵢ ... | node right y' l' r' | hrᵢ | x≤*rᵢ | compound = node (lemma-≤-≤* x≤y y≤*l) x≤*rᵢ hl hrᵢ ... | node left y' l' r' | hrᵢ | x≤*rᵢ | compound = node (lemma-≤-≤* x≤y y≤*l) x≤*rᵢ hl hrᵢ lemma-insert-heap x (node {right} {y} {l} {r} y≤*l y≤*r hl hr) | inj₂ y≤x with insert x r | lemma-insert-heap x hr | lemma-insert-≤* y≤x y≤*r | lemma-insert-compound x r ... | node perfect y' l' r' | hrᵢ | y≤*rᵢ | compound = node y≤*l y≤*rᵢ hl hrᵢ ... | node right y' l' r' | hrᵢ | y≤*rᵢ | compound = node y≤*l y≤*rᵢ hl hrᵢ ... | node left y' l' r' | hrᵢ | y≤*rᵢ | compound = node y≤*l y≤*rᵢ hl hrᵢ
programs/oeis/199/A199419.asm
karttu/loda
1
5204
<gh_stars>1-10 ; A199419: 4*7^n+1. ; 5,29,197,1373,9605,67229,470597,3294173,23059205,161414429,1129900997,7909306973,55365148805,387556041629,2712892291397,18990246039773,132931722278405,930522055948829,6513654391641797,45595580741492573 mov $1,7 pow $1,$0 mul $1,4 add $1,1
programs/oeis/064/A064038.asm
karttu/loda
1
163901
; A064038: Numerator of average number of swaps needed to bubble sort a string of n distinct letters. ; 0,1,3,3,5,15,21,14,18,45,55,33,39,91,105,60,68,153,171,95,105,231,253,138,150,325,351,189,203,435,465,248,264,561,595,315,333,703,741,390,410,861,903,473,495,1035,1081,564,588,1225,1275,663,689,1431,1485,770,798,1653,1711,885,915,1891,1953,1008,1040,2145,2211,1139,1173,2415,2485,1278,1314,2701,2775,1425,1463,3003,3081,1580,1620,3321,3403,1743,1785,3655,3741,1914,1958,4005,4095,2093,2139,4371,4465,2280,2328,4753,4851,2475,2525,5151,5253,2678,2730,5565,5671,2889,2943,5995,6105,3108,3164,6441,6555,3335,3393,6903,7021,3570,3630,7381,7503,3813,3875,7875,8001,4064,4128,8385,8515,4323,4389,8911,9045,4590,4658,9453,9591,4865,4935,10011,10153,5148,5220,10585,10731,5439,5513,11175,11325,5738,5814,11781,11935,6045,6123,12403,12561,6360,6440,13041,13203,6683,6765,13695,13861,7014,7098,14365,14535,7353,7439,15051,15225,7700,7788,15753,15931,8055,8145,16471,16653,8418,8510,17205,17391,8789,8883,17955,18145,9168,9264,18721,18915,9555,9653,19503,19701,9950,10050,20301,20503,10353,10455,21115,21321,10764,10868,21945,22155,11183,11289,22791,23005,11610,11718,23653,23871,12045,12155,24531,24753,12488,12600,25425,25651,12939,13053,26335,26565,13398,13514,27261,27495,13865,13983,28203,28441,14340,14460,29161,29403,14823,14945,30135,30381,15314,15438,31125 add $0,1 bin $0,2 mov $1,1031 mul $1,$0 sub $1,$0 mov $2,$0 gcd $2,2 div $1,$2 div $1,1030
tmux/.tmux/bin/applescripts/music.scpt
gblock0/dotfiles
3
518
-- Show music info if Spotify is playing music if application "Spotify" is running then tell application "Spotify" set theName to name of the current track set theArtist to artist of the current track try return "♫ " & theName & " - " & theArtist on error err end try end tell end if -- Show music info if the Apple Music app is playing music if application "Music" is running then tell application "Music" if exists current track then set theName to the name of the current track set theArtist to the artist of the current track try return "♫ " & theName & " - " & theArtist on error err end try end if end tell end if
src/core/vectors.asm
danielg0/yatzy-gb
0
103513
<filename>src/core/vectors.asm INCLUDE "hardware.inc" ; TODO: move frequently used functions to RST bank SECTION "RST Vectors", ROM0[$00] DS $40 - @ SECTION "Interrup Vectors", ROM0[$40] ; VBlank handler reti DS $48 - @ ; STAT handler reti DS $50 - @ ; timer handler reti DS $58 - @ ; serial handler reti DS $60 - @ ; joypad handler reti ; fill up to entry point DS $100 - @, 0
programs/oeis/199/A199573.asm
neoneye/loda
22
244216
; A199573: Number of round trips of length n from any of the four vertices of the cycle graph C_4. ; 1,0,2,0,8,0,32,0,128,0,512,0,2048,0,8192,0,32768,0,131072,0,524288,0,2097152,0,8388608,0,33554432,0,134217728,0,536870912,0,2147483648,0,8589934592,0,34359738368,0,137438953472,0 mov $1,-2 pow $1,$0 max $1,0 dif $1,2 mov $0,$1
oeis/178/A178205.asm
neoneye/loda-programs
11
92817
<reponame>neoneye/loda-programs<filename>oeis/178/A178205.asm<gh_stars>10-100 ; A178205: a(n) = a(n-1) + 10*a(n-3) for n > 2; a(0) = a(1) = a(2) = 1. ; Submitted by <NAME> ; 1,1,1,11,21,31,141,351,661,2071,5581,12191,32901,88711,210621,539631,1426741,3532951,8929261,23196671,58526181,147818791,379785501,965047311,2443235221,6241090231,15891563341,40323915551,102734817861,261650451271,664889606781,1692237785391,4308742298101,10957638365911,27880016219821,70967439200831,180543822859941,459343985058151,1169018377066461,2974456605665871,7567896456247381,19258080226911991,49002646283570701,124681610846044511,317262413115164421,807288875950871431,2054104984411316541 lpb $0 sub $0,1 mul $1,2 mov $3,$1 mov $1,$4 mul $3,5 add $2,$3 mov $4,$2 sub $4,$3 add $4,1 lpe mov $0,$2 add $0,1
oeis/299/A299854.asm
neoneye/loda-programs
11
10626
; A299854: G.f. S(x) satisfies C(x)^(1/2) - S(x)^(1/2) = 1 such that C'(x)*S(x)^(1/2) = S'(x)*C(x)^(1/2) = 72*x. ; Submitted by <NAME>(w3) ; 36,-144,864,-6048,46080,-370656,3096576,-26604864,233570304,-2086063200,18893242368,-173111152320,1601754365952,-14945262816960,140461536706560,-1328495714939520,12635295568625664,-120770748612067680,1159474181591531520,-11176086736640548800,108114032779214192640,-1049288769526156568640,10214201953998140866560,-99701511082612622322048 mov $2,-1 pow $2,$0 seq $0,214377 ; G.f. satisfies: A(x) = 1 + 4*x*A(x)^(3/2). mul $0,$2 mul $0,36
test/Fail/RecordFromModuleAmb.agda
shlevy/agda
1,989
16442
postulate I : Set D : I → Set T : Set record R : Set where field t0 : T {i0} : I t1 : T d0 : D i0 {i1} : I d1 : D i1 t2 : T module M0 where postulate t0 t1 : T module MI where postulate i1 : I d1 : D i1 module MD {i0 : I} where postulate d0 : D i0 t0 : T r : R r = record { M0; t2 = M0.t0; MD; MI; i0 = i0 } module My where postulate i0 : I r' : R r' = record { R r; t0 = R.t1 r } where module Rr = R r
Cubical/HITs/TypeQuotients.agda
marcinjangrzybowski/cubical
301
9215
<reponame>marcinjangrzybowski/cubical {-# OPTIONS --safe #-} module Cubical.HITs.TypeQuotients where open import Cubical.HITs.TypeQuotients.Base public open import Cubical.HITs.TypeQuotients.Properties public
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/fmax_callee.asm
Frodevan/z88dk
640
27645
<filename>libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/fmax_callee.asm SECTION code_fp_math32 PUBLIC _fmax_callee EXTERN cm32_sdcc_fmax_callee defc _fmax_callee = cm32_sdcc_fmax_callee
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43105a.ada
best08618/asylo
7
20682
-- C43105A.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: -- IN A RECORD AGGREGATE, (X => E, Y => E), WHERE E IS AN OVERLOADED -- ENUMERATION LITERAL, OVERLOADING RESOLUTION OCCURS SEPARATELY FOR -- THE DIFFERENT OCCURRENCES OF E. -- HISTORY: -- DHH 08/10/88 CREATED ORIGINAL TEST. WITH REPORT; USE REPORT; PROCEDURE C43105A IS BEGIN TEST("C43105A", "IN A RECORD AGGREGATE, (X => E, Y => E), WHERE " & "E IS AN OVERLOADED ENUMERATION LITERAL, " & "OVERLOADING RESOLUTION OCCURS SEPARATELY FOR " & "THE DIFFERENT OCCURRENCES OF E"); DECLARE TYPE COLOR IS (RED, YELLOW, GREEN); TYPE PALETTE IS (GREEN, YELLOW, RED); TYPE REC IS RECORD X : COLOR; Y : PALETTE; END RECORD; TYPE RECD IS RECORD X : PALETTE; Y : COLOR; END RECORD; REC1 : REC; REC2 : RECD; FUNCTION IDENT_C(C : COLOR) RETURN COLOR IS BEGIN IF EQUAL(3,3) THEN RETURN C; ELSE RETURN GREEN; END IF; END IDENT_C; FUNCTION IDENT_P(P : PALETTE) RETURN PALETTE IS BEGIN IF EQUAL(3,3) THEN RETURN P; ELSE RETURN RED; END IF; END IDENT_P; BEGIN REC1 := (X => YELLOW, Y => YELLOW); REC2 := (X => YELLOW, Y => YELLOW); IF REC1.X /= IDENT_C(REC2.Y) THEN FAILED("COLOR RESOLUTION FAILED"); END IF; IF REC1.Y /= IDENT_P(REC2.X) THEN FAILED("PALETTE RESOLUTION FAILED"); END IF; EXCEPTION WHEN OTHERS => FAILED("EXCEPTION RAISED"); END; RESULT; END C43105A;
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_log10.asm
meesokim/z88dk
0
11795
<filename>libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_log10.asm ; float log10(float x) SECTION code_fp_math48 PUBLIC cm48_sdcciy_log10 EXTERN cm48_sdcciy_log10_fastcall cm48_sdcciy_log10: pop af pop hl pop de push de push hl push af jp cm48_sdcciy_log10_fastcall
source/slim-messages.adb
reznikmm/slimp
0
11138
-- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with System.Storage_Elements; with Ada.Storage_IO; package body Slim.Messages is ----------------- -- Read_Fields -- ----------------- procedure Read_Fields (Self : in out Base_Message'Class; List : Field_Description_Array; Data : League.Stream_Element_Vectors.Stream_Element_Vector) is use type Ada.Streams.Stream_Element_Offset; generic type Element is private; procedure Read (Result : out Element); Input : Ada.Streams.Stream_Element_Offset := 1; ---------- -- Read -- ---------- procedure Read (Result : out Element) is package IO is new Ada.Storage_IO (Element); Buffer : IO.Buffer_Type; begin for J in reverse Buffer'Range loop Buffer (J) := System.Storage_Elements.Storage_Element (Data.Element (Input)); Input := Input + 1; end loop; IO.Read (Buffer, Result); end Read; procedure Read_8 is new Read (Interfaces.Unsigned_8); procedure Read_16 is new Read (Interfaces.Unsigned_16); procedure Read_32 is new Read (Interfaces.Unsigned_32); procedure Read_64 is new Read (Interfaces.Unsigned_64); Kind : Field_Kinds; Fields : Field_Description_Array := List; Index : Positive := Fields'First; Counts : array (Field_Kinds) of Natural := (others => 0); begin while Index <= Fields'Last loop Kind := Fields (Index).Kind; Counts (Kind) := Counts (Kind) + 1; case Kind is when Uint_8_Field => Read_8 (Self.Data_8 (Counts (Kind))); when Uint_16_Field => Read_16 (Self.Data_16 (Counts (Kind))); when Uint_32_Field => Read_32 (Self.Data_32 (Counts (Kind))); when Uint_64_Field => Read_64 (Self.Data_64 (Counts (Kind))); when others => Self.Read_Custom_Field (Index => Counts (Kind), Input => Input, Data => Data); end case; if Fields (Index).Count = 1 then Index := Index + 1; else Fields (Index).Count := Fields (Index).Count - 1; end if; end loop; end Read_Fields; ----------- -- Slice -- ----------- procedure Slice (Result : out Ada.Streams.Stream_Element_Array; From : Ada.Streams.Stream_Element_Offset) is use type Ada.Streams.Stream_Element_Offset; begin for J in Result'Range loop Result (J) := Data.Element (From + J - Result'First); end loop; end Slice; ------------------ -- Write_Fields -- ------------------ procedure Write_Fields (Self : Base_Message'Class; List : Field_Description_Array; Data : in out League.Stream_Element_Vectors.Stream_Element_Vector) is generic type Element is private; procedure Write (Result : Element); ----------- -- Write -- ----------- procedure Write (Result : Element) is package IO is new Ada.Storage_IO (Element); Buffer : IO.Buffer_Type; begin IO.Write (Buffer, Result); -- Use network byte order, so use 'reverse' for J in reverse Buffer'Range loop Data.Append (Ada.Streams.Stream_Element (Buffer (J))); end loop; end Write; procedure Write_8 is new Write (Interfaces.Unsigned_8); procedure Write_16 is new Write (Interfaces.Unsigned_16); procedure Write_32 is new Write (Interfaces.Unsigned_32); procedure Write_64 is new Write (Interfaces.Unsigned_64); Kind : Field_Kinds; Fields : Field_Description_Array := List; Index : Positive := Fields'First; Counts : array (Field_Kinds) of Natural := (others => 0); begin while Index <= Fields'Last loop Kind := Fields (Index).Kind; Counts (Kind) := Counts (Kind) + 1; case Kind is when Uint_8_Field => Write_8 (Self.Data_8 (Counts (Kind))); when Uint_16_Field => Write_16 (Self.Data_16 (Counts (Kind))); when Uint_32_Field => Write_32 (Self.Data_32 (Counts (Kind))); when Uint_64_Field => Write_64 (Self.Data_64 (Counts (Kind))); when others => Self.Write_Custom_Field (Index => Counts (Kind), Data => Data); end case; if Fields (Index).Count = 1 then Index := Index + 1; else Fields (Index).Count := Fields (Index).Count - 1; end if; end loop; end Write_Fields; end Slim.Messages;
Classes/script/script/property parent : cls/test.applescript
looking-for-a-job/applescript-examples
1
4631
#!/usr/bin/osascript script A on say_hello() display dialog "Script A says hi!" end say_hello end script script B property parent : A end script tell B to say_hello()
programs/oeis/080/A080335.asm
karttu/loda
1
80708
; A080335: Diagonal in square spiral or maze arrangement of natural numbers. ; 1,5,9,17,25,37,49,65,81,101,121,145,169,197,225,257,289,325,361,401,441,485,529,577,625,677,729,785,841,901,961,1025,1089,1157,1225,1297,1369,1445,1521,1601,1681,1765,1849,1937,2025,2117,2209,2305,2401,2501,2601,2705,2809,2917,3025,3137,3249,3365,3481,3601,3721,3845,3969,4097,4225,4357,4489,4625,4761,4901,5041,5185,5329,5477,5625,5777,5929,6085,6241,6401,6561,6725,6889,7057,7225,7397,7569,7745,7921,8101,8281,8465,8649,8837,9025,9217,9409,9605,9801,10001,10201,10405,10609,10817,11025,11237,11449,11665,11881,12101,12321,12545,12769,12997,13225,13457,13689,13925,14161,14401,14641,14885,15129,15377,15625,15877,16129,16385,16641,16901,17161,17425,17689,17957,18225,18497,18769,19045,19321,19601,19881,20165,20449,20737,21025,21317,21609,21905,22201,22501,22801,23105,23409,23717,24025,24337,24649,24965,25281,25601,25921,26245,26569,26897,27225,27557,27889,28225,28561,28901,29241,29585,29929,30277,30625,30977,31329,31685,32041,32401,32761,33125,33489,33857,34225,34597,34969,35345,35721,36101,36481,36865,37249,37637,38025,38417,38809,39205,39601,40001,40401,40805,41209,41617,42025,42437,42849,43265,43681,44101,44521,44945,45369,45797,46225,46657,47089,47525,47961,48401,48841,49285,49729,50177,50625,51077,51529,51985,52441,52901,53361,53825,54289,54757,55225,55697,56169,56645,57121,57601,58081,58565,59049,59537,60025,60517,61009,61505,62001,62501 mov $1,1 add $1,$0 pow $1,2 div $1,4 mul $1,4 add $1,1
programs/oeis/333/A333297.asm
jmorken/loda
1
244634
; A333297: a(n) = Sum_{i=1..n, j=1..n, gcd(i,j)=1} i. ; 1,4,13,25,55,73,136,184,265,325,490,562,796,922,1102,1294,1702,1864,2377,2617,2995,3325,4084,4372,5122,5590,6319,6823,8041,8401,9796,10564,11554,12370,13630,14278,16276,17302,18706,19666,22126,22882,25591,26911,28531,30049,33292,34444,37531,39031,41479,43351,47485,48943,52243,54259,57337,59773,64906,66346,71836,74626,78028,81100,85780,87760,94393,97657,102211,104731,112186,114778,122662,126658,131158,135262,142192,145000,154243,158083,164644,169564,179773,182797,190957,196375,203683,208963,220711,223951,233779,239851,248221,254707,264967,269575,283543,289717,298627,304627,319777,324673,340432,347920,355480,363748,380761,386593,404251,410851,422839,430903,449887,456043,471223,480967,493603,503869,521005,526765,546730,557710,572470,583630,602380,609184,633187,645475,661729,671089,696634,704554,726100,739366,753946,767002,794950,804058,832831,842911,862369,877279,903019,913387,937747,953515,972037,988021,1021099,1030099,1064074,1080490,1102522,1116382,1144282,1155514,1192252,1210738,1235542,1250902,1282780,1295902,1335511,1355191,1374991,1395409,1436992,1449088,1488634,1504954,1532656,1554328,1598962,1613578,1645078,1666198,1696996,1720492,1768285,1781245,1830115,1849771,1882711,1906999,1946959,1963699,2008579,2034523,2065141,2085661,2140096,2158528,2214112,2242048,2270128,2294824,2352742,2370562,2429665,2453665,2493463,2523763,2574919,2594503,2643703,2675221,2716207,2746159,2802589,2817709,2884174,2917246,2961976,2996002,3050182,3073510,3132100,3167416,3214720,3241120,3304768,3328744,3403003,3435259,3475759,3513727,3590680,3615304,3693622,3723982,3765562,3804538,3885622,3910894,3975754,4016818,4072276,4106548,4191871,4214911,4301671,4341601,4400650,4444570,4506310,4535830,4615858,4660498,4721752,4759252 mov $27,$0 mov $29,$0 add $29,1 lpb $29 clr $0,27 mov $0,$27 sub $29,1 sub $0,$29 add $1,$0 cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n. mul $0,6 mul $1,$0 add $0,$1 mov $1,$0 div $1,2 sub $1,3 div $1,6 add $1,1 add $28,$1 lpe mov $1,$28 sub $1,1 mul $1,3 add $1,1
30Oct2019/mycode.asm
candh/8086-programs
0
12809
org 100h ; add your code here ret
arch/ARM/STM32/driver_demos/demo_timer_interrupts_multichannel/src/demo.adb
rocher/Ada_Drivers_Library
192
19856
<reponame>rocher/Ada_Drivers_Library ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, 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 using one timer to generate several periodic -- interrupts, each with a different period. Each interrupt is tied to a -- separate LED such that the LED blinks at the corresponding rate. -- This file declares the main procedure for the demonstration. -- We use the STM F4 Discovery board for the sake of the four LEDs but another -- board could be used, with different LED configurations. Using a board -- with fewer LEDs is possible but less interesting. In that case, change the -- number of channels driven (and interrupts generated) to match the number of -- LEDs available. with Last_Chance_Handler; pragma Unreferenced (Last_Chance_Handler); with STM32.Board; use STM32.Board; with STM32.Device; use STM32.Device; with STM32.Timers; use STM32.Timers; with STM32F4_Timer_Interrupts; use STM32F4_Timer_Interrupts; with HAL; use HAL; procedure Demo is begin Initialize_LEDs; -- set up the timer base Enable_Clock (Timer_3); Reset (Timer_3); Configure (Timer_3, Prescaler => Prescaler, Period => UInt32 (UInt16'Last), -- all the way up Clock_Divisor => Div1, Counter_Mode => Up); Configure_Prescaler (Timer_3, Prescaler => Prescaler, Reload_Mode => Immediate); -- configure the channel outputs for Next_Channel in Timer_Channel loop Configure_Channel_Output (Timer_3, Channel => Next_Channel, Mode => Frozen, State => Enable, Pulse => Channel_Periods (Next_Channel), Polarity => High); Set_Output_Preload_Enable (Timer_3, Next_Channel, False); end loop; -- enable the timer's four channel interrupts and go Enable_Interrupt (Timer_3, Timer_CC1_Interrupt & Timer_CC2_Interrupt & Timer_CC3_Interrupt & Timer_CC4_Interrupt); Enable (Timer_3); loop null; end loop; end Demo;
src/spat-flow_item.adb
yannickmoy/spat
0
904
------------------------------------------------------------------------------ -- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>) -- -- This work is free. You can redistribute it and/or modify it under the -- terms of the Do What The Fuck You Want To Public License, Version 2, -- as published by Sam Hocevar. See the LICENSE file for more details. ------------------------------------------------------------------------------ pragma License (Unrestricted); with SPAT.Field_Names; package body SPAT.Flow_Item is --------------------------------------------------------------------------- -- Create --------------------------------------------------------------------------- overriding function Create (Object : in JSON_Value) return T is (Entity_Location.Create (Object => Object) with Rule => Object.Get (Field => Field_Names.Rule), Severity => Object.Get (Field => Field_Names.Severity)); end SPAT.Flow_Item;
programs/oeis/077/A077904.asm
neoneye/loda
22
11347
; A077904: Expansion of (1-x)^(-1)/(1+x-2*x^3). ; 1,0,1,2,-1,4,1,-2,11,-8,5,18,-33,44,-7,-58,147,-160,45,250,-569,660,-159,-978,2299,-2616,661,3938,-9169,10492,-2615,-15722,36707,-41936,10493,62922,-146793,167780,-41935,-251650,587211,-671080,167781,1006642,-2348801,2684364,-671079,-4026522 mov $1,1 lpb $0 mov $2,$0 sub $0,1 seq $2,77973 ; Expansion of 1/(1+x-2*x^3). add $1,$2 lpe mov $0,$1
mips/5-3.asm
x06lan/mt
0
167078
<gh_stars>0 .data result1: .ascii "\nfirst value = " result2: .ascii "\nsecond value = " .text main: li $v0, 4 la $a0, result1 syscall li $v0, 1 li $a0, 4 syscall
mc-sema/validator/x86/tests/ROR16ri.asm
randolphwong/mcsema
2
12075
<filename>mc-sema/validator/x86/tests/ROR16ri.asm BITS 32 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS=FLAG_OF ;TEST_FILE_META_END ; ROR16ri mov cx, 0x545 ;TEST_BEGIN_RECORDING ror cx, 0x8 ;TEST_END_RECORDING
F0xC_WIN/include/util/readConsoleLine.asm
Pusty/F0xC
0
5262
%ifndef READ_CONSOLE_LINE %define READ_CONSOLE_LINE %ifndef _READCONSOLELINE extern _GetCommandLineA@16 %endif ;0 args ;returns pointer to commandline string ;example call readConsoleLine readConsoleLine: pop dword [std_addr] ;this is apparently the address, so let's just save it and push it back later :) call _GetCommandLineA@16 push dword [std_addr] ret %endif
alloy4fun_models/trashltl/models/4/aeGDuBANXttxaFLKP.als
Kaixi26/org.alloytools.alloy
0
4236
open main pred idaeGDuBANXttxaFLKP_prop5 { eventually #File < #File' } pred __repair { idaeGDuBANXttxaFLKP_prop5 } check __repair { idaeGDuBANXttxaFLKP_prop5 <=> prop5o }
programs/oeis/262/A262267.asm
neoneye/loda
22
23959
<gh_stars>10-100 ; A262267: Number of (n+2) X (1+2) 0..1 arrays with each row and column divisible by 5, read as a binary number with top and left being the most significant bits. ; 2,4,7,13,26,52,103,205,410,820,1639,3277,6554,13108,26215,52429,104858,209716,419431,838861,1677722,3355444,6710887,13421773,26843546,53687092,107374183,214748365,429496730,858993460,1717986919,3435973837,6871947674,13743895348,27487790695,54975581389,109951162778,219902325556,439804651111,879609302221,1759218604442,3518437208884,7036874417767,14073748835533,28147497671066,56294995342132,112589990684263,225179981368525,450359962737050,900719925474100,1801439850948199,3602879701896397,7205759403792794,14411518807585588,28823037615171175,57646075230342349,115292150460684698,230584300921369396,461168601842738791,922337203685477581,1844674407370955162,3689348814741910324,7378697629483820647,14757395258967641293,29514790517935282586,59029581035870565172,118059162071741130343,236118324143482260685,472236648286964521370,944473296573929042740,1888946593147858085479,3777893186295716170957,7555786372591432341914,15111572745182864683828,30223145490365729367655,60446290980731458735309,120892581961462917470618,241785163922925834941236,483570327845851669882471,967140655691703339764941,1934281311383406679529882,3868562622766813359059764,7737125245533626718119527,15474250491067253436239053,30948500982134506872478106,61897001964269013744956212,123794003928538027489912423,247588007857076054979824845,495176015714152109959649690,990352031428304219919299380,1980704062856608439838598759,3961408125713216879677197517,7922816251426433759354395034,15845632502852867518708790068,31691265005705735037417580135,63382530011411470074835160269,126765060022822940149670320538,253530120045645880299340641076,507060240091291760598681282151,1014120480182583521197362564301 mov $1,2 pow $1,$0 mul $1,8 div $1,5 add $1,1 mov $0,$1
45/beef/cw/kernel/osspec.asm
minblock/msdos
0
88821
;* ;* CW : Character Windows ;* ;* osspec.asm : jump table for OS specific routines (DUAL only) include cmacros.inc include version.inc include _osspec.inc ;* defines OSSPEC_ENTRIES ;***************************************************************************** sBegin DATA externW fProtectMode sEnd DATA ;***************************************************************************** OSSPEC_DEF MACRO label,os ;* external refernces externFP <label&os> ENDM OSSPEC_LABEL MACRO label,os ;* jump table, exported labels PUBLIC label label: jmp label&os ENDM OSSPEC_NOLABEL MACRO label,os ;* alternate jump table jmp label&os ENDM OSSPEC_OS2PROC MACRO label,os ;* protect mode only procedure PUBLIC label label: IFDEF DEBUG mov cx,fProtectMode jcxz @F jmp label&OS2 @@: jmp os2_only ELSE ;!DEBUG jmp label&OS2 ENDIF ;!DEBUG ENDM OSSPEC_DOS3PROC MACRO label,os ;* real mode only procedure PUBLIC label label: IFDEF DEBUG mov cx,fProtectMode jcxz @F jmp dos3_only @@: ENDIF ;DEBUG jmp label&DOS3 ENDM ;***************************************************************************** createSeg OSSPEC_TEXT,OSSPEC_TEXT,BYTE,PUBLIC,CODE ;* externFP CowAssertFailed ;* in _osspec.inc already OSSPEC_ENTRIES OSSPEC_DEF,OS2 OSSPEC_ENTRIES OSSPEC_DEF,DOS3 OSSPEC_OS2ONLY OSSPEC_DEF,OS2 OSSPEC_DOS3ONLY OSSPEC_DEF,OS2 OSSPEC_DOS3ONLY OSSPEC_DEF,DOS3 sBegin OSSPEC_TEXT assumes CS,OSSPEC_TEXT assumes DS,DATA PUBLIC rgfnosspec,rgfnosspec3 ;* * rgfnosspec must preceed rgfnosspec3 and the two tables must be ;* * contiguous!! rgfnosspec: ;* General code OSSPEC_ENTRIES OSSPEC_LABEL,OS2 ;* OS/2 only procs OSSPEC_OS2ONLY OSSPEC_LABEL,OS2 ;* Stubs for OS/2 (see stubs.asm) OSSPEC_DOS3ONLY OSSPEC_LABEL,OS2 rgfnosspec3: ;* General code OSSPEC_ENTRIES OSSPEC_NOLABEL,DOS3 ;* Stubs for DOS3 (see stubs.asm) OSSPEC_OS2ONLY OSSPEC_NOLABEL,DOS3 ;* DOS3 only procs OSSPEC_DOS3ONLY OSSPEC_NOLABEL,DOS3 ;* * mode specific entry points IFDEF DEBUG os2_only: cCall CowAssertFailed DB "Protect mode only proc called during real mode!$" ENDIF ;DEBUG IFDEF DEBUG dos3_only: cCall CowAssertFailed DB "Real mode only proc called during protect mode!$" ENDIF ;DEBUG sEnd OSSPEC_TEXT ;***************************************************************************** END