-
Notifications
You must be signed in to change notification settings - Fork 7
/
8086_bios_and_dos_interrupts.html
executable file
·2080 lines (1186 loc) · 51.8 KB
/
8086_bios_and_dos_interrupts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<HTML>
<HEAD>
<TITLE>basic 8086 and dos interrupts that are currently supported by the emulator</TITLE>
<META name="description" content="interrupts currently supported by the 8086 emulator">
</HEAD>
<BODY>
<!-- START INSERT -->
<FONT FACE="Verdana" SIZE=3>
<A NAME="top1"> </A>
<HR>
<BR>
Quick reference:<BR><BR>
<FONT FACE="Fixedsys">
<TABLE WIDTH=100%>
<TR>
<TD>
<A HREF="#int10h_00h">INT 10h/00h</A><BR>
<A HREF="#int10h_01h">INT 10h/01h</A><BR>
<A HREF="#int10h_02h">INT 10h/02h</A><BR>
<A HREF="#int10h_03h">INT 10h/03h</A><BR>
<A HREF="#int10h_05h">INT 10h/05h</A><BR>
<A HREF="#int10h_06h">INT 10h/06h</A><BR>
<A HREF="#int10h_07h">INT 10h/07h</A><BR>
<A HREF="#int10h_08h">INT 10h/08h</A><BR>
<A HREF="#int10h_09h">INT 10h/09h</A><BR>
<A HREF="#int10h_0Ah">INT 10h/0Ah</A><BR>
<A HREF="#int10h_0Ch">INT 10h/0Ch</A><BR>
<A HREF="#int10h_0Dh">INT 10h/0Dh</A><BR>
<A HREF="#int10h_0Eh">INT 10h/0Eh</A><BR>
<A HREF="#int10h_13h">INT 10h/13h</A><BR>
</TD>
<TD>
<A HREF="#int10h_1003h">INT 10h/1003h</A><BR>
<A HREF="#int11h">INT 11h</A><BR>
<A HREF="#int12h">INT 12h</A><BR>
<A HREF="#int13h_00h">INT 13h/00h</A><BR>
<A HREF="#int13h_02h">INT 13h/02h</A><BR>
<A HREF="#int13h_03h">INT 13h/03h</A><BR>
<A HREF="#int15h_86h">INT 15h/86h</A><BR>
<A HREF="#int16h_00h">INT 16h/00h</A><BR>
<A HREF="#int16h_01h">INT 16h/01h</A><BR>
<A HREF="#int19h">INT 19h</A><BR>
<A HREF="#int1Ah_00h">INT 1Ah/00h</A><BR>
<A HREF="#int20h">INT 20h</A><BR>
</TD>
<TD>
<A HREF="#int21h">INT 21h</A><BR>
<A HREF="#int21h_01h">INT 21h/01h</A><BR>
<A HREF="#int21h_02h">INT 21h/02h</A><BR>
<A HREF="#int21h_05h">INT 21h/05h</A><BR>
<A HREF="#int21h_06h">INT 21h/06h</A><BR>
<A HREF="#int21h_07h">INT 21h/07h</A><BR>
<A HREF="#int21h_09h">INT 21h/09h</A><BR>
<A HREF="#int21h_0Ah">INT 21h/0Ah</A><BR>
<A HREF="#int21h_0Bh">INT 21h/0Bh</A><BR>
<A HREF="#int21h_0Ch">INT 21h/0Ch</A><BR>
<A HREF="#int21h_0Eh">INT 21h/0Eh</A><BR>
<A HREF="#int21h_19h">INT 21h/19h</A><BR>
<A HREF="#int21h_25h">INT 21h/25h</A><BR>
<A HREF="#int21h_2Ah">INT 21h/2Ah</A><BR>
<A HREF="#int21h_2Ch">INT 21h/2Ch</A><BR>
</TD>
<TD>
<A HREF="#int21h_35h">INT 21h/35h</A><BR>
<A HREF="#int21h_39h">INT 21h/39h</A><BR>
<A HREF="#int21h_3Ah">INT 21h/3Ah</A><BR>
<A HREF="#int21h_3Bh">INT 21h/3Bh</A><BR>
<A HREF="#int21h_3Ch">INT 21h/3Ch</A><BR>
<A HREF="#int21h_3Dh">INT 21h/3Dh</A><BR>
<A HREF="#int21h_3Eh">INT 21h/3Eh</A><BR>
<A HREF="#int21h_3Fh">INT 21h/3Fh</A><BR>
<A HREF="#int21h_40h">INT 21h/40h</A><BR>
<A HREF="#int21h_41h">INT 21h/41h</A><BR>
<A HREF="#int21h_42h">INT 21h/42h</A><BR>
<A HREF="#int21h_47h">INT 21h/47h</A><BR>
<A HREF="#int21h_4Ch">INT 21h/4Ch</A><BR>
<A HREF="#int21h_56h">INT 21h/56h</A><BR>
</TD>
<TD>
<A HREF="#int33h_0000h">INT 33h/0000h</A><BR>
<A HREF="#int33h_0001h">INT 33h/0001h</A><BR>
<A HREF="#int33h_0002h">INT 33h/0002h</A><BR>
<A HREF="#int33h_0003h">INT 33h/0003h</A><BR>
</TD>
</TR>
</TABLE>
</FONT>
<BR><BR>
<HR>
<BR>
the short list of supported interrupts with descriptions:<BR><BR>
<A NAME="int10h_00h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 0</B> - set video mode.<BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = desired video mode.<BR>
<BR>
these video modes are supported:<br><br>
<b>00h</b> - text mode. 40x25. 16 colors. 8 pages.<br><br>
<b>03h</b> - text mode. 80x25. 16 colors. 8 pages.<br><br>
<b>13h</b> - graphical mode. 40x25. 256 colors. 320x200 pixels. 1 page.
</BLOCKQUOTE>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>al</font>, 13h
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 0
<font color=#0000FF>int</font> 10h
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_01h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 01h</B> - set text-mode cursor shape.<BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>CH</B> = cursor start line (bits 0-4) and options (bits 5-7).<BR>
<B>CL</B> = bottom cursor line (bits 0-4).<BR>
<BR>
when bit 5 of CH is set to <B>0</B>, the cursor is visible.
when bit 5 is <B>1</B>, the cursor is not visible.
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#008000>; hide blinking text cursor: </font>
<font color=#0000FF>mov</font> <font color=#C80000>ch</font>, 32
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 1
<font color=#0000FF>int</font> 10h
<font color=#008000>; show standard blinking text cursor: </font>
<font color=#0000FF>mov</font> <font color=#C80000>ch</font>, 6
<font color=#0000FF>mov</font> <font color=#C80000>cl</font>, 7
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 1
<font color=#0000FF>int</font> 10h
<font color=#008000>; show box-shaped blinking text cursor: </font>
<font color=#0000FF>mov</font> <font color=#C80000>ch</font>, 0
<font color=#0000FF>mov</font> <font color=#C80000>cl</font>, 7
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 1
<font color=#0000FF>int</font> 10h
<font color=#008000>; note: some bioses required CL to be >=7,
; otherwise wrong cursor shapes are displayed. </font>
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_02h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 2</B> - set cursor position.<BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>DH</B> = row.<BR>
<B>DL</B> = column.<BR>
<B>BH</B> = page number (0..7).<BR>
</BLOCKQUOTE>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>dh</font>, 10
<font color=#0000FF>mov</font> <font color=#C80000>dl</font>, 20
<font color=#0000FF>mov</font> <font color=#C80000>bh</font>, 0
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 2
<font color=#0000FF>int</font> 10h
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_03h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 03h</B> - get cursor position and size.<BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>BH</B> = page number.<BR>
<I>return:</I><BR>
<B>DH</B> = row.<BR>
<B>DL</B> = column.<BR>
<B>CH</B> = cursor start line.<BR>
<B>CL</B> = cursor bottom line.<BR>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_05h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 05h</B> - select active video page.<BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = new page number (0..7).<BR>
the activated page is displayed.
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_06h"> </A>
<A NAME="int10h_07h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 06h</B> - scroll up window.<BR>
<B>INT 10h</B> / <B>AH = 07h</B> - scroll down window.<BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = number of lines by which to scroll (00h = clear entire window).<BR>
<B>BH</B> = <A HREF="#attrib">attribute</A> used to write blank lines at bottom of window.<BR>
<B>CH, CL</B> = row, column of window's upper left corner.<BR>
<B>DH, DL</B> = row, column of window's lower right corner.<BR>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_08h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 08h</B> - read character and <A HREF="#attrib">attribute</A> at cursor position.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>BH</B> = page number.<BR>
<I>return:</I><BR>
<B>AH</B> = <A HREF="#attrib">attribute</A>.<BR>
<B>AL</B> = character.<BR>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_09h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 09h</B> - write character and <A HREF="#attrib">attribute</A> at cursor position.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = character to display.<BR>
<B>BH</B> = page number.<BR>
<B>BL</B> = <A HREF="#attrib">attribute</A>.<BR>
<B>CX</B> = number of times to write character.<BR>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_0Ah"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 0Ah</B> - write character only at cursor position.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = character to display.<BR>
<B>BH</B> = page number.<BR>
<B>CX</B> = number of times to write character.<BR>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_0Ch"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 0Ch</B> - change color for a single pixel.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = pixel color<BR>
<B>CX</B> = column.<BR>
<B>DX</B> = row.<BR>
</BLOCKQUOTE>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>al</font>, 13h
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 0
<font color=#0000FF>int</font> 10h <font color=#008000>; set graphics video mode. </font>
<font color=#0000FF>mov</font> <font color=#C80000>al</font>, 1100b
<font color=#0000FF>mov</font> <font color=#C80000>cx</font>, 10
<font color=#0000FF>mov</font> <font color=#C80000>dx</font>, 20
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 0ch
<font color=#0000FF>int</font> 10h <font color=#008000>; set pixel. </font>
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_0Dh"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 0Dh</B> - get color of a single pixel.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>CX</B> = column.<BR>
<B>DX</B> = row.<BR>
<I>output:</I><BR>
<B>AL</B> = pixel color<BR>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_0Eh"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 0Eh</B> - teletype output.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = character to write.
</BLOCKQUOTE>
this functions displays a character on the screen,
advancing the cursor and scrolling the screen as necessary.
the printing is always done to current active page.
<BR><BR>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>al</font>, <font color=#800080>'a'</font>
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 0eh
<font color=#0000FF>int</font> 10h
<font color=#008000>; note: on specific systems this
; function may not be supported in graphics mode. </font>
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_13h"> </A>
<HR>
<B>INT 10h</B> / <B>AH = 13h</B> - write string.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>AL</B> = write mode:<BR>
<B>bit 0</B>: update cursor after writing;<BR>
<B>bit 1</B>: string contains <A HREF="#attrib">attributes</A>.<BR>
<B>BH</B> = page number.<BR>
<B>BL</B> = <A HREF="#attrib">attribute</A> if string contains only characters (bit 1 of AL is zero).<BR>
<B>CX</B> = number of characters in string (attributes are not counted).<BR>
<B>DL,DH</B> = column, row at which to start writing.<BR>
<B>ES:BP</B> points to string to be printed.
</BLOCKQUOTE>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>al</font>, 1
<font color=#0000FF>mov</font> <font color=#C80000>bh</font>, 0
<font color=#0000FF>mov</font> <font color=#C80000>bl</font>, 0011_1011b
<font color=#0000FF>mov</font> <font color=#C80000>cx</font>, msg1end <font color=#0064C8>-</font> <font color=#000064>offset</font> msg1 <font color=#008000>; calculate message size. </font>
<font color=#0000FF>mov</font> <font color=#C80000>dl</font>, 10
<font color=#0000FF>mov</font> <font color=#C80000>dh</font>, 7
<font color=#0000FF>push</font> <font color=#800000>cs</font>
<font color=#0000FF>pop</font> <font color=#800000>es</font>
<font color=#0000FF>mov</font> <font color=#C80000>bp</font>, <font color=#000064>offset</font> msg1
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 13h
<font color=#0000FF>int</font> 10h
<font color=#0000FF>jmp</font> msg1end
msg1 <font color=#000064>db</font> <font color=#800080>" hello, world! "</font>
msg1end:
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int10h_1003h"> </A>
<HR>
<B>INT 10h</B> / <B>AX = 1003h</B> - toggle intensity/blinking.<BR><BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<B>BL</B> = write mode:<BR>
<B>0</B>: enable intensive colors.<BR>
<B>1</B>: enable blinking (not supported by the emulator and windows command prompt).<BR>
<B>BH</B> = 0 (to avoid problems on some adapters).<BR>
</BLOCKQUOTE>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>ax</font>, 1003h
<font color=#0000FF>mov</font> <font color=#C80000>bx</font>, 0
<font color=#0000FF>int</font> 10h
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<HR>
<A NAME="attrib"> </A><BR>
<B>bit color table:</B><BR>
character attribute is 8 bit value, low 4 bits set fore color, high 4 bits
set background color.<BR>
note: the emulator and windows command line prompt do not support background blinking, however to make colors look the same in dos and in full screen mode it is required to turn off the background blinking.<BR>
<PRE><FONT FACE="Fixedsys">
HEX BIN COLOR
0 0000 black
1 0001 blue
2 0010 green
3 0011 cyan
4 0100 red
5 0101 magenta
6 0110 brown
7 0111 light gray
8 1000 dark gray
9 1001 light blue
A 1010 light green
B 1011 light cyan
C 1100 light red
D 1101 light magenta
E 1110 yellow
F 1111 white
</FONT></PRE>
note:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#008000>; use this code for compatibility with dos/cmd prompt full screen mode: </font>
<font color=#0000FF>mov</font> <font color=#C80000>ax</font>, 1003h
<font color=#0000FF>mov</font> <font color=#C80000>bx</font>, 0 <font color=#008000>; disable blinking. </font>
<font color=#0000FF>int</font> 10h
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int11h"> </A>
<HR>
<BR>
<B>INT 11h</B> - get BIOS equipment list.<BR>
<BLOCKQUOTE>
<I>return:</I><BR>
<B>AX</B> = BIOS equipment list word, actually this call returns
the contents of the word at 0040h:0010h.<BR><BR>
Currently this function can be used to determine the number
of installed number of floppy disk drives.
<PRE><FONT FACE="Fixedsys">
Bit fields for BIOS-detected installed hardware:
bit(s) Description
15-14 Number of parallel devices.
13 Reserved.
12 Game port installed.
11-9 Number of serial devices.
8 Reserved.
7-6 Number of floppy disk drives (minus 1):
00 single floppy disk;
01 two floppy disks;
10 three floppy disks;
11 four floppy disks.
5-4 Initial video mode:
00 EGA,VGA,PGA, or other with on-board video BIOS;
01 40x25 CGA color.
10 80x25 CGA color (emulator default).
11 80x25 mono text.
3 Reserved.
2 PS/2 mouse is installed.
1 Math coprocessor installed.
0 Set when booted from floppy.
</FONT></PRE>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int12h"> </A>
<HR>
<BR>
<B>INT 12h</B> - get memory size.<BR>
<BLOCKQUOTE>
<I>return:</I><BR>
<B>AX</B> = kilobytes of contiguous
memory starting at absolute
address 00000h, this call returns
the contents of the word
at 0040h:0013h.
</BLOCKQUOTE>
<HR>
<BR>
<B>Floppy drives are emulated using</B> <I>FLOPPY_0(..3)</I> <B>files.</B>
<BR><BR>
<A NAME="int13h_00h"> </A>
<HR>
<BR>
<B>INT 13h</B> / <B>AH = 00h</B> - reset disk system.
<BR><BR>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int13h_02h"> </A>
<A NAME="int13h_03h"> </A>
<HR>
<BR>
<B>INT 13h</B> / <B>AH = 02h</B> - read disk sectors into memory.<BR>
<B>INT 13h</B> / <B>AH = 03h</B> - write disk sectors.<BR>
<BLOCKQUOTE>
<I>input:</I><BR>
<BLOCKQUOTE>
<B>AL</B> = number of sectors to read/write (must be nonzero)<BR>
<B>CH</B> = cylinder number (0..79).<BR>
<B>CL</B> = sector number (1..18).<BR>
<B>DH</B> = head number (0..1).<BR>
<B>DL</B> = drive number (0..3 , for the emulator it depends on quantity of FLOPPY_ files).<BR>
<B>ES:BX</B> points to data buffer.<BR>
</BLOCKQUOTE>
<I>return:</I><BR>
<BLOCKQUOTE>
<B>CF</B> set on error.<BR>
<B>CF</B> clear if successful.<BR>
<B>AH</B> = status (0 - if successful).<BR>
<B>AL</B> = number of sectors transferred. <BR>
</BLOCKQUOTE>
Note: each sector has <B>512</B> bytes.
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int15h_86h"> </A>
<HR>
<BR>
<B>INT 15h</B> / <B>AH = 86h</B> - BIOS wait function.
<BLOCKQUOTE>
<I>input:</I><BR>
<BLOCKQUOTE>
<B>CX:DX</B> = interval in microseconds
</BLOCKQUOTE>
<I>return:</I><BR>
<BLOCKQUOTE>
<B>CF</B> clear if successful (wait interval elapsed),<BR>
<B>CF</B> set on error or when wait function is already in progress.
</BLOCKQUOTE>
<BR>
<I>Note:</I>
<BLOCKQUOTE>
the resolution of the wait period is 977 microseconds
on many systems (1 million microseconds - 1 second).
<BR>
Windows XP does not support this interrupt (always sets CF=1).
</BLOCKQUOTE>
</BLOCKQUOTE>
<BR>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int16h_00h"> </A>
<HR>
<BR>
<B>INT 16h</B> / <B>AH = 00h</B> - get keystroke from keyboard (no echo).<BR>
<BLOCKQUOTE>
<I>return:</I><BR>
<BLOCKQUOTE>
<B>AH</B> = BIOS scan code.<BR>
<B>AL</B> = ASCII character.<BR>
(if a keystroke is present, it is removed from the keyboard buffer).
</BLOCKQUOTE>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int16h_01h"> </A>
<HR>
<BR>
<B>INT 16h</B> / <B>AH = 01h</B> - check for keystroke in the keyboard buffer.<BR>
<BLOCKQUOTE>
<I>return:</I><BR>
<BLOCKQUOTE>
<B>ZF = 1</B> if keystroke is not available.<BR>
<B>ZF = 0</B> if keystroke available.<BR>
<B>AH</B> = BIOS scan code.<BR>
<B>AL</B> = ASCII character.<BR>
(if a keystroke is present, it is not removed from the keyboard buffer).
</BLOCKQUOTE>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int19h"> </A>
<HR>
<BR>
<B>INT 19h</B> - system reboot.<BR>
<BLOCKQUOTE>
Usually, the BIOS will try to read sector 1, head 0, track 0 from drive
<B>A:</B> to 0000h:7C00h. The emulator just stops the execution, to boot from
floppy drive select from the menu:
<B>'virtual drive' -> 'boot from floppy'</B>
</BLOCKQUOTE>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int1Ah_00h"> </A>
<HR>
<BR>
<B>INT 1Ah</B> / <B>AH = 00h</B> - get system time.<BR>
<BLOCKQUOTE>
<I>return:</I><BR>
<BLOCKQUOTE>
<B>CX:DX</B> = number of clock ticks since midnight.<BR>
<B>AL</B> = midnight counter, advanced each time midnight passes.<BR>
</BLOCKQUOTE>
</BLOCKQUOTE>
notes:<BR>
there are approximately <B>18.20648</B> clock ticks per second,<BR>
and <B>1800B0h</B> per 24 hours.
<BR><B>AL</B> is not set by the emulator.
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int20h"> </A>
<HR>
<BR><BR>
<B>INT 20h</B> - exit to operating system.<BR><BR>
<A NAME="int21h"> </A>
<HR>
<BR><BR>
<B><FONT SIZE=+1>The short list of emulated <U>MS-DOS</U> interrupts -- INT 21h</FONT><BR><BR></B>
<HR>
<FONT SIZE=+1>DOS file system is emulated in <B><FONT COLOR=green>C:\emu8086\vdrive\x</FONT></B> (x is a drive letter)</FONT><BR><BR>
If no drive letter is specified and current directory is not set, then <B><FONT COLOR=green>C:\emu8086\MyBuild\</FONT></B> path is used by default. <b>FLOPPY_0,1,2,3</b> files are emulated independently from DOS file system.
<BR><BR>
For the emulator physical drive <b>A:</b> is this file <b>c:\emu8086\FLOPPY_0</b> (for BIOS interrupts: <b>INT 13h</b> and boot).
<BR><BR>
For DOS interrupts (<b>INT 21h</b>) drive <b>A:</b> is emulated in this subdirectory: <b>C:\emu8086\vdrive\a\</b>
<BR><BR>
<FONT SIZE=1> Note: DOS file system limits the file and directory names to 8 characters, extension is limited to 3 characters;<BR>
example of a valid file name: <B>myfile.txt</B> (file name = 6 chars, extension - 3 chars).
extension is written after the dot, no other dots are allowed.</FONT>
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int21h_01h"> </A>
<HR>
<BR><BR>
<B>INT 21h</B> / <B>AH=1</B> - read character from standard input, with echo, result is stored in <B>AL</B>.<BR>
if there is no character in the keyboard buffer, the function waits until any key is pressed.
<BR><BR>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 1
<font color=#0000FF>int</font> 21h
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int21h_02h"> </A>
<HR>
<BR><BR>
<B>INT 21h</B> / <B>AH=2</B> - write character to standard output.<BR>
entry: <B>DL</B> = character to write, after execution <B>AL = DL</B>.
<BR><BR>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 2
<font color=#0000FF>mov</font> <font color=#C80000>dl</font>, <font color=#800080>'a'</font>
<font color=#0000FF>int</font> 21h
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int21h_05h"> </A>
<HR>
<BR><BR>
<B>INT 21h</B> / <B>AH=5</B> - output character to printer.<BR>
entry: <B>DL</B> = character to print, after execution <B>AL = DL</B>.
<BR><BR>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 5
<font color=#0000FF>mov</font> <font color=#C80000>dl</font>, <font color=#800080>'a'</font>
<font color=#0000FF>int</font> 21h
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>
<A NAME="int21h_06h"> </A>
<HR>
<BR><BR>
<B>INT 21h</B> / <B>AH=6</B> - direct console input or output.
<BR><BR>
parameters for output: <B>DL</B> = 0..254 (ascii code)<BR>
parameters for input: <B>DL</B> = 255
<BR><BR>
for output returns: AL = DL<BR>
for input returns: <B>ZF</B> set if no character available and <B>AL = 00h</B>, <B>ZF</B> clear if character available.<BR>
<B>AL</B> = character read; buffer is cleared.
<BR><BR>
example:
<!-- START AUTOMATIC ASM TO HTML EXPORT -->
<pre><font size=3 face="Terminal">
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 6
<font color=#0000FF>mov</font> <font color=#C80000>dl</font>, <font color=#800080>'a'</font>
<font color=#0000FF>int</font> 21h <font color=#008000>; output character. </font>
<font color=#0000FF>mov</font> <font color=#C80000>ah</font>, 6
<font color=#0000FF>mov</font> <font color=#C80000>dl</font>, 255
<font color=#0000FF>int</font> 21h <font color=#008000>; get character from keyboard buffer (if any) or set ZF=1. </font>
</font></pre>
<!-- emu8086 version 3.27xn -->
<!-- STOP AUTOMATIC ASM TO HTML EXPORT -->
<A HREF="#top1"><IMG ALIGN=right WIDTH=41 HEIGHT=36 SRC="img/back_to_top.gif" BORDER=0 ALT="Back to Top"></A>