jesus123
Apr 14th, 2006, 09:31 AM
Hey guys...I have to write the microcode for floating point add, floating point multiply, and floating point subtraction for the MIC-1...I've been working on this for weeks and I can't figure it out....someone please help
maki
Apr 14th, 2006, 09:54 AM
Does something like that help you?
## count.s
#################################################
# #
# text segment #
# #
#################################################
.text
.globl __start
__start:
la $t0,array ##$t0 will hold the elements
lw $t1,count ##$t1 will be the count
lb $t3,int ##$t3 will hold the integer we are looking for
loop1: beqz $t1,End ##if it’s null,exit loop
lw $t4,($t0) ##fetch next int
add $t0,$t0,4
bne $t4,$t3,con ##not null;same as int?
add $t5,$t5,1 ##yes,increment counter
con: sub $t1,$t1,1 ##increase index
j loop1 ##and continue
End: la $a0,ans ##system call to print
li $v0,4 ##out a message
syscall
move $a0,$t5 ##system call to print
li $v0,1 ##out the count worked out
syscall
la $a0,end1 ##system call to print
li $v0,4 ##out a newline
syscall
li $v0, 10
syscall ##au revoir..
#################################################
# #
# data segment #
# #
#################################################
.data
array: .word 1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,0,-1
count: .word 20
int: .word 1
end1: .asciiz "\n"
ans: .asciiz "The count of the number is "
##
##end of file count.s
jesus123
Apr 14th, 2006, 05:32 PM
i appreciate the help...but I need to write it in microcode....i need to use registers like MDR, MAR, SP, TOS, H....and so on.......
Raedwulf
Apr 23rd, 2006, 11:40 AM
most us assemblers are x86 - so you are pretty much stuffed.
I'm amazed Maki is using RISC there.....
maki
Apr 24th, 2006, 04:52 PM
Some years ago i've worked using Risc for academic purposes. I do not know very much. I thought that something like that may be helpful :bigyello:
Raedwulf
Apr 25th, 2006, 02:02 AM
RISC knowledge is great.....though for personal computers ....working with Macs is a very rare ambition ;). However,its useful if you're working with mainframes lol :D
Cheers.