+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 5
    Points: 436, Level: 4

    Join Date
    Sep 2010
    Posts
    8
    Helped
    0 / 0
    Points
    436
    Level
    4

    8086 microprocessor sample program

    anyone has a sample program that prints out 'hello world' using masm? thanks :)

    •   Alt5th March 2011, 01:41

      advertising

        
       

  2. #2
    Advanced Member level 2
    Points: 6,774, Level: 19
    blooz's Avatar
    Join Date
    Dec 2010
    Location
    India
    Posts
    561
    Helped
    124 / 124
    Points
    6,774
    Level
    19
    Blog Entries
    2

    Re: 8086 microprocessor sample program

    .model small
    .data

    msg db 'hello$'

    .code

    mov ax,@data ;the ds is set to datasegment
    mov ds,ax
    mov dx,offset msg ;ofset of buffer is stored in dx
    mov ah,09h ;write string terminated with $
    int21h
    mov ah,4ch ;exit to dos
    int 21h
    end



    •   Alt5th March 2011, 04:45

      advertising

        
       

  3. #3
    Advanced Member level 5
    Points: 35,219, Level: 45
    Awards:
    Helpful bronze
    ckshivaram's Avatar
    Join Date
    Apr 2008
    Location
    villingen (Germany) / Bangalore
    Posts
    5,070
    Helped
    2125 / 2125
    Points
    35,219
    Level
    45
    Blog Entries
    1

    Re: 8086 microprocessor sample program

    http://www.csi.ucd.ie/staff/jcarthy/home/alp/alp-05.pdf

    for windows
    ; requires /coff switch on 6.15 and earlier versions
    .386
    .model small,c
    .stack 100h

    .data
    msg db "Hello World!",0

    .code
    includelib MSVCRT
    extrn printf:near
    extrn exit:near

    public main
    main proc
    push offset msg
    call printf
    push 0
    call exit
    main endp

    end main

    for dos:
    .model small
    .stack 100h

    .data
    msg db 'Hello, world!$'

    .code
    start:
    mov ah, 09h ; Display the message
    lea dx, msg
    int 21h
    mov ax, 4C00h ; Terminate the executable
    int 21h

    end start
    " It is so simple to be happy,
    but it is so difficult to be simple"



    •   Alt5th March 2011, 04:47

      advertising

        
       

  4. #4
    Newbie level 5
    Points: 436, Level: 4

    Join Date
    Sep 2010
    Posts
    8
    Helped
    0 / 0
    Points
    436
    Level
    4

    Re: 8086 microprocessor sample program

    thanks.. i will try that :)



+ Post New Thread
Please login