aboutsummaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-03 22:58:39 +0200
committerJavier <dev.git@javispedro.com>2022-04-03 22:58:39 +0200
commitf9b0699da8adb44fd91640180a7b70639a43449b (patch)
tree81fcbd285a306b85f21086d1c7d37e77af71ed12 /utils.h
parent71f66c759930ce22f099ad1631f05ddb3e0ccd8a (diff)
downloadvbados-f9b0699da8adb44fd91640180a7b70639a43449b.tar.gz
vbados-f9b0699da8adb44fd91640180a7b70639a43449b.zip
replace some custom asm utils with watcom intrinsincs
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h55
1 files changed, 0 insertions, 55 deletions
diff --git a/utils.h b/utils.h
index 39260c4..c7db435 100644
--- a/utils.h
+++ b/utils.h
@@ -3,8 +3,6 @@
#include <stdint.h>
-#define ABS(x) (((x) < 0) ? -(x) : (x))
-
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
@@ -13,12 +11,6 @@
static inline void breakpoint(void);
#pragma aux breakpoint = 0xcd 0x03;
-static inline void cli(void);
-#pragma aux cli = "cli"
-
-static inline void sti(void);
-#pragma aux sti = "sti"
-
/** Map x linearly from range [0, srcmax] to [0, dstmax].
* Equivalent of (x * dstmax) / srcmax but with 32-bit unsigned precision. */
static unsigned scaleu(unsigned x, unsigned srcmax, unsigned dstmax);
@@ -59,51 +51,4 @@ static int scalei_rem(int x, int srcmax, int dstmax, short *rem);
__value [ax] \
__modify [ax cx dx si]
-static void bzero(void __far *buf, unsigned int size);
-#pragma aux bzero = \
- "cld" \
- "mov ax, 0" \
- "rep stos byte ptr es:[di]" \
- __parm [es di] [cx] \
- __modify [ax]
-
-static void nfmemcpy(void __far *dst, const void *src, unsigned int size);
-#pragma aux nfmemcpy = \
- "cld" \
- "rep movs byte ptr es:[di], byte ptr ds:[si]" \
- __parm [es di] [si] [cx] \
- __modify [cx si di]
-
-static void fnmemcpy(void *dst, const void __far *src, unsigned int size);
-#pragma aux fnmemcpy = \
- "cld" \
- "push gs" \
- "mov ax, es" \
- "mov gs, ax" /* gs is now the src segment */ \
- "mov ax, ds" \
- "mov es, ax" /* es is now ds, the dst segment */ \
- "rep movs byte ptr es:[di], byte ptr gs:[si]" \
- "pop gs" \
- __parm [di] [es si] [cx] \
- __modify [ax cx si di es]
-
-static void ffmemcpy(void __far *dst, const void __far *src, unsigned int size);
-#pragma aux ffmemcpy = \
- "cld" \
- "push gs" \
- "mov gs, ax" \
- "rep movs byte ptr es:[di], byte ptr gs:[si]" \
- "pop gs" \
- __parm [es di] [gs si] [cx] \
- __modify [cx si di]
-
-static void nnmemcpy(void *dst, const void *src, unsigned int size);
-#pragma aux nnmemcpy = \
- "cld" \
- "mov ax, ds" \
- "mov es, ax" /* es is now ds, the src+dst segment */ \
- "rep movs byte ptr es:[di], byte ptr ds:[si]" \
- __parm [di] [si] [cx] \
- __modify [cx si di es]
-
#endif