.data
nhapA: .asciiz "Nhap a : "
nhapB: .asciiz "Nhap b: "
lonHon: .asciiz " a lon hon b"
beHon: .asciiz " a be hon hoac bang b "
.text
main:
la $a0, nhapA
addi $v0, $0, 4
syscall
# nhap a
addi $v0, $0, 5
syscall
addi $s0, $v0, 0 # a luu trong s0
la $a0, nhapB
addi $v0, $0, 4
syscall
# nhap b
addi $v0, $0, 5
syscall
addi $s1, $v0, 0 # b luu trong s1
# so sanh s0, s1
bgt $s0, $s1 bigger # neu s0 > s1 thi nhay den bigger
# con s0 be hon s1 thi in thong bao be hon
la $a0, beHon
addi $v0, $0, 4
syscall
j end # nhay den end de ket thuc chuong trinh
bigger: # khi s0 > s1 thi in thong bao lon hon
la $a0, lonHon
addi $v0, $0, 4
syscall
end:
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.