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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:49:35+00:00 2026-06-14T10:49:35+00:00

I want to know how I can use mmix in interactive mode to display

  • 0

I want to know how I can use mmix in interactive mode to display the contents of registers whenever I ask to see them. For example, I have a simple mmix program:

% Compute D=4A-2B+16C
%LABEL      OPCode      Operands        Comments
            LOC         Data_Segment
            GREG        @
A           OCTA        3          Reserve an octabyte for A
B           OCTA        #10        Reserve an octabyte for B
C           OCTA        2          Reserve an octabyte for C
D           OCTA        0          Reserve an octabyte for D

            LOC         #100            start assembly instructions
Main        LDO         $0,A            $0 contents of A
            LDO         $1,B            $1 contents of B
            LDO         $2,C            $2 contents of C
            SL          $0,$0,2         $0 = 4*$0
            SL          $1,$1,1         $1 = 2*$1
            SL          $2,$2,4         $2 = 16*$2
            SUB         $0,$0,$1        $0 < 4A-2B
            ADD         $0,$0,$2        $0 < 4A-2B+16C
            STO         $0,D            store answer in D

and I can run mmix -i myprog.mmo to get the output:

mmix> 
           (00000000000000fc: fb0000ff (UNSAVE)) #6000000000000088: rG=254, ..., rL=2
  0 instructions, 0 mems, 0 oops; 0 good guesses, 0 bad
  (now at location #0000000000000100)
mmix> 
         1. 0000000000000100: 8d00fe00 (LDOI) $0=l[0] = M8[#2000000000000000] = 3
  1 instruction, 1 mem, 1 oop; 0 good guesses, 0 bad
  (now at location #0000000000000104)
mmix> 
         1. 0000000000000104: 8d01fe08 (LDOI) $1=l[1] = M8[#2000000000000000+8] = 16
  2 instructions, 2 mems, 2 oops; 0 good guesses, 0 bad
  (now at location #0000000000000108)
mmix> 
         1. 0000000000000108: 8d02fe10 (LDOI) rL=3, $2=l[2] = M8[#2000000000000000+16] = 2
  3 instructions, 3 mems, 3 oops; 0 good guesses, 0 bad
  (now at location #000000000000010c)
mmix> 
         1. 000000000000010c: 39000002 (SLI) $0=l[0] = 3 << 2 = 12
  4 instructions, 3 mems, 4 oops; 0 good guesses, 0 bad
  (now at location #0000000000000110)
mmix> 
         1. 0000000000000110: 39010101 (SLI) $1=l[1] = 16 << 1 = 32
  5 instructions, 3 mems, 5 oops; 0 good guesses, 0 bad
  (now at location #0000000000000114)
mmix> 
         1. 0000000000000114: 39020204 (SLI) $2=l[2] = 2 << 4 = 32
  6 instructions, 3 mems, 6 oops; 0 good guesses, 0 bad
  (now at location #0000000000000118)
mmix> 
         1. 0000000000000118: 24000001 (SUB) $0=l[0] = 12 - 32 = -20
  7 instructions, 3 mems, 7 oops; 0 good guesses, 0 bad
  (now at location #000000000000011c)
mmix> 
         1. 000000000000011c: 20000002 (ADD) $0=l[0] = -20 + 32 = 12
  8 instructions, 3 mems, 8 oops; 0 good guesses, 0 bad
  (now at location #0000000000000120)
mmix> 
         1. 0000000000000120: ad00fe18 (STOI) M8[#2000000000000000+24] = 12
  9 instructions, 4 mems, 9 oops; 0 good guesses, 0 bad
  (now at location #0000000000000124)
mmix> 
         1. 0000000000000124: 00000000 (TRAP) Halt(0)
  10 instructions, 4 mems, 14 oops; 0 good guesses, 0 bad
  (halted at location #0000000000000124)
mmix> 
  10 instructions, 4 mems, 14 oops; 0 good guesses, 0 bad
  (halted at location #0000000000000124)

Which is all good and well. But what do I need to do if I want to inspect the contents of some register in the middle of running this interactively? Also, how about seeing the contents in hex instead of decimal?

  • 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-14T10:49:36+00:00Added an answer on June 14, 2026 at 10:49 am

    For those who are interested, apparently not many 🙂 , the information I was looking for can be found at the MMIX documentation site. Then check out the mmix-sim.pdf file on page 3.

    In particular, to inspect a local register, in the simulator type

    l0
    

    to see local register $0 contents in decimal. If you want to set the local register to something, it’s simply

    l0=27.0
    

    so now $0 is the 64bit floating point representation of 27.0! If you want to see hex, just do

    l0#.
    

    The rest you all can read for yourself. Documentation includes how to set breakpoints, etc.

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

Sidebar

Related Questions

I want to know if I can use datas inside configuration profile generate by
First i briefly want to know how you can use oauth works. What we
I know I can use install-data-hook to do anything I want after my data
On hover I want my div to scroll down. I know i can use
I want to know how and when can I use the exit() function like
I don't know if I can use regex for this, but I want to
I know why I want to use private virtual functions, but how exactly can
I want to know if we can use the same file for both video
I want to know how can I use NSDictionary in NSUserDefault ? I have
I want to know how to limit the MySQL result. I can use select

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.