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 8564665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:15:00+00:00 2026-06-11T17:15:00+00:00

Hi i trying to make a loop in Nasm. I have the loop working

  • 0

Hi i trying to make a loop in Nasm. I have the loop working but want to change the string when it loops and cant seem to get this to work.

I have this working:

main:
        mov ebx,0               ; set ebx to 0 
       myloop:                  ;
       inc ebx                  ;
       mov [msg], 2Ah           ;  Immediate move * to msg
       mov eax, 2Ah             ;
       push ecx                ; save ecx as printf uses it
       push OFFSET msg         ; parameter used by printf
       call printf             ; print string msg
       add esp, 4              ; remove  pointer to msg
       pop ecx                 ; restore ecx
        cmp ebx,[len]           ;
         jl myloop                  ;
       ret


.DATA

msg    db  "Hello, World+!", 0Ah, 0  ; 0A cariage return
                                     ; 0  end of string
star BYTE 2Ah ; 2A (hex) = Ascii *
len   equ $ - (msg +1)               ; length of string msg
 end

and it outputs *ello, World! the right number of times but i want it to output this

*ello, World!
**llo, World!
***lo, World!
****o, World!

and so on.

Can anyone help me please.

I must also note that it is linked to a C library to use printf for out put.

  • 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-11T17:15:01+00:00Added an answer on June 11, 2026 at 5:15 pm

    I won’t comment it

    SECTION .data
    msg     db  "Hello, World+!", 0Ah, 0  
    len     equ $ - msg - 2
    
    SECTION .text 
    main:
        xor     ebx, ebx
        mov     esi, msg
    
        push    esi
        call    printf
        add     esp, 4 
    .DoStar:
        mov     byte [esi + ebx], 2Ah
        push    esi
        call    printf
        add     esp, 4 
    
        inc     ebx
        cmp     ebx, len
        jne     .DoStar
        ret
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i am trying to make function with while loop in php but cant
I am trying to make a stop button for this loop but it runs
I am trying to make a loop that loops through all different integers where
I'm trying to make an HTTP GET request using the jQuery get() function, but
I'm trying to make a homework assignment where I have to use fork() but
I'm trying to make a loop that will output this: 08:00 08:15 08:30 08:45
I am trying to make this animation loop $(.jquery_bounce).ready(function(){ $(img, this).animate({ marginLeft : '20px'
Trying to make a loop of MAC address values with: String macAddr = AA:BB:CC:DD:;
I'm trying to make a loop to get wheather conditions from diferent cities and
I will keep this very short: I'm trying to make a loop through an

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.