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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:39:27+00:00 2026-06-10T08:39:27+00:00

If I had an instruction like 00010101 for example, and I had it in

  • 0

If I had an instruction like 00010101 for example, and I had it in ram for programs to access, how would I be able to excecute that instruction in assembly language without using OS functions? I am using Fasm for intel. Thanks.

EDIT: I know this is really crappy code, I havnt even assembled it yet and I know a lot is wrong, but keep in mind this is for learning purposes. This is the part of the code that loads a file with binary instructions and stores it in ram. Once again I know it is very crappy.

loadkernel:
    mov dx, 1F7h
    in dx, bl
    bt bl, 6    ;this reads the sixth bit of bl and stores it in the carry flag(cf)

    cmp cf, 1   ;if bit 6 is one, then the hard drive is signaling that it is ready for the next operation
    jz loadkernel
    clc ;clear carry flag


beginload:
    mov eax, 300h
    mov ecx, eax    ;copy the starting point of the kernel in memory to ecx
    mov ebx, 0  ;clear
    mov edx, 0  ;clear

    mov bl, 1F4h
    out ebx, bl ;give the hard drive the low address of the location of the kernel
    mov bl, 1F5h
    out 0h, bl      ;give the hard drive the high address of the location of the kernel

    mov bl, 1F0h

    in edx, bl   ;read the hard drive
    mov [eax], edx   ;add kernel data to memory
    add eax, 1

    inc ebx     ;move the hard drive reading head thing forward

    mov ip, [eax]   ;mov the instruction pointer to memory, so that the computer excecutes the kernel

    cmp edx, 0AA55h
    jz beginload    ;if 0AA55h is not at the end, then read the next data of the kernel.
  • 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-10T08:39:28+00:00Added an answer on June 10, 2026 at 8:39 am

    Depending on your execution environment, you may have to disable (most) OS’s Execute-Disable security for your program. This is put into place so that a vulnerable program is much harder to inject code into. If you’re running in a freestanding environment such as DOS or your own kernel, this isn’t anything to worry about.

    Anyway, all you have to do is this:

    mov ax,0x9090 //0x90 is opcode for NOP
    mov [code],ax
    code:
    jmp  foo //this is a 2-byte opcode (so long as it does the "correct" behavior and generate a relative jmp
    
    bar:
    hlt //this will get executed "magically"
    
    foo:
    //won't get here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had no issue with Django + uWSGI + Cherokee. BUt I would like
I've followed the instructions from http://www.lucidimagination.com/blog/2009/03/09/nutch-solr/ Had solr up and running before that, could
Had a page that was working fine. Only change I made was to add
Had a good search here but can't see anything that gets my mind in
Had a problem with the recursive conflictCheck() method. That seems fine now. I have
I had a debate about macros and their readability. I think that in some
I would like to install Python 2.5.5 to use with Google apps but have
I am having a problem that has had me stuck for a day and
Edit: My original example had a silly mistake. After fixing it I still get
Ive had a similar question as this one before, and when that solved this

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.