Subversion Repositories Kolibri OS

Rev

Rev 6037 | Rev 6468 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6037 Rev 6262
Line 41... Line 41...
41
;;  20.05.2002 Hd status check - VT                             ;;
41
;;  20.05.2002 Hd status check - VT                             ;;
42
;;  01.05.2002 Bugfix in device write - VT                      ;;
42
;;  01.05.2002 Bugfix in device write - VT                      ;;
43
;;                                                              ;;
43
;;                                                              ;;
44
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
44
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 45... Line 45...
45
 
45
 
Line 46... Line 46...
46
$Revision: 6037 $
46
$Revision: 6262 $
Line 47... Line 47...
47
 
47
 
48
cache_max equ 1919      ; max. is 1919*512+0x610000=0x6ffe00
48
cache_max equ 1919      ; max. is 1919*512+0x610000=0x6ffe00
Line 1226... Line 1226...
1226
        jmp     mutex_lock
1226
        jmp     mutex_lock
1227
fat_unlock:
1227
fat_unlock:
1228
        lea     ecx, [ebp+FAT.Lock]
1228
        lea     ecx, [ebp+FAT.Lock]
1229
        jmp     mutex_unlock
1229
        jmp     mutex_unlock
Line 1230... Line -...
1230
 
-
 
1231
; \begin{diamond}
-
 
1232
uni2ansi_str:
-
 
1233
; convert UNICODE zero-terminated string to ASCII-string (codepage 866)
-
 
1234
; in: esi->source, edi->buffer (may be esi=edi)
-
 
1235
; destroys: eax,esi,edi
-
 
1236
        lodsw
-
 
1237
        test    ax, ax
-
 
1238
        jz      .done
-
 
1239
        cmp     ax, 0x80
-
 
1240
        jb      .ascii
-
 
1241
        cmp     ax, 0x401
-
 
1242
        jz      .yo1
-
 
1243
        cmp     ax, 0x451
-
 
1244
        jz      .yo2
-
 
1245
        cmp     ax, 0x410
-
 
1246
        jb      .unk
-
 
1247
        cmp     ax, 0x440
-
 
1248
        jb      .rus1
-
 
1249
        cmp     ax, 0x450
-
 
1250
        jb      .rus2
-
 
1251
.unk:
-
 
1252
        mov     al, '_'
-
 
1253
        jmp     .doit
-
 
1254
.yo1:
-
 
1255
        mov     al, 0xF0 ; 'Ё'
-
 
1256
        jmp     .doit
-
 
1257
.yo2:
-
 
1258
        mov     al, 0xF1 ; 'ё'
-
 
1259
        jmp     .doit
-
 
1260
.rus1:
-
 
1261
; 0x410-0x43F -> 0x80-0xAF
-
 
1262
        add     al, 0x70
-
 
1263
        jmp     .doit
-
 
1264
.rus2:
-
 
1265
; 0x440-0x44F -> 0xE0-0xEF
-
 
1266
        add     al, 0xA0
-
 
1267
.ascii:
-
 
1268
.doit:
-
 
1269
        stosb
-
 
1270
        jmp     uni2ansi_str
-
 
1271
.done:
-
 
1272
        mov     byte [edi], 0
-
 
1273
        ret
-
 
1274
 
-
 
1275
ansi2uni_char:
-
 
1276
; convert ANSI character in al to UNICODE character in ax, using cp866 encoding
-
 
1277
        mov     ah, 0
-
 
1278
; 0x00-0x7F - trivial map
-
 
1279
        cmp     al, 0x80
-
 
1280
        jb      .ret
-
 
1281
; 0x80-0xAF -> 0x410-0x43F
-
 
1282
        cmp     al, 0xB0
-
 
1283
        jae     @f
-
 
1284
        add     ax, 0x410-0x80
-
 
1285
.ret:
-
 
1286
        ret
-
 
1287
@@:
-
 
1288
; 0xE0-0xEF -> 0x440-0x44F
-
 
1289
        cmp     al, 0xE0
-
 
1290
        jb      .unk
-
 
1291
        cmp     al, 0xF0
-
 
1292
        jae     @f
-
 
1293
        add     ax, 0x440-0xE0
-
 
1294
        ret
-
 
1295
; 0xF0 -> 0x401
-
 
1296
; 0xF1 -> 0x451
-
 
1297
@@:
-
 
1298
        cmp     al, 0xF0 ; 'Ё'
-
 
1299
        jz      .yo1
-
 
1300
        cmp     al, 0xF1 ; 'ё'
-
 
1301
        jz      .yo2
-
 
1302
.unk:
-
 
1303
        mov     al, '_'         ; ah=0
-
 
1304
        ret
-
 
1305
.yo1:
-
 
1306
        mov     ax, 0x401
-
 
1307
        ret
-
 
1308
.yo2:
-
 
1309
        mov     ax, 0x451
-
 
1310
        ret
-
 
1311
 
-
 
1312
char_toupper:
-
 
1313
; convert character to uppercase, using cp866 encoding
-
 
1314
; in: al=symbol
-
 
1315
; out: al=converted symbol
-
 
1316
        cmp     al, 'a'
-
 
1317
        jb      .ret
-
 
1318
        cmp     al, 'z'
-
 
1319
        jbe     .az
-
 
1320
        cmp     al, 0xF1 ; 'ё'
-
 
1321
        jz      .yo1
-
 
1322
        cmp     al, 0xA0 ; 'а'
-
 
1323
        jb      .ret
-
 
1324
        cmp     al, 0xE0 ; 'р'
-
 
1325
        jb      .rus1
-
 
1326
        cmp     al, 0xEF ; 'я'
-
 
1327
        ja      .ret
-
 
1328
; 0xE0-0xEF -> 0x90-0x9F
-
 
1329
        sub     al, 0xE0-0x90
-
 
1330
.ret:
-
 
1331
        ret
-
 
1332
.rus1:
-
 
1333
; 0xA0-0xAF -> 0x80-0x8F
-
 
1334
.az:
-
 
1335
        and     al, not 0x20
-
 
1336
        ret
-
 
1337
.yo1:
-
 
1338
; 0xF1 -> 0xF0
-
 
1339
        dec     ax
-
 
Line 1340... Line 1230...
1340
        ret
1230
 
1341
 
1231
 
1342
fat_get_name:
1232
fat_get_name:
1343
; in: edi->FAT entry
1233
; in: edi->FAT entry
Line 3749... Line 3639...
3749
        call    update_disk
3639
        call    update_disk
3750
        call    fat_unlock
3640
        call    fat_unlock
3751
        pop     edi
3641
        pop     edi
3752
        xor     eax, eax
3642
        xor     eax, eax
3753
        ret
3643
        ret
3754
 
-
 
3755
; \end{diamond}
-