Subversion Repositories Kolibri OS

Rev

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

Rev 437 Rev 465
Line 1... Line 1...
1
$Revision: 437 $
1
$Revision: 465 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
5
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
6
;; Distributed under terms of the GNU General Public License    ;;
6
;; Distributed under terms of the GNU General Public License    ;;
Line 18... Line 18...
18
;
18
;
19
;                           16 BIT FUNCTIONS
19
;                           16 BIT FUNCTIONS
20
;
20
;
21
;==========================================================================
21
;==========================================================================
Line 22... Line -...
22
 
-
 
23
; 16-bit data
-
 
24
		org $+0x10000
-
 
25
 
-
 
26
old_ints_h:
-
 
27
        dw      0x400
-
 
28
        dd      0
-
 
29
        dw      0
-
 
30
 
-
 
31
kernel_restart_bootblock:
-
 
32
    db    1    ; version
-
 
33
    dw    1    ; floppy image is in memory
-
 
34
    dd    0    ; cannot save parameters
-
 
35
 
-
 
36
 
-
 
37
align 32
-
 
38
 
-
 
39
; GDT TABLE
-
 
40
 
-
 
41
gdts:
-
 
42
 
-
 
43
        dw     gdte-$-1
-
 
44
        dd     gdts
-
 
45
        dw     0
-
 
46
 
-
 
47
; Attention! The order first four selectors not to change, is used in Fast System Call
-
 
48
; must be : os_code, os_data, app_code, app_data, ....
-
 
49
 
-
 
50
int_code_l:
-
 
51
os_code_l:
-
 
52
        dw     0xffff
-
 
53
        dw     0x0000
-
 
54
        db     0x00
-
 
55
        dw     11011111b *256 +10011010b
-
 
56
        db     0x00
-
 
57
 
-
 
58
int_data_l:
-
 
59
os_data_l:
-
 
60
        dw     0xffff
-
 
61
        dw     0x0000
-
 
62
        db     0x00
-
 
63
        dw     11011111b *256 +10010010b
-
 
64
        db     0x00
-
 
65
 
-
 
66
app_code_l:
-
 
67
        dw 0xFFFF
-
 
68
        dw 0
-
 
69
        db 0
-
 
70
        db cpl3
-
 
71
        dw G32+D32+0x8000+0x7;
-
 
72
 
-
 
73
app_data_l:
-
 
74
        dw 0xFFFF
-
 
75
        dw 0
-
 
76
        db 0
-
 
77
        db drw3
-
 
78
        dw G32+D32+0x8000+0x7;
-
 
79
 
-
 
80
; --------------- APM ---------------------
-
 
81
apm_code_32:
-
 
82
        dw     0x0f        ; limit 64kb
-
 
83
        db     0, 0, 0
-
 
84
        dw     11010000b *256 +10011010b
-
 
85
        db     0x00
-
 
86
apm_code_16:
-
 
87
        dw     0x0f
-
 
88
        db     0, 0, 0
-
 
89
        dw     10010000b *256 +10011010b
-
 
90
        db     0x00
-
 
91
apm_data_16:
-
 
92
        dw     0x0f
-
 
93
        db     0, 0, 0
-
 
94
        dw     10010000b *256 +10010010b
-
 
95
        db     0x00
-
 
96
; -----------------------------------------
-
 
97
 
-
 
98
graph_data_l:
-
 
99
 
-
 
100
        dw     0x7ff
-
 
101
        dw     0x0000
-
 
102
        db     0x00
-
 
103
        dw     11010000b *256 +11110010b
-
 
104
        db     0x00
-
 
105
 
-
 
106
tss0_l:
-
 
107
;      times (max_processes+10) dd 0,0
-
 
108
gdte = $ + (max_processes+10)*8
-
 
109
 
-
 
110
; videomodes table
-
 
111
gr_table:
-
 
112
    dw      0x112+0100000000000000b ,  640 ,  480        ; 1
-
 
113
    dw      0x115+0100000000000000b ,  800 ,  600        ; 2
-
 
114
    dw      0x118+0100000000000000b , 1024 ,  768        ; 3
-
 
115
    dw      0x11B+0100000000000000b , 1280 , 1024        ; 4
-
 
116
    dw      0x112 ,  640 , 480                ; 5
-
 
117
    dw      0x115 ,  800 , 600                ; 6
-
 
118
    dw      0x118 , 1024 , 768                ; 7
-
 
119
    dw      0x11B , 1280 ,1024                ; 8
-
 
120
    dw    0x13, 640, 480                    ; 9
-
 
121
    dw    0x12, 640, 480                    ; 0
-
 
122
 
-
 
123
; table for move to extended memory (int 15h, ah=87h)
-
 
124
       movedesc:
-
 
125
        db      0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
-
 
126
        db      0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
-
 
127
 
-
 
128
        db      0xff,0xff,0x0,0xa0,0x00,0x93,0x0,0x0
-
 
129
        db      0xff,0xff,0x0,0x00,0x10,0x93,0x0,0x0
-
 
130
 
-
 
131
        db      0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
-
 
132
        db      0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
-
 
133
        db      0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
-
 
134
        db      0x00,0x00,0x0,0x00,0x00,0x00,0x0,0x0
-
 
Line 135... Line 22...
135
        	org $-0x10000
22
 
136
 
23
 
137
putchar:
24
putchar:
138
; in: al=character
25
; in: al=character
Line 158... Line 45...
158
    cmp    al, 0
45
    cmp    al, 0
159
    jnz    @b
46
    jnz    @b
160
    popa
47
    popa
161
    ret
48
    ret
Line 162... Line -...
162
 
-
 
163
; Now int 16 is used for keyboard support.
-
 
164
; This is shorter, simpler and more reliable.
-
 
165
if 0
-
 
166
getkey:      push  ecx
-
 
167
             push  edx
-
 
168
             add   ebx,0x0101
-
 
169
             xor   eax,eax
-
 
170
 
-
 
171
           gk1:
-
 
172
             in    al,0x60
-
 
173
             mov   cl,al
-
 
174
           gk0:
-
 
175
             in    al,0x60
-
 
176
             cmp   al,cl
-
 
177
             je    gk0
-
 
178
             cmp   ax,11
-
 
179
             jg    gk0
-
 
180
             gk0_1:
-
 
181
             mov   cl,al
