summaryrefslogtreecommitdiffstats
path: root/yotlibc/bccfunc.s
diff options
context:
space:
mode:
authorlantw44 <lantw44@gmail.com>2013-01-19 14:46:39 +0800
committerlantw44 <lantw44@gmail.com>2013-01-19 14:46:39 +0800
commit21f4b645319848112fd62b0bb5019d98f8e4a741 (patch)
tree7825680d2f45aaaf8f263cdf4ef7a3bb9d16943b /yotlibc/bccfunc.s
parentd16cda16bbc5f5d51cce15584014cccafbcf08da (diff)
downloadyotos-21f4b645319848112fd62b0bb5019d98f8e4a741.tar
yotos-21f4b645319848112fd62b0bb5019d98f8e4a741.tar.gz
yotos-21f4b645319848112fd62b0bb5019d98f8e4a741.tar.bz2
yotos-21f4b645319848112fd62b0bb5019d98f8e4a741.tar.lz
yotos-21f4b645319848112fd62b0bb5019d98f8e4a741.tar.xz
yotos-21f4b645319848112fd62b0bb5019d98f8e4a741.tar.zst
yotos-21f4b645319848112fd62b0bb5019d98f8e4a741.zip
Update to the latest version!
Diffstat (limited to 'yotlibc/bccfunc.s')
-rw-r--r--yotlibc/bccfunc.s91
1 files changed, 86 insertions, 5 deletions
diff --git a/yotlibc/bccfunc.s b/yotlibc/bccfunc.s
index 3060428..7aedaac 100644
--- a/yotlibc/bccfunc.s
+++ b/yotlibc/bccfunc.s
@@ -1,9 +1,90 @@
; 專門給 bcc 用的,我不知道為什麼它會缺基本功能
-
+global _env_load
+global _env_save
+global _env_def
+global isru
+global isr
+global isl
+global islu
+global imul_
+global imul_u
+global imodu
+global idiv_u
global imod
+global imodu
+
+idiv_:
+ cwd
+ idiv bx
+ ret
+
+
+idiv_u:
+ xor dx,dx
+ div bx
+ ret
+
imod:
- cwd
- idiv bx
- mov ax,dx
- ret
+ cwd
+ idiv bx
+ mov ax,dx
+ ret
+
+
+imodu:
+ xor dx,dx
+ div bx
+ mov ax,dx
+ ret
+
+
+imul_:
+imul_u:
+ imul bx
+ ret
+
+
+isl:
+islu:
+ mov cl,bl
+ shl ax,cl
+ ret
+
+
+isr:
+ mov cl,bl
+ sar ax,cl
+ ret
+
+
+isru:
+ mov cl,bl
+ shr ax,cl
+ ret
+
+
+_env_def:
+ push bp
+ mov bp, sp
+ push cx
+ push si
+ mov cx, [bp+6]
+ mov si, [bp+4]
+ int 0x52
+ pop si
+ pop cx
+ mov sp, bp
+ pop bp
+ ret
+
+
+_env_save:
+ int 0x53
+ ret
+
+
+_env_load:
+ int 0x54
+ ret
+