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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:08:00+00:00 2026-06-04T13:08:00+00:00

This is my simpe Hello world program in ASM: .global _start _start: adr r1,

  • 0

This is my simpe “Hello world” program in ASM:

.global _start
    _start:         
        adr r1, hello
        b test
    loop:   ldr r12, =0x16000000
        str r0, [r12]

    test:   ldrb r0, [r1], #1
        cmp r0,#0
        bne loop
        @b loop
hello: .asciz "Hello world.\n\r"

After commenting out b loop, I expect it to print out only one “Hello world.” but actually it does not stop, like the command b loop was still there. Why?

  • 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-04T13:08:01+00:00Added an answer on June 4, 2026 at 1:08 pm

    bne is a conditional branch, branch if not equal, basically branch if the zero flag is clear. If it doesnt branch it continues executing. Once you have found the null termination you wont branch to loop, instead you execute the bytes that make up “Hell” as an instruction. Try this:

    .global _start
        _start:         
            adr r1, hello
            b test
        loop:   ldr r12, =0x16000000
            str r0, [r12]
    
        test:   ldrb r0, [r1], #1
            cmp r0,#0
            bne loop
        forever: b forever
    hello: .asciz "Hello world.\n\r"
    

    give the arm something to execute after the bne, something other than data. it should walk through the data string one time then fall into the infinite loop.

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

Sidebar

Related Questions

This is what I get when trying to compile a simple hello world program
I wrote a simple hello world program to test the JDK installation. I can
For example, this simple program: Program Helloworld; Begin writeln ('Hello world!'); readln; End;
I compile this program: #include <stdio.h> int main() { printf(Hello World!); return 0; }
I am trying to learn Java now and this is the hello world program
I have written a simple Hello World program. #include <stdio.h> int main() { printf(Hello
I'm attempting to compile a simple hello world program in c with lcc-win32/wedit, and
So I am trying to run console 64 bit Hello World program. I have
I set up CDT for eclipse and wrote a simple hello world C program:
I'm trying to create a very simple Hello, world program in RoR, but when

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.