home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR13 / DOS32V12.ZIP / EXAMPLE1.ASM < prev    next >
Assembly Source File  |  1993-10-17  |  2KB  |  95 lines

  1. ;         32BIT  DOS  EXTENDER
  2. ;
  3. ; Written by Adam Seychell     Wed 8-25-1993
  4. ;
  5. .386
  6.  
  7.  
  8. CODE32    SEGMENT PARA PUBLIC  USE32
  9. assume    DS:CODE32 , CS:CODE32
  10. extrn    CODE32_sel    :word        ; Selector Values
  11. extrn    DATA_sel    :word
  12. extrn    VIDEO_sel    :word
  13. extrn    FLAT_CODE32_sel    :word
  14. extrn    FLAT_DATA_sel    :word
  15. extrn    XMS_sel        :word
  16. extrn    BASE_sel    :word
  17. extrn    PSP_sel        :word
  18. extrn    ENVIRONMENT_sel    :word
  19.  
  20. align 4
  21. xms_usage    dd 0        ; Requested size of XMS block in bytes.
  22. xms_base    dd ?        ; Linear base address of the XMS block.
  23. Base_Segment    dw ?        ; Real mode segment value for base memory.
  24. PSP_segment    dw ?        ; Real mode segment value for PSP segment.
  25.  
  26. include        dos32.inc
  27.  
  28. start32:        ; 32 bit code entry point.
  29.  
  30.  
  31.         mov    ds,cs:[data_sel]       ;Must load these with valid selectors
  32.     mov    es,cs:[data_sel]
  33.     mov    fs,CS:[FLAT_DATA_sel]
  34.     mov    gs,CS:[XMS_sel]
  35.         mov    ss,CS:[data_sel]        ; Must set a stack area
  36.     mov    esp,offset pmode_stack
  37.         mov    [real_DS],CODE32        ; Set the DS reg for V86 mode
  38.     sti
  39.  
  40.  
  41.         ; Example to call a real mode interrupt
  42.  
  43.         mov     dx,offset v86_mesg
  44.     mov    ah,9
  45.         dosint    21h
  46.  
  47.     mov ah,4ch        ; Termiate the program
  48.         int 21h
  49.  
  50.  
  51. v86_mesg   db ' Message printed in v86 mode ',10,13,36
  52.  
  53. ; The 16 hardware inetrrupts.
  54. ; If an IRQ accours in V86 mode the segment registers will contain same
  55. ; selector values as they were before the last V86 call. ( i.e dosint xx ).
  56. IRQ0:    dosint 08h                      ;  8253  Timer 0
  57.     iretd
  58. IRQ1:    dosint 09h            ;  8242 Keyboard
  59.     iretd
  60. IRQ2:    dosint 0Ah                      ; LPT 2 or  Vert Retrate (6845)
  61.     iretd
  62. IRQ3:    dosint 0Bh            ; Serial communications ports 2 & 4
  63.     iretd
  64. IRQ4:    dosint 0Ch            ; Serial communications ports 1 & 3
  65.     iretd
  66. IRQ5:    dosint 0Dh            ; Reserved
  67.     iretd
  68. IRQ6:    dosint 0Eh            ; NEC µPD765 Floppy Disk Controler
  69.     iretd
  70. IRQ7:    dosint 0Fh                      ; LPT 1
  71.     iretd
  72. IRQ8:    dosint 70h            ; 6818 CMOS CLOCK
  73.     iretd
  74. IRQ9:    dosint 71h            ; Reserved
  75.     iretd
  76. IRQ10:    dosint 72h            ; Reserved
  77.     iretd
  78. IRQ11:    dosint 73h            ; Reserved
  79.     iretd
  80. IRQ12:    dosint 74h            ; Reserved
  81.     iretd
  82. IRQ13:    dosint 75h            ; 80x87 Math Co-Pro exception.
  83.     iretd
  84. IRQ14:    dosint 76h            ; Hard Drive Cotroller.
  85.     iretd
  86. IRQ15:    dosint 77h            ; Reserved
  87.     iretd
  88.  
  89. align 4
  90. db 100h dup (?)
  91. pmode_stack:
  92.  
  93. CODE32 ENDS
  94.  
  95. END