-
 
182
 
-
 
183
;             add   al,47
-
 
184
;             mov   [ds:keyinbs-0x10000],al
-
 
185
;             mov   si,keyinbs-0x10000
-
 
186
;             call  printplain
-
 
187
 
-
 
188
           gk12:
-
 
189
             in    al,0x60
-
 
190
             cmp   al,cl
-
 
191
             je    gk12
-
 
192
             cmp   ax,240
-
 
193
             jne   gk13
-
 
194
             mov   al,cl
-
 
195
             jmp   gk14
-
 
196
           gk13:
-
 
197
             add   cl,128
-
 
198
             cmp   al,cl
-
 
199
             jne   gk1
-
 
200
             sub   al,128
-
 
201
           gk14:
-
 
202
 
-
 
203
             movzx edx,bl
-
 
204
             cmp   eax,edx
-
 
205
             jb    gk1
-
 
206
             movzx edx,bh
-
 
207
             cmp   eax,edx
-
 
208
             jg    gk1
-
 
209
             test  ebx,0x010000
-
 
210
             jnz   gk3
-
 
211
             mov   cx,0x1000
-
 
212
             mov   dx,cx
-
 
213
             add   eax,47
-
 
214
             mov   cx,ax
-
 
215
             cmp   cx,58
-
 
216
             jb    gk_nozero
-
 
217
             sub   cx,10
-
 
218
           gk_nozero:
-
 
219
             mov   [ds:keyin-0x10000],cl
-
 
220
             mov   si,keyin-0x10000
-
 
221
             call  printplain
-
 
222
           gk3:
-
 
223
             sub   eax,48
-
 
224
             pop   edx
-
 
225
             pop   ecx
-
 
226
             ret
-
 
227
end if
-
 
228
 
49
 
229
getkey:
50
getkey:
230
; get number in range [bl,bh] (bl,bh in ['0'..'9'])
51
; get number in range [bl,bh] (bl,bh in ['0'..'9'])
231
; in: bx=range
52
; in: bx=range
232
; out: ax=digit (1..9, 10 for 0)
53
; out: ax=digit (1..9, 10 for 0)
Line 256... Line 77...
256
{
77
{
257
    mov    dx, row*256 + column
78
    mov    dx, row*256 + column
258
    call    setcursor
79
    call    setcursor
259
}
80
}
Line 260... Line -...
260
 
-
 
261
;pagetable_set:
-
 
262
;eax - physical address
-
 
263
;es:di - page table
-
 
264
;ecx - number of pages to map
-
 
265
;    or    al, 7
-
 
266
;@@:
-
 
267
;    stosd
-
 
268
;    add    eax, 1000h
-
 
269
;    loop    @b
-
 
270
;    ret
-
 
271
 
81
 
272
boot_read_floppy:
82
boot_read_floppy:
273
        push    si
83
        push    si
274
        xor     si, si
84
        xor     si, si
275
        mov     ah, 2   ; read
85
        mov     ah, 2   ; read
Line 279... Line 89...
279
        pop     ax
89
        pop     ax
280
        jnc     @f
90
        jnc     @f
281
        inc     si
91
        inc     si
282
        cmp     si, 10
92
        cmp     si, 10
283
        jb      @b
93
        jb      @b
284
        mov     si, badsect-0x10000
94
        mov     si, badsect
285
sayerr_plain:
95
sayerr_plain:
286
        call    printplain
96
        call    printplain
287
        jmp     $
97
        jmp     $
288
@@:
98
@@:
289
        pop     si
99
        pop     si
Line 299... Line 109...
299
start_of_code:
109
start_of_code:
300
    cld
110
    cld
301
; \begin{diamond}[02.12.2005]
111
; \begin{diamond}[02.12.2005]
302
    cmp    ax, 'KL'
112
    cmp    ax, 'KL'
303
    jnz    @f
113
    jnz    @f
304
    mov    word [cs:cfgmanager.loader_block-0x10000], si
114
    mov    word [cs:cfgmanager.loader_block], si
305
    mov    word [cs:cfgmanager.loader_block+2-0x10000], ds
115
    mov    word [cs:cfgmanager.loader_block+2], ds
306
@@:
116
@@:
307
; \end{diamond}[02.12.2005]
117
; \end{diamond}[02.12.2005]
Line 308... Line -...
308
 
-
 
309
 
-
 
310
	mov    word [cs:bx_from_load - 0x10000], bx		; {SPraid}[13.03.2007]
-
 
311
	
-
 
312
	
118
 
313
; set up stack
119
; set up stack
314
    mov    ax, 3000h
120
    mov    ax, 3000h
315
    mov    ss, ax
121
    mov    ss, ax
316
    mov    sp, 0EC00h
122
    mov    sp, 0EC00h
Line 324... Line 130...
324
    mov    ax, 3
130
    mov    ax, 3
325
        int  0x10
131
        int  0x10
Line 326... Line 132...
326
 
132
 
327
if lang eq ru
133
if lang eq ru
328
 ; Load & set russian VGA font (RU.INC)
134
 ; Load & set russian VGA font (RU.INC)
329
        mov  bp,RU_FNT1-10000h   ; RU_FNT1 - First part
135
        mov  bp, RU_FNT1         ; RU_FNT1 - First part
330
          mov  bx,1000h            ; 768 bytes
136
          mov  bx,1000h            ; 768 bytes
331
          mov  cx,30h              ; 48 symbols
137
          mov  cx,30h              ; 48 symbols
332
          mov  dx,80h              ; 128 - position of first symbol
138
          mov  dx,80h              ; 128 - position of first symbol
333
        mov  ax,1100h
139
        mov  ax,1100h
Line 334... Line 140...
334
          int  10h
140
          int  10h
335
 
141
 
336
        mov  bp,RU_FNT2-10000h   ; RU_FNT2 -Second part
142
        mov  bp,RU_FNT2          ; RU_FNT2 -Second part
337
        mov  bx,1000h            ; 512 bytes
143
        mov  bx,1000h            ; 512 bytes
338
        mov  cx,20h              ; 32 symbols
144
        mov  cx,20h              ; 32 symbols
339
        mov  dx,0E0h             ; 224 - position of first symbol
145
        mov  dx,0E0h             ; 224 - position of first symbol
340
        mov  ax,1100h
146
        mov  ax,1100h
341
          int  10h
