root/dos/mystuff.h

Revision fcd383ae04ef0382ad93b83ba82112104aa986e0, 0.5 KB (checked in by H. Peter Anvin <hpa@…>, 3 years ago)

dos: int 25/26 may be register-dirty; wrap them in assembly

int 25h and int 26h are known to be register-dirty for some versions
of DOS -- unlike int 21h, which is usually clean. As such, wrap those
in assembly functions.

Signed-off-by: H. Peter Anvin <hpa@…>

  • Property mode set to 100644
Line 
1#ifndef MYSTUFF_H
2#define MYSTUFF_H
3
4#include <inttypes.h>
5
6#define NULL ((void *)0)
7
8unsigned int skip_atou(const char **s);
9unsigned int atou(const char *s);
10
11static inline int isdigit(int ch)
12{
13    return (ch >= '0') && (ch <= '9');
14}
15
16struct diskio {
17    uint32_t startsector;
18    uint16_t sectors;
19    uint16_t bufoffs, bufseg;
20} __attribute__ ((packed));
21int int25_read_sector(unsigned char drive, struct diskio *dio);
22int int26_write_sector(unsigned char drive, struct diskio *dio);
23
24#endif /* MYSTUFF_H */
Note: See TracBrowser for help on using the browser.