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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:08:23+00:00 2026-06-09T23:08:23+00:00

.global main # makes label main globally known .text # Instructions follow .align 2

  • 0
        .global main            # makes label "main" globally known

        .text                   # Instructions follow
        .align  2               # Align instructions to 4-byte words

main:   movi    r16,0x47        # Load the hexadecimal value 41
                                # to register r16

loop:   mov     r4,r16          # Copy to r4 from r16

        nop                     # (later changed to call hexasc)
        nop                     # (later changed to mov r4,r2)

        movia   r8,putchar      # copy subroutine address to a register
        callr   r8              # call subroutine via register

        addi    r16, r16,1      # Add 1 to register r16
        andi    r16, r16, 0x7f  # mask with 7 bits
        ori     r16, r16, 0x20  # set a bit to avoid control chars

        br      loop            # Branch to loop

        .end                    # The assembler will stop reading here
        foo bar bletch          # comes after .end - ignored

I can understand everything, I think, except how the two instructions andi and ori work in this case. ori appears to make so that the ASCII 20 positions forward is printed but why and how?

  • 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-09T23:08:24+00:00Added an answer on June 9, 2026 at 11:08 pm

    andi and ori are both bitwise operators:

    To see the difference, concider”

    and $rd, $rs, $rt
    or  $rd, $rs, $rt 
    

    versus

    andi $rt, $rs, immed
    ori  $rt, $rs, immed
    

    http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Mips/bitwise.html

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

Sidebar

Related Questions

Please, I need help with my code: def start(): def start_tkinter(): global main,l main.destroy()
I have the following global in variable in file_1.pl, in package main: package main;
how do I access a global variable which is initialized in the main() function
Running this xul app: <?xml version=1.0?> <?xml-stylesheet href=chrome://global/skin/ type=text/css?> <window width=400 height=300 style=background-color:transparent; xmlns=http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul>
I'm trying to allocate dynamically a global struct in c, but something makes my
Global scope allows you to use a variable in a function that was defined
Global Windows hooks must be in a DLL because the hook is going to
global.asax: var desktopJsBundle = new Bundle(~/desktop-js-bundle, new JsMinify()); desktopJsBundle.AddFile(~/scripts/jquery-1.7.1.min.js); desktopJsBundle.AddFile(~/scripts/test.js); BundleTable.Bundles.Add(desktopJsBundle); layout.cshtml: <script src=@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl(~/desktop-js-bundle)></script>
A global variable for a Twig template can be defined inside the config.yml of
Regarding global variable initialization, function hello_testing() { global $conditional_random; if (isset($conditional_random)) { echo foo

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.