FreeBASIC  0.91.0
farmemset.c
Go to the documentation of this file.
1 /* farptr memset routines for DOS */
2 
3 #include "../fb.h"
4 #include <sys/farptr.h>
5 
6 void fb_hFarMemSet(unsigned short selector, unsigned long dest, unsigned char char_to_set, size_t bytes)
7 {
8  unsigned long addr = dest;
9  int i;
10 
11  _farsetsel(selector);
12 
13  for (i = 0; i < bytes; i++, addr++) {
14  _farnspokeb(addr, char_to_set);
15  }
16 }
17 
18 void fb_hFarMemSetW(unsigned short selector, unsigned long dest, unsigned short word_to_set, size_t words)
19 {
20  unsigned long addr = dest;
21  int i;
22 
23  _farsetsel(selector);
24 
25  for (i = 0; i < words; i++, addr += 2) {
26  _farnspokew(addr, word_to_set);
27  }
28 }