summaryrefslogtreecommitdiffstats
path: root/yotlibc
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
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')
-rw-r--r--yotlibc/bccfunc.s91
-rw-r--r--yotlibc/str_in.c1
-rw-r--r--yotlibc/strbasic.c2
-rw-r--r--yotlibc/yotlibc.h6
4 files changed, 89 insertions, 11 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
+
diff --git a/yotlibc/str_in.c b/yotlibc/str_in.c
index 6f71791..77b4c21 100644
--- a/yotlibc/str_in.c
+++ b/yotlibc/str_in.c
@@ -122,6 +122,7 @@ int yotrl(dest, init, maxlen, color)
}else{
switch(cscan){
case KEYDOWN_SCANCODE_ENTER:
+ chv_move_cursor(nowlen - pos);
dest[nowlen++] = '\0';
if(++char_vga_cursor_y >= CHAR_VGA_SCREENY){
char_vga_cursor_y--;
diff --git a/yotlibc/strbasic.c b/yotlibc/strbasic.c
index c73757a..686b667 100644
--- a/yotlibc/strbasic.c
+++ b/yotlibc/strbasic.c
@@ -62,6 +62,8 @@ int strtos(str, store)
}else{
return 0;
}
+ }else if(*str == ' ' || *str == '\t' || *str == '\n'){
+ break;
}else{
return 0; /* Failed */
}
diff --git a/yotlibc/yotlibc.h b/yotlibc/yotlibc.h
index 4a1e6a3..fd458c0 100644
--- a/yotlibc/yotlibc.h
+++ b/yotlibc/yotlibc.h
@@ -21,12 +21,6 @@
#define false 0
#endif
-#define exit(globalvar) \
- asm "mov sp, bp"; \
- asm "mov ax, [_" #globalvar "]" ; \
- asm "pop bp"; \
- asm "retf"
-
/* str_out.s */
void putint(unsigned short); /* 以 10 進位顯示一個 word (unsigned) */
void putcharhex(char); /* 以 16 進位顯示一個 byte */