Advertisement
Guest User

Untitled

a guest
Apr 12th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bits 16
  2.  
  3. %include "MZEXE.MAC"
  4.  
  5. MZCode:
  6. MZMain:
  7.     mov     ax,         cs
  8.     sub     ax,         MZHeaderSize
  9.     mov     fs,         ax
  10.     mov     [fs:OldDS], ds
  11.     mov     [fs:OldES], es
  12.     mov     [fs:OldSS], ss
  13.     mov     ds,         ax
  14.     add     ax,         MZStackTop
  15.     mov     ss,         ax
  16.  
  17.     mov     ax,         0007h
  18.     int     10h
  19.  
  20.     mov     al,         1bh
  21.     movzx   ecx,        al
  22.     mov     ax,         0b800h
  23.     mov     es,         ax
  24.     xor     edi,        edi
  25.     mov     esi,        Hello
  26.     rep     movsb
  27.  
  28.     mov     ds,         [fs:OldDS]
  29.     mov     es,         [fs:OldES]
  30.     mov     ss,         [fs:OldSS]
  31.     retf
  32.     align 16, db 0cch
  33. MZCodeTop:
  34.  
  35. Relocations:
  36. align 16, db 00h
  37. RelocationsTop:
  38.  
  39. MZData:
  40. Hello:      db          'H e l l o ,   W o r l d ! ', 00h
  41. align 16, db 00h
  42. MZDataTop:
  43.  
  44. MZBSS:
  45. OldDS:      dw          00h
  46. OldES:      dw          00h
  47. OldSS:      dw          00h
  48. Stack:      times 128 dq 00h
  49. align 16, db 00h
  50. MZBSSTop:
  51.  
  52. MZTail:
  53. align 16, db 00h
  54. MZTailEnd:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement