• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

need help machine langauge

Status
Not open for further replies.

batty

New Member
i need help in writing a c++ program that will read in a file that has 32 bit hexadecimal and than change each 32 bit number in to the correct assembly language instruction(MIPS). then output file ...include the output from the program.....

but only using lui, ori,sw,addi,syscall
 

Nigel Goodwin

Super Moderator
Most Helpful Member
batty said:
i need help in writing a c++ program that will read in a file that has 32 bit hexadecimal and than change each 32 bit number in to the correct assembly language instruction(MIPS). then output file ...include the output from the program.....

but only using lui, ori,sw,addi,syscall
It's called a disassembler, you don't mention what processor it's for, and I don't recognise those instructions.

The processor type is obviously crucial, and affects the writing of the disassembler a huge amount. I've done this for PIC's in Delphi, and it's included in WinPicProg - but a PIC has a big advantage for this, all instructions are a single 14 bit word in length - most processors have different length instructions, which makes it slightly more tricky.
 
I don't recognize the instruction set either , it sounds like a RISC , maybe Sun. You need a symbolic disassembler that will generate ASCII names for the proggies. Most machine language is stripped of all comments , designations and most other useful ( from a human standpoint ) information . That's why unassembled win-doze code is something like 65 gig and boils down to a fifth or less of that in Machine code.
 

batty

New Member
this is what i meant

You will write a C++/Java program that will read in a file that has a list of 32 bit hexadecimal numbers (one per line) and then change each 32 bit number into the correct assembly language instruction. Then you will output to a file all the instructions. Then you will run the PCspim on the assembly language file you made and include the output from the program with your code.

Your program will only be responsible for the following commands
· lui
· ori
· sw
· addi
· syscall
plx help me
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Re: this is what i meant

batty said:
You will write a C++/Java program that will read in a file that has a list of 32 bit hexadecimal numbers (one per line) and then change each 32 bit number into the correct assembly language instruction. Then you will output to a file all the instructions. Then you will run the PCspim on the assembly language file you made and include the output from the program with your code.
This sounds rather like homework or an assignment, you need to do it yourself! - getting other people to do your homework isn't going to help you.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top