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

  • Home
  • SEARCH
  • 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 8880001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:04:39+00:00 2026-06-14T20:04:39+00:00

I am reading this guide about Intel 8080 emulation Emulator 101 and when I’m

  • 0

I am reading this guide about Intel 8080 emulation Emulator 101 and when I’m reading the code to check what I wrote, I stumbled upon this

case 0x36:      //MVI   M,byte
{                   
//AC set if lower nibble of h was zero prior to dec
uint16_t offset = (state->h<<8) | state->l;
state->memory[offset] = opcode[1];
state->pc++;
}
break;

from a book called Intel 8080/8085 Assembly Language Programming, I read about MVI this

This instruction copies the data stored in its second byte into the
memory location addressed by H and L. M is a symbolic reference to the
H and L register pair.

so I’m guessing that the offset is the memory location addressed by H and L, but why do we do it that way? That is (state->h<<8) | state->l

Thanks

  • 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-14T20:04:40+00:00Added an answer on June 14, 2026 at 8:04 pm

    how is the combination of << and | gives us the 16-bit offset?

    Take H, an 8-bit register, where H7 is the most significant bit and H0 is the least significant bit:

    H7H6H5H4H3H2H1H0

    Take L, an 8-bit register, where L7 is the most significant bit and L0 is the least significant bit:

    L7L6L5L4L3L2L1L0

    You now want to construct the 16-bit offset that results from combining H (Highest 8-bits) and L (Lowest 8-bits.) In C/C++/Java this can be achieved by an 8-bit shift-left << followed by a bitwise-or | as follows:

    H      =                 H7H6H5H4H3H2H1H0
    H<<8   = H7H6H5H4H3H2H1H00 0 0 0 0 0 0 0 
    H<<8|L = H7H6H5H4H3H2H1H0L7L6L5L4L3L2L1L0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading about Rails fixtures in this guide (thanks, trevorturk). It appears you define
I'm reading a guide about Rails and I came across this line in a
I was reading this two docs about Service in the Android SDK http://developer.android.com/reference/android/app/Service.html http://developer.android.com/guide/components/services.html
I was reading the guide here about setting up a BroadcastReceiver to check changes
I was reading this about using google market licensing: http://developer.android.com/guide/publishing/licensing.html It says in part
I saved my project.apk file, and I was reading this document: http://developer.android.com/guide/publishing/app-signing.html#setup and they
I've been reading several threads and questions about this issue but I didn't find
I was reading a document about npm Developer Guide . I was wondering if
I've been reading the following: http://developer.android.com/guide/practices/screens_support.html It's about the folders res-long-land-hdpi , res-notlong-land-dpi ,
I have been reading this installation guide to install tinymce with django. First, it

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.