Jump to content

Assembly Applications

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
skilletsteve

skilletsteve

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
Before visiting this forum I had never heard of Assembly programming. Does anybody know of any applications written in assembly? If anyone does I would like to check them out to help me understand what assembly was used for.

#2
Ronin

Ronin

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 309 posts
Good question. I don't know of any applications that are actually wrote in assembly. I'd like to see some as well.

#3
kromagnon

kromagnon

    Learning Programmer

  • Members
  • PipPipPip
  • 50 posts
I have a few, one calculates the quadratic equation, I'll try to find the code for you
<!-- comment comment comment --></

#4
Sionofdarkness

Sionofdarkness

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 384 posts
I wrote a program on my calcluator that did the quadratic equation, but I'd bet $3,000,000 that the assembly version is more complicated.

#5
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well if im not wrong Delphi ( or some other language ) supports inline Assembly!

#6
Blaze

Blaze

    Programmer

  • Members
  • PipPipPipPip
  • 117 posts
interesting, how do you add assembly to delphi?

#7
kromagnon

kromagnon

    Learning Programmer

  • Members
  • PipPipPip
  • 50 posts
This is a program I wrote a couple years ago. It is written in MIPS assembly language
#
#	mktab.s:   evaluate arithmetic expressions using the first
#		   12 natural numbers
#
#	
#$s0: counter
#$s1: the final value is passed to this for each problem
#$s2: used as a "counter" in the Fn problem
#$s3: used as a "counter" in the Fn problem
#$s4: used as a "counter" in the n! problem
#
	.data

print_int = 1
print_str = 4
Fn_1	  = 1
FINAL = 12		                                              #the last number
first_line:     .asciiz "******************************\n"
second_line:	.asciiz	"Welcome to the 'mktab' program\n"
space_char:     .asciiz  "     "
newline:        .asciiz  "\n"
labels:         .asciiz  "n     n2     n3     Fn     n!\n"
first_fib:      .word    1
second_fib:     .word    1



#
#
# ***main***
#    ====
#
	.text

main:

	move 	$s0,$0			#counter = 0
	
	move    $s2,$0			#initializes as zero
	move    $s3,$0			
    	add     $s3,$s3,1		#initializes as one
    	move    $s5,$s3			
    
    
    
    
	# --Display the Greeting--
	
	
	la	$a0, first_line
	li	$v0, print_str
	syscall

	la	$a0, second_line
	li	$v0, print_str
	syscall

	la	$a0, first_line
	li	$v0, print_str
	syscall

		
    	la	$a0, labels                          
	li	$v0, print_str
	syscall

    

#^L
	MAIN_LOOP:
              

	# -- display n --
	
	move 	$a0,$s0			
	li   	$v0,print_int
	syscall
	
    	la	$a0, space_char			#adds a space
	li	$v0, print_str
	syscall
	
	# -- display n2 --
	
	mul	$s1,$s0,$s0
	move	$a0,$s1
	li	$v0,print_int
	syscall

    	la	$a0, space_char                 #adds a space
	li	$v0, print_str
	syscall

	# -- display n3 --
	
	mul	$s1,$s1,$s0
	move	$a0,$s1
	li	$v0,print_int
	syscall

    	la	$a0, space_char                 #adds a space
	li	$v0, print_str
	syscall
	
	
	# -- display Fn --


    	move $s4,$s3
    	add  $s3,$s2,$s3
    
	
	move $a0,$s3
	li	$v0,print_int
	syscall
    
    	move $s2,$s4

    	la	$a0, space_char                 #adds a space
	li	$v0, print_str
	syscall


	# -- display n! --
	
	
	mul $s5,$s0,$s5
	bnez $s0,NOT_E
	add $s5,$s5,1

NOT_E:	move $a0,$s5
	li	$v0,print_int
	syscall
   	la	$a0, newline                    #adds a newline
	li	$v0, print_str
	syscall
	
	
	
	
	
	

    	add     $s0,$s0,1			#increment counter
	bne	$s0,FINAL,MAIN_LOOP		#loops if not done



	jr	$ra				#return to OS	

<!-- comment comment comment --></

#8
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well I dont use delphi but I saw that on a site! but cant find it! but you just write


asm

[I]Assembly code here[/I]

end;


thats all! look ata this site! http://www.alstonlabs.com/assembly.htm

#9
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
C and C++ also support inline assembly. Many C/C++ libraries use assembly at to perform low-level system-specific tasks.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog