MARS, MIPS assembler, linking two files together?

Code Doggo

I have a quick question. I am using MARS assembler (programming in the MIPS instruction set) and I have two MIPS files. One file contains my main method to be run and it calls a function in the other file. My function has the .globl directive before it, but every time I try and compile my program it says

Symbol "print_hex" not found in symbol table.

Here is a screen shot for more context: enter image description here

The label print_hex is located in the file called print_hex.s.

enter image description here

How can I link these two files together? Lastly, how can I tell MARS to call a specific label at the start of execution, for example I want it to call main.

countunique
  1. Put the files in the same directory
  2. Enable the MARS option Settings->Assemble all files in directory
  3. Assemble the file you want to start execution at.

And then all the files in the directory should get assembled and linked together.

To always have execution start at your main label, you can enable Settings->Initialize program counter to global 'main'.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Linking two .o files together

From Dev

how to write octal constants in MIPS (MARS assembler)

From Dev

Linking two classes together

From Dev

Mips- How to run multiple files in Mars

From Dev

Linking two user accounts together

From Dev

Merging two files together

From Dev

AngularJS - binding/linking two directives together

From Dev

Insert data into two tables, linking the records together

From Dev

Linking GLFW in Eclipse Mars

From Dev

Join two files together (AWK)

From Dev

Merge two files together by awk

From Dev

Load address and Strings, Mars Mips

From Dev

Does MASM assembling multiple source files and linking them together?

From Dev

linking error between two files c++

From Dev

Linking two Javascript files to a html document

From Dev

Merging two csv files together using php

From Dev

Two .htaccess files doesn't work together

From Dev

Merging two csv files together using php

From Dev

Mars MIPS Simulator not functioning, installation issues?

From Dev

Convert Binary to Decimal in MIPS, Assembly MARS

From Dev

MIPS drum sequencer ends imediatly on MARS enviroment

From Dev

Linking lots of classes together

From Dev

Attempt to execute non-instruction in mips assembler?

From Dev

Linking an assembler program: error "undefined reference to `printf'"

From Dev

Linking to Kernel32.lib in assembler

From Dev

Linking error between assembler and C code (MinGW)

From Dev

Linking against two lib files that have the same function signature?

From Dev

Multiple definition error while linking two object files with same definition

From Dev

Linking text views to scroll together