Srikanth's user avatar
Srikanth's user avatar
Srikanth's user avatar
Srikanth
  • Member for 2 years, 9 months
  • Last seen more than a month ago
  • Udupi
Stats
135
reputation
3k
reached
0
answers
3
questions
About
; Define variables in the data section
SECTION .DATA
    hello:     db 'Hello world!',10
    helloLen:  equ $-hello

; Code goes in the text section
SECTION .TEXT
    GLOBAL _start 

_start:
    mov eax,4            ; 'write' system call = 4
    mov ebx,1            ; file descriptor 1 = STDOUT
    mov ecx,hello        ; string to write
    mov edx,helloLen     ; length of string to write
    int 80h              ; call the kernel

    ; Terminate program
    mov eax,1            ; 'exit' system call
    mov ebx,0            ; exit with error code 0
    int 80h              ; call the kernel
Badges
This user doesn’t have any gold badges yet.
This user doesn’t have any silver badges yet.
6
bronze badges
Top tags
0
Score
3
Posts
100
Posts %
0
Score
1
Posts
33
Posts %
0
Score
1
Posts
33
Posts %
question
0
Oct 26, 2021