Assembly Language Assignment Help

An assembly language is a low-level programming language used for microprocessors, microcontrollers, and additional programmable devices. Assembly language is used where speed is more important or there are operations which can’t be performed on high-level programming languages. It also gives the insight to develop efficient code in high-level language. It is the most powerful computer programming language available

Assembly languages helps users to know the operations of their PC better which in turn, helps them in consistent development of software. With the help of an assembler you have full control on your PC. The programs created in assembly languages are smaller and have much more capacity than ones developed with the use of other languages. In assembly language, symbolic memory addresses are used for used to remember where data is stored instead of remembering the exact memory location. To translate the assembly language statements into machine language code, an assembler is used.

We at Assignmentpedia provide best-in-class Assignment Help and Homework Help in Assembly Languages. You can interact with the expert first, before making the payment. This unique attribute helps the students specifically in Assembly Languages because of the complexity and criticality involved.

NOTE-The following Assembly Language Program has been prepared by our Assembly Language Programmers , just for demonstrating you the quality and comprehensiveness of our Assembly Language Homework Solutions and they do not constitute to any of our previous Assembly Language Assignment/Homework solution deliveries.

1. Sample Assembly Language Assignment


# the array to store which position in each column
# has the brighest color.
# so it is a number between 0 (the top row) and 55
# (the 15 lines below the last row) so that we can
# display the full animation of each column.
pos : .space 80
update: .space 80
prob: .space 80 # the probability of each column to fall down in each turn

.globl main


# draw random letters with green color on the screen
jal _randomLetters

# initialize the position of the brighest colour in each column
# to 0
# initialize the probability
li $t0, 80
la $t1, pos
la $t2, update
la $t3, prob
beq $t0, $0, main_loop
sb $0, 0($t1)
sb $0, 0($t2)

# generate a random probability for each column
li $v0, 41
xor $a0, $a0, $a0
andi $a0, 0xF # now random number 0 < $a0 <= 15
sb $a0, 0($t3)

addi $t2, $t2, 1
addi $t3, $t3, 1
addi $t1, $t1, 1 # move to the next column
addi $t0, $t0, -1 # decrease the counter
j init_column_next

# loop forever to update the monitor
# print the letters with the current position of brighest positions
jal _printLetters

# now update the position
# for each column, there is 2/16 chance to move the position

li $t0, 80
la $t1, pos
la $s2, update
la $s3, prob
beq $t0, $0, main_loop # update column done, go to the main loop
sb $0, 0($s2) # reset the update bit

# generate a random number to determine whether
# this column should be updated
addi $sp, $sp, -8
sw $t0, 0($sp)
sw $t1, 4($sp)

li $v0, 41
xor $a0, $a0, $a0
andi $a0, 0xF # now random number 0 < $a0 <= 15

la $t2, prob
add $t2, $t2, $t0
lb $t2, ($t2)
bgt $a0, $t2, column_update # $a0 >= 4, no update

# otherwise, update the position
lb $t2, 0($t1)
li $t3, 55
beq $t2, $t3, reset_column # already fall out of the terminal reset to 0
addi $t2, $t2, 1
j column_update

or $t2, $0, $0
j column_update

sb $t2, 0($t1)

li $t2, 1
sb $t2, 0($s2) # change the update bit
lw $t0, 0($sp)
lw $t1, 4($sp)
addi $sp, $sp, 8
addi $t0, $t0, -1 # decrease the column counter
addi $t1, $t1, 1 # move to the next column
addi $s2, $s2, 1
j update_column_next

# print the letters on the screen using the current positions
# of brighest color

# store registers on the stack
addi $sp, $sp, -4
sw $ra, 0($sp)

li $t0, 0 # column = 0
li $t1, 80 # if column == 80, no more columns, print done
beq $t0, $t1, print_column_done

# check if this column needs to update
la $s2, update
add $s2, $s2, $t0
lb $s2, 0($s2)
beq $s2, $0, next_row_done # no need to update, jmp to next column directly

# move to the last row of the current column
li $s0, 0xffff8000 # left top
li $t1, 4
mult $t0, $t1 # column * 4
mflo $t1 # $t1 = column * 4
addu $t1, $s0, $t1 # the top row of the current column
addu $t1, $t1, 0x30C0 # the last row of the current column
li $t3, 39 # the current row

# load the position of the brighest for the current row
la $t4, pos
add $t4, $t4, $t0
lb $t4, 0($t4)

blt $t3, $0, next_row_done

bgt $t3, $t4, dark_green # have not fall this part yet, print dark green

# otherwise, calculate the distance between
# the current and the brightest
sub $t2, $t4, $t3
li $t5, 12
bgt $t2, $t5, dark_green # far away, already fall, print dark green

# otherwise, calculate the color
li $t5, 0xF
sub $t5, $t5, $t2
sll $t6, $t5, 4
or $t6, $t6, $t5
sll $t6, $t6, 8
# print the color of $t6
lw $t2, 0($t1)
andi $t2, $t2, 0xFFFF00FF # remove the green part
or $t2, $t2, $t6 # add the new green part
sw $t2, 0($t1)
j next_column

lw $t2, 0($t1)
ori $t2, $t2, 0x00002200
sw $t2, 0($t1)

addi $t1, $t1, -320 # move up one row
addi $t3, $t3, -1 # decrease the row number
j print_next_row


addi $t0, $t0, 1 # move to the next column
j print_next_column

lw $ra, 0($sp)
addi $sp, $sp, 4
jr $ra

# store registers on the stack
addi $sp, $sp, -4
sw $ra, 0($sp)

li $s0, 0xffff8000 # left top
li $s1, 0x00002200 # dark-green colour
li $t0, 3200 # 40 rows x 80 column

beq $t0, $0, random_letter_done
# generate a random number between 33 and 126
li $v0, 41
xor $a0, $a0, $a0
andi $a0, $a0, 0x7F # now 0 <= a0 <= 127
li $t1, 33
blt $a0, $t1, random_next
li $t2, 126
bgt $a0, $t2, random_next
# now 33 <= a0 <= 126
sll $a0, $a0, 24
or $a0, $a0, $s1 # append the color
sw $a0, 0($s0) # store the word to the terminal
addi $s0, $s0, 4 # move to the next positon in the terminal
addi $t0, $t0, -1 # decrease the counter
j next_random_letter

lw $ra, 0($sp)
addi $sp, $sp, 4
jr $ra