proper headers

This commit is contained in:
Kelvin Sherlock 2017-01-03 13:09:10 -05:00
parent 31cbc7934d
commit 18fe552a77
3 changed files with 60 additions and 58 deletions

View File

@ -1,6 +1,7 @@
#include "disassembler.h"
#include <stdio.h>
#include <string.h>
#include <string>
static constexpr const char opcodes[] =
"brkoracoporatsboraaslora"

View File

@ -6,6 +6,7 @@
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <type_traits>
#include <vector>

114
link.cpp
View File

@ -1,58 +1,58 @@
/*
* WDC to OMF Linker.
*
*
*/
#include <sysexits.h>
#include <stdlib.h>
#include <unistd.h>
#include <err.h>
void help() {
exit(0);
}
void usage() {
exit(EX_USAGE);
}
int main(int argc, char **argv) {
std::string _o;
bool _C = false;
bool _X = false;
std::vector<std::string> _l;
std::vector<std::string> _L;
int c;
while ((c = getopt(argc, argv, "CXL:l:o:")) != -1) {
switch(c) {
case 'X': _X = true; break;
case 'C': _C = true; break;
case 'o': _o = optarg; break;
case 'l': _l.emplace_back(optarg); break;
case 'L': _L.emplace_back(optarg); break;
case 'h': help(); break;
case ':':
case '?':
default:
usage();
}
}
argc -= optind;
argv += optind;
if (argc == 0) usage();
}
struct section {
std::vector<uint8_t> data;
uint32_t offset;
/*
* WDC to OMF Linker.
*
*
*/
#include <sysexits.h>
#include <stdlib.h>
#include <unistd.h>
#include <err.h>
void help() {
exit(0);
}
void usage() {
exit(EX_USAGE);
}
int main(int argc, char **argv) {
std::string _o;
bool _C = false;
bool _X = false;
std::vector<std::string> _l;
std::vector<std::string> _L;
int c;
while ((c = getopt(argc, argv, "CXL:l:o:")) != -1) {
switch(c) {
case 'X': _X = true; break;
case 'C': _C = true; break;
case 'o': _o = optarg; break;
case 'l': _l.emplace_back(optarg); break;
case 'L': _L.emplace_back(optarg); break;
case 'h': help(); break;
case ':':
case '?':
default:
usage();
}
}
argc -= optind;
argv += optind;
if (argc == 0) usage();
}
struct section {
std::vector<uint8_t> data;
uint32_t offset;
}