147
          int  10h
342
 ; End set VGA russian font
148
 ; End set VGA russian font
343
else if lang eq et
149
else if lang eq et
344
        mov  bp,ET_FNT-10000h   ; ET_FNT1
150
        mov  bp,ET_FNT          ; ET_FNT1
345
        mov  bx,1000h           ;
151
        mov  bx,1000h           ;
346
        mov  cx,255             ; 256 symbols
152
        mov  cx,255             ; 256 symbols
347
        mov  dx,0h              ; 0 - position of first symbol
153
        mov  dx,0h              ; 0 - position of first symbol
Line 351... Line 157...
351
 
157
 
352
; draw frames
158
; draw frames
353
    push    0xb800
159
    push    0xb800
354
    pop    es
160
    pop    es
355
    xor    di, di
-
 
356
;        mov  si,d80x25-0x10000
-
 
357
;        mov  cx,80*25
-
 
358
;        mov  ah,1*16+15
-
 
359
;       dfl1:
-
 
360
;        lodsb
-
 
361
;        stosw
-
 
362
;        loop dfl1
161
    xor    di, di
-
 
162
    mov    ah, 1*16+15
363
    mov    ah, 1*16+15
163
 
364
; draw top
164
; draw top
365
    mov    si, d80x25_top - 0x10000
165
    mov    si, d80x25_top
366
    mov    cx, d80x25_top_num * 80
166
    mov    cx, d80x25_top_num * 80
367
@@:
167
@@:
368
    lodsb
168
    lodsb
369
    stosw
169
    stosw
370
    loop    @b
170
    loop    @b
371
; draw spaces
171
; draw spaces
372
    mov    si, space_msg - 0x10000
172
    mov    si, space_msg
373
    mov    cx, 25 - d80x25_top_num - d80x25_bottom_num
173
    mov    cx, 25 - d80x25_top_num - d80x25_bottom_num
374
dfl1:
174
dfl1:
375
    push    cx
175
    push    cx
376
    push    si
176
    push    si
Line 381... Line 181...
381
    loop    @b
181
    loop    @b
382
    pop    si
182
    pop    si
383
    pop    cx
183
    pop    cx
384
    loop    dfl1
184
    loop    dfl1
385
; draw bottom
185
; draw bottom
386
    mov    si, d80x25_bottom - 0x10000
186
    mov    si, d80x25_bottom
387
    mov    cx, d80x25_bottom_num * 80
187
    mov    cx, d80x25_bottom_num * 80
388
@@:
188
@@:
389
    lodsb
189
    lodsb
390
    stosw
190
    stosw
391
    loop    @b
191
    loop    @b
Line 392... Line 192...
392
 
192
 
Line 393... Line 193...
393
    mov    byte [space_msg-0x10000+80], 0    ; now space_msg is null terminated
193
    mov    byte [space_msg+80], 0    ; now space_msg is null terminated
Line 394... Line 194...
394
 
194
 
Line 408... Line 208...
408
        pop     ax
208
        pop     ax
409
        and     ax,bx
209
        and     ax,bx
410
        and     dx,bx
210
        and     dx,bx
411
        cmp     ax,dx
211
        cmp     ax,dx
412
        jnz     cpugood
212
        jnz     cpugood
413
        mov     si,not386-0x10000
213
        mov     si,not386
414
sayerr:
214
sayerr:
415
        call    print
215
        call    print
416
        jmp     $
216
        jmp     $
417
     cpugood:
217
     cpugood:
Line -... Line 218...
-
 
218
 
-
 
219
        push 0
-
 
220
        popf
-
 
221
        sti
418
 
222
 
419
; set up esp
223
; set up esp
Line 420... Line -...
420
    movzx    esp, sp
-
 
421
 
-
 
422
; FLUSH 8042 KEYBOARD CONTROLLER
-
 
423
 
-
 
424
;// mike.dld [
-
 
425
 ;       mov     al,0xED
-
 
426
 ;       out     0x60,al
-
 
427
 ;       or      cx,-1
-
 
428
 ;     @@:
-
 
429
 ;       in      al,0x64
-
 
430
 ;       test    al,2
-
 
431
 ;       jz      @f
-
 
432
 ;       loop    @b
-
 
433
 ;     @@:
-
 
434
 ;       mov     al,0
-
 
435
 ;       out     0x60,al
-
 
436
 ;       or      cx,-1
-
 
437
 ;     @@:
-
 
438
 ;       in      al,0x64
-
 
439
 ;       test    al,2
-
 
440
 ;       jz      @f
-
 
441
 ;       loop    @b
-
 
442
 ;     @@:
-
 
443
;// mike.dld ]
-
 
444
 
-
 
445
;       mov     ecx,10000
-
 
446
;      fl1:
-
 
447
;       in      al,0x64
-
 
448
;       loop    fl1
-
 
449
;       test    al,1
-
 
450
;       jz      fl2
-
 
451
;       in      al,0x60
-
 
452
;       jmp     fl1
-
 
453
;      fl2:
-
 
454
 
-
 
455
;****************************************************************
-
 
456
; The function is modified Mario79
-
 
457
;*****************************************************************
-
 
458
; wait_kbd:        ; variant 1
-
 
459
;       mov      cx,2500h  ;çàäåðæêà ïîðÿäêà 10 ìñåê
-
 
460
; test_kbd:
-
 
461
;       in       al,64h    ;÷èòàåì ñîñòîÿíèå êëàâèàòóðû
-
 
462
;       test     al,2      ;ïðîâåðêà áèòà ãîòîâíîñòè
-
 
463
;       loopnz   test_kbd
224
    movzx    esp, sp
464
 
225
 
465
        push    0
226
        push    0
466
        pop     es
227
        pop     es
467
        and     word [es:0x9031], 0
228
        and     word [es:0x9031], 0
Line 529... Line 290...
529
    mov    [es : 0x9046], cx        ; Save APM flags
290
    mov    [es : 0x9046], cx        ; Save APM flags
Line 530... Line 291...
530
 
291
 
531
    ; Write APM ver ----
292
    ; Write APM ver ----
532
    and    ax, 0xf0f
293
    and    ax, 0xf0f
533
    add    ax, '00'
294
    add    ax, '00'
534
    mov    si, msg_apm - 0x10000
295
    mov    si, msg_apm
535
    mov    [si + 5], ah
