These determine the assumed/default size of instruction operands, and restricts which opcodes are available, and how they are used.
Modern operating systems, booted inside Real mode,
| // demo_new_delete.cpp | |
| #include <cstddef> | |
| #include <new> | |
| struct Base { | |
| Base(); | |
| virtual ~Base(); // virtual => emits D0, D1, D2 | |
| static void* operator new(std::size_t); | |
| static void operator delete(void*) noexcept; | |
| }; |
| ==7307== Memcheck, a memory error detector | |
| ==7307== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
| ==7307== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info | |
| ==7307== Command: ./a.out | |
| ==7307== | |
| Starting Libevent 2.0.20-stable. | |
| Available methods are: | |
| epoll | |
| poll | |
| select |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <netinet/in.h> | |
| #include <event2/event.h> | |
| #include <sys/socket.h> | |
| #include <stdlib.h> | |
| int main(int argc, char **argv) | |
| { | |
| int i; |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int main(int argc, char *argv[]) | |
| { | |
| int i =0; | |
| char *memPtr=NULL; | |
| char *memPtr2G=NULL; | |
| int j=0; |
| ## {{{ http://code.activestate.com/recipes/366178/ (r5) | |
| def primes(n): | |
| if n==2: return [2] | |
| elif n<2: return [] | |
| s=range(3,n+1,2) | |
| mroot = n ** 0.5 | |
| half=(n+1)/2-1 | |
| i=0 | |
| m=3 | |
| while m <= mroot: |
| package edu.cmu.cs771.hw1; | |
| import java.nio.charset.Charset; | |
| import java.util.*; | |
| import java.math.BigInteger; | |
| public class MerkleHellmanKnapsackTest { | |
| public MerkleHellmanKnapsackTest() { | |
| // TODO Auto-generated constructor stub |
| package edu.cmu.cs771.hw1; | |
| import java.nio.charset.Charset; | |
| import java.util.*; | |
| import java.math.BigInteger; | |
| /** | |
| * @author songluo | |
| * | |
| */ |
| package edu.cmu.cs771.hw1; | |
| /** | |
| * Class EmptyListException definition. | |
| * @author songluo | |
| * | |
| */ | |
| public class EmptyListException extends RuntimeException{ | |
| /** |