wok diff linld/stuff/src/CRTL.ASM @ rev 20751
Add libsbc
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 12 12:12:36 2019 +0100 (2019-02-12) |
parents | 57d97be431f4 |
children | c89d25976dbe |
line diff
1.1 --- a/linld/stuff/src/CRTL.ASM Tue Jan 08 17:51:51 2019 +0100 1.2 +++ b/linld/stuff/src/CRTL.ASM Tue Feb 12 12:12:36 2019 +0100 1.3 @@ -256,9 +256,15 @@ 1.4 1.5 1.6 ;*************************************************************** 1.7 +;_fastcall int readrm(bx:struct himem *m, ax:int sz); 1.8 ;_fastcall int read(ax:int fd, bx:void* data, dx:int sz); 1.9 ;_fastcall int write(ax:int fd, bx:const void* data, dx:int sz); 1.10 ;*************************************************************** 1.11 + global @readrm$qp11image_himemi:near 1.12 +@readrm$qp11image_himemi: 1.13 + xchg ax,dx ; sz 1.14 + mov ax,[bx] ; fd 1.15 + mov bx,[bx-2] ; data 1.16 global @read$qipvi:near 1.17 proc @read$qipvi near 1.18 1.19 @@ -366,6 +372,81 @@ 1.20 endif 1.21 1.22 1.23 + ifdef USE_ARGSTR 1.24 +;*************************************************************** 1.25 +;_fastcall int argstr(bx:const char *s, ax:const char keywords[], dx:const char **var); 1.26 +;_fastcall int argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var); 1.27 +;*************************************************************** 1.28 + global @argstr$qpxzcxt1ppxzc:near 1.29 + proc @argstr$qpxzcxt1ppxzc near 1.30 + 1.31 + stc 1.32 + db 73h ; jnc 1.33 + global @argnum$qpzcxpxzcpul:near 1.34 +@argnum$qpzcxpxzcpul: 1.35 + clc 1.36 + 1.37 + xchg ax,bx ; keywords 1.38 + xchg ax,cx ; s 1.39 + xchg ax,dx ; vars 1.40 + sbb dx,dx ; str:-1 num:0 1.41 + sbb dx,-4 ; str:2 num:4 1.42 + push si di 1.43 + xchg ax,di ; vars 1.44 + dec bx 1.45 + mov al,0 1.46 +@@testalt: 1.47 + sub di,dx 1.48 +@@test: 1.49 + cmp al,'=' 1.50 + je @@found 1.51 + mov si,cx ; s 1.52 + add di,dx 1.53 +@@match: 1.54 + inc bx 1.55 + lodsb 1.56 + or al,20h 1.57 + cmp al,[bx] 1.58 + je @@match 1.59 + cmp al,'/' ; 2f 1.60 + jne @@notopt 1.61 + cmp [byte bx],'-' 1.62 + je @@match 1.63 +@@notopt: 1.64 + ifdef EXTRA 1.65 + add di,dx 1.66 + cmp [byte bx],'/' 1.67 + je @@testalt 1.68 + sub di,dx 1.69 + endif 1.70 + cmp [byte bx],'|' 1.71 + je @@test 1.72 + mov al,0 1.73 + inc bx 1.74 + cmp [bx-1],al 1.75 + jne @@notopt 1.76 + stc 1.77 + jmp @@nokeyword 1.78 +@@found: 1.79 + mov [di],si 1.80 + dec dx 1.81 + dec dx 1.82 + je @@done 1.83 + push si 1.84 + call @strtol$qpxzc 1.85 + mov [di],ax 1.86 + mov [di+2],dx 1.87 +@@done: 1.88 + clc 1.89 +@@nokeyword: 1.90 + sbb ax,ax 1.91 + pop di si 1.92 + ret 1.93 + 1.94 + endp @argstr$qpxzcxt1ppxzc 1.95 + 1.96 + else 1.97 + 1.98 ;*************************************************************** 1.99 ;_fastcall int strhead(bx:const char* a, ax:const char* b); 1.100 ;*************************************************************** 1.101 @@ -387,6 +468,7 @@ 1.102 1.103 endp @strhead$qpxzct1 1.104 1.105 + endif 1.106 1.107 ;*************************************************************** 1.108 ;_fastcall char* malloc_or_die(ax:unsigned size); 1.109 @@ -1147,6 +1229,23 @@ 1.110 endp @strtol$qpxzc 1.111 1.112 1.113 + ifdef USE_ARGSTR 1.114 +;*************************************************************** 1.115 +;_fastcall void set_cmdline(bx:const char *filename); 1.116 +;*************************************************************** 1.117 + global @set_cmdline$qpxzc:near 1.118 + proc @set_cmdline$qpxzc near 1.119 + call openargs 1.120 + jc strtol_ret 1.121 + mov cx,4096 1.122 + mov di,[_heap_top] 1.123 + extrn read_cmdline:near 1.124 + jmp near read_cmdline ; read_cmdline(ax,di,cx) 1.125 + 1.126 + endp @set_cmdline$qpxzc 1.127 + endif 1.128 + 1.129 + 1.130 ifdef NO386 1.131 ;*************************************************************** 1.132 ;u16 topseg();