This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Auto Generated From ANSI C BNF using grammar adapted from Section A13 of The | |
| // C programming language, 2nd edition, by Brian W. Kernighan and Dennis M. | |
| // Ritchie, Prentice Hall, 1988. | |
| #include <cassert> | |
| #include <array> | |
| #include <vector> | |
| struct ast_node_t {}; | |
| bool match(int index, int token); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ______ ________ __________,_ ___________ | |
| // ___ ___/ __ \/ _____/ \_ _____/ | _____ ____ ______\_ _____/_____ __ __ | |
| // \ \/ /> / __ \ | __)| | \__ \ / ___\/ ___/ | __)_/ \| | \ | |
| // > </ -- \ |__\ \ | | | |__/ __ \_/ /_/ >___ \ | \ Y Y \ | / | |
| // / /\ \_______/\_______/ \____/ |____(______/\___ /_____/ /_________/_|_|__/____/ | |
| // \_/ \_/ ..:: x86 flags emulator ::.. /_____/ | |
| // '' Aidan Dodds 2017 '' | |
| #include <assert.h> | |
| #include <stdint.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <cstdint> | |
| struct xtea_t | |
| { | |
| static const uint32_t _delta = 0x9E3779B9; | |
| typedef uint32_t key_t[4]; | |
| template <uint32_t num_rounds> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OPCODE MNEMONIC OPERANDS FLAGS CYCLES LENGTH | |
| 0x00 BRK B 7 1 | |
| 0x01 ORA (ind,X) SZ 6 2 | |
| 0x05 ORA zpg SZ 3 2 | |
| 0x06 ASL zpg SZC 5 2 | |
| 0x08 PHP 3 1 | |
| 0x09 ORA # SZ 2 2 | |
| 0x0a ASL A SZC 2 1 | |
| 0x0d ORA abs SZ 4 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 6502 netlist and pin descriptions | |
| * | |
| * Original author: Greg James | |
| * Original source material: www.visual6502.org | |
| **/ | |
| #pragma once | |
| #include <cstdint> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| // fourcc function | |
| static constexpr | |
| uint32_t fourcc(const char (&in)[4]) { | |
| return ((in[0]<<24) | (in[1]<<16) | (in[3]<<8) | ' '); | |
| } | |
| // addressing mode types | |
| enum { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| // operand format | |
| enum { | |
| OPR_IMM = 0, | |
| OPR_ZP, | |
| OPR_ZPX, | |
| OPR_ZPY, | |
| OPR_ABS, | |
| OPR_ABSX, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- | |
| # DATA TRANSFER | |
| # ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- | |
| # | |
| @ MOV, Move | |
| / Register to Register/Memory | |
| % 2/12 + 4*w | |
| $ 1000100w | mod reg r/m | |
| / Register/memory to register |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| struct base_t { | |
| const int type; | |
| base_t() : type(0) {} | |
| base_t(int type) : type(type) {} | |
| virtual int call() { return 1; } | |
| }; | |
| struct derived_t : public base_t { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdint> | |
| namespace { | |
| template <int hi, int lo> | |
| constexpr uint32_t mask() { | |
| // hi_mask xor lo_mask | |
| return ((1u << hi) | ((1u << hi) - 1u)) ^ ((1u << lo) - 1u); | |
| } | |
| template <int hi, int lo> |