This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.include "macros.asm" | |
.data | |
# arrays | |
variables: .space 16 # [random number][low][high][guesses] | |
range: .byte 100 # Set the range [0 t0 range] | |
# Constant strings | |
guess1: .asciiz "Guess a number between " | |
guess2: .asciiz " and " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
main: | |
li $a0, 5 | |
jal fib | |
move $a0, $v0 | |
jal print_int | |
jal print_newline | |
fib: | |
addiu $sp, $sp, -12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timeout=0 | |
targets="scanme.nmap.org" | |
filename=~/Downloads/CourseMaterial/nmap/git/testnmap/nmap/scripts/script.db | |
output_path=~/Downloads/CourseMaterial/nmap/tests/host_timeout | |
#Read from script.db file | |
mapfile -t SCRIPT < <(awk -F'[{=", ]+' '$1 == "Entry"{print $3}' $filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data | |
msg1: | |
.asciiz "Enter a number in base 2 (-2 to quit): " | |
msg2: | |
.asciiz "\nResult: " | |
allOnes: | |
.asciiz "1111111111111111" | |
empty: | |
.space 16 | |
newLine: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data | |
fin: .asciiz "maze1.dat" # filename for input | |
buffer: .asciiz "" | |
.text | |
#open a file for writing | |
li $v0, 13 # system call for open file | |
la $a0, fin # board file name | |
li $a1, 0 # Open for reading | |
li $a2, 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# count significant bits in bit battern | |
.text | |
.globl main | |
lui $8, 0x0029 #register 8 contains bit battern to check for sigbits | |
ori $8, $8, 0x8D7D | |
addiu $10, $0, 32 #exit upper loop counter value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main: | |
addi $t7, $zero, 128 | |
li $v0, 13 | |
la $a0, filename | |
li $a1, 0 | |
li $a2, 0 | |
syscall | |
addi $s0, $v0, 0 | |
readFromFile: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# print_msg function takes three arguments and is equivalent to | |
# snprintf(“Move disk %d from %d to %d.”, $a0, $a1, $a2); | |
hanoi: | |
slti $t0, $a0, 2 | |
bne $t0, $0, caseOne | |
addiu $sp, $sp, -20 | |
sw $a0, 0($sp) | |
sw $a1, 4($sp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2002 Manu Datta (gmail.com ID Manu dot Datta) | |
# All rights reserved | |
.data | |
msg1: .asciiz "\nEnter integer values followed by return (-1 terminates input): \n" | |
msg2: .asciiz "," | |
msg3: .asciiz "Bubble Sort" | |
msg4: .asciiz "#########pass#########" | |
msg5: .asciiz "\n" | |
msg6: .asciiz "\nNumber list has been sorted\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data | |
.text | |
.globl main | |
main: | |
#li $v0, 5 | |
#syscall | |
move $a0, $v0 #sposto l'intero in a0 |
NewerOlder