Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ex42.s:
- .text
- .globl __start
- __start: # execution starts here
- la $a0,prompt
- li $v0,4
- syscall # display prompt
- li $v0,5
- syscall # read first integer in $v0
- move $t1,$v0 # and then move in $t1
- la $a0,prompt
- li $v0,4
- syscall # display prompt
- li $v0,5
- syscall # read second integer in $v0
- move $t2,$v0 # and then move in $t2
- blt $t1,100,cond1
- j end
- cond1: blt $t2,100,cond2
- j end
- cond2: la $a0,msg # display message
- li $v0,4
- syscall
- end:
- li $v0,10 # exit
- syscall
- .data
- prompt: .asciiz "Give integer: "
- msg: .asciiz "Both integers less than 100"
- ex49.s:
- .text
- .globl __start
- __start: # execution starts here
- la $a0,input # address of word to transform
- lw $t1,0($a0) # load word to $t1
- li $t0,0x001FF800 # mask definition
- and $t2,$t1,$t0 # masked word
- li $v0,10
- syscall
- .data
- input: .word 0xFFFFFFFF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement