This repository has been archived by the owner on Dec 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy path1988-01-28.asm
13908 lines (12817 loc) · 493 KB
/
1988-01-28.asm
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
;
; ROM BIOS for COMPAQ DeskPro 386-16
; Rev J.4, from parts 109592-001 and 109591-001, dated '01/28/88'
; (C)Copyright COMPAQ Computer Corporation 1982,83,84,85,86,87-All rights reserved.
;
; Listing produced by NDISASM, 2015-Apr-04
; Additional post-processing performed by the PCjs TextOut module
; All post-processing, comments, etc., copyright © 2012-2017 Jeff Parsons <[email protected]>
;
; This file is part of PCjs, a computer emulation software project at <https://www.pcjs.org>.
;
; PCjs is free software: you can redistribute it and/or modify it under the terms of the
; GNU General Public License as published by the Free Software Foundation, either version 3
; of the License, or (at your option) any later version.
;
; PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along with PCjs. If not,
; see <http://www.gnu.org/licenses/gpl.html>.
;
; Overview
; --------
; This 32Kb ROM image is ORG'ed at 0x8000, because most of its code is designed to run
; at real-mode addresses F000:8000 through F000:FFFF.
;
; And even though the 80386 resets with CS:IP set to F000:FFF0, the physical base address
; of CS is set to %FFFF0000, which means the ROM must also be mapped at physical addresses
; %FFFF8000 through %FFFFFFFF.
;
; Additionally, DeskPro 386 systems mirror this 32Kb ROM at real-mode address F000:0000
; through F000:7FFF. And that region is similarly mirrored at physical addresses %FFFF0000
; through %FFFF7FFFF.
;
; In other words, both 32Kb halves of the last 64Kb of both the first and last megabyte
; of the 80386's 4Gb address space are physically mapped to this ROM image.
;
; Finally, the DeskPro 386 has a "RAM Relocation" feature that allows 128Kb of RAM at
; %00FE0000 through %00FFFFFF to be mapped to %000E0000 through %000FFFFF, effectively
; replacing the ROM in the first megabyte with write-protected RAM; the top 64Kb of that
; RAM must first be initialized with the 64Kb at %000F0000 prior to remapping. It's also
; possible to copy external ROMs from %000C0000 through %000EFFFF into the bottom 64Kb of
; that RAM, but this is only done for ROMs known to contain relocatable code; eg, a COMPAQ
; Video Graphics Controller (VGC) Board.
;
; Every DeskPro 386 system must have a MINIMUM of 1Mb of RAM, of which either 256Kb,
; 512Kb, or 640Kb can be physically mapped as conventional memory (at the bottom of the
; first megabyte), with the remainder (either 768Kb, 512Kb, or 384Kb) physically mapped
; to the top of the 16th megabyte (ending at address %00FFFFFF), the last 128Kb of which
; is used by the "RAM Relocation" feature. The remaining memory immediately below that
; 128Kb (ie, below %00FE0000) can only be accessed by special system software, such as CEMM.
;
; COMPAQ refers to that remaining memory as "Compaq Built-in Memory".
;
; As the COMPAQ 386/25 TechRef explains:
;
; A data structure in memory indicates how much of the COMPAQ Built-in Memory (F40000h
; to FE0000h) is [available and] in use. This memory is allocated downward (decreasing
; addresses) starting at address FE0000h. Applications developed specifically for the
; COMPAQ DESKPRO 386/25 Personal Computer, such as CEMM, read and modify this data
; structure to allocate and deallocate portions of the COMPAQ Built-in Memory for their
; use. The built-in memory data structure is located in write-protected memory at segment
; F000h. The offset is specified by the word at F000:FFE0.
;
; The format of the data structure is given [below]. Because the data structure resides
; in write-protected memory, the write-protection must be disabled when updating the data
; structure.
;
; Word Description
; ---- -----------
; 0 FFFFh indicates that no COMPAQ Built-in Memory is available. Otherwise, words
; 1, 2, and 3 define the amount of memory available.
;
; 1 Total COMPAQ Built-in Memory size in 16-byte blocks.
;
; 2 Available built-in memory in 16-byte blocks.
;
; 3 Address for the last-used byte. The byte below (lower address) this byte is the
; first free byte in the COMPAQ Built-in Memory.
;
org 0x8000
CMD8042_WRITE_OUTPORT equ 0xD1
;
; BIOS DATA OFFSETS (RELATIVE TO SEGMENT 0x40)
;
MOTOR_STATUS equ 0x3F
MOTOR_COUNT equ 0x40
xchg bh,bl ; 00008000 86FB '..'
xor bh,bh ; 00008002 32FF '2.'
shl bx,1 ; 00008004 D1E3 '..'
mov dx,[bx+0x50] ; 00008006 8B975000 '..P.'
mov [bp+0x2],dx ; 0000800A 895602 '.V.'
mov cx,[0x60] ; 0000800D 8B0E6000 '..`.'
mov [bp+0x4],cx ; 00008011 894E04 '.N.'
mov word [bp+0x0],0x0 ; 00008014 C746000000 '.F...'
ret ; 00008019 C3 '.'
mov al,0xe ; 0000801A B00E '..'
out dx,al ; 0000801C EE '.'
inc dx ; 0000801D 42 'B'
in al,dx ; 0000801E EC '.'
mov ah,al ; 0000801F 8AE0 '..'
dec dx ; 00008021 4A 'J'
mov al,0xf ; 00008022 B00F '..'
out dx,al ; 00008024 EE '.'
inc dx ; 00008025 42 'B'
in al,dx ; 00008026 EC '.'
ret ; 00008027 C3 '.'
;
; Protected-mode memory probe
;
x8028: push ax ; 00008028 50 'P'
push bx ; 00008029 53 'S'
push cx ; 0000802A 51 'Q'
push es ; 0000802B 06 '.'
mov ax,0x48 ; 0000802C B84800 '.H.'
mov es,ax ; 0000802F 8EC0 '..'
mov cl,0x2 ; 00008031 B102 '..'
mov ch,0x9 ; 00008033 B509 '..'
mov al,0x1 ; 00008035 B001 '..'
call x8051 ; 00008037 E81700 '...'
add ax,0x80 ; 0000803A 058000 '...'
mov [0x7c],ax ; 0000803D A37C00 '.|.'
mov cl,0x10 ; 00008040 B110 '..'
mov ch,0xfd ; 00008042 B5FD '..'
mov al,0x1 ; 00008044 B001 '..'
call x8051 ; 00008046 E80800 '...'
mov [0x7e],ax ; 00008049 A37E00 '.~.'
pop es ; 0000804C 07 '.'
pop cx ; 0000804D 59 'Y'
pop bx ; 0000804E 5B '['
pop ax ; 0000804F 58 'X'
ret ; 00008050 C3 '.'
;
; (AL) == block increment (eg, 0x1)
; (CL) == starting 64Kb block number (eg, 0x02, or 0x10)
; (CH) == maximum 64Kb block number (eg, 0x09, or 0xFD)
;
x8051: push bx ; 00008051 53 'S'
push dx ; 00008052 52 'R'
push bp ; 00008053 55 'U'
mov dl,al ; 00008054 8AD0 '..'
mov bp,es ; 00008056 8CC5 '..'
;
; 0x4C is the base portion of the descriptor at DS:0x48
;
mov [0x4c],cl ; 00008058 880E4C00 '..L.'
x805c: mov es,bp ; 0000805C 8EC5 '..'
mov bx,0x0 ; 0000805E BB0000 '...'
mov word [es:bx],0x0 ; 00008061 26C7070000 '&....'
mov word [es:bx+0x2],0xffff ; 00008066 26C74702FFFF '&.G...'
cld ; 0000806C FC '.'
cld ; 0000806D FC '.'
mov bx,[es:bx] ; 0000806E 268B1F '&..'
cld ; 00008071 FC '.'
cld ; 00008072 FC '.'
cld ; 00008073 FC '.'
cld ; 00008074 FC '.'
cld ; 00008075 FC '.'
cmp bx,byte +0x0 ; 00008076 83FB00 '...'
mov byte [es:0x0],0x0 ; 00008079 26C606000000 '&.....'
jz x8089 ; 0000807F 7408 't.'
mov al,[0x4c] ; 00008081 A04C00 '.L.'
sub al,cl ; 00008084 2AC1 '*.'
jmp short x809c ; 00008086 EB14 '..'
nop ; 00008088 90 '.'
x8089: cmp [0x4c],ch ; 00008089 382E4C00 '8.L.'
jz x8095 ; 0000808D 7406 't.'
;
; Bump the base portion of the descriptor at DS:0x48 to the next 64Kb block
;
add [0x4c],dl ; 0000808F 00164C00 '..L.'
jmp short x805c ; 00008093 EBC7 '..'
x8095: mov al,[0x4c] ; 00008095 A04C00 '.L.'
sub al,cl ; 00008098 2AC1 '*.'
inc al ; 0000809A FEC0 '..'
x809c: xor ah,ah ; 0000809C 32E4 '2.'
shl ax,0x6 ; 0000809E C1E006 '...'
pop bp ; 000080A1 5D ']'
pop dx ; 000080A2 5A 'Z'
pop bx ; 000080A3 5B '['
ret ; 000080A4 C3 '.'
;
; Display (AX) as a 5-digit, zero-padded number in the top-left corner of
; the display, using (ES) as the segment of the video buffer.
;
; The number is followed by " KB OK", for a total of 11 (0x0B) characters.
;
; This function works for both Mono and CGA displays because it writes to both
; video buffers (%B0000 via ES:0000 and %B8000 via ES:8000).
;
; Called by CS:DBD6 in the normal case, where CS == 0x30 and ES == 0x40.
;
x80a5: push bx ; 000080A5 53 'S'
push cx ; 000080A6 51 'Q'
push dx ; 000080A7 52 'R'
push si ; 000080A8 56 'V'
push di ; 000080A9 57 'W'
mov bx,0xa ; 000080AA BB0A00 '.',0x0A,'.'
mov cx,0x5 ; 000080AD B90500 '...'
mov di,0x8 ; 000080B0 BF0800 '...'
x80b3: xor dx,dx ; 000080B3 33D2 '3.'
div bx ; 000080B5 F7F3 '..'
add dl,0x30 ; 000080B7 80C230 '..0'
mov dh,0x7 ; 000080BA B607 '..'
mov [di+0x93],dx ; 000080BC 89959300 '....'
dec di ; 000080C0 4F 'O'
dec di ; 000080C1 4F 'O'
loop x80b3 ; 000080C2 E2EF '..'
cld ; 000080C4 FC '.'
mov si,0x93 ; 000080C5 BE9300 '...'
mov di,0x0 ; 000080C8 BF0000 '...'
mov cx,0xb ; 000080CB B90B00 '...'
rep movsw ; 000080CE F3A5 '..'
cld ; 000080D0 FC '.'
mov si,0x93 ; 000080D1 BE9300 '...'
mov di,0x8000 ; 000080D4 BF0080 '...'
mov cx,0xb ; 000080D7 B90B00 '...'
rep movsw ; 000080DA F3A5 '..'
pop di ; 000080DC 5F '_'
pop si ; 000080DD 5E '^'
pop dx ; 000080DE 5A 'Z'
pop cx ; 000080DF 59 'Y'
pop bx ; 000080E0 5B '['
ret ; 000080E1 C3 '.'
;
; Use INT 0x15, (AH) == 0x89, to enter protected-mode
;
; Returns ZF set if successful
;
; See COMPAQ 386/25 TechRef, p.4-98 for details
;
x80e2: push bx ; 000080E2 53 'S'
push cx ; 000080E3 51 'Q'
push dx ; 000080E4 52 'R'
push di ; 000080E5 57 'W'
push si ; 000080E6 56 'V'
call x8102 ; 000080E7 E81800 '...'
mov bh,0x8 ; 000080EA B708 '..'
mov bl,0x70 ; 000080EC B370 '.p'
mov ax,0x1c00 ; 000080EE B8001C '...'
mov es,ax ; 000080F1 8EC0 '..'
mov si,0x0 ; 000080F3 BE0000 '...'
mov ah,0x89 ; 000080F6 B489 '..'
int 0x15 ; 000080F8 CD15 '..'
or ah,ah ; 000080FA 0AE4 0x0A,'.'
pop si ; 000080FC 5E '^'
pop di ; 000080FD 5F '_'
pop dx ; 000080FE 5A 'Z'
pop cx ; 000080FF 59 'Y'
pop bx ; 00008100 5B '['
ret ; 00008101 C3 '.'
;
; Descriptor table initialization
;
; Used by x80e2 to prepare for an INT 0x15 call to enter protected-mode
;
x8102: pusha ; 00008102 60 '`'
push ds ; 00008103 1E '.'
push es ; 00008104 06 '.'
mov ax,0x1c00 ; 00008105 B8001C '...'
mov ds,ax ; 00008108 8ED8 '..'
mov es,ax ; 0000810A 8EC0 '..'
cld ; 0000810C FC '.'
xor ax,ax ; 0000810D 33C0 '3.'
mov di,0x0 ; 0000810F BF0000 '...'
mov cx,0x4 ; 00008112 B90400 '...'
rep stosw ; 00008115 F3AB '..'
mov si,0x8 ; 00008117 BE0800 '...'
mov ax,0x1c00 ; 0000811A B8001C '...'
mov bx,0x10 ; 0000811D BB1000 '...'
mul bx ; 00008120 F7E3 '..'
add ax,0x0 ; 00008122 050000 '...'
adc dl,0x0 ; 00008125 80D200 '...'
mov [si+0x2],ax ; 00008128 894402 '.D.'
mov [si+0x4],dl ; 0000812B 885404 '.T.'
mov byte [si+0x5],0x92 ; 0000812E C6440592 '.D..'
mov word [si],0x5f ; 00008132 C7045F00 '.._.'
mov si,0x10 ; 00008136 BE1000 '...'
mov ax,0xf000 ; 00008139 B800F0 '...'
mov bx,0x10 ; 0000813C BB1000 '...'
mul bx ; 0000813F F7E3 '..'
add ax,0xf821 ; 00008141 0521F8 '.!.'
adc dl,0x0 ; 00008144 80D200 '...'
mov [si+0x2],ax ; 00008147 894402 '.D.'
mov [si+0x4],dl ; 0000814A 885404 '.T.'
mov byte [si+0x5],0x92 ; 0000814D C6440592 '.D..'
mov word [si],0x7 ; 00008151 C7040700 '....'
mov si,0x30 ; 00008155 BE3000 '.0.'
mov ax,cs ; 00008158 8CC8 '..'
mov bl,0x9a ; 0000815A B39A '..'
call x81cb ; 0000815C E86C00 '.l.'
mov si,0x18 ; 0000815F BE1800 '...'
mov ax,0x1c00 ; 00008162 B8001C '...'
mov bl,0x92 ; 00008165 B392 '..'
call x81cb ; 00008167 E86100 '.a.'
mov si,0x20 ; 0000816A BE2000 '. .'
mov ax,0x40 ; 0000816D B84000 '.@.'
mov bl,0x92 ; 00008170 B392 '..'
call x81cb ; 00008172 E85600 '.V.'
mov si,0x28 ; 00008175 BE2800 '.(.'
mov ax,ss ; 00008178 8CD0 '..'
mov bl,0x92 ; 0000817A B392 '..'
call x81cb ; 0000817C E84C00 '.L.'
mov si,0x40 ; 0000817F BE4000 '.@.'
mov ax,0xb000 ; 00008182 B800B0 '...'
mov bl,0x92 ; 00008185 B392 '..'
call x81cb ; 00008187 E84100 '.A.'
mov si,0x48 ; 0000818A BE4800 '.H.'
mov ax,0x2000 ; 0000818D B80020 '.. '
mov bl,0x92 ; 00008190 B392 '..'
call x81cb ; 00008192 E83600 '.6.'
mov si,0x50 ; 00008195 BE5000 '.P.'
mov ax,0xc000 ; 00008198 B800C0 '...'
mov bl,0x92 ; 0000819B B392 '..'
call x81cb ; 0000819D E82B00 '.+.'
mov byte [0x54],0xc0 ; 000081A0 C6065400C0 '..T..'
mov byte [0x57],0x80 ; 000081A5 C606570080 '..W..'
mov si,0x58 ; 000081AA BE5800 '.X.'
mov ax,0xf000 ; 000081AD B800F0 '...'
mov bl,0x92 ; 000081B0 B392 '..'
call x81cb ; 000081B2 E81600 '...'
mov ax,cs ; 000081B5 8CC8 '..'
mov ds,ax ; 000081B7 8ED8 '..'
mov si,0xf821 ; 000081B9 BE21F8 '.!.'
mov di,0xa9 ; 000081BC BFA900 '...'
mov cx,0x7 ; 000081BF B90700 '...'
inc cx ; 000081C2 41 'A'
shr cx,1 ; 000081C3 D1E9 '..'
rep movsw ; 000081C5 F3A5 '..'
pop es ; 000081C7 07 '.'
pop ds ; 000081C8 1F '.'
popa ; 000081C9 61 'a'
ret ; 000081CA C3 '.'
;
; Descriptor initializer
;
; Used by x8102 to initialize a descriptor table
;
x81cb: mov word [si],0xffff ; 000081CB C704FFFF '....'
mov bh,ah ; 000081CF 8AFC '..'
shl ax,0x4 ; 000081D1 C1E004 '...'
shr bh,0x4 ; 000081D4 C0EF04 '...'
mov [si+0x2],ax ; 000081D7 894402 '.D.'
mov [si+0x4],bh ; 000081DA 887C04 '.|.'
mov [si+0x5],bl ; 000081DD 885C05 '.\.'
mov word [si+0x6],0x0 ; 000081E0 C744060000 '.D...'
ret ; 000081E5 C3 '.'
x81e6: push ax ; 000081E6 50 'P'
mov al,0x8e ; 000081E7 B08E '..'
call xb544 ; 000081E9 E85833 '.X3'
test al,0xc0 ; 000081EC A8C0 '..'
jz x81f3 ; 000081EE 7403 't.'
stc ; 000081F0 F9 '.'
jmp short x8212 ; 000081F1 EB1F '..'
x81f3: mov al,0x96 ; 000081F3 B096 '..'
call xb544 ; 000081F5 E84C33 '.L3'
mov ah,al ; 000081F8 8AE0 '..'
mov al,0x95 ; 000081FA B095 '..'
call xb544 ; 000081FC E84533 '.E3'
mov [0x76],ax ; 000081FF A37600 '.v.'
mov al,0x98 ; 00008202 B098 '..'
call xb544 ; 00008204 E83D33 '.=3'
mov ah,al ; 00008207 8AE0 '..'
mov al,0x97 ; 00008209 B097 '..'
call xb544 ; 0000820B E83633 '.63'
mov [0x78],ax ; 0000820E A37800 '.x.'
clc ; 00008211 F8 '.'
x8212: pop ax ; 00008212 58 'X'
ret ; 00008213 C3 '.'
x8214: push ax ; 00008214 50 'P'
mov al,0x8e ; 00008215 B08E '..'
call xb544 ; 00008217 E82A33 '.*3'
mov ah,al ; 0000821A 8AE0 '..'
or ah,0x10 ; 0000821C 80CC10 '...'
or cl,cl ; 0000821F 0AC9 0x0A,'.'
jnz x8226 ; 00008221 7503 'u.'
and ah,0xef ; 00008223 80E4EF '...'
x8226: mov al,0x8e ; 00008226 B08E '..'
call xb549 ; 00008228 E81E33 '..3'
pop ax ; 0000822B 58 'X'
ret ; 0000822C C3 '.'
x822d: push si ; 0000822D 56 'V'
call xc704 ; 0000822E E8D344 '..D'
pop bx ; 00008231 5B '['
call x8257 ; 00008232 E82200 '.".'
mov dx,0x0 ; 00008235 BA0000 '...'
mov bx,err201 ; 00008238 BBA6B6 '...'
mov cx,err201_len ; 0000823B B91100 '...'
call xc745 ; 0000823E E80445 '..E'
ret ; 00008241 C3 '.'
x8242: push si ; 00008242 56 'V'
call xc704 ; 00008243 E8BE44 '..D'
pop bx ; 00008246 5B '['
call x8257 ; 00008247 E80D00 '.',0x0D,'.'
mov dx,0x0 ; 0000824A BA0000 '...'
mov bx,err203 ; 0000824D BBB7B6 '...'
mov cx,err203_len ; 00008250 B91900 '...'
call xc745 ; 00008253 E8EF44 '..D'
ret ; 00008256 C3 '.'
x8257: mov ax,[0x60] ; 00008257 A16000 '.`.'
and al,0xc0 ; 0000825A 24C0 '$.'
cmp al,0x40 ; 0000825C 3C40 '<@'
jz x8263 ; 0000825E 7403 't.'
jmp x82e7 ; 00008260 E98400 '...'
x8263: mov si,0xb706 ; 00008263 BE06B7 '...'
cmp bl,0xfe ; 00008266 80FBFE '...'
jz x82de ; 00008269 7473 'ts'
cmp bl,0xff ; 0000826B 80FBFF '...'
jz x82de ; 0000826E 746E 'tn'
or bl,bl ; 00008270 0ADB 0x0A,'.'
jz x82de ; 00008272 746A 'tj'
mov bh,0x10 ; 00008274 B710 '..'
mov al,ah ; 00008276 8AC4 '..'
and al,0x3 ; 00008278 2403 '$.'
cmp al,0x3 ; 0000827A 3C03 '<.'
jz x82e7 ; 0000827C 7469 'ti'
cmp al,0x2 ; 0000827E 3C02 '<.'
jz x8284 ; 00008280 7402 't.'
mov bh,0x40 ; 00008282 B740 '.@'
x8284: cmp bl,bh ; 00008284 3ADF ':.'
jc x82de ; 00008286 7256 'rV'
mov si,0xb713 ; 00008288 BE13B7 '...'
add bh,0x10 ; 0000828B 80C710 '...'
mov al,ah ; 0000828E 8AC4 '..'
and al,0xc ; 00008290 240C '$.'
shr al,0x2 ; 00008292 C0E802 '...'
cmp al,0x3 ; 00008295 3C03 '<.'
jz x82e7 ; 00008297 744E 'tN'
cmp al,0x2 ; 00008299 3C02 '<.'
jz x82a0 ; 0000829B 7403 't.'
add bh,0x30 ; 0000829D 80C730 '..0'
x82a0: cmp bl,bh ; 000082A0 3ADF ':.'
jc x82de ; 000082A2 723A 'r:'
mov si,0xb71d ; 000082A4 BE1DB7 '...'
add bh,0x10 ; 000082A7 80C710 '...'
mov al,ah ; 000082AA 8AC4 '..'
and al,0x30 ; 000082AC 2430 '$0'
shr al,0x4 ; 000082AE C0E804 '...'
cmp al,0x3 ; 000082B1 3C03 '<.'
jz x82e7 ; 000082B3 7432 't2'
cmp al,0x2 ; 000082B5 3C02 '<.'
jz x82bc ; 000082B7 7403 't.'
add bh,0x30 ; 000082B9 80C730 '..0'
x82bc: cmp bl,bh ; 000082BC 3ADF ':.'
jc x82de ; 000082BE 721E 'r.'
mov si,0xb727 ; 000082C0 BE27B7 '.',0x27,'.'
add bh,0x10 ; 000082C3 80C710 '...'
mov al,ah ; 000082C6 8AC4 '..'
and al,0xc0 ; 000082C8 24C0 '$.'
shr al,0x6 ; 000082CA C0E806 '...'
cmp al,0x3 ; 000082CD 3C03 '<.'
jz x82e7 ; 000082CF 7416 't.'
cmp al,0x2 ; 000082D1 3C02 '<.'
jz x82da ; 000082D3 7405 't.'
add bh,0x30 ; 000082D5 80C730 '..0'
jz x82de ; 000082D8 7404 't.'
x82da: cmp bl,bh ; 000082DA 3ADF ':.'
jnc x82e7 ; 000082DC 7309 's.'
x82de: push ds ; 000082DE 1E '.'
mov ax,cs ; 000082DF 8CC8 '..'
mov ds,ax ; 000082E1 8ED8 '..'
call xe282 ; 000082E3 E89C5F '.._'
pop ds ; 000082E6 1F '.'
x82e7: ret ; 000082E7 C3 '.'
x82e8: push ds ; 000082E8 1E '.'
mov ax,cs ; 000082E9 8CC8 '..'
mov ds,ax ; 000082EB 8ED8 '..'
mov si,0x8000 ; 000082ED BE0080 '...'
xor ah,ah ; 000082F0 32E4 '2.'
mov cx,0x8000 ; 000082F2 B90080 '...'
x82f5: lodsb ; 000082F5 AC '.'
add ah,al ; 000082F6 02E0 '..'
loop x82f5 ; 000082F8 E2FB '..'
jz x830a ; 000082FA 740E 't.'
mov dx,0x5000 ; 000082FC BA0050 '..P'
mov bx,err101 ; 000082FF BB5AB7 '.Z.'
mov cx,err101_len ; 00008302 B90F00 '...'
call xc745 ; 00008305 E83D44 '.=D'
x8308: jmp short x8308 ; 00008308 EBFE ; HANG THE MACHINE
x830a: pop ds ; 0000830A 1F '.'
ret ; 0000830B C3 '.'
xor [bx],al ; 0000830C 3007 '0.'
xor [bx],al ; 0000830E 3007 '0.'
xor [bx],al ; 00008310 3007 '0.'
xor [bx],al ; 00008312 3007 '0.'
xor [bx],al ; 00008314 3007 '0.'
and [bx],al ; 00008316 2007 ' .'
dec bx ; 00008318 4B 'K'
pop es ; 00008319 07 '.'
inc dx ; 0000831A 42 'B'
pop es ; 0000831B 07 '.'
and [bx],al ; 0000831C 2007 ' .'
dec di ; 0000831E 4F 'O'
pop es ; 0000831F 07 '.'
dec bx ; 00008320 4B 'K'
pop es ; 00008321 07 '.'
mov ah,[0x49] ; 00008322 8A264900 '.&I.'
mov [bp+0x1],ah ; 00008326 886601 '.f.'
ret ; 00008329 C3 '.'
push ds ; 0000832A 1E '.'
cmp al,0x3 ; 0000832B 3C03 '<.'
ja x838c ; 0000832D 775D 'w]'
push es ; 0000832F 06 '.'
mov bh,[bp+0x7] ; 00008330 8A7E07 '.~.'
mov ah,0x3 ; 00008333 B403 '..'
call x83db ; 00008335 E8A300 '...'
push dx ; 00008338 52 'R'
mov dx,[bp+0x2] ; 00008339 8B5602 '.V.'
mov ah,0x2 ; 0000833C B402 '..'
call x83db ; 0000833E E89A00 '...'
mov cx,[bp+0x4] ; 00008341 8B4E04 '.N.'
jcxz x837c ; 00008344 E336 '.6'
mov si,[bp+0xc] ; 00008346 8B760C '.v.'
mov ax,[bp+0x10] ; 00008349 8B4610 '.F.'
mov ds,ax ; 0000834C 8ED8 '..'
cld ; 0000834E FC '.'
x834f: lodsb ; 0000834F AC '.'
mov bx,[bp+0x6] ; 00008350 8B5E06 '.^.'
cmp byte [bp+0x0],0x1 ; 00008353 807E0001 '.~..'
jna x836c ; 00008357 7613 'v.'
cmp al,0x7 ; 00008359 3C07 '<.'
jz x836c ; 0000835B 740F 't.'
cmp al,0x8 ; 0000835D 3C08 '<.'
jz x836c ; 0000835F 740B 't.'
cmp al,0xa ; 00008361 3C0A '<',0x0A
jz x836c ; 00008363 7407 't.'
cmp al,0xd ; 00008365 3C0D '<',0x0D
jz x836c ; 00008367 7403 't.'
xchg ax,bx ; 00008369 93 '.'
lodsb ; 0000836A AC '.'
xchg ax,bx ; 0000836B 93 '.'
x836c: push cx ; 0000836C 51 'Q'
push ds ; 0000836D 1E '.'
push ax ; 0000836E 50 'P'
mov ax,0x40 ; 0000836F B84000 '.@.'
mov ds,ax ; 00008372 8ED8 '..'
pop ax ; 00008374 58 'X'
call x8395 ; 00008375 E81D00 '...'
pop ds ; 00008378 1F '.'
pop cx ; 00008379 59 'Y'
loop x834f ; 0000837A E2D3 '..'
x837c: pop dx ; 0000837C 5A 'Z'
pop es ; 0000837D 07 '.'
mov bh,[bp+0x7] ; 0000837E 8A7E07 '.~.'
test byte [bp+0x0],0x1 ; 00008381 F6460001 '.F..'
jnz x838c ; 00008385 7505 'u.'
mov ah,0x2 ; 00008387 B402 '..'
call x83db ; 00008389 E84F00 '.O.'
x838c: pop ds ; 0000838C 1F '.'
mov ah,[0x49] ; 0000838D 8A264900 '.&I.'
mov [bp+0x1],ah ; 00008391 886601 '.f.'
ret ; 00008394 C3 '.'
x8395: cmp al,0x7 ; 00008395 3C07 '<.'
jz x83d4 ; 00008397 743B 't;'
cmp al,0x8 ; 00008399 3C08 '<.'
db 't7<',0x0A,'t3<',0x0D,'t/'
mov cx,0x1 ; 000083A5 B90100 '...'
mov ah,0x9 ; 000083A8 B409 '..'
call x83db ; 000083AA E82E00 '...'
mov ah,0x3 ; 000083AD B403 '..'
call x83db ; 000083AF E82900 '.).'
inc dl ; 000083B2 FEC2 '..'
cmp dl,[0x4a] ; 000083B4 3A164A00 ':.J.'
jnz x83ce ; 000083B8 7514 'u.'
xor dl,dl ; 000083BA 32D2 '2.'
inc dh ; 000083BC FEC6 '..'
cmp dh,0x19 ; 000083BE 80FE19 '...'
jnz x83ce ; 000083C1 750B 'u.'
dec dh ; 000083C3 FECE '..'
mov al,0xa ; 000083C5 B00A '.',0x0A
mov ah,0xe ; 000083C7 B40E '..'
call x83db ; 000083C9 E80F00 '...'
xor dl,dl ; 000083CC 32D2 '2.'
x83ce: mov ah,0x2 ; 000083CE B402 '..'
call x83db ; 000083D0 E80800 '...'
x83d3: ret ; 000083D3 C3 '.'
x83d4: mov ah,0xe ; 000083D4 B40E '..'
call x83db ; 000083D6 E80200 '...'
jmp short x83d3 ; 000083D9 EBF8 '..'
x83db: push ax ; 000083DB 50 'P'
push bx ; 000083DC 53 'S'
push es ; 000083DD 06 '.'
mov bx,0x0 ; 000083DE BB0000 '...'
mov es,bx ; 000083E1 8EC3 '..'
mov bx,0x42 ; 000083E3 BB4200 '.B.'
mov ax,cs ; 000083E6 8CC8 '..'
cmp [es:bx],ax ; 000083E8 263907 '&9.'
pop es ; 000083EB 07 '.'
pop bx ; 000083EC 5B '['
pop ax ; 000083ED 58 'X'
jz x83f3 ; 000083EE 7403 't.'
int 0x10 ; 000083F0 CD10 '..'
ret ; 000083F2 C3 '.'
x83f3: pushf ; 000083F3 9C '.'
push cs ; 000083F4 0E '.'
call xf065 ; 000083F5 E86D6C '.ml'
ret ; 000083F8 C3 '.'
x83f9: push cs ; 000083F9 0E '.'
pop ds ; 000083FA 1F '.'
cld ; 000083FB FC '.'
mov al,0xa0 ; 000083FC B0A0 '..'
out 0x84,al ; 000083FE E684 '..'
mov dx,0x3f2 ; 00008400 BAF203 '...'
mov al,0x0 ; 00008403 B000 '..'
out dx,al ; 00008405 EE '.'
mov al,0xa1 ; 00008406 B0A1 '..'
out 0x84,al ; 00008408 E684 '..'
mov bx,0x64 ; 0000840A BB6400 '.d.'
call xc638 ; 0000840D E82842 '.(B' ; CALL DELAY(BX)
mov al,0xc ; 00008410 B00C '..'
out dx,al ; 00008412 EE '.'
mov al,0xa2 ; 00008413 B0A2 '..'
out 0x84,al ; 00008415 E684 '..'
mov bx,0x64 ; 00008417 BB6400 '.d.'
call xc638 ; 0000841A E81B42 '..B' ; CALL DELAY(BX)
mov si,0x849f ; 0000841D BE9F84 '...'
mov di,0x4 ; 00008420 BF0400 '...'
call x8d8d ; 00008423 E86709 '.g.'
jc x847c ; 00008426 7254 'rT'
mov al,0x1c ; 00008428 B01C '..'
mov dx,0x3f2 ; 0000842A BAF203 '...'
out dx,al ; 0000842D EE '.'
mov al,0xa3 ; 0000842E B0A3 '..'
out 0x84,al ; 00008430 E684 '..'
xor bp,bp ; 00008432 33ED '3.'
x8434: call x8d8d ; 00008434 E85609 '.V.'
jc x847c ; 00008437 7243 'rC'
mov bx,0x1f4 ; 00008439 BBF401 '...'
call xc638 ; 0000843C E8F941 '..A' ; CALL DELAY(BX)
call x8d8d ; 0000843F E84B09 '.K.'
jc x847c ; 00008442 7238 'r8'
mov cx,0x64 ; 00008444 B96400 '.d.'
x8447: call xe944 ; 00008447 E8FA64 '..d'
jc x847c ; 0000844A 7230 'r0'
loope x8447 ; 0000844C E1F9 '..'
jz x847c ; 0000844E 742C 't,'
call x919a ; 00008450 E8470D '.G',0x0D
in al,dx ; 00008453 EC '.'
test al,0xc0 ; 00008454 A8C0 '..'
jnz x845b ; 00008456 7503 'u.'
in al,dx ; 00008458 EC '.'
jmp short x848e ; 00008459 EB33 '.3'
x845b: xor bp,0x1 ; 0000845B 81F50100 '....'
jz x8476 ; 0000845F 7415 't.'
cmp al,0x70 ; 00008461 3C70 '<p'
jnz x8476 ; 00008463 7511 'u.'
call xe944 ; 00008465 E8DC64 '..d'
jc x847c ; 00008468 7212 'r.'
call x919a ; 0000846A E82D0D '.-',0x0D
in al,dx ; 0000846D EC '.'
mov si,0x84a2 ; 0000846E BEA284 '...'
mov di,0x3 ; 00008471 BF0300 '...'
jmp short x8434 ; 00008474 EBBE '..'
x8476: mov al,0xa5 ; 00008476 B0A5 '..'
out 0x84,al ; 00008478 E684 '..'
jmp short x8480 ; 0000847A EB04 '..'
x847c: mov al,0xa4 ; 0000847C B0A4 '..'
out 0x84,al ; 0000847E E684 '..'
x8480: mov bx,0xb82f ; 00008480 BB2FB8 './.'
mov cx,0x20 ; 00008483 B92000 '. .'
mov dx,0x0 ; 00008486 BA0000 '...'
call xc745 ; 00008489 E8B942 '..B'
jmp short x8492 ; 0000848C EB04 '..'
x848e: mov al,0xa6 ; 0000848E B0A6 '..'
out 0x84,al ; 00008490 E684 '..'
x8492: in al,0x21 ; 00008492 E421 '.!'
and al,0xbf ; 00008494 24BF '$.'
out 0x21,al ; 00008496 E621 '.!'
mov al,0x0 ; 00008498 B000 '..'
out 0xd2,al ; 0000849A E6D2 '..'
out 0xd4,al ; 0000849C E6D4 '..'
ret ; 0000849E C3 '.'
add bx,di ; 0000849F 03DF '..'
add al,[bx] ; 000084A1 0207 '..'
add [bx+si],cl ; 000084A3 0008 '..'
x84a5: mov ax,0x50 ; 000084A5 B85000 '.P.'
push ds ; 000084A8 1E '.'
mov ds,ax ; 000084A9 8ED8 '..'
mov byte [0x0],0xff ; 000084AB C6060000FF '.....'
pop ds ; 000084B0 1F '.'
mov word [0x8d],0x0 ; 000084B1 C7068D000000 '......'
mov byte [0x8c],0xfa ; 000084B7 C6068C00FA '.....'
xor bx,bx ; 000084BC 33DB '3.'
mov cl,0xff ; 000084BE B1FF '..'
mov ch,0xf0 ; 000084C0 B5F0 '..'
xor di,di ; 000084C2 33FF '3.'
push es ; 000084C4 06 '.'
x84c5: mov [0x4c],cl ; 000084C5 880E4C00 '..L.'
mov ax,0x48 ; 000084C9 B84800 '.H.'
mov es,ax ; 000084CC 8EC0 '..'
mov word [es:di],0x0 ; 000084CE 26C7050000 '&....'
mov word [es:di+0x2],0xffff ; 000084D3 26C74502FFFF '&.E...'
cld ; 000084D9 FC '.'
cld ; 000084DA FC '.'
mov ax,[es:di] ; 000084DB 268B05 '&..'
cld ; 000084DE FC '.'
cld ; 000084DF FC '.'
cld ; 000084E0 FC '.'
cld ; 000084E1 FC '.'
cld ; 000084E2 FC '.'
or ax,ax ; 000084E3 0BC0 '..'
mov [es:di],ax ; 000084E5 268905 '&..'
jz x84ee ; 000084E8 7404 't.'
inc cl ; 000084EA FEC1 '..'
jmp short x84f9 ; 000084EC EB0B '..'
x84ee: add bx,byte +0x40 ; 000084EE 83C340 '..@'
cmp cl,ch ; 000084F1 3ACD ':.'
jz x84f9 ; 000084F3 7404 't.'
dec cl ; 000084F5 FEC9 '..'
jmp short x84c5 ; 000084F7 EBCC '..'
x84f9: sub bx,0x80 ; 000084F9 81EB8000 '....'
jna x8507 ; 000084FD 7608 'v.'
mov [0x8d],bx ; 000084FF 891E8D00 '....'
mov [0x8c],cl ; 00008503 880E8C00 '....'
x8507: pop es ; 00008507 07 '.'
ret ; 00008508 C3 '.'
;
; Wrapper around xdb33 to test memory at %FE0000
;
x8509: mov ah,0xfe ; 00008509 B4FE '..'
mov word [0x82],0x80 ; 0000850B C70682008000 '......'
mov byte [0x8f],0xff ; 00008511 C6068F00FF '.....'
mov byte [0x92],0x1 ; 00008516 C606920001 '.....'
mov bp,0x80 ; 0000851B BD8000 '...'
call xdb33 ; 0000851E E81256 '..V'
add bp,0x80 ; 00008521 81C58000 '....'
or ax,ax ; 00008525 0BC0 '..'
jz x853b ; 00008527 7412 't.'
mov [0x66],ch ; 00008529 882E6600 '..f.'
mov [0x67],dx ; 0000852D 89166700 '..g.'
mov [0x69],cl ; 00008531 880E6900 '..i.'
or word [0x64],0x41 ; 00008535 810E64004100 '..d.A.'
x853b: ret ; 0000853B C3 '.'
;
; Copy ROM from %0F0000 to %FF0000
;
x853c: mov al,0x7f ; 0000853C B07F '..'
out 0x84,al ; 0000853E E684 '..'
mov word [0x50],0xffff ; 00008540 C7065000FFFF '..P...'
mov word [0x52],0x0 ; 00008546 C70652000000 '..R...'
mov byte [0x54],0xf ; 0000854C C60654000F '..T..'
mov byte [0x55],0x92 ; 00008551 C606550092 '..U..'
mov byte [0x56],0x0 ; 00008556 C606560000 '..V..'
mov byte [0x57],0x0 ; 0000855B C606570000 '..W..'
mov word [0x48],0xffff ; 00008560 C7064800FFFF '..H...'
mov word [0x4a],0x0 ; 00008566 C7064A000000 '..J...'
mov byte [0x4c],0xff ; 0000856C C6064C00FF '..L..'
mov byte [0x4d],0x92 ; 00008571 C6064D0092 '..M..'
mov word [0x4e],0x0 ; 00008576 C7064E000000 '..N...'
push es ; 0000857C 06 '.'
push ds ; 0000857D 1E '.'
mov ax,0x50 ; 0000857E B85000 '.P.'
mov ds,ax ; 00008581 8ED8 '..'
mov ax,0x48 ; 00008583 B84800 '.H.'
mov es,ax ; 00008586 8EC0 '..'
xor si,si ; 00008588 33F6 '3.'
xor di,di ; 0000858A 33FF '3.'
;
; Copy 64Kb from %0F0000 to %FF0000
;
mov cx,0x4000 ; 0000858C B90040 '..@'
cld ; 0000858F FC '.'
rep movsd ; 00008590 66F3A5 'f..'
;
; (DI) -> 0x7FB6
;
mov bx,bim_table_offset ; 00008593 BBE0FF '...'
mov di,[bx] ; 00008596 8B3F '.?'
;
; (SI) -> 0x7FBE
;
mov bx,cpu_idrev_offset ; 00008598 BBE2FF '...'
mov si,[bx] ; 0000859B 8B37 '.7'
pop ds ; 0000859D 1F '.'
mov word [0x50],0xffff ; 0000859E C7065000FFFF '..P...'
mov word [0x52],0x0 ; 000085A4 C70652000000 '..R...'
mov byte [0x54],0xc0 ; 000085AA C6065400C0 '..T..'
mov byte [0x55],0x92 ; 000085AF C606550092 '..U..'
mov byte [0x56],0x0 ; 000085B4 C606560000 '..V..'
mov byte [0x57],0x80 ; 000085B9 C606570080 '..W..'
;
; (BX) is 0x100 (256Kb)
;
mov bx,[0x8d] ; 000085BE 8B1E8D00 '....'
push ds ; 000085C2 1E '.'
;
; (DS) -> 0x80C00000
;
mov ax,0x50 ; 000085C3 B85000 '.P.'
mov ds,ax ; 000085C6 8ED8 '..'
;
; Disable IOCHK NMI, since it is possible to generate a
; parity error by simply reading the RAM Diagnostics Register.
;
in al,0x61 ; 000085C8 E461 '.a'
push ax ; 000085CA 50 'P'
or al,0x8 ; 000085CB 0C08 '..'
out 0x61,al ; 000085CD E661 '.a'
;
; (AL) == RAM Diagnostics Register (from 0x80C00000)
;
mov al,[0x0] ; 000085CF A00000 '...'
;
; Ensure that relocatable RAM at %FE0000 is NEITHER currently remapped NOR write-protected
;
mov byte [0x0],0xff ; 000085D2 C6060000FF '.....'
;
; Isolate the base memory settings in bits 5-4 (00=640Kb, 10=512Kb, 11=256Kb)
;
and al,0xf0 ; 000085D7 24F0 '$.'
;
; Update [bim_table_offset]+1 (eg, %FF7FB7) with base memory settings
;
mov [es:di+0x1],al ; 000085D9 26884501 '&.E.'
pop ax ; 000085DD 58 'X'
out 0x61,al ; 000085DE E661 '.a'
;
; Update [bim_table_offset]+0 (eg, %FF7FB6) with 0x10; that will set the first word of the built-in
; memory table to one of these values:
;
; 0x0010 256kb (1024 - 640 - 128)
; 0x2010 384Kb (1024 - 512 - 128)
; 0x3010 640Kb (1024 - 256 - 128)
;
mov byte [es:di],0x10 ; 000085E0 26C60510
mov al,0xb1 ; 000085E4 B0B1 '..'
out 0x70,al ; 000085E6 E670 '.p'
in al,0x71 ; 000085E8 E471 '.q'
mov ah,al ; 000085EA 8AE0 '..'
mov al,0xb0 ; 000085EC B0B0 '..'
out 0x70,al ; 000085EE E670 '.p'
in al,0x71 ; 000085F0 E471 '.q'
;
; (AX) contains CMOS EXTMEM2 value (eg, 0x400 or 1024Kb), to which we add another 1024Kb (for conventional memory)
;
add ax,0x400 ; 000085F2 050004 '...'
mov cx,0x3f80 ; 000085F5 B9803F '..?'
;
; (CX) contains 0x3F80 (maximum # of supported Kb), reduced by the amount of built-in memory
;
sub cx,bx ; 000085F8 2BCB '+.'
;
; Compare (AX), total conventional+extended memory, to (CX)
;
cmp ax,cx ; 000085FA 3BC1 ';.'
jc x8600 ; 000085FC 7202 'r.'
xor bx,bx ; 000085FE 33DB '3.'
;
; Assuming no problems, convert Kb of built-in memory to paragraphs, by multiplying by 64
;
x8600: shl bx,0x6 ; 00008600 C1E306 '...'
;
; If (BX) was 0x100 (256Kb), we'll move the equivalent number of paragraphs
; (0x4000) to [bim_table_offset]+2 and +4 (eg, %FF7FB8 and %FF7FBA).
;
mov [es:di+0x2],bx ; 00008603 26895D02 '&.].'
mov [es:di+0x4],bx ; 00008607 26895D04 '&.].'
mov ch,0xfe ; 0000860B B5FE '..'
xor cl,cl ; 0000860D 32C9 '2.'
shl cx,0x4 ; 0000860F C1E104 '...'
;
; Move 0xE000 to [bim_table_offset]+6 (eg, %FF7FBC)
;
mov [es:di+0x6],cx ; 00008612 26894D06 '&.M.'
mov di,si ; 00008616 8BFE '..'
mov ax,gs ; 00008618 8CE8 '..'
;
; (AX) contains the processor type and revision (AH=0x03, AL=0x04),
; which were preserved on reset in (GS); store them at the offset specified
; by cpu_idrev_offset (eg, type in %FF7FBE and revision in %FF7FBF).
;
mov [es:di],ah ; 0000861A 268825 '&.%'
mov [es:di+0x1],al ; 0000861D 26884501 '&.E.'
mov cx,0x7fff ; 00008621 B9FF7F '...'
mov si,0x8000 ; 00008624 BE0080 '...'
xor ah,ah ; 00008627 32E4 '2.'
cld ; 00008629 FC '.'
x862a: es lodsb ; 0000862A 26AC '&.'
add ah,al ; 0000862C 02E0 '..'
loop x862a ; 0000862E E2FA '..'
not ah ; 00008630 F6D4 '..'
inc ah ; 00008632 FEC4 '..'
mov [es:si],ah ; 00008634 268824 '&.$'
;
; Relocate RAM at %FF0000 to %0F0000
;
mov byte [0x0],0xfc ; 00008637 C6060000FC '.....'
pop ds ; 0000863C 1F '.'
pop es ; 0000863D 07 '.'
ret ; 0000863E C3 '.'
x863f: call x86db ; 0000863F E89900 '...'
mov [0x60],ax ; 00008642 A36000 '.`.'
mov cx,ax ; 00008645 8BC8 '..'
mov bx,0x280 ; 00008647 BB8002 '...'
test cl,0x20 ; 0000864A F6C120 '.. '
jz x865a ; 0000864D 740B 't.'
mov bx,0x200 ; 0000864F BB0002 '...'
test cl,0x10 ; 00008652 F6C110 '...'
jz x865a ; 00008655 7403 't.'
mov bx,0x100 ; 00008657 BB0001 '...'
x865a: mov ax,0x400 ; 0000865A B80004 '...'
mul bx ; 0000865D F7E3 '..'
dec dl ; 0000865F FECA '..'
mov [0x90],dl ; 00008661 88169000 '....'
mov al,cl ; 00008665 8AC1 '..'
and al,0xc0 ; 00008667 24C0 '$.'
cmp al,0x40 ; 00008669 3C40 '<@'
jz x868c ; 0000866B 741F 't.'
mov bx,0x400 ; 0000866D BB0004 '...'
test cl,0x40 ; 00008670 F6C140 '..@'
jnz x8680 ; 00008673 750B 'u.'
mov bx,0x800 ; 00008675 BB0008 '...'
test cl,0x80 ; 00008678 F6C180 '...'
jnz x8680 ; 0000867B 7503 'u.'
mov bx,0x2800 ; 0000867D BB0028 '..('
x8680: mov ax,0x400 ; 00008680 B80004 '...'
mul bx ; 00008683 F7E3 '..'
dec dl ; 00008685 FECA '..'
mov [0x91],dl ; 00008687 88169100 '....'
ret ; 0000868B C3 '.'
x868c: mov bh,ch ; 0000868C 8AFD '..'
mov bl,0x0 ; 0000868E B300 '..'
mov cx,0x4 ; 00008690 B90400 '...'
x8693: mov al,bh ; 00008693 8AC7 '..'
shr bh,0x2 ; 00008695 C0EF02 '...'
and al,0x3 ; 00008698 2403 '$.'
cmp al,0x2 ; 0000869A 3C02 '<.'
jnz x86a3 ; 0000869C 7505 'u.'
add bl,0x1 ; 0000869E 80C301 '...'
jmp short x86aa ; 000086A1 EB07 '..'
x86a3: cmp al,0x1 ; 000086A3 3C01 '<.'
jnz x86ac ; 000086A5 7505 'u.'
add bl,0x4 ; 000086A7 80C304 '...'
x86aa: loop x8693 ; 000086AA E2E7 '..'
x86ac: push ds ; 000086AC 1E '.'
mov ax,0x50 ; 000086AD B85000 '.P.'
mov ds,ax ; 000086B0 8ED8 '..'
mov al,[0x2] ; 000086B2 A00200 '...'
and al,0xf0 ; 000086B5 24F0 '$.'
or al,bl ; 000086B7 0AC3 0x0A,'.'
mov [0x2],al ; 000086B9 A20200 '...'
pop ds ; 000086BC 1F '.'
xor ah,ah ; 000086BD 32E4 '2.'
mov [0x62],ax ; 000086BF A36200 '.b.'
or bl,bl ; 000086C2 0ADB 0x0A,'.'
jnz x86c8 ; 000086C4 7502 'u.'
mov bl,0x1 ; 000086C6 B301 '..'