-
Notifications
You must be signed in to change notification settings - Fork 57
/
IDASM.ASM
1378 lines (1050 loc) · 25.9 KB
/
IDASM.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
; Hovertank 3-D Source Code
; Copyright (C) 1993-2014 Flat Rock Software
;
; This program 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 2 of the License, or
; (at your option) any later version.
;
; This program 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 this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
IDEAL
MODEL SMALL,C
;============================================================================
;
; Gamer's Edge Library, ASM section
;
;============================================================================
;=======================================================================
;
; KEYBOARD ROUTINES
;
;=======================================================================
DATASEG
EVEN
oldint9 dd 0
keydown db 128 dup (0)
NBKscan dw 0
NBKascii dw 0
scanascii db 0,27,49,50,51,52,53,54,55,56,57,48,45,61,8,9,113 ;'q'
db 119,101,114,116,121,117,105,111,112,91,93,13,0,97,115 ;'s'
db 100,102,103,104,106,107,108,59,39,96,0,92,122,120,99 ;'c'
db 118,98,110,109,44,46,47,0,42,0,32,0,1,1,1,1,1,1,1,1,1,1 ;f10
db 0,0,1,1,1,45,1,1,1,43,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0 ;shift-f10
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;ctl-home
db 0,0,0,0,0,0,0,0,0,0,0,0,0
PUBLIC keydown,NBKscan,NBKascii
CODESEG
;========
;
; StartupKbd
;
; Sets up the new INT 8 ISR and various internal pointers.
; Assumes that the calling program has pointer soundseg to something
; meaningful...
;
;========
PROC StartupKbd
PUBLIC StartupKbd
mov ax,3509h ;call bios to get int 9
int 21h
mov [WORD oldint9],bx
mov ax,es
mov [WORD oldint9+2],ax
push ds
push cs
pop ds
lea dx,[Int9Isr]
mov ax,2509h ;call bios to set int 9
int 21h
pop ds
ret
ENDP
;========
;
; ShutdownKbd
;
;========
PROC ShutdownKbd
PUBLIC ShutdownKbd
push ds
mov dx,[WORD Oldint9]
mov ds,[WORD Oldint9+2]
mov ax,2509h ;call bios to set int 8
int 21h
mov ax,40h ;clear ctrl/alt/shift flags
mov ds,ax
mov ax,[17h]
and ax,1111110011110000b
mov [17h],ax
pop ds
ret
ENDP
;========
;
; NoBiosKey
;
;========
PROC NoBiosKey parm:WORD
PUBLIC NoBiosKey
xor bh,bh
mov ax,[parm]
or ax,ax
jnz @@bioskey1
@@waitforkey:
mov bl,[BYTE NBKscan]
or bl,bl
jns @@waitforkey
mov al,[BYTE NBKascii]
or al,al
jz @@waitforkey
mov ah,[BYTE NBKscan]
and [BYTE NBKscan],7fh
ret
@@bioskey1:
mov al,[BYTE NBKascii]
mov ah,[BYTE NBKscan]
and ah,7fh
or al,al
jnz @@ok
xor ah,ah ; just a modifier key
@@ok:
ret
ENDP
;========
;
; Int9ISR
; only called by interrupt $9!
;
;=========
PROC Int9ISR FAR
PUBLIC Int9ISR
push ax
push bx
push ds
xor ah,ah
in al,60h ;get the key pressed
push ax
in al,61h
mov ah,al
or al,80h
out 61h,al
mov al,ah
out 61h,al
mov bx,_DATA
mov ds,bx ;ds to this data segment
pop ax
or al,al
jns @@keydown
;
; key released
;
and al,7fh
mov bx,ax
mov [keydown+BX],ah ;keydown[key] = false
jmp @@done
@@keydown:
mov [BYTE NBKscan],al
or [BYTE NBKscan],80h ;high bit set after press, cleared
mov bx,ax ;after NoBiosKey gets it
mov al,1
mov [keydown+BX],al ;keydown[key] = true
mov al,[scanascii+bx]
mov [BYTE NBKascii],al ;set the ascii code of key
@@done:
mov al,20h
out 20h,al ;we got the interrupt here
pop ds
pop bx
pop ax
iret
ENDP
;============================================================================
;
; SOUND ROUTINES
;
;============================================================================
DATASEG
;
;offsets into .SPK file at segment SPKRfile, offset 0
;
;sound records each take up 16 bytes, and start at $10, and continue to $3F0
snd_start equ 0
snd_priority equ 2
snd_samples equ 3
snd_name equ 4
timerspeed dw 0 ;clock speed for tic counting
LABEL inttime WORD
timecount dd 0,0 ;fast timer tics since startup
SPKactive dw 0 ;set non zero when started
soundmode dw 1 ;0=nosound, 1=SPKR, 2= adlib...
OldInt8 dd ? ;StartupSPK saves here, Shutdown restores
Intcount db ? ;counter for extraints, call OldInt8 at 0
SndPtr dw ? ;Pointer to frequency of current sound
SndPriority db ? ;current sound's priority
pausesndptr dw ?
pausepriority db ?
pauseintcount db ?
dontplay dw 0 ;set to 1 to avoid all interrupt and timer stuff
int8hook dw 0 ;gets called every tic if not null
soundseg dw ?
PUBLIC soundmode,dontplay,timecount,inttime,timerspeed,int8hook,soundseg,sndptr
PUBLIC SndPriority
EXTRN soundblaster:WORD
CODESEG
;========
;
; StartupSound
;
; Sets up the new INT 8 ISR and various internal pointers.
; Assumes that the calling program has pointer soundseg to something
; meaningful...
;
;========
PROC StartupSound
PUBLIC StartupSound
test [dontplay],0ffffh
je @@dowork
ret
@@dowork:
test [SPKactive],0FFFFh ;see if library is active
jne @@started ;library was allready started
@@start:
call NEAR PTR StopSound ;make sure nothing is playing
mov ax,3508h ;call bios to get int 8
int 21h
mov [WORD oldint8],bx
mov ax,es
mov [WORD oldint8+2],ax
push ds
push cs
pop ds
lea dx,[UpdateSPKR]
mov ax,2508h ;call bios to set int 8
int 21h
pop ds
mov bx,[timerspeed]
cli
mov al,36h ;tell the timer chip we are going to
out 43h,al ;change the speed of timer 0
mov al,0
mov al,bl
out 40h,al ;low
mov al,bh
out 40h,al ;high
sti
inc [SPKactive] ;sound routines are now active
@@started:
mov ax,1
mov [soundmode],ax ;set soundmode to SPKR
ret
ENDP
;========
;
; CallTimer
;
; Call the bios int8 to turn off drive motors
;
;========
PROC CallTimer
PUBLIC CallTimer
test [WORD OldInt8+2],0ffffh
jz @@done
pushf
call [OldInt8]
@@done:
ret
ENDP
;========
;
; ShutdownSound
;
;========
PROC ShutdownSound
PUBLIC ShutdownSound
test [dontplay],0ffffh
je @@dowork
ret
@@dowork:
cli
mov al,36h ;tell the timer chip we are going to
out 43h,al ;change the speed of timer 0
mov al,0 ;system expects 0000 for rate
out 40h,al ;low
out 40h,al ;high
sti
mov ax,[SPKactive]
cmp ax,0
je @@done ;sound library wasn't started...
push ds
mov dx,[WORD Oldint8]
mov ax,[WORD Oldint8+2]
mov ds,ax
mov ax,2508h ;call bios to set int 8
int 21h
pop ds
mov [SPKactive],0 ;sound routines are now inactive
cli
in al,61h ;get peripheral (speaker) port value
and al,11111101b ;turn speaker off
out 61h,al
sti
@@done:
ret
ENDP
;===========
;
; PlaySoundSPK (soundnum)
;
; If the sound's priority is >= the current priority, SoundPtr, SndPriority,
; and the timer speed are changed
;
; Hacked for sound blaster support!
;
;===========
EXTRN jmPlaySample:PROC
PROC PlaySound playnum:WORD
USES SI
PUBLIC PlaySound
test [dontplay],-1 ;for profiler
jne @@playdone
test [soundmode],-1 ;f2 to turn off sound blaster also
je @@playdone
mov ax,[playnum] ;index into the sound headers
mov si,ax
shl si,1
shl si,1
shl si,1
shl si,1
mov es,[soundseg] ;point es: to the spkr file
mov al,[es:si+snd_Priority] ;priority table (one byte each)
cmp al,[SndPriority]
jb @@playdone ;current sound has higher priority
mov [SndPriority],al
test [soundblaster],-1
jz @@pc
push [playnum]
call jmPlaySample
pop ax
ret
@@pc:
mov ax,[es:si+snd_Start] ;offset in .SPK file
mov [SndPtr],ax ;store it in the sound playing table
@@playdone:
ret
ENDP
;======================================================================
;===========
;
; StopSound
;
;===========
PROC StopSound
PUBLIC StopSound
test [dontplay],0ffffh
je @@dowork
ret
@@dowork:
xor ax,ax ;set to 0
mov [SndPtr],ax
mov [SndPriority],al
cli
in al,61h ;get peripheral (speaker) port value
and al,11111101b ;turn speaker off
out 61h,al
sti
ret
ENDP
;======================================================================
;===========
;
; PauseSound
;
;===========
PROC PauseSound
PUBLIC PauseSound
test [dontplay],0ffffh
je @@dowork
ret
@@dowork:
mov ax,[SndPtr] ;save off the current values
mov [pausesndptr],ax
mov al,[SndPriority]
mov [pausepriority],al
mov al,[intcount]
mov [pauseintcount],al
call StopSound
ret
ENDP
;======================================================================
;===========
;
; ContinueSound
;
;===========
PROC ContinueSound
PUBLIC ContinueSound
test [dontplay],0ffffh
je @@dowork
ret
@@dowork:
mov ax,[pausesndptr]
mov [SndPtr],ax ;restore the old values
mov al,[pausepriority]
mov [SndPriority],al
mov al,[pauseintcount]
mov [intcount],al
ret
ENDP
;======================================================================
;========
;
; WaitendSound
; Just waits around until the current sound stops playing
;
;========
PROC WaitEndSound
PUBLIC WaitEndSound
test [dontplay],0ffffh
je @@dowork
ret
@@dowork:
pushf
call FAR PTR UpdateSPKR ;in case a sound was just started and hasn't
;been hit by an INT yet
@@wait:
mov ax,[sndptr]
cmp ax,0 ;when the ptr is 0, nothing is on
jne @@wait
ret
ENDP
;=========================================================================
;========
;
; UpdateSPKR
; only called by interrupt $8!
;
;=========
DATASEG
EVEN
oldss dw ?
oldsp dw ?
fakestack dw 64 dup (?)
PUBLIC fakestack
CODESEG
PROC UpdateSPKR FAR
PUBLIC UpdateSPKR
push ax
push bx
push cx
push si
push ds
push es
mov al,20h
out 20h,al ;we got the interrupt here
mov ax,@Data
mov ds,ax ;ds to this data segment
add [WORD timecount],1 ;inced once every VBL time
adc [WORD timecount+2],0
;
; call a user routine if needed
;
mov ax,[int8hook]
or ax,ax
jz @@userdone
push ax
push bx
push cx
push dx
push si
push di
push bp
push es
push ds
pushf
mov [oldss],ss ;because we might not be in our stack!
mov [oldsp],sp
mov bx,ds
mov ss,bx ;make SURE the stack is = ds
mov sp,OFFSET fakestack+60
call ax ;user routine that gets called every tic
mov ss,[oldss]
mov sp,[oldsp]
popf
pop ds
pop es
pop bp
pop di
pop si
pop dx
pop cx
pop bx
pop ax
@@userdone:
mov es,[soundseg] ;es to sound file
;
; play the speaker
;
mov si,[SndPtr]
cmp si,0
je @@nosound ;nothing playing
mov bx,[es:si]
inc [SndPtr]
inc [SndPtr]
cmp bx,0
je @@nosound ;a zero frequency is no sound, but don't stop
cmp bx,-1 ;a -1 frequency is end of sound
jne @@playfreq
call StopSound
jmp @@doneplay
@@nosound:
in al,61h ;get peripheral (speaker) port value
and al,11111100b ;turn speaker off
out 61h,al
jmp @@doneplay
@@playfreq:
test [soundmode],0FFh ;if soundon=0, don't play anything
je @@nosound
mov al,10110110b ;write to channel 2 (speaker) timer
out 43h,al
mov al,bl
out 42h,al ;low byte
mov al,bh
out 42h,al ;high byte
in al,61h ;get peripheral (speaker) port value
or al,00000011b ;turn speaker on to timer
out 61h,al
@@doneplay:
pop es
pop ds
pop si
pop cx
pop bx
pop ax
iret
ENDP
;============================================================================
;
; RANDOM ROUTINES
;
;============================================================================
DATASEG
rndindex dw ?
rndtable db 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66
db 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36
db 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188
db 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224
db 149, 104, 25, 178, 252, 182, 202, 182, 141, 197, 4, 81, 181, 242
db 145, 42, 39, 227, 156, 198, 225, 193, 219, 93, 122, 175, 249, 0
db 175, 143, 70, 239, 46, 246, 163, 53, 163, 109, 168, 135, 2, 235
db 25, 92, 20, 145, 138, 77, 69, 166, 78, 176, 173, 212, 166, 113
db 94, 161, 41, 50, 239, 49, 111, 164, 70, 60, 2, 37, 171, 75
db 136, 156, 11, 56, 42, 146, 138, 229, 73, 146, 77, 61, 98, 196
db 135, 106, 63, 197, 195, 86, 96, 203, 113, 101, 170, 247, 181, 113
db 80, 250, 108, 7, 255, 237, 129, 226, 79, 107, 112, 166, 103, 241
db 24, 223, 239, 120, 198, 58, 60, 82, 128, 3, 184, 66, 143, 224
db 145, 224, 81, 206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95
db 28, 139, 123, 98, 125, 196, 15, 70, 194, 253, 54, 14, 109, 226
db 71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36
db 17, 46, 52, 231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106
db 197, 242, 98, 43, 39, 175, 254, 145, 190, 84, 118, 222, 187, 136
db 120, 163, 236, 249
;
; Random # Generator vars
;
indexi dw ? ;Rnd#Generator
indexj dw ?
LastRnd dw ?
RndArray dw 17 dup (?)
baseRndArray dw 1,1,2,3,5,8,13,21,54,75,129,204
dw 323,527,850,1377,2227
CODESEG
;=================================================
;
; InitRnd (boolean randomize)
; if randomize is false, the counter is set to 0
;
;=================================================
PROC InitRnd randomize:word
USES SI,DI
public InitRnd
mov ax,ds
mov es,ax
mov di,offset RndArray
mov si,offset baseRndArray
mov cx,17
cld
rep movsw ;set up the table (which is constantly changed)
mov [LastRnd],0
mov [indexi],17*2
mov [indexj],5*2
mov ax,[randomize]
cmp ax,0
je @@setit ;if randomize is true, really random
mov ah,2ch
int 21h ;GetSystemTime
mov [RndArray+34-2],dx
xor dx,cx ;init w/seconds values
mov [RndArray+10-2],dx
@@setit:
mov ax,0ffffh
push ax
call Rnd ;warm up generator!
pop ax
ret
ENDP
;=================================================
;
; unsigned Random (unsigned maxval)
; Return a random # between 0-?
;
;=================================================
PROC Rnd maxval:WORD
USES SI
public Rnd
mov ax,[maxval]
push ax ;save max value
;
; create a mask to cut down on the # of SUBTRACTS!
;
mov dx,0ffffh ;full-mask
@@0:
shl ax,1
jc @@0a
shr dx,1
jmp @@0
@@0a:
mov bx,[indexi] ;this routine was converted from
mov si,[indexj] ;the Random macro on Merlin GS
mov ax,[RndArray-2+bx]
adc ax,[RndArray-2+si]
mov [RndArray-2+bx],ax
add ax,[LastRnd]
mov [LastRnd],ax
dec bx
dec bx
jne @@1
mov bx,17*2
@@1:
dec si
dec si
jne @@2
mov si,17*2
@@2:
mov [indexi],bx
mov [indexj],si
pop cx ;loop -- returns value in range
and ax,dx ;AND our mask!
@@3:
cmp ax,cx ;SUBTRACT to be within range
jbe @@4
shr ax,1
@@4:
ret
ENDP
;=================================================
;
; InitRndT (boolean randomize)
; Init table based RND generator
; if randomize is false, the counter is set to 0
;
;=================================================
PROC InitRndT randomize:word
uses si,di
public initrndt
mov ax,[randomize]
or ax,ax
jne @@timeit ;if randomize is true, really random
mov dx,0 ;set to a definate value
jmp @@setit
@@timeit:
mov ah,2ch
int 21h ;GetSystemTime
and dx,0ffh
@@setit:
mov [rndindex],dx
ret
ENDP
;=================================================
;
; int RandomT (void)
; Return a random # between 0-255
; Exit : AX = value
;
;=================================================
PROC RndT
public RndT
mov bx,[rndindex]
inc bx
and bx,0ffh
mov [rndindex],bx
mov al,[rndtable+BX]
xor ah,ah
ret
ENDP
;============================================================================
;
; MISC VIDEO ROUTINES
;
;============================================================================
;========
;
; WaitVBL (int number)
;
;========
STATUS_REGISTER_1 = 03dah
PROC WaitVBL number:WORD
PUBLIC WaitVBL
mov dx,STATUS_REGISTER_1
mov cx,[number]
waitvbl1:
in al,dx
test al,00001000b ;look for vbl
jnz waitvbl1
waitvbl2:
in al,dx
test al,00001000b ;look for vbl
jz waitvbl2
loop waitvbl1
ret
ENDP
;===========================================================================
MASM
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
;
; Name: VideoID
;
; Function: Detects the presence of various video subsystems
;
; int VideoID;
;
; Subsystem ID values:
; 0 = (none)
; 1 = MDA
; 2 = CGA
; 3 = EGA
; 4 = MCGA
; 5 = VGA
; 80h = HGC
; 81h = HGC+
; 82h = Hercules InColor
;
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
;
; Equates
;
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
VIDstruct STRUC ; corresponds to C data structure
Video0Type DB ? ; first subsystem type
Display0Type DB ? ; display attached to first subsystem
Video1Type DB ? ; second subsystem type
Display1Type DB ? ; display attached to second subsystem
VIDstruct ENDS
Device0 EQU word ptr Video0Type[di]
Device1 EQU word ptr Video1Type[di]
MDA EQU 1 ; subsystem types
CGA EQU 2
EGA EQU 3
MCGA EQU 4
VGA EQU 5
HGC EQU 80h
HGCPlus EQU 81h
InColor EQU 82h
MDADisplay EQU 1 ; display types
CGADisplay EQU 2
EGAColorDisplay EQU 3
PS2MonoDisplay EQU 4
PS2ColorDisplay EQU 5
TRUE EQU 1
FALSE EQU 0
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
;
; Program
;
;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Results VIDstruct <> ;results go here!