Skip to content

Commit

Permalink
kw11 cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
davecheney committed Sep 19, 2020
1 parent edf6e68 commit 3a5beb9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 0 additions & 2 deletions avr11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ void setup(char * disk) {
printf("Ready\n");
}

uint16_t instcounter;

jmp_buf trapbuf;

void loop0();
Expand Down
3 changes: 1 addition & 2 deletions kb11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,7 @@ void KB11::interrupt(uint8_t vec, uint8_t pri) {

// pop the top interrupt off the itab.
void KB11::popirq() {
uint8_t i;
for (i = 0; i < itab.size() - 1; i++) {
for (uint8_t i = 0; i < itab.size() - 1; i++) {
itab[i] = itab[i + 1];
}
itab[itab.size() - 1].vec = 0;
Expand Down
8 changes: 3 additions & 5 deletions kb11.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ enum {
#define SA(x) (aget(S(x), L(x)))
#define DA(x) (aget(D(x), L(x)))

extern UNIBUS unibus;

class KB11 {
public:
uint16_t PC;
Expand Down Expand Up @@ -66,7 +64,7 @@ class KB11 {
PS |= (1 << 13) | (1 << 12);
}
}

struct intr {
uint8_t vec;
uint8_t pri;
Expand All @@ -78,8 +76,8 @@ class KB11 {
UNIBUS unibus;

private:
std::array<uint16_t,8> R; // R0-R8
std::array<uint16_t, 8> R; // R0-R8

bool N();
bool Z();
void setZ(const bool b);
Expand Down
15 changes: 10 additions & 5 deletions kw11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ void kw11alarm(int) {

KW11::KW11() {
signal(SIGALRM, kw11alarm);
struct itimerval itv;
itv.it_interval.tv_sec = 0;
itv.it_interval.tv_usec = 20000;
itv.it_value.tv_sec = 0;
itv.it_value.tv_usec = 20000;
struct itimerval itv = {
.it_interval = {
.tv_sec = 0,
.tv_usec = 20000,
},
.it_value = {
.tv_sec = 0,
.tv_usec = 20000,
},
};
setitimer(ITIMER_REAL, &itv, NULL);
}

Expand Down
3 changes: 2 additions & 1 deletion unibus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ uint16_t UNIBUS::read16(uint32_t a) {
}

printf("unibus: read from invalid address %06o\n", a);
return trap(INTBUS);
trap(INTBUS);
std::abort(); // not reached
}

void UNIBUS::reset() {
Expand Down

0 comments on commit 3a5beb9

Please sign in to comment.