Description: This is a simple 8086 assembly language programming
example to print “Hello World!” in the center of the screen.
[org 0x0100]
   mov ax , 0xB800
   mov es , ax
   mov ax , 80
   mov cx , 12
   mul cx
   mov cx , 40
   add al , cl
   mov cx , 2
   mul cx
   mov di , ax            ;DI=Middle of the screen
   mov bx , string
   mov cx , [size]
   mov si , 0
   mov ah , 0x0F
   print:
      mov al , [bx+si]
      mov [es:di] , ax
      inc si
      add di , 2
      loop print
   mov ax , 0x4c00
   int 0x21
size: dw 8
string: db 'Hello World!' 14:36
14:36

No comments
Post a Comment