Follow us on Twitter!
It is never to LATE to become what you never WERE.
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 27
Guests Online: 25
Members Online: 2

Registered Members: 82906
Newest Member: ilija
Latest Articles

Assembly Basics

Arrow Image this is a newer updated version of assembly and how to compile and run it. I will have a new one coming out soon that i am writting soon@!



Assembly How-To-------------------------------------------------------------------------------------
By blackmind

I have found from my own experience that the easiest and fast way to learn assembly is practice. I also found that the easiest and simplest is MIPS assembly which stands for
Microprocessor without Interlocked Pipeline Stages is a type of RISC microprocessor architecture. RISC processors only use simple instructions that can be executed within one clock cycle as opposed to what most people are familiar with which is CISC. A complex instruction set computer (CISC) is a microprocessor instruction set architecture in which each instruction can execute several low-level operations, such as a load from memory, an arithmetic operation, and a memory store, all in a single instruction.
(Thanks wiki for the definitions of CISC and RISC)


CISC

• Emphasis on hardware
• Includes multi-clock
complex instructions
• Memory-to-memory:
\"LOAD\" and \"STORE\"
incorporated in instructions
• Small code sizes,
high cycles per second
• Transistors used for storing
complex instructions
RISC
• Emphasis on software
• Single-clock,
reduced instruction only
• Register to register:
\"LOAD\" and \"STORE\"
are independent instructions
• Low cycles per second,
large code sizes
• Spends more transistors
on memory registers

The advantage to a CISC processor is that you can perform a complex task with use of very little RAM while the advantage of a RISC processor is that you can perform actions step by step loading the values into registers that you want, and perform simple tasks with great speed.

Now that I have explained what kinds of assembly there are lets get started. To run MIPS you need a program called SPIM which can be downloaded for Linux, Mac, or windows http://pages.cs.wisc.edu/~larus/spim.html

Now before you get started you have to know a few things first how to compile, well start off by saving your files as .asm files. Second when running SPIM you need to know how to compile.
For Example if your running Linux you can type:
(1)spim <enter>
Which will load the simulator then
(2) load “file” <enter>
(3) run
Then if you want to run it again you need to type:
reinit
(4) reinit <enter>
Which reinitializes the file and then follow the step 2-3 to run again

Now to write an actual program:


.text
.globl main

main:
li $v0,4 # sys call for printing string
la $a0,text # prints a break
syscall

li $v0,4 # sys call for printing string
la $a0,br # prints a break
syscall

li $v0, 10 # code to exit
syscall # make the call
.data
br: .asciiz \"\\n\"
text: .asciiz “Hello, world”

This will output Hello, world

Now that I have started you view some other ways to work in assembly.
I am now writing an article that will better explain the program above and give more examples.

Comments
No Comments have been Posted.
Post Comment

Sorry.

You must have completed the challenge Basic 1 and have 100 points or more, to be able to post.