polmon: cleanup
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "polos.h"
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int kDumpSize = 16;
|
||||
@@ -81,21 +83,6 @@ void WriteUint16ln(uint16_t a) {
|
||||
puts("\r\n");
|
||||
}
|
||||
|
||||
uint8_t __get_far_u8__(uint16_t addr, uint16_t seg) {
|
||||
register uint16_t ad asm("si") = addr;
|
||||
register uint16_t sg asm("ds") = seg;
|
||||
register uint8_t ret asm("al");
|
||||
asm("lodsb \n\t" : "=r"(ret) : "r"(ad), "r"(sg));
|
||||
return ret;
|
||||
}
|
||||
|
||||
void __set_far_u8__(uint16_t addr, uint16_t seg, uint8_t val) {
|
||||
register uint16_t ad asm("di") = addr;
|
||||
register uint16_t sg asm("es") = seg;
|
||||
register uint8_t v asm("al") = val;
|
||||
asm("stosb \n\t" ::"r"(sg), "r"(ad), "r"(v) : "memory");
|
||||
}
|
||||
|
||||
__attribute__((noreturn)) inline static void __basic__() {
|
||||
asm volatile("movw $0x40, %ax \n\t"
|
||||
"mov %ax, %ds \n\t"
|
||||
@@ -140,23 +127,6 @@ void ClearScreen() {
|
||||
: "ax", "cc");
|
||||
}
|
||||
|
||||
void Status(uint8_t status) {
|
||||
asm volatile("xorb %%bh, %%bh \n\t"
|
||||
"movb $0x03, %%ah \n\t"
|
||||
"int $0x10 \n\t"
|
||||
"mov %%dx, %%di \n\t"
|
||||
"movb $0x02, %%ah \n\t"
|
||||
"movw $77, %%dx \n\t"
|
||||
"int $0x10 \n\t"
|
||||
"movb %0, %%al \n\t"
|
||||
"call %1 \n\t"
|
||||
"movb $0x02, %%ah \n\t"
|
||||
"movw %%di, %%dx \n\t"
|
||||
"int $0x10" ::"rm"(status),
|
||||
"l"(WriteUint8)
|
||||
: "ax", "bh", "dx", "cx", "di", "cc");
|
||||
}
|
||||
|
||||
char toupper(char c) {
|
||||
if (c >= 'a' && c <= 'z') {
|
||||
return c - ('a' - 'A');
|
||||
|
Reference in New Issue
Block a user