1 Replies - 324 Views - Last Post: 16 September 2017 - 09:22 PM

#1 sunshine33  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 15-September 17

Why does my hello world program in assembly language keeps crashing?

Posted 16 September 2017 - 06:15 AM

I am using SASM assembler .

%include "io.inc"

      section .data
hello   db "Hello World!",0xa
len equ $-hello

    section .text
    global  CMAIN

CMAIN:
    mov eax, 4
    mov ebx, 1
    mov ecx, hello
    mov edx, len
    int 80h

    mov eax, 1 ; exit(0)
    mov ebx, 0


Why does this little program keeps crashing ?
Is This A Good Question/Topic? 0
  • +

Replies To: Why does my hello world program in assembly language keeps crashing?

#2 sunshine33  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 15-September 17

Re: Why does my hello world program in assembly language keeps crashing?

Posted 16 September 2017 - 09:22 PM

I finally found a hello world program that works in SASM :-)

%include "io.inc"

section .data
    msg db 'Hello, world!', 0

section .text
    global CMAIN
CMAIN:
    mov ebp, esp
    PRINT_STRING msg
    NEWLINE
    xor eax, eax
    ret

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1