Logo Search packages:      
Sourcecode: faucc version File versions

test14.c

/* $Id: test14.c,v 1.2 2009-01-27 15:58:54 potyra Exp $ 
 *
 * Copyright (C) 2008-2009 FAUcc Team <info@faumachine.org>.
 * This program is free software. You can redistribute it and/or modify it
 * under the terms of the GNU General Public License, either version 2 of
 * the License, or (at your option) any later version. See COPYING.
 */

extern unsigned char get(void);

int reg;

inline void func(int opcode) {
      switch (opcode) {
            case 0: reg += 7; break;
            case 1: reg -= 7; break;
            case 2: reg %= 7; break;
      }
}

void disas(void) {
      int opcode = get();

      switch (opcode) {
            case 0: func(0); break;
            case 1: func(1); break;
            case 2: func(2); break;
      }
}



Generated by  Doxygen 1.6.0   Back to index