Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<dos.h>
  3. #include<iostream.h>
  4. #include <conio.h>
  5.  
  6. long long A = 125;
  7. long long B = 0;
  8.  
  9. void interrupt(*old)(...);
  10. void interrupt cmp_int(...)
  11. {
  12.  
  13. cout << "Interrapt" << endl;
  14. _asm
  15. {
  16. lea si, A
  17. lea di, B
  18. mov ax, 0
  19.  
  20. mov dx,[si]
  21. shl dx, 1
  22. mov[di], dx
  23.  
  24.  
  25. mov dx, 0
  26.  
  27. mov dx,[si + 4]
  28. rol dx, 1
  29. mov[di + 4], dx
  30. }
  31.  
  32. }
  33.  
  34. void interrupt cmp_int1(...)
  35. {
  36.  
  37. cout << "Interrapt" << endl;
  38. _asm
  39. {
  40. lea si, A
  41. lea di, B
  42. mov ax, 0
  43.  
  44. mov dx,[si]
  45. shl dx, 1
  46. mov[di], dx
  47.  
  48.  
  49. mov dx, 0
  50.  
  51. mov dx,[si + 4]
  52. rol dx, 1
  53. mov[di + 4], dx
  54. mov cx, 2
  55. mov[bp + 18], cx
  56. }
  57.  
  58. }
  59.  
  60. void main(void)
  61. {
  62. clrscr();
  63. int aa;
  64. aa = 1;
  65. old = getvect(0xf0);
  66. disable();
  67. setvect(0xf0, cmp_int);
  68. setvect(0, cmp_int1);
  69. enable();
  70. aa = aa / 0;
  71. geninterrupt(0xf0);
  72. cout << B << endl;
  73. getch();
  74. puts("v1=v2");
  75. setvect(0xf0, old);
  76. return;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement