-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTools.h
More file actions
22 lines (20 loc) · 676 Bytes
/
Tools.h
File metadata and controls
22 lines (20 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
File: Tools.h
Desc: Declarations for utility functions used in
Z80 simulator. Taken from CS 3481 Y86 Simulator Project.
*/
#ifndef TOOLS_H
#define TOOLS_H
#include <cstdint>
namespace Tools
{
uint8_t bcd(uint8_t source);
uint8_t getBits(unsigned low, unsigned high, uint8_t source);
uint8_t setBits(unsigned low, unsigned high, uint8_t source);
uint8_t clearBits(unsigned low, unsigned high, uint8_t source);
uint8_t assignOneBit(unsigned bitNum, unsigned bitVal, uint8_t source);
uint16_t changeEndian(uint16_t);
bool isNegative(uint8_t source);
void clearBuffer(char *pbuf, int size);
} // namespace Tools
#endif