about summary refs log tree commit diff stats
path: root/subx/019syscalls.cc
blob: 96c11ee0ad1d90efa6e100584034a7734f42c049 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
:(before "End Single-Byte Opcodes")
case 0xcd: {  // int imm8 (software interrupt)
  uint8_t code = next();
  if (code != 0x80) {
    raise << "Unimplemented interrupt code " << HEXBYTE << code << '\n' << end();
    raise << "  Only `int 80h` supported for now.\n" << end();
    break;
  }
  process_int80();
  break;
}

:(code)
void process_int80() {
  switch (Reg[EAX].u) {
  case 1:
    exit(Reg[EBX].u);
  }
}