Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. ;What this skeleton COM file can currently do is:
  2. ;
  3. ; - Use Unreal Mode (enable it first somewhere, make a utility).
  4. ; - Return to DOS.
  5. ; - Use portable x86 registers and general-purpose instructions.
  6. ; - Define locations for the entry point and data/library bytes.
  7. ;;
  8.  
  9.  
  10. org 100h
  11. bits 16
  12.  
  13. jmp skeleton_START
  14.  
  15.  
  16. ;Set the default mode of x86 Portable to work under
  17. ;386+ 16-bit Real/Unreal Mode (with access to 4GB of address space,
  18. ;if they are enabled, or at least to 32-bit CPU registers):
  19. ;;
  20. %ixdefine _x86_Portable__PLATFORMBITS_ 1632 ;386+ Real/Unreal Mode
  21. %include "arch/hw/CPU/x86/0000000__x86_Portable.asm"
  22.  
  23.  
  24.  
  25. align 16
  26. skeleton_START:
  27.  
  28. ;This is the entry point of the application:
  29. ;;
  30.  
  31.  
  32. ;Save any registers before starting:
  33. ;;
  34. pushf
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. ;;;INIT
  42. ;;;INIT
  43. ;;;INIT
  44. ;;;INIT
  45. ;;;INIT
  46. ;;;INIT
  47. ;;;INIT
  48. ;;;INIT
  49. ; ;
  50. ;; Structure the main application driver entry point here. ;;
  51. ;;; ;;;
  52.  
  53.  
  54.  
  55.  
  56. ;;;END
  57. ;;;END
  58. ;;;END
  59. ;;;END
  60. ;;;END
  61. ;;;END
  62. ;;;END
  63. ;;;END
  64.  
  65.  
  66.  
  67.  
  68. ;Restore any registers before ending:
  69. ;;
  70. popf
  71.  
  72.  
  73. ;Exit to system (DOS). For normal raw COM files, we don't
  74. ;need INT 21h service AH=4Ch, just a normal RET instruction:
  75. ;;
  76. ret
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90. ;;;INIT
  91. ;;;INIT
  92. ;;;INIT: Data/library (right at the end of reachable code)
  93.  
  94.  
  95. ;;;END: Data/library (right at the end of reachable code)
  96. ;;;END
  97. ;;;END
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108. ;It's always nice to align the binary to 16 bytes.
  109. ;It's necessary for MZ EXEs. But this is a 65536-byte COM executable.
  110. ;;
  111. align 16
  112.  
  113.  
  114.  
  115. ;EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement