Subversion Repositories Kolibri OS

Rev

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

Rev 4622 Rev 4623
Line 50... Line 50...
50
        dec     esi
50
        dec     esi
51
  .done:
51
  .done:
Line 52... Line 52...
52
 
52
 
Line -... Line 53...
-
 
53
        ret
-
 
54
 
-
 
55
;----------------------------------
53
        ret
56
; scan untill next line is reached
54
 
57
;
55
; When you set the direction flag before calling, you can also scan for previous line!
58
; When you set the direction flag before calling, you can also scan for previous line!
-
 
59
; IN:   esi
56
; in: esi
60
; OUT:  esi
Line 57... Line 61...
57
; out:esi
61
;----------------------------------
58
text_nextline:
62
text_nextline:
59
 
63
 
Line 71... Line 75...
71
  .done:
75
  .done:
Line 72... Line 76...
72
 
76
 
Line -... Line 77...
-
 
77
        ret
-
 
78
 
-
 
79
 
73
        ret
80
;----------------------------------
74
 
81
; print string
75
 
82
;
-
 
83
; IN:   esi = ptr to string
76
print_text:                             ; eax = start ptr
84
;       bl = char which marks end of string
77
                                        ; dl = end char
-
 
Line -... Line 85...
-
 
85
; OUT:  esi = ptr to end of str
-
 
86
;----------------------------------
-
 
87
print_string:
78
        pusha
88
 
79
  ptr2:
89
        push    eax
-
 
90
  .loop:
-
 
91
        lodsb
80
        mov     bl, [eax]
92
        cmp     al, bl
81
 
93
        je      .done
82
        cmp     bl, dl
94
        cmp     al, 13
83
        je      .done
-
 
84
        test    bl, bl
-
 
85
        jz      .done
95
        je      .loop
86
        call    print_character
-
 
87
 
96
        test    al, al
88
        inc     eax
97
        jz      .done
Line 89... Line 98...
89
        jmp     ptr2
98
        call    print_char
Line -... Line 99...
-
 
99
        jmp     .loop
-
 
100
  .done:
-
 
101
        pop     eax
-
 
102
 
-
 
103
        ret
-
 
104
 
-
 
105
 
Line 90... Line -...
90
 
-
 
91
  .done:
-
 
92
        popa
106
;----------------------------------
93
 
107
; print ASCIIZ string
94
        ret
108
;
95
 
109
; IN:   esi = ptr to ASCIIZ string
96
 
110
; OUT:  esi = ptr to end of str
97
 
-
 
98
print_text2:                            ; esi = ptr to ASCIIZ string
111
;----------------------------------
99
 
112
print_asciiz:
100
        pusha
-
 
101
  .loop:
113
 
102
        lodsb
114
        push    eax
Line 103... Line 115...
103
        test    al, al
115
  .loop:
Line -... Line 116...
-
 
116
        lodsb
104
        jz      .done
117
        test    al, al
-
 
118
        jz      .done
-
 
119
        call    print_char
-
 
120
        jmp     .loop
-
 
121
  .done:
-
 
122
        pop     eax
Line 105... Line 123...
105
        mov     bl, al
123
 
106
        call    print_character
124
        ret
107
        jmp     .loop
125
 
108
 
-
 
109
  .done:
126
 
110
        popa
127
;----------------------------------
111
 
128
; print character
112
        ret
129
;
113
 
130
; IN:   al = char to print
114
 
131
; OUT:  /
Line 328... Line 345...
328
if TIMESTAMP
345
if TIMESTAMP
329
print_timestamp:
346
print_timestamp:
Line 330... Line 347...
330
 
347
 
331
        pusha
348
        pusha
-
 
349
        mcall   3                       ; get system time
Line 332... Line 350...
332
        mcall   3                       ; get system time
350
        mov     ebx, eax
333
 
351
 
334
        mov     bl, '['
352
        mov     al, '['
335
        call    print_character
353
        call    print_char
336
        mov     ecx, TIMESTAMP
354
        mov     ecx, TIMESTAMP
337
  .loop:
355
  .loop:
338
        mov     bl, al
356
        mov     al, bl
339
        shr     bl, 4
357
        shr     al, 4
340
        add     bl, '0'
358
        add     al, '0'
341
        call    print_character
359
        call    print_char
342
 
360
 
343
        mov     bl, al
361
        mov     al, bl
344
        and     bl, 0x0f
362
        and     al, 0x0f
Line 345... Line 363...
345
        add     bl, '0'
363
        add     al, '0'
346
        call    print_character
364
        call    print_char
Line 347... Line 365...
347
 
365
 
348
        dec     ecx
366
        dec     ecx
349
        jz      .done
367
        jz      .done
350
 
368
 
351
        mov     bl, ':'
369
        mov     al, ':'
352
        call    print_character
370
        call    print_char
353
        shr     eax, 8
371
        shr     ebx, 8
354
        jmp     .loop
372
        jmp     .loop
355
  .done:
373
  .done:
Line 356... Line 374...
356
        mov     bl, ']'
374
        mov     al, ']'
357
        call    print_character
375
        call    print_char
358
        mov     bl, ' '
376
        mov     al, ' '
359
        call    print_character
377
        call    print_char