-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathowcomp.h
More file actions
2151 lines (1810 loc) · 47.5 KB
/
owcomp.h
File metadata and controls
2151 lines (1810 loc) · 47.5 KB
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
/* 32-bit compact memory model (device-drivers) */
// check carry flag, and set eax=0 if set and eax=1 if clear
#define CarryToBool 0x73 4 0x33 0xC0 0xEB 5 0xB8 1 0 0 0
// check carry flag, and set ebx=0 if set and ebx=bx if clear
#define ValidateHandle 0x73 2 0x33 0xDB 0xF 0xB7 0xDB
// check carry flag, and set eax=0 if set
#define ValidateEax 0x73 2 0x33 0xC0
// check carry flag, and set ecx=0 if set
#define ValidateEcx 0x73 2 0x33 0xC9
// check carry flag, and set edx=0 if set
#define ValidateEdx 0x73 2 0x33 0xD2
// check carry flag, and set esi=0 if set
#define ValidateEsi 0x73 2 0x33 0xF6
// check carry flag, and set edi=0 if set
#define ValidateEdi 0x73 2 0x33 0xFF
// check disc id, set to -1 on carry, extend to eax
#define ValidateDisc 0x73 2 0xB0 0xFF 0xF 0xBE 0xC0
#pragma aux RdosTestGate = \
CallGate_test_gate
#pragma aux RdosLoad32 = \
CallGate_load_device32 \
#pragma aux RdosSwapShort = \
"xchg al,ah" \
__parm [__ax] \
__value [__ax]
#pragma aux RdosSwapLong = \
"xchg al,ah" \
"rol eax,16" \
"xchg al,ah" \
__parm [__eax] \
__value [__eax]
#pragma aux RdosGetCharSize = \
"mov al,1" \
"mov ah,es:[edi]" \
"test ah,80h" \
"jz size_ok" \
"inc al" \
"test ah,20h" \
"jz size_ok" \
"inc al" \
"test ah,10h" \
"jz size_ok" \
"inc al" \
"size_ok: " \
"movzx eax,al" \
__parm [__es __edi] \
__value [__eax]
#pragma aux RdosGetLongRandom = \
CallGate_get_random \
__value [__eax]
#pragma aux RdosGetRandom = \
CallGate_get_random \
"mul edx" \
__parm [__edx] \
__value [__edx] \
__modify [__eax]
#pragma aux RdosSetClipRect = \
CallGate_set_clip_rect \
__parm [__ebx] [__ecx] [__edx] [__esi] [__edi]
#pragma aux RdosClearClipRect = \
CallGate_clear_clip_rect \
__parm [__ebx]
#pragma aux RdosSetDrawColor = \
CallGate_set_drawcolor \
__parm [__ebx] [__eax]
#pragma aux RdosSetLGOP = \
CallGate_set_lgop \
__parm [__ebx] [__eax]
#pragma aux RdosSetHollowStyle = \
CallGate_set_hollow_style \
__parm [__ebx]
#pragma aux RdosSetFilledStyle = \
CallGate_set_filled_style \
__parm [__ebx]
#pragma aux RdosAnsiToUtf8 = \
"push ds" \
"mov eax,fs" \
"mov ds,eax" \
CallGate_ansi_to_utf8 \
"pop ds" \
__parm [__fs __esi] [__es __edi] [__ecx] \
__value [__eax]
#pragma aux RdosUtf8ToAnsi = \
"push ds" \
"mov eax,fs" \
"mov ds,eax" \
CallGate_utf8_to_ansi \
"pop ds" \
__parm [__fs __esi] [__es __edi] [__ecx] \
__value [__eax]
#pragma aux RdosAnsiToUtf16 = \
"push ds" \
"mov eax,fs" \
"mov ds,eax" \
CallGate_ansi_to_utf16 \
"pop ds" \
__parm [__fs __esi] [__es __edi] [__ecx] \
__value [__eax]
#pragma aux RdosUtf16ToAnsi = \
"push ds" \
"mov eax,fs" \
"mov ds,eax" \
CallGate_utf16_to_ansi \
"pop ds" \
__parm [__fs __esi] [__es __edi] [__ecx] \
__value [__eax]
#pragma aux RdosOpenFont = \
CallGate_open_font \
ValidateHandle \
__parm [__edx] [__eax] \
__value [__ebx]
#pragma aux RdosCloseFont = \
CallGate_close_font \
__parm [__ebx]
#pragma aux RdosGetStringMetrics = \
CallGate_get_string_metrics \
"movzx ecx,cx" \
"movzx edx,dx" \
"mov es:[eax],ecx" \
"mov fs:[esi],edx" \
__parm [__ebx] [__edi] [__es __eax] [__fs __esi] \
__modify [__ecx __edx]
#pragma aux RdosSetFont = \
CallGate_set_font \
__parm [__ebx] [__eax]
#pragma aux RdosGetPixel = \
CallGate_get_pixel \
__parm [__ebx] [__ecx] [__edx] \
__value [__eax]
#pragma aux RdosSetPixel = \
CallGate_set_pixel \
__parm [__ebx] [__ecx] [__edx]
// Blit here
// DrawMask here
#pragma aux RdosDrawLine = \
CallGate_draw_line \
__parm [__ebx] [__ecx] [__edx] [__esi] [__edi]
#pragma aux RdosDrawString = \
CallGate_draw_string \
__parm [__ebx] [__ecx] [__edx] [__es __edi]
#pragma aux RdosDrawRect = \
CallGate_draw_rect \
__parm [__ebx] [__ecx] [__edx] [__esi] [__edi]
#pragma aux RdosDrawEllipse = \
CallGate_draw_ellipse \
__parm [__ebx] [__ecx] [__edx] [__esi] [__edi]
#pragma aux RdosCreateBitmap = \
CallGate_create_bitmap \
ValidateHandle \
__parm [__eax] [__ecx] [__edx] \
__value [__ebx]
#pragma aux RdosDuplicateBitmapHandle = \
CallGate_dup_bitmap_handle \
ValidateHandle \
__parm [__ebx] \
__value [__ebx]
#pragma aux RdosCloseBitmap = \
CallGate_close_bitmap \
__parm [__ebx]
#pragma aux RdosCreateStringBitmap = \
CallGate_create_string_bitmap \
ValidateHandle \
__parm [__ebx] [__es __edi] \
__value [__ebx]
// GetBitmapInfo here
#pragma aux RdosCreateSprite = \
CallGate_create_sprite \
ValidateHandle \
__parm [__ebx] [__ecx] [__edx] [__eax] \
__value [__ebx]
#pragma aux RdosCloseSprite = \
CallGate_close_sprite \
__parm [__ebx]
#pragma aux RdosShowSprite = \
CallGate_show_sprite \
__parm [__ebx]
#pragma aux RdosHideSprite = \
CallGate_hide_sprite \
__parm [__ebx]
#pragma aux RdosMoveSprite = \
CallGate_move_sprite \
__parm [__ebx] [__ecx] [__edx]
#pragma aux RdosSetForeColor = \
CallGate_set_forecolor \
__parm [__eax]
#pragma aux RdosSetBackColor = \
CallGate_set_backcolor \
__parm [__eax]
#pragma aux RdosGetFreePhysical = \
CallGate_get_free_physical \
__value [__edx __eax]
#pragma aux RdosGetFreeGdt = \
CallGate_get_free_gdt \
"movzx eax,ax" \
__value [__eax]
#pragma aux RdosGetFreeSmallKernelLinear = \
CallGate_available_small_linear \
__value [__eax]
#pragma aux RdosGetFreeBigKernelLinear = \
CallGate_available_big_linear \
__value [__eax]
#pragma aux RdosGetFreeSmallLocalLinear = \
CallGate_available_small_local_linear \
__value [__eax]
#pragma aux RdosGetFreeBigLocalLinear = \
CallGate_available_big_local_linear \
__value [__eax]
#pragma aux RdosGetMaxComPort = \
CallGate_get_max_com_port \
"jc fail" \
"movzx eax,al" \
"jmp done" \
"fail:" \
"xor eax,eax" \
"done:" \
__value [__eax]
#pragma aux RdosOpenCom = \
CallGate_open_com \
ValidateHandle \
__parm [__al] [__ecx] [__bh] [__ah] [__bl] [__esi] [__edi] \
__value [__ebx]
#pragma aux RdosCloseCom = \
CallGate_close_com \
__parm [__ebx]
#pragma aux RdosFlushCom = \
CallGate_flush_com \
__parm [__ebx]
#pragma aux RdosResetCom = \
CallGate_reset_com \
__parm [__ebx]
#pragma aux RdosReadCom = \
CallGate_read_com \
__parm [__ebx] \
__value [__al]
#pragma aux RdosWriteCom = \
CallGate_write_com \
"movsx eax,al" \
__parm [__ebx] [__al] \
__value [__eax]
#pragma aux RdosEnableCts = \
CallGate_enable_cts \
__parm [__ebx]
#pragma aux RdosDisableCts = \
CallGate_disable_cts \
__parm [__ebx]
#pragma aux RdosEnableAutoRts = \
CallGate_enable_auto_rts \
__parm [__ebx]
#pragma aux RdosDisableAutoRts = \
CallGate_disable_auto_rts \
__parm [__ebx]
#pragma aux RdosSetDtr = \
CallGate_set_dtr \
__parm [__ebx]
#pragma aux RdosResetDtr = \
CallGate_reset_dtr \
__parm [__ebx]
#pragma aux RdosSetRts = \
CallGate_set_rts \
__parm [__ebx]
#pragma aux RdosResetRts = \
CallGate_reset_rts \
__parm [__ebx]
#pragma aux RdosGetReceiveBufferSpace = \
CallGate_get_com_receive_space \
ValidateEax \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosGetSendBufferSpace = \
CallGate_get_com_send_space \
ValidateEax \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosWaitForSendCompletedCom = \
CallGate_wait_for_send_completed_com \
__parm [__ebx]
#pragma aux RdosGetMaxPrinters = \
CallGate_get_max_printer \
"jc fail" \
"movzx eax,al" \
"jmp done" \
"fail:" \
"xor eax,eax" \
"done:" \
__value [__eax]
#pragma aux RdosOpenPrinter = \
CallGate_open_printer \
ValidateHandle \
__parm [__al] \
__value [__ebx]
#pragma aux RdosClosePrinter = \
CallGate_close_printer \
__parm [__ebx]
#pragma aux RdosGetPrinterName = \
CallGate_get_printer_name \
CarryToBool \
__parm [__ebx] [__es __edi] \
__value [__eax]
#pragma aux RdosIsPrinterJammed = \
CallGate_is_printer_jammed \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosIsPrinterPaperLow = \
CallGate_is_printer_paper_low \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosIsPrinterPaperEnd = \
CallGate_is_printer_paper_end \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosIsPrinterCutterJammed = \
CallGate_is_printer_cutter_jammed \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosIsPrinterOk = \
CallGate_is_printer_ok \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosIsPrinterHeadLifted = \
CallGate_is_printer_head_lifted \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosHasPrinterPaperInPresenter = \
CallGate_has_printer_paper_in_presenter \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosHasPrinterTemperatureError = \
CallGate_has_printer_temp_error \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosHasPrinterFeedError = \
CallGate_has_printer_feed_error \
"cmc" \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosPrintTest = \
CallGate_print_test \
__parm [__ebx]
#pragma aux RdosCreatePrinterBitmap = \
CallGate_create_printer_bitmap \
"mov ebx,eax" \
ValidateHandle \
__parm [__ebx] [__edx] \
__value [__ebx]
#pragma aux RdosPrintBitmap = \
CallGate_print_bitmap \
__parm [__ebx] [__eax]
#pragma aux RdosPresentPrinterMedia = \
CallGate_present_printer_media \
__parm [__ebx] [__eax]
#pragma aux RdosEjectPrinterMedia = \
CallGate_eject_printer_media \
__parm [__ebx]
#pragma aux RdosWaitForPrint = \
CallGate_wait_for_print \
__parm [__ebx]
#pragma aux RdosResetPrinter = \
CallGate_reset_printer \
__parm [__ebx]
#pragma aux RdosGetMaxCardDev = \
CallGate_get_max_carddev \
"jc fail" \
"movzx eax,al" \
"jmp done" \
"fail:" \
"xor eax,eax" \
"done:" \
__value [__eax]
#pragma aux RdosOpenCardDev = \
CallGate_open_carddev \
ValidateHandle \
__parm [__al] \
__value [__ebx]
#pragma aux RdosCloseCardDev = \
CallGate_close_carddev \
__parm [__ebx]
#pragma aux RdosGetCardDevName = \
CallGate_get_carddev_name \
CarryToBool \
__parm [__ebx] [__es __edi] \
__value [__eax]
#pragma aux RdosIsCardDevOk = \
CallGate_is_carddev_ok \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosIsCardDevBusy = \
CallGate_is_carddev_busy \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosIsCardDevInserted = \
CallGate_is_carddev_inserted \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosHadCardDevInserted = \
CallGate_had_carddev_inserted \
CarryToBool \
__parm [__ebx] \
__value [__eax]
#pragma aux RdosClearCardDevInserted = \
CallGate_clear_carddev_inserted \
__parm [__ebx]
#pragma aux RdosWaitForCard = \
CallGate_wait_for_card \
CarryToBool \
__parm [__ebx] [__es __edi] \
__value [__eax]
#pragma aux RdosOpenFile = \
CallGate_open_file \
ValidateHandle \
__parm [__es __edi] [__cl] \
__value [__ebx]
#pragma aux RdosCreateFile = \
CallGate_create_file \
ValidateHandle \
__parm [__es __edi] [__ecx] \
__value [__ebx]
#pragma aux RdosCloseFile = \
CallGate_close_file \
__parm [__ebx]
#pragma aux RdosDuplFile = \
CallGate_dupl_file \
ValidateHandle \
__parm [__eax] \
__value [__ebx]
#pragma aux RdosGetFileSize = \
CallGate_get_file_size64 \
"jnc gfsDone" \
CallGate_get_file_size32 \
"xor edx,edx" \
ValidateEax \
"gfsDone:" \
__parm [__ebx] \
__value [__edx __eax]
#pragma aux RdosSetFileSize = \
CallGate_set_file_size64 \
"jnc sfsDone" \
CallGate_set_file_size32 \
"sfsDone:" \
__parm [__ebx] [__edx __eax]
#pragma aux RdosGetFilePos = \
CallGate_get_file_pos64 \
"jnc gfpDone" \
CallGate_get_file_pos32 \
"xor edx,edx" \
ValidateEax \
"gfpDone:" \
__parm [__ebx] \
__modify [__ecx] \
__value [__edx __eax]
#pragma aux RdosSetFilePos = \
CallGate_set_file_pos64 \
"jnc sfpDone" \
CallGate_set_file_pos32 \
"sfpDone:" \
__parm [__ebx] [__eax]
#pragma aux RdosReadFile = \
CallGate_read_file \
ValidateEax \
__parm [__ebx] [__es __edi] [__ecx] \
__value [__eax]
#pragma aux RdosWriteFile = \
CallGate_write_file \
ValidateEax \
__parm [__ebx] [__es __edi] [__ecx] \
__value [__eax]
#pragma aux RdosGetFileTime = \
CallGate_get_file_time \
"mov fs:[esi],edx" \
"mov es:[edi],eax" \
__parm [__ebx] [__fs __esi] [__es __edi] \
__modify [__eax __edx]
#pragma aux RdosSetFileTime = \
CallGate_set_file_time \
__parm [__ebx] [__edx] [__eax]
#pragma aux RdosCreateMapping = \
CallGate_create_mapping \
ValidateHandle \
__parm [__eax] \
__value [__ebx]
#pragma aux RdosCreateNamedMapping = \
CallGate_create_named_mapping \
ValidateHandle \
__parm [__es __edi] [__eax] \
__value [__ebx]
#pragma aux RdosOpenNamedMapping = \
CallGate_open_named_mapping \
ValidateHandle \
__parm [__es __edi] \
__value [__ebx]
#pragma aux RdosCloseMapping = \
CallGate_close_mapping \
__parm [__ebx]
#pragma aux RdosMapView = \
CallGate_map_view \
__parm [__ebx] [__eax] [__es __edi] [__ecx]
#pragma aux RdosUnmapView = \
CallGate_unmap_view \
__parm [__ebx]
#pragma aux RdosSetCurDrive = \
CallGate_set_cur_drive \
CarryToBool \
__parm [__eax] \
__value [__eax]
#pragma aux RdosGetCurDrive = \
CallGate_get_cur_drive \
"movzx eax,al" \
__value [__eax]
#pragma aux RdosGetCurDir = \
CallGate_get_cur_dir \
CarryToBool \
__parm [__eax] [__es __edi] \
__value [__eax]
#pragma aux RdosSetCurDir = \
CallGate_set_cur_dir \
CarryToBool \
__parm [__es __edi] \
__value [__eax]
#pragma aux RdosMakeDir = \
CallGate_make_dir \
CarryToBool \
__parm [__es __edi] \
__value [__eax]
#pragma aux RdosRemoveDir = \
CallGate_remove_dir \
CarryToBool \
__parm [__es __edi] \
__value [__eax]
#pragma aux RdosRenameFile = \
"push ds" \
"mov ds,edx" \
CallGate_rename_file \
CarryToBool \
"pop ds" \
__parm [__es __edi] [__edx __esi] \
__value [__eax]
#pragma aux RdosDeleteFile = \
CallGate_delete_file \
CarryToBool \
__parm [__es __edi] \
__value [__eax]
#pragma aux RdosGetFileAttribute = \
CallGate_get_file_attribute \
"movzx ecx,cx" \
"mov fs:[eax],ecx" \
CarryToBool \
__parm [__es __edi] [__fs __eax] \
__value [__eax] \
__modify [__ecx]
#pragma aux RdosSetFileAttribute = \
CallGate_set_file_attribute \
CarryToBool \
__parm [__es __edi] [__ecx] \
__value [__eax]
#pragma aux RdosOpenDir = \
CallGate_open_dir \
ValidateHandle \
__parm [__es __edi] \
__value [__ebx]
#pragma aux RdosCloseDir = \
CallGate_close_dir \
__parm [__ebx]
// ReadDir here
#pragma aux RdosGetImageHeader = \
CallGate_get_image_header \
CarryToBool \
__parm [__eax] [__edx] [__es __edi] \
__value [__eax]
#pragma aux RdosGetImageData = \
CallGate_get_image_data \
CarryToBool \
__parm [__eax] [__edx] [__es __edi] \
__value [__eax]
#pragma aux RdosGetDeviceInfo = \
"push ds" \
"mov ds,eax" \
"push edx" \
CallGate_get_device_info \
"mov [ecx],eax" \
CarryToBool \
"mov gs:[esi],edx" \
"pop edx" \
"mov fs:[edx],bx" \
"pop ds" \
__parm [__ebx] [__es __edi] [__eax __ecx] [__fs __edx] [__gs __esi] \
__modify [__ebx __edx] \
__value [__eax]
#pragma aux RdosGetSelectorInfo = \
CallGate_get_selector_info \
"mov fs:[esi],ecx" \
"movzx eax,al" \
"mov es:[edi],eax" \
CarryToBool \
__parm [__bx] [__fs __esi] [__es __edi] \
__modify [__ecx] \
__value [__eax]
#pragma aux RdosGetFaultThreadState = \
CallGate_get_fault_thread_state \
CarryToBool \
__parm [__eax] [__es __edi] \
__value [__eax]
#pragma aux RdosGetFaultThreadTss = \
CallGate_get_fault_thread_tss \
CarryToBool \
__parm [__eax] [__es __edi] \
__value [__eax]
#pragma aux RdosGetThreadCount = \
CallGate_get_thread_count \
"movzx eax,ax" \
__value [__eax]
#pragma aux RdosGetThreadState = \
CallGate_get_thread_state \
CarryToBool \
__parm [__eax] [__es __edi] \
__value [__eax]
#pragma aux RdosSetThreadAction = \
CallGate_set_thread_action \
__parm [__es __edi]
#pragma aux RdosGetThreadActionState = \
CallGate_get_thread_action_state \
CarryToBool \
__parm [__eax] [__es __edi] \
__value [__eax]
#pragma aux RdosSuspendThread = \
CallGate_suspend_thread \
CarryToBool \
__parm [__eax] \
__value [__eax]
#pragma aux RdosSuspendAndSignalThread = \
CallGate_suspend_and_signal_thread \
CarryToBool \
__parm [__eax] \
__value [__eax]
#pragma aux RdosSoftReset = \
CallGate_soft_reset
#pragma aux RdosHardReset = \
CallGate_hard_reset
#pragma aux RdosPowerFailure = \
CallGate_power_failure \
"movzx eax,ax" \
__value [__eax]
#pragma aux RdosIsEmergencyStopped = \
CallGate_is_emergency_stopped \
CarryToBool \
__value [__eax]
#pragma aux RdosHasGlobalTimer = \
CallGate_has_global_timer \
CarryToBool \
__value [__eax]
#pragma aux RdosGetActiveCores = \
CallGate_get_active_cores \
__value [__eax]
#pragma aux RdosGetCoreLoad = \
CallGate_get_core_load \
"mov fs:[esi],ebx" \
"mov fs:[esi+4],ecx" \
"mov es:[edi],eax" \
"mov es:[edi+4],edx" \
CarryToBool \
__parm [__eax] [__fs __esi] [__es __edi] \
__value [__eax] \
__modify [__ebx __ecx __edx]
#pragma aux RdosGetCoreDuty = \
CallGate_get_core_duty \
"mov fs:[esi],eax" \
"mov fs:[esi+4],edx" \
"mov es:[edi],ebx" \
"mov es:[edi+4],ecx" \
CarryToBool \
__parm [__eax] [__fs __esi] [__es __edi] \
__value [__eax] \
__modify [__ebx __ecx __edx]
#pragma aux RdosGetVersion = \
CallGate_get_version \
"movzx edx,dx" \
"mov gs:[ebx],edx" \
"movzx eax,ax" \
"mov fs:[esi],eax" \
"movzx ecx,cx" \
"mov es:[edi],ecx" \
__parm [__gs __ebx] [__fs __esi] [__es __edi] \
__modify [__eax __ecx __edx]
#pragma aux RdosGetCpuVersion = \
CallGate_get_cpu_version \
"movzx eax,al" \
"mov fs:[esi],edx" \
"mov gs:[ecx],ebx" \
__parm [__es __edi] [__fs __esi] [__gs __ecx] \
__value [__eax]
#pragma aux RdosTerminateThread = \
CallGate_terminate_thread
#pragma aux RdosGetThreadHandle = \
CallGate_get_thread \
"movzx eax,ax" \
__value [__eax]
#pragma aux RdosWaitMilli = \
CallGate_wait_milli \
__parm [__eax]
#pragma aux RdosWaitMicro = \
CallGate_wait_micro \
__parm [__eax]
#pragma aux RdosWaitUntil = \
CallGate_wait_until \
__parm [__edx] [__eax]
#pragma aux RdosGetSysTime = \
CallGate_get_system_time \
"mov fs:[esi],edx" \
"mov es:[edi],eax" \
__parm [__fs __esi] [__es __edi] \
__modify [__eax __edx]
#pragma aux RdosGetLongSysTime = \
CallGate_get_system_time \
__value [__edx __eax]
#pragma aux RdosGetTime = \
CallGate_get_time \
"mov fs:[esi],edx" \
"mov es:[edi],eax" \
__parm [__fs __esi] [__es __edi] \
__modify [__eax __edx]
#pragma aux RdosGetLongTime = \
CallGate_user_get_time \
"jnc ok" \
CallGate_get_time \
"ok: " \
__value [__edx __eax]
#pragma aux RdosSetTime = \
CallGate_get_system_time \
"sub esi,eax" \
"sbb edi,edx" \
"mov eax,esi" \
"mov edx,edi" \
CallGate_update_time \
__parm [__edi] [__esi] \
__modify [__eax __edx __esi __edi]
#pragma aux RdosDayOfWeek = \
"mov ch,al" \
"xor ebx,ebx" \
"xor ah,ah" \
CallGate_adjust_time \
"push edx" \
"mov eax,365" \
"imul dx" \
"push dx" \
"push ax" \
"pop ebx" \
"pop edx" \
CallGate_passed_days \
"dec edx" \
"shr edx,2" \
"inc edx" \
"add ax,dx" \
"add eax,ebx" \
"xor edx,edx" \
"add eax,5" \
"mov ebx,7" \
"div ebx" \
"movzx eax,dl" \
__parm [__edx] [__eax] [__ecx] \
__value [__eax] \
__modify [__ebx __ecx __edx]
#pragma aux RdosDosTimeDateToTics = \
"push ebx" \
"push ecx" \
"mov dx,si" \
"mov ax,dx" \
"shr dx,9" \
"add dx,1980" \
"mov cx,ax" \
"shr cx,5" \
"mov ch,cl" \
"and ch,0Fh" \
"mov cl,al" \
"and cl,1Fh" \
"mov bx,di" \
"mov ax,bx" \
"shr bx,11" \
"mov bh,bl" \
"shr ax,5" \
"and al,3Fh" \
"mov bl,al" \
"mov ax,di" \
"mov ah,al" \
"add ah,ah" \
"and ah,3Fh" \
CallGate_time_to_binary \
"pop ecx" \
"pop ebx" \
"mov fs:[ebx],edx" \
"mov es:[ecx],eax" \
__parm [__si] [__di] [__fs __ebx] [__es __ecx] \
__modify [__eax __edx]
#pragma aux RdosTicsToDosTimeDate = \
CallGate_binary_to_time \
"shl cl,3" \
"shr cx,3" \
"sub dx,1980" \
"mov dh,dl" \
"shl dh,1" \
"xor dl,dl" \
"or dx,cx" \
"mov al,ah" \
"shr al,1" \
"shl bl,2" \
"shl bx,3" \
"or bl,al" \
"mov fs:[esi],dx" \
"mov es:[edi],bx" \
__parm [__edx] [__eax] [__fs __esi] [__es __edi] \
__modify [__eax __ebx __ecx __edx]
#pragma aux RdosDecodeTicsBase = \
CallGate_binary_to_time \