diff options
| author | Richard M. Stallman | 1994-07-09 05:13:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-09 05:13:38 +0000 |
| commit | ca986694dd42174722bd56965af7bba854af9ef3 (patch) | |
| tree | ef93770ec234e034289c4399afa3ae7f3f011d19 /src | |
| parent | 0e3263737c7cb102a98e4395a272093aae3671d1 (diff) | |
| download | emacs-ca986694dd42174722bd56965af7bba854af9ef3.tar.gz emacs-ca986694dd42174722bd56965af7bba854af9ef3.zip | |
(install_ctrl_break_check): Doc fix.
(do_visible_bell): Clean-up using Gnu assembly extension.
Diffstat (limited to 'src')
| -rw-r--r-- | src/msdos.c | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/src/msdos.c b/src/msdos.c index 0b738c4a050..3ef68d0ccc9 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -779,52 +779,38 @@ init_environment (argc, argv, skip_args) | |||
| 779 | 779 | ||
| 780 | /* Flash the screen as a substitute for BEEPs. */ | 780 | /* Flash the screen as a substitute for BEEPs. */ |
| 781 | 781 | ||
| 782 | static unsigned char _xorattr; | ||
| 783 | |||
| 784 | static void | 782 | static void |
| 785 | do_visible_bell (xorattr) | 783 | do_visible_bell (xorattr) |
| 786 | unsigned char xorattr; | 784 | unsigned char xorattr; |
| 787 | { | 785 | { |
| 788 | _xorattr = xorattr; | ||
| 789 | asm volatile | 786 | asm volatile |
| 790 | (" pushl %eax | 787 | (" movb $1,%%dl |
| 791 | pushl %ebx | ||
| 792 | pushl %ecx | ||
| 793 | pushl %edx | ||
| 794 | movl $1,%edx | ||
| 795 | visible_bell_0: | 788 | visible_bell_0: |
| 796 | call _ScreenRows | 789 | movl _ScreenPrimary,%%eax |
| 797 | pushl %eax | ||
| 798 | call _ScreenCols | ||
| 799 | pushl %eax | ||
| 800 | movl _ScreenPrimary,%eax | ||
| 801 | call dosmemsetup | 790 | call dosmemsetup |
| 802 | movl %eax,%ebx | 791 | movl %%eax,%%ebx |
| 803 | popl %ecx | 792 | movl %1,%%ecx |
| 804 | popl %eax | 793 | movb %0,%%al |
| 805 | imull %eax,%ecx | 794 | incl %%ebx |
| 806 | movb (__xorattr),%al | ||
| 807 | incl %ebx | ||
| 808 | visible_bell_1: | 795 | visible_bell_1: |
| 809 | xorb %al,%gs:(%ebx) | 796 | xorb %%al,%%gs:(%%ebx) |
| 810 | addl $2,%ebx | 797 | addl $2,%%ebx |
| 811 | decl %ecx | 798 | decl %%ecx |
| 812 | jne visible_bell_1 | 799 | jne visible_bell_1 |
| 813 | decl %edx | 800 | decb %%dl |
| 814 | jne visible_bell_3 | 801 | jne visible_bell_3 |
| 815 | visible_bell_2: | 802 | visible_bell_2: |
| 816 | movzwl %ax,%eax | 803 | movzwl %%ax,%%eax |
| 817 | movzwl %ax,%eax | 804 | movzwl %%ax,%%eax |
| 818 | movzwl %ax,%eax | 805 | movzwl %%ax,%%eax |
| 819 | movzwl %ax,%eax | 806 | movzwl %%ax,%%eax |
| 820 | decw %cx | 807 | decw %%cx |
| 821 | jne visible_bell_2 | 808 | jne visible_bell_2 |
| 822 | jmp visible_bell_0 | 809 | jmp visible_bell_0 |
| 823 | visible_bell_3: | 810 | visible_bell_3:" |
| 824 | popl %edx | 811 | : /* no output */ |
| 825 | popl %ecx | 812 | : "m" (xorattr), "g" (ScreenCols () * ScreenRows ()) |
| 826 | popl %ebx | 813 | : "%eax", "%ebx", /* "%gs",*/ "%ecx", "%edx"); |
| 827 | popl %eax"); | ||
| 828 | } | 814 | } |
| 829 | 815 | ||
| 830 | /* At screen position (X,Y), output C characters from string S with | 816 | /* At screen position (X,Y), output C characters from string S with |
| @@ -1044,7 +1030,7 @@ install_ctrl_break_check () | |||
| 1044 | if (!ctrlbreakinstalled) | 1030 | if (!ctrlbreakinstalled) |
| 1045 | { | 1031 | { |
| 1046 | /* Don't press Ctrl-Break if you don't have either DPMI or Emacs | 1032 | /* Don't press Ctrl-Break if you don't have either DPMI or Emacs |
| 1047 | was compiler with Djgpp 1.11 maintenance level 2 or later! */ | 1033 | was compiler with Djgpp 1.11 maintenance level 5 or later! */ |
| 1048 | ctrlbreakinstalled = 1; | 1034 | ctrlbreakinstalled = 1; |
| 1049 | ctrl_break_vector.pm_offset = (int) ctrl_break_func; | 1035 | ctrl_break_vector.pm_offset = (int) ctrl_break_func; |
| 1050 | _go32_dpmi_allocate_real_mode_callback_iret (&ctrl_break_vector, | 1036 | _go32_dpmi_allocate_real_mode_callback_iret (&ctrl_break_vector, |
| @@ -1122,7 +1108,7 @@ mouse_pressed (b, xp, yp) | |||
| 1122 | regs.x.bx = mouse_button_translate[b]; | 1108 | regs.x.bx = mouse_button_translate[b]; |
| 1123 | int86 (0x33, ®s, ®s); | 1109 | int86 (0x33, ®s, ®s); |
| 1124 | if (regs.x.bx) | 1110 | if (regs.x.bx) |
| 1125 | *xp = regs.x.cx / 8, *yp = regs.x.dx /8; | 1111 | *xp = regs.x.cx / 8, *yp = regs.x.dx / 8; |
| 1126 | return (regs.x.bx != 0); | 1112 | return (regs.x.bx != 0); |
| 1127 | } | 1113 | } |
| 1128 | 1114 | ||