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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:48:45+00:00 2026-06-07T02:48:45+00:00

I’ve been trying to increase my baseline knowledge of Intel x86 Nasm by working

  • 0

I’ve been trying to increase my baseline knowledge of Intel x86 Nasm by working on outputting a hardcoded text string in an OS/Kernel real mode environment using BIOS interrupts.

Here’s my code:

top:
[BITS 16]
[ORG 7C00h]
resb 56 ; Just for testing
outStr db "This is a test string!", 10, 0
resb 56

.main:
main:
mov edi, outStr
again:
mov BYTE al, [edi]
mov ah,0Eh
int 10h
inc edi

cmp BYTE [edi], 0
jg again


leaving:
mov ah, 0Eh

mov al,13
int 10h
mov al,10
int 10h

mov al,'Q' ; Using the distinct character Q to show that the code executed to this point
int 10h

complete:
hlt


times (510-($-top)) db 0 ; Pad the executable to act as the boot sector
dw 0xAA55

I have actually gotten it to work, but only with certain strings. Changing the contents of outStr will sometimes cause the code to not execute at all. At first I thought it was the length, but this proved not to be a determining factor; a small handful of random characters, “Gfd” for example, outputs fine, but “Gfd is awesome!” mysteriously does not work. On the other hand, “ABCDEFGH…Z” (the full capitalized alphabet) did work. To make things even weirder, the full lowercase alphabet did not work.

Anytime it doesn’t work, the confirmation character at the end (“Q”) is not outputted, and non of the other expected behavior is observed, further leading me to believe that this has nothing to do with my executable code, but with something else.

Important: I’ve been doing my testing using QEMU. It seems to be a pretty commonly used tool and works for me (with the above exceptions), but I’ll be interested to see if this could have some effect on the output.

  • 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-07T02:48:46+00:00Added an answer on June 7, 2026 at 2:48 am

    You’re executing your resb’s and the string! “jmp” over ’em.

    Initialize ds… and perhaps es… and set up a valid stack at a known (safe!) address. It may be that QEMU is starting you up with acceptable values, but you shouldn’t count on it. ASSume only that you’re loaded at 0x7C00 and that the boot drive number is in dl.

    “hlt” only halts the CPU until an interrupt occurs (one per 18.2 seconds for the timer interrupt, among any others), at which point you’re executing random code. Throw a “hlt” into an infinite loop if you want to keep the CPU cool…

    Happy bootin’,

    Frank

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

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.