Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8684727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:22:42+00:00 2026-06-12T22:22:42+00:00

I am making a simple program to print Hello, world! in hex ASCII characters.

  • 0

I am making a simple program to print “Hello, world!” in hex ASCII characters.
Here is my code:

SECTION .DATA
msg db 'Printing Hello world in ASCII values: ', 0
msglen EQU $-msg
char1 db 064h  ; 'd' character
char2 db 06Ch  ; 'l' character
char3 db 072h  ; 'r' 
char4 db 06Fh  ; 'o'
char5 db 077h  ; 'w'
char6 db 020h  ; (space)
char7 db 06Fh  ; 'o'
char8 db 06Ch  ; 'l'      
char9 db 06Ch  ; 'l'
char10 db 065h ; 'e'
char11 db 048h ; 'H'

SECTION .bss

SECTION .text

GLOBAL _start:
_start:
nop
mov esi, 0

mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, msglen
int 80h
; printing 'H'
mov eax, 4
mov ebx, 1  
mov ecx, char11 
mov edx, 1
int 80h

; printing 'e'
mov eax, 4
mov ebx, 1  
mov ecx, char10
mov edx, 1
int 80h

; printing 'l'
mov eax, 4
mov ebx, 1  
mov ecx, char9
mov edx, 1
int 80h     

; printing 'l'
mov eax, 4
mov ebx, 1  
mov ecx, char8 
mov edx, 1
int 80h 

; printing 'o'
mov eax, 4
mov ebx, 1  
mov ecx, char7 
mov edx, 1
int 80h 

; printing space
mov eax, 4
mov ebx, 1  
mov ecx, char6 
mov edx, 1
int 80h 

; printing 'w'
mov eax, 4
mov ebx, 1  
mov ecx, char5 
mov edx, 1
int 80h

; printing 'o'
mov eax, 4
mov ebx, 1  
mov ecx, char4 
mov edx, 1
int 80h

; printing 'r'
mov eax, 4
mov ebx, 1  
mov ecx, char3 
mov edx, 1
int 80h

; printing 'l'
mov eax, 4
mov ebx, 1  
mov ecx, char2 
mov edx, 1
int 80h

; printing 'd'
mov eax, 4
mov ebx, 1  
mov ecx, char1 
mov edx, 1
int 80h

    ; end
mov eax, 1
mov ebx, 0
int 80h

MY QUESTION:

How can I do something like this:

loop:
    mov eax, 4
    mov ebx, 1
    mov ecx, char[incremented variable]
    mov edx, 1
    int 80h
    inc (incremented variable)
    jmp loop

What I mean is how can I have a variable and an incrementing counter be read as one variable?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:22:43+00:00Added an answer on June 12, 2026 at 10:22 pm

    You’d need to make an array out for your string, the same way msg is declared, the load the pointer to that string, dereference to get that character, check if its 0, break if so, else print and increment the pointer.

    eg: (MASM syntax, sorry)

    msg2 BYTE "Hello World!",0
    
    MOV ESI, OFFSET msg2
    
    LOOP1:
    
    MOVZX ECX, BYTE PTR[ESI]
    TEST ECX,ECX
    JE NEXT
    MOV EAX, 4
    MOV EBX, 1
    MOV EDX, 1
    INT 80h
    INC ESI
    JMP LOOP1
    
    NEXT:
    ...
    

    Just noticed that your title states x86-64, but your code (and my code), is plain x86, if you are actually wanting x64 code, the ABI for the syscall’s changes a bit, but the rest is pretty much the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just learning Ruby and making a simple Hello World program, put for some
So I'm practicing pointers to functions, and tried out making this simple program, here's
I'm making a simple program in Objective-C. It has one class with a lot
I am working on making a simple drawing program. So far I am able
I was making this very simple lex program (just an introductory program). But on
I am new to android developement. I am making a simple expense management program
I'm making a simple form that is to step through a program iteratively. How
I'm in the process of making a simple drawing program for the iPhone. At
I'm making a simple paint program and am stuck with getting a certain part
I am making a simple Java program for class that is supposed to output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.