aboutsummaryrefslogtreecommitdiff
path: root/test/test-dis.c
blob: 127b0b4825e1fb8c4055a01bb402d90921e997be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include "dis.h"
unsigned f(unsigned x) {
    struct bitslice addr = {.nruns = 4, .runs = (struct bitslice_run[]) {{0,0,4}, {5,5,7}, {16,13,4}, {23,12,1}}};
    return bs_get(addr, x);

}
unsigned fs(unsigned val, unsigned op) {
    struct bitslice addr = {.nruns = 4, .runs = (struct bitslice_run[]) {{0,0,4}, {5,5,7}, {16,13,4}, {23,12,1}}};
    return bs_set(addr, val, op);

}
int main() {
    printf("%x\n", f(0xdeadbeef));
    printf("%x\n", f(0xdeadbeee));
    printf("%x\n", f(0xfeedface));
    printf("%x\n", fs(0xdead, 0xdeadbeef));

}