summary refs log tree commit diff
path: root/pc-thing/lib.ts
blob: a1cd815f8a4409c629cb16e90bfe90a90249508b (plain)
1
2
3
4
5
export function parseReg(arg: number): number {
    if (!'abcd'.split('').includes(String.fromCharCode(arg).toLowerCase()))
        throw `invalid register "${String.fromCharCode(arg)}"`;
    return 'abcd'.split('').indexOf(String.fromCharCode(arg).toLowerCase())
}