296
    mov    [si + 5], ah
536
    mov    [si + 7], al
297
    mov    [si + 7], al
537
    _setcursor 0, 3
298
    _setcursor 0, 3
538
    call    printplain
299
    call    printplain
Line 542... Line 303...
542
    xor    bx, bx
303
    xor    bx, bx
543
    int    0x15
304
    int    0x15
544
    mov    ax, 0x5303            ; Connect 32 bit mode interface
305
    mov    ax, 0x5303            ; Connect 32 bit mode interface
545
    xor    bx, bx
306
    xor    bx, bx
546
    int    0x15
307
    int    0x15
547
    ; init selectors
-
 
548
    movzx    eax, ax ; real-mode segment base address of protected-mode 32-bit code segment
-
 
-
 
308
 
549
    shl    eax, 4
309
    push 0
550
    mov    [apm_code_32 - 0x10000 + 2], ax
-
 
551
    shr    eax, 16
-
 
552
    mov    [apm_code_32 - 0x10000 + 4], al
-
 
553
    movzx    ecx, cx ; real-mode segment base address of protected-mode 16-bit code segment
-
 
554
    shl    ecx, 4
310
    pop es
-
 
311
 
555
    mov    [apm_code_16 - 0x10000 + 2], cx
312
    mov [es:0x9040], ebx
556
    shr    ecx, 16
313
    mov [es:0x9050], ax
557
    mov    [apm_code_16 - 0x10000 + 4], cl
-
 
558
    movzx    edx, dx ; real-mode segment base address of protected-mode 16-bit data segment
-
 
559
    shl    edx, 4
314
    mov [es:0x9052], cx
560
    mov    [apm_data_16 - 0x10000 + 2], dx
-
 
561
    shr    edx, 16
315
    mov [es:0x9054], dx
562
    mov    [apm_data_16 - 0x10000 + 4], dl
-
 
563
    mov    [es : 0x9040], ebx              ; offset of APM entry point
-
 
-
 
316
 
564
apm_end:
317
apm_end:
565
        _setcursor d80x25_top_num, 0
318
        _setcursor d80x25_top_num, 0
566
; -----------------------------------------
-
 
Line 567... Line 319...
567
 
319
 
Line 568... Line 320...
568
; DISPLAY VESA INFORMATION
320
; DISPLAY VESA INFORMATION
569
 
321
 
570
    push    0
322
    push    0
571
    pop    es
323
    pop    es
572
        mov     ax,0x4f00
324
        mov     ax,0x4f00
573
        mov     di,0xa000
325
        mov     di,0xa000
574
        int     0x10
326
        int     0x10
575
        cmp     ax,0x004f
327
        cmp     ax,0x004f
576
        mov    si, novesa-0x10000
328
        mov    si, novesa
577
        jnz    @f
329
        jnz    @f
578
        mov bx, word [es:di+0x12]
330
        mov bx, word [es:di+0x12]
579
        shl ebx,16
331
        shl ebx,16
580
        mov [es:0x9050], ebx
332
        mov [es:0x9050], ebx
581
        mov     ax,[es:di+4]
333
        mov     ax,[es:di+4]
582
        add     ax,'0'*256+'0'
334
        add     ax,'0'*256+'0'
583
        mov    si,vervesa-0x10000
335
        mov    si,vervesa
584
        mov     [si+vervesa_off], ah
336
        mov     [si+vervesa_off], ah
Line 585... Line 337...
585
        mov     [si+vervesa_off+2], al
337
        mov     [si+vervesa_off+2], al
Line 591... Line 343...
591
; a) preboot_graph = graphical mode
343
; a) preboot_graph = graphical mode
592
;    preboot_gprobe = probe this mode?
344
;    preboot_gprobe = probe this mode?
593
; b) preboot_dma_write  = use DMA write?
345
; b) preboot_dma_write  = use DMA write?
594
; c) preboot_vrrm = use VRR?
346
; c) preboot_vrrm = use VRR?
595
; d) preboot_device = from what boot?
347
; d) preboot_device = from what boot?
596
    mov    di, preboot_graph-0x10000
348
    mov    di, preboot_graph
597
; check bootloader block
349
; check bootloader block
598
    cmp    [.loader_block-0x10000], -1
350
    cmp    [.loader_block], -1
599
    jz    .noloaderblock
351
    jz    .noloaderblock
600
    les    bx, [.loader_block-0x10000]
352
    les    bx, [.loader_block]
601
    cmp    byte [es:bx], 1
353
    cmp    byte [es:bx], 1
602
    mov    si, loader_block_error-0x10000
354
    mov    si, loader_block_error
603
    jnz    sayerr
355
    jnz    sayerr
604
    test    byte [es:bx+1], 1
356
    test    byte [es:bx+1], 1
605
    jz    @f
357
    jz    @f
606
; image in memory present
358
; image in memory present
607
    cmp    [di+preboot_device-preboot_graph], 0
359
    cmp    [di+preboot_device-preboot_graph], 0
608
    jnz    @f
360
    jnz    @f
609
    mov    [di+preboot_device-preboot_graph], 3
361
    mov    [di+preboot_device-preboot_graph], 3
610
@@:
362
@@:
611
.noloaderblock:
363
.noloaderblock:
612
; determine default settings
364
; determine default settings
613
    mov    [.bSettingsChanged-0x10000], 0
365
    mov    [.bSettingsChanged], 0
614
    cmp    byte [di], 0
366
    cmp    byte [di], 0
615
    jnz    .preboot_gr_end
367
    jnz    .preboot_gr_end
616
    mov    [di+preboot_gprobe-preboot_graph], 0
368
    mov    [di+preboot_gprobe-preboot_graph], 0
617
    mov    al, [vervesa+vervesa_off-0x10000]
369
    mov    al, [vervesa+vervesa_off]
618
    cmp    al, 'x'
370
    cmp    al, 'x'
619
    jz    .novesa
371
    jz    .novesa
620
    cmp    al, '1'
372
    cmp    al, '1'
621
    jz    .vesa12
373
    jz    .vesa12
622
    mov    [di+preboot_gprobe-preboot_graph], 2
374
    mov    [di+preboot_gprobe-preboot_graph], 2
Line 635... Line 387...
635
    cmp    [di+preboot_vrrm-preboot_graph], 1
387
    cmp    [di+preboot_vrrm-preboot_graph], 1
636
    adc    [di+preboot_vrrm-preboot_graph], 0
388
    adc    [di+preboot_vrrm-preboot_graph], 0
637
    cmp    [di+preboot_device-preboot_graph], 1
389
    cmp    [di+preboot_device-preboot_graph], 1
638
    adc    [di+preboot_device-preboot_graph], 0
390
    adc    [di+preboot_device-preboot_graph], 0
639
; notify user
391
; notify user
640
    mov    si, linef-0x10000
392
    mov    si, linef
641
    call    print
393
    call    print
642
    mov    si, start_msg-0x10000
394
    mov    si, start_msg
643
    call    print
395
    call    print
644
    mov    si, time_msg-0x10000
396
    mov    si, time_msg
645
    call    print
397
    call    print
646
; get start time
398
; get start time
647
    call    .gettime
399
    call    .gettime
648
    mov    [.starttime-0x10000], eax
400
    mov    [.starttime], eax
649
    mov    word [.timer-0x10000], .newtimer
401
    mov    word [.timer], .newtimer
650
    mov    word [.timer-0x10000+2], cs
402
    mov    word [.timer+2], cs
651
.printcfg:
403
.printcfg:
652
    _setcursor 9,0
404
    _setcursor 9,0
653
    mov    si, current_cfg_msg-0x10000
405
    mov    si, current_cfg_msg
654
    call    print
406
    call    print
655
    mov    si, curvideo_msg-0x10000
407
    mov    si, curvideo_msg
656
    call    print
408
    call    print
657
    mov    al, [preboot_graph-0x10000]
409
    mov    al, [preboot_graph]
658
    cmp    al, 8
410
    cmp    al, 8
659
    ja    .pnovesa
411
    ja    .pnovesa
660
    mov    dl, al
412
    mov    dl, al
661
    and    eax, 3
413
    and    eax, 3
662
    mov    si, [modes_msg-0x10000+eax*2]
414
    mov    si, [modes_msg+eax*2]
663
    call    printplain
415
    call    printplain
664
    mov    si, modevesa20-0x10000
416
    mov    si, modevesa20
665
    cmp    dl, 4
417
    cmp    dl, 4
666
    jbe    @f
418
    jbe    @f
667
    mov    si, modevesa12-0x10000
419
    mov    si, modevesa12
668
@@:
420
@@:
669
    call    printplain
421
    call    printplain
670
    cmp    dl, 4
422
    cmp    dl, 4
671
    ja    .x
423
    ja    .x
672
    mov    si, probeno_msg-0x10000
424
    mov    si, probeno_msg
673
    cmp    [preboot_gprobe-0x10000], 2
425
    cmp    [preboot_gprobe], 2
674
    jnz    @f
426
    jnz    @f
675
    mov    si, probeok_msg-0x10000
427
    mov    si, probeok_msg
676
@@:
428
@@:
677
    call    printplain
429
    call    printplain
678
.x:
430
.x:
679
    jmp    .c
431
    jmp    .c
680
.pnovesa:
432
.pnovesa:
681
    cmp    al, 9
433
    cmp    al, 9
682
    mov    si, mode9-0x10000
434
    mov    si, mode9
683
    jz    @b
435
    jz    @b
684
    mov    si, mode10-0x10000
436
    mov    si, mode10
685
    jmp    @b
437
    jmp    @b
686
.c:
438
.c:
687
    mov    si, linef-0x10000
439
    mov    si, linef
688
    call    printplain
440
    call    printplain
689
    mov    si, dma_msg-0x10000
441
    mov    si, dma_msg
690
    cmp    [preboot_dma_write-0x10000], 1
442
    cmp    [preboot_dma_write], 1
691
    call    .say_on_off
443
    call    .say_on_off
692
    mov    si, vrrm_msg-0x10000
444
    mov    si, vrrm_msg
693
    cmp    [preboot_vrrm-0x10000], 1
445
    cmp    [preboot_vrrm], 1
694
    call    .say_on_off
446
    call    .say_on_off
695
    mov    si, preboot_device_msg-0x10000
447
    mov    si, preboot_device_msg
696
    call    print
448
    call    print
697
    mov    al, [preboot_device-0x10000]
449
    mov    al, [preboot_device]
698
    and    eax, 3
450
    and    eax, 3
699
    mov    si, [preboot_device_msgs-0x10000+eax*2]
451
    mov    si, [preboot_device_msgs+eax*2]
700
    call    printplain
452
    call    printplain
701
.wait:
453
.wait:
702
    _setcursor 25,0        ; out of screen
454
    _setcursor 25,0        ; out of screen
703
; set timer interrupt handler
455
; set timer interrupt handler
704
    cli
456
    cli
705
    push    0
457
    push    0
706
    pop    es
458
    pop    es
707
    mov    eax, [es:8*4]
459
    mov    eax, [es:8*4]
708
    mov    [.oldtimer-0x10000], eax
460
    mov    [.oldtimer], eax
709
    mov    eax, [.timer-0x10000]
461
    mov    eax, [.timer]
710
    mov    [es:8*4], eax
462
    mov    [es:8*4], eax
711
    sti
463
    sti
712
; wait for keypressed
464
; wait for keypressed
713
    mov    ah, 0
465
    mov    ah, 0
714
    int    16h
466
    int    16h
715
    push    ax
467
    push    ax
716
; restore timer interrupt
468
; restore timer interrupt
717
    push    0
469
    push    0
718
    pop    es
470
    pop    es
719
    mov    eax, [.oldtimer-0x10000]
471
    mov    eax, [.oldtimer]
720
    mov    [es:8*4], eax
472
    mov    [es:8*4], eax
721
    mov    [.timer-0x10000], eax
473
    mov    [.timer], eax
722
    _setcursor 7,0
474
    _setcursor 7,0
723
    mov    si, space_msg-0x10000
475
    mov    si, space_msg
724
    call    printplain
476
    call    printplain
725
    pop    ax
477
    pop    ax
726
; switch on key
478
; switch on key
727
    cmp    al, 13
479
    cmp    al, 13
728
    jz    .continue
480
    jz    .continue
Line 734... Line 486...
734
    cmp    al, 'c'
486
    cmp    al, 'c'
735
    jz    .change_c
487
    jz    .change_c
736
    cmp    al, 'd'
488
    cmp    al, 'd'
737
    jnz    .wait
489
    jnz    .wait
738
    _setcursor 15,0
490
    _setcursor 15,0
739
    mov     si,bdev-0x10000
491
    mov     si,bdev
740
    call    print
492
    call    print
741
    mov     bx,'13'
493
    mov     bx,'13'
742
    call    getkey
494
    call    getkey
743
    mov    [preboot_device-0x10000], al
495
    mov    [preboot_device], al
744
    _setcursor 13,0
496
    _setcursor 13,0
745
.d:
497
.d:
746
    mov    [.bSettingsChanged-0x10000], 1
498
    mov    [.bSettingsChanged], 1
747
    mov    si, space_msg-0x10000
499
    mov    si, space_msg
748
    call    printplain
500
    call    printplain
749
    _setcursor 15,0
501
    _setcursor 15,0
750
    mov    cx, 6
502
    mov    cx, 6
751
@@:
503
@@:
752
    call    printplain
504
    call    printplain
753
    loop    @b
505
    loop    @b
754
    jmp    .printcfg
506
    jmp    .printcfg
755
.change_a:
507
.change_a:
756
    _setcursor 15,0
508
    _setcursor 15,0
757
    mov    si, gr_mode-0x10000
509
    mov    si, gr_mode
758
    call    printplain
510
    call    printplain
759
    mov     bx, '09'
511
    mov     bx, '09'
760
    call    getkey
512
    call    getkey
761
    mov    [preboot_graph-0x10000], al
513
    mov    [preboot_graph], al
762
    cmp    al, 4
514
    cmp    al, 4
763
    ja    @f
515
    ja    @f
764
    mov    si, probetext-0x10000
516
    mov    si, probetext
765
    call    printplain
517
    call    printplain
766
    mov    bx, '12'
518
    mov    bx, '12'
767
    call    getkey
519
    call    getkey
768
    mov    [preboot_gprobe-0x10000], al
520
    mov    [preboot_gprobe], al
769
@@:
521
@@:
770
    _setcursor 10,0
522
    _setcursor 10,0
771
    jmp    .d
523
    jmp    .d
772
.change_b:
524
.change_b:
773
    _setcursor 15,0
525
    _setcursor 15,0
774
    mov    si, ask_dma-0x10000
526
    mov    si, ask_dma
775
    call    print
527
    call    print
776
    mov    bx, '12'
528
    mov    bx, '12'
777
    call    getkey
529
    call    getkey
778
    mov    [preboot_dma_write-0x10000], al
530
    mov    [preboot_dma_write], al
779
    _setcursor 11,0
531
    _setcursor 11,0
780
    jmp    .d
532
    jmp    .d
781
.change_c:
533
.change_c:
782
    _setcursor 15,0
534
    _setcursor 15,0
783
    mov    si, vrrmprint-0x10000
535
    mov    si, vrrmprint
784
    call    print
536
    call    print
785
    mov    bx, '12'
537
    mov    bx, '12'
786
    call    getkey
538
    call    getkey
787
    mov    [preboot_vrrm-0x10000], al
539
    mov    [preboot_vrrm], al
788
    _setcursor 12,0
540
    _setcursor 12,0
789
    jmp    .d
541
    jmp    .d
790
.say_on_off:
542
.say_on_off:
791
    pushf
543
    pushf
792
    call    print
544
    call    print
793
    mov    si, on_msg-0x10000
545
    mov    si, on_msg
794
    popf
546
    popf
795
    jz    @f
547
    jz    @f
796
    mov    si, off_msg-0x10000
548
    mov    si, off_msg
797
@@:    call    printplain
549
@@:    call    printplain
798
    ret
550
    ret
799
; novesa and vervesa strings are not used at the moment of executing this code
551
; novesa and vervesa strings are not used at the moment of executing this code
800
virtual at novesa
552
virtual at novesa
801
.oldtimer dd ?
553
.oldtimer dd ?
802
.starttime dd ?
554
.starttime dd ?
803
.bSettingsChanged db ?
555
.bSettingsChanged db ?
804
.timer dd ?
556
.timer dd ?
805
end virtual
557
end virtual
806
	org $+0x10000
-
 
807
.loader_block dd -1
558
.loader_block dd -1
808
	org $-0x10000
-
 
809
.gettime:
559
.gettime:
810
    mov    ah, 0
560
    mov    ah, 0
811
    int    1Ah
561
    int    1Ah
812
    xchg    ax, cx
562
    xchg    ax, cx
813
    shl    eax, 10h
563
    shl    eax, 10h
Line 816... Line 566...
816
.newtimer:
566
.newtimer:
817
    push    ds
567
    push    ds
818
    push    cs
568
    push    cs
819
    pop    ds
569
    pop    ds
820
    pushf
570
    pushf
821
    call    [.oldtimer-0x10000]
571
    call    [.oldtimer]
822
    pushad
572
    pushad
823
    call    .gettime
573
    call    .gettime
824
    sub    eax, [.starttime-0x10000]
574
    sub    eax, [.starttime]
825
    sub    ax, 18*5
575
    sub    ax, 18*5
826
    jae    .timergo
576
    jae    .timergo
827
    neg    ax
577
    neg    ax
828
    add    ax, 18-1
578
    add    ax, 18-1
829
    mov    bx, 18
579
    mov    bx, 18
Line 836... Line 586...
836
    jae    @f
586
    jae    @f
837
    cmp    al, 1
587
    cmp    al, 1
838
    mov    cl, 'ã'
588
    mov    cl, 'ã'
839
    jz    @f
589
    jz    @f
840
    mov    cl, 'ë'
590
    mov    cl, 'ë'
841
@@:    mov    [time_str+9-0x10000], cl
591
@@:    mov    [time_str+9], cl
842
else if lang eq et
592
else if lang eq et
843
    cmp    al, 1
593
    cmp    al, 1
844
    ja     @f
594
    ja     @f
845
    mov    [time_str+9-0x10000], ' '
595
    mov    [time_str+9], ' '
846
    mov    [time_str+10-0x10000],' '
596
    mov    [time_str+10],' '
847
@@:
597
@@:
848
else
598
else
849
; wait 5/4/3/2 seconds, 1 second
599
; wait 5/4/3/2 seconds, 1 second
850
    cmp    al, 1
600
    cmp    al, 1
851
    mov    cl, 's'
601
    mov    cl, 's'
852
    ja    @f
602
    ja    @f
853
    mov    cl, ' '
603
    mov    cl, ' '
854
@@:    mov    [time_str+9-0x10000], cl
604
@@:    mov    [time_str+9], cl
855
end if
605
end if
856
    add    al, '0'
606
    add    al, '0'
857
    mov    [time_str+1-0x10000], al
607
    mov    [time_str+1], al
858
    mov    si, time_msg-0x10000
608
    mov    si, time_msg
859
    _setcursor 7,0
609
    _setcursor 7,0
860
    call    print
610
    call    print
861
    _setcursor 25,0
611
    _setcursor 25,0
862
    popad
612
    popad
863
    pop    ds
613
    pop    ds
864
    iret
614
    iret
865
.timergo:
615
.timergo:
866
    push    0
616
    push    0
867
    pop    es
617
    pop    es
868
    mov    eax, [.oldtimer-0x10000]
618
    mov    eax, [.oldtimer]
869
    mov    [es:8*4], eax
619
    mov    [es:8*4], eax
870
    mov    sp, 0EC00h
620
    mov    sp, 0EC00h
871
.continue:
621
.continue:
872
    sti
622
    sti
873
    _setcursor 6,0
623
    _setcursor 6,0
874
    mov    si, space_msg-0x10000
624
    mov    si, space_msg
875
    call    printplain
625
    call    printplain
876
    call    printplain
626
    call    printplain
877
    _setcursor 6,0
627
    _setcursor 6,0
878
    mov    si, loading_msg-0x10000
628
    mov    si, loading_msg
879
    call    print
629
    call    print
880
    _setcursor 15,0
630
    _setcursor 15,0
881
    cmp    [.bSettingsChanged-0x10000], 0
631
    cmp    [.bSettingsChanged], 0
882
    jz    .load
632
    jz    .load
883
    cmp    [.loader_block-0x10000], -1
633
    cmp    [.loader_block], -1
884
    jz    .load
634
    jz    .load
885
    les    bx, [.loader_block-0x10000]
635
    les    bx, [.loader_block]
886
    mov    eax, [es:bx+3]
636
    mov    eax, [es:bx+3]
887
    push    ds
637
    push    ds
888
    pop    es
638
    pop    es
889
    test    eax, eax
639
    test    eax, eax
890
    jz    .load
640
    jz    .load
891
    push    eax
641
    push    eax
892
    mov    si, save_quest-0x10000
642
    mov    si, save_quest
893
    call    print
643
    call    print
894
.waityn:
644
.waityn:
895
    mov    ah, 0
645
    mov    ah, 0
896
    int    16h
646
    int    16h
897
    or    al, 20h
647
    or    al, 20h
898
    cmp    al, 'n'
648
    cmp    al, 'n'
899
    jz    .loadc
649
    jz    .loadc
900
    cmp    al, 'y'
650
    cmp    al, 'y'
901
    jnz    .waityn
651
    jnz    .waityn
902
    call    putchar
652
    call    putchar
903
    mov    byte [space_msg-0x10000+80], 186
653
    mov    byte [space_msg+80], 186
904
    pop    eax
654
    pop    eax
905
    push    cs
655
    push    cs
906
    push    .cont
656
    push    .cont
907
    push    eax
657
    push    eax
908
    retf
658
    retf
909
.loadc:
659
.loadc:
910
    pop    eax
660
    pop    eax
911
.cont:
661
.cont:
912
    push    cs
662
    push    cs
913
    pop    ds
663
    pop    ds
914
    mov    si, space_msg-0x10000
664
    mov    si, space_msg
915
    mov    byte [si+80], 0
665
    mov    byte [si+80], 0
916
    _setcursor 15,0
666
    _setcursor 15,0
917
    call    printplain
667
    call    printplain
918
    _setcursor 15,0
668
    _setcursor 15,0
919
.load:
669
.load:
920
; \end{diamond}[02.12.2005]
670
; \end{diamond}[02.12.2005]
Line 921... Line 671...
921
 
671
 
Line 922... Line 672...
922
; ASK GRAPHICS MODE
672
; ASK GRAPHICS MODE
923
 
673
 
924
    movzx    ax, [preboot_graph-0x10000]
674
    movzx    ax, [preboot_graph]
925
    push    0
675
    push    0
926
    pop    es
676
    pop    es
927
; address is gr_table+6*(ax-1)-0x10000
677
; address is gr_table+6*(ax-1)
928
        add    ax, ax
678
        add    ax, ax
929
        lea    si, [gr_table-0x10000 + eax + eax*2 - 6]
679
        lea    si, [gr_table + eax + eax*2 - 6]
930
        mov     bx,[si+0]
680
        mov     bx,[si+0]
931
        mov     cx,[si+2]
681
        mov     cx,[si+2]
932
        mov     dx,[si+4]
682
        mov     dx,[si+4]
Line 943... Line 693...
943
        jz    nov
693
        jz    nov
Line 944... Line 694...
944
 
694
 
Line 945... Line 695...
945
; USE DEFAULTS OR PROBE
695
; USE DEFAULTS OR PROBE
946
 
696
 
947
; bx - mode : cx - x size : dx - y size
697
; bx - mode : cx - x size : dx - y size
Line 948... Line 698...
948
    cmp    [preboot_gprobe-0x10000], 1
698
    cmp    [preboot_gprobe], 1
949
    jz    noprobe
699
    jz    noprobe
950
 
700
 
951
        mov     bx,0x100
701
        mov     bx,0x100
952
     newprobe:
702
     newprobe:
953
        inc     bx
703
        inc     bx
Line 954... Line 704...
954
        cmp     bx,0x17f
704
        cmp     bx,0x17f
955
        mov    si,prnotfnd-0x10000
705
        mov    si,prnotfnd
956
        jz    sayerr
706
        jz    sayerr
Line 997... Line 747...
997
        ; BPP
747
        ; BPP
998
        mov     al,byte [es:di+0x19]
748
        mov     al,byte [es:di+0x19]
999
        mov     [es:0x9000],al
749
        mov     [es:0x9000],al
1000
       nov:
750
       nov:
1001
        cmp     al,24
751
        cmp     al,24
1002
        mov    si,bt24-0x10000
752
        mov    si,bt24
1003
        jz    bppl
753
        jz    bppl
1004
        cmp     al,32
754
        cmp     al,32
1005
        mov     si,bt32-0x10000
755
        mov     si,bt32
1006
        jz     bppl
756
        jz     bppl
1007
        mov     si,btns-0x10000
757
        mov     si,btns
1008
        jmp    sayerr
758
        jmp    sayerr
1009
       bppl:
759
       bppl:
1010
        call    print
760
        call    print
Line 1031... Line 781...
1031
; force yes
781
; force yes
1032
        mov     [es:0x901C], byte 1
782
        mov     [es:0x901C], byte 1
Line 1033... Line 783...
1033
 
783
 
Line 1034... Line 784...
1034
; DMA WRITE
784
; DMA WRITE
1035
 
785
 
Line 1036... Line 786...
1036
        mov     al, [preboot_dma_write-0x10000]
786
        mov     al, [preboot_dma_write]
Line 1037... Line 787...
1037
        mov     [es:0x901F],al
787
        mov     [es:0x901F],al
1038
 
788
 
1039
; VRR_M USE
789
; VRR_M USE
Line 1040... Line 790...
1040
 
790
 
Line 1041... Line 791...
1041
        mov     al,[preboot_vrrm-0x10000]
791
        mov     al,[preboot_vrrm]
1042
        mov     [es:0x9030],al
792
        mov     [es:0x9030],al
1043
        mov     [es:0x901E],byte 1
793
        mov     [es:0x901E],byte 1
Line 1044... Line 794...
1044
 
794
 
Line 1045... Line 795...
1045
; BOOT DEVICE
795
; BOOT DEVICE
1046
 
796
 
1047
    mov    al, [preboot_device-0x10000]
797
    mov    al, [preboot_device]
1048
        dec     al
798
        dec     al
1049
        mov     [boot_dev-0x10000],al
799
        mov     [boot_dev],al
1050
 
800
 
1051
; READ DISKETTE TO MEMORY
801
; READ DISKETTE TO MEMORY
1052
 
802
 
Line 1063... Line 813...
1063
        xor     dx, dx          ; starthead,drive
813
        xor     dx, dx          ; starthead,drive
1064
        mov     al, 1+9         ; no of sectors to read
814
        mov     al, 1+9         ; no of sectors to read
1065
        mov     bx, 0xB000      ; es:bx -> data area
815
        mov     bx, 0xB000      ; es:bx -> data area
1066
        call    boot_read_floppy
816
        call    boot_read_floppy
1067
; and copy them to extended memory
817
; and copy them to extended memory
1068
        mov     si, movedesc-0x10000
818
        mov     si, movedesc
1069
        mov     [si+8*2+3], bh
819
        mov     [si+8*2+3], bh
1070
        push    es
820
        push    es
1071
        push    ds
821
        push    ds
1072
        pop     es
822
        pop     es
1073
        mov     cx, 256*10
823
        mov     cx, 256*10
Line 1077... Line 827...
1077
        jz      @f
827
        jz      @f
1078
sayerr_floppy:
828
sayerr_floppy:
1079
        mov     dx, 0x3f2
829
        mov     dx, 0x3f2
1080
        mov     al, 0
830
        mov     al, 0
1081
        out     dx, al
831
        out     dx, al
1082
        mov     si, memmovefailed-0x10000
832
        mov     si, memmovefailed
1083
        jmp     sayerr_plain
833
        jmp     sayerr_plain
1084
@@:
834
@@:
1085
        add     dword [si+8*3+2], 512*10
835
        add     dword [si+8*3+2], 512*10
1086
; copy FAT to second copy
836
; copy FAT to second copy
1087
        mov     byte [si+8*2+3], 0xB2
837
        mov     byte [si+8*2+3], 0xB2
Line 1166... Line 916...
1166
        mul     cx
916
        mul     cx
1167
        div     bp
917
        div     bp
1168
        aam
918
        aam
1169
        xchg    al, ah
919
        xchg    al, ah
1170
        add     ax, '00'
920
        add     ax, '00'
1171
        mov     si, pros-0x10000
921
        mov     si, pros
1172
        cmp     [si], ax
922
        cmp     [si], ax
1173
        jz      @f
923
        jz      @f
1174
        mov     [si], ax
924
        mov     [si], ax
1175
        call    printplain
925
        call    printplain
1176
@@:
926
@@:
Line 1244... Line 994...
1244
;        dec     ax
994
;        dec     ax
1245
;        push    ax
995
;        push    ax
1246
;        jnz     reads
996
;        jnz     reads
1247
;       readdone:
997
;       readdone:
1248
;        pop     ax
998
;        pop     ax
-
 
999
 
1249
        mov     si,backspace2-0x10000
1000
        mov     si,backspace2
1250
        call    printplain
1001
        call    printplain
1251
        mov     si,okt-0x10000
1002
        mov     si,okt
1252
        call    printplain
1003
        call    printplain
1253
       no_sys_on_floppy:
1004
       no_sys_on_floppy:
1254
        xor    ax, ax        ; reset drive
1005
        xor    ax, ax        ; reset drive
1255
        xor    dx, dx
1006
        xor    dx, dx
1256
        int     0x13
1007
        int     0x13
Line 1272... Line 1023...
1272
        je      setgr
1023
        je      setgr
1273
        mov     ax,0x4f02            ; Vesa
1024
        mov     ax,0x4f02            ; Vesa
1274
setgr:
1025
setgr:
1275
        int     0x10
1026
        int     0x10
1276
        test    ah,ah
1027
        test    ah,ah
1277
        mov    si, fatalsel-0x10000
1028
        mov    si, fatalsel
1278
        jnz    sayerr
1029
        jnz    sayerr
1279
; set mode 0x12 graphics registers:
1030
; set mode 0x12 graphics registers:
1280
        cmp     bx,0x12
1031
        cmp     bx,0x12
1281
        jne     gmok2
1032
        jne     gmok2
Line 1300... Line 1051...
1300
        out     dx,al      ; select GDC bit mask register
1051
        out     dx,al      ; select GDC bit mask register
1301
                           ; for writes to 0x03cf
1052
                           ; for writes to 0x03cf
1302
gmok2:
1053
gmok2:
1303
        push    ds
1054
        push    ds
1304
        pop    es
1055
        pop    es
1305
-