home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1995 November / PCWK1195.iso / inne / dos / programo / pmw120.exe / EXAMPLES.ZIP / EXAMPLE5.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-07-28  |  2.2 KB  |  64 lines

  1. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  2. ; PMODE/W Assembly Example File #1
  3. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  4. .386p
  5.  
  6. _TEXT   segment use32 dword public 'CODE'
  7.         assume  cs:_TEXT,ds:_DATA
  8.  
  9. start:
  10.         jmp short _main
  11.  
  12.         db 'WATCOM... What me worry?'   ; The "WATCOM" string is needed in
  13.                                         ; order to run under DOS/4G and WD.
  14.  
  15. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  16. ; CODE
  17. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  18.  
  19. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  20. ; Entry To ASM Code (_main)
  21. ; In:
  22. ;   CS - Code Selector    Base: 00000000h - Limit: 4G
  23. ;   DS - Data Selector    Base: 00000000h - Limit: 4G
  24. ;   ES - PSP Selector     Base: PSP Seg   - Limit: 100h
  25. ;   FS - ?
  26. ;   GS - ?
  27. ;   SS - Data Selector    Base: 00000000h - Limit: 4G
  28. ;   ESP -> STACK segment
  29. ;   Direction Flag - ?
  30. ;   Interrupt Flag - ?
  31. ;
  32. ;   All Other Registers Are Undefined!
  33. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  34. _main:
  35.         sti                             ; Set The Interrupt Flag
  36.         cld                             ; Clear The Direction Flag
  37.  
  38.         mov ah,9                        ; AH=09h - Print DOS Message
  39.         mov edx,offset _msg             ; DS:EDX -> $ Terminated String
  40.         int 21h                         ; DOS INT 21h
  41.  
  42.         mov ax,4c00h                    ; AH=4Ch - Exit To DOS
  43.         int 21h                         ; DOS INT 21h
  44.  
  45. _TEXT   ends
  46.  
  47. _DATA   segment use32 dword public 'DATA'
  48. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  49. ; DATA
  50. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  51. _msg    db 'Hello World From Protected Mode!',10,13,'$'
  52.  
  53. _DATA   ends
  54.  
  55. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  56. ; STACK
  57. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  58. stack   segment para stack 'STACK'
  59.         db 1000h dup(?)
  60. stack   ends
  61.  
  62.         end start
  63.  
  64.