root / lab2 / utils.c @ 1
History | View | Annotate | Download (663 Bytes)
1 | 1 | up20180614 | #include <lcom/lcf.h> |
---|---|---|---|
2 | |||
3 | #include <stdint.h> |
||
4 | |||
5 | int(util_get_LSB)(uint16_t val, uint8_t *lsb) {
|
||
6 | /* To be implemented by the students */
|
||
7 | printf("%s is not yet implemented!\n", __func__);
|
||
8 | |||
9 | return 1; |
||
10 | } |
||
11 | |||
12 | int(util_get_MSB)(uint16_t val, uint8_t *msb) {
|
||
13 | /* To be implemented by the students */
|
||
14 | printf("%s is not yet implemented!\n", __func__);
|
||
15 | |||
16 | return 1; |
||
17 | } |
||
18 | |||
19 | int (util_sys_inb)(int port, uint8_t *value) { |
||
20 | /* To be implemented by the students */
|
||
21 | uint32_t b32; |
||
22 | sys_inb(port,&b32); |
||
23 | //printf("%x",b32);
|
||
24 | *value=b32&0xFF;
|
||
25 | //printf("%x\n",*value);
|
||
26 | |||
27 | |||
28 | //printf("%s is not yet implemented!\n", __func__);
|
||
29 | |||
30 | return 0; |
||
31 | } |
||
32 | |||
33 | /* a = 133
|
||
34 | b = a & 0x0F
|
||
35 | 1000 0101
|
||
36 | */ |