Assemble the below code in Mips Assembler to solve the sudoku below.
input the sudoku in the following grid.
.data
.align 4
#variable of the board
board: .byte 0, 6, 0, 1, 0, 4, 0, 5, 0
.byte 0, 0, 8, 3, 0, 5, 6, 0, 0
.byte 2, 0, 0, 0, 0, 0, 0, 0, 1
.byte 8, 0, 0, 4, 0, 7, 0, 0, 6
.byte 0, 0, 6, 0, 0, 0, 3, 0, 0
.byte 7, 0, 0, 9, 0, 1, 0, 0, 4
.byte 5, 0, 0, 0, 0, 0, 0, 0, 2
.byte 0, 0, 7, 2, 0, 6, 9, 0, 0
.byte 0, 4, 0, 5, 0, 8, 0, 7, 0
new_row: .ascii "\n"
.text
.globl main
main:
#$s0 has the offset
#$s1 has the row
#s2 has the coloum
#$s3 for the number currently testing
move $a0, $zero #first cell with offset 0
jal guess
jal print_grid
j exit
exit:
move $a0, $s0
li $v0, 17
syscall
guess:
#Setup the stack frame and save all the required register's values to be used later
sub $sp, $sp, 20
sw $ra, 16($sp)
sw $s0, 12($sp)
sw $s1, 8($sp)
sw $s2, 4($sp)
sw $s3, 0($sp)
move $s0, $a0
beq $s0, 81, guess_comp #Chekc if it has reached the end of the grid
#iF NOT THE END
li $s3, 9
div $s0, $s3
mflo $s1 #lo holds the quotient
mfhi $s2 #hi has the remainder
lb $t0, board+0($s0)
beq $t0, 0, guess_it # if equal to zero then guess the number to be placed in it
addi $a0, $s0, 1
jal guess
j guess_return
#$a0 has the number
#$a1 has the row
#$a2 has the coloumn
guess_it:
move $a0, $s3
move $a1, $s1
move $a2, $s2
jal check_num
bnez $v0, num_exist
#else
sb $s3, board + 0($s0)
addi $a0, $s0, 1
jal guess
beqz $v0, guess_return
num_exist:
sub $s3, $s3, 1
bnez $s3, guess_it
sb $zero, board + 0($s0)
#else No number is satisfied as already checked from 9 to 1 go back change the previous number and come back
li $v0, 1
j guess_return
guess_comp:
move $v0, $zero
guess_return:
lw $ra, 16($sp)
lw $s0 , 12($sp)
lw $s1, 8($sp)
lw $s2, 4($sp)
lw $s3, 0($sp)
addi $sp, $sp, 20
jr $ra
#set t1 to an element. decrease t0 by 1 and check it with t1
check_num:
li $t0, 9
mul $t1, $a1, $t0 # offset of the first element of the row of the element to guess
check_num_row:
lb $t2, board+0($t1)
beq $t2, $a0, present #Found the element in the row
#else
addi $t1, $t1, 1
sub $t0, $t0, 1
bnez $t0, check_num_row
#else
move $t1, $a2
check_num_col:
lb $t2, board+0($t1)
beq $t2, $a0, present #found the element in the coloumn
#else
addi $t1, $t1, 9
ble $t1, 81, check_num_col
#else
#(success)
move $v0, $zero
j check_success
present:
li $v0, 1
check_success:
jr $ra
#Printing
#s0 holds the offset
#s1 hold row
#s2 hols coloumn
print_grid:
sub $sp, $sp, 16
sw $ra, 12($sp)
sw $s2, 8($sp)
sw $s1, 4($sp)
sw $s0, 0($sp)
la $s0, board #number-> board[0,0]
move $s1, $zero #row ->0
move $s2, $zero #coloum ->0
print_cell:
lb $a0, ($s0) #To print a int
li $v0, 1
syscall
addi $s0, $s0, 1 #add to offset
addi $s2, $s2, 1 #add to coloumn
blt $s2, 9, print_cell #if the coloumn is complted
la $a0, new_row #to print asciiz
li $v0, 4
syscall
move $s2, $zero #reset coloumn to zero
addi $s1, $s1, 1 #add to row
#Check if the row is printed
blt $s1,9, print_cell
lw $s0, 0($sp) # Restore the $s0 register
lw $s1, 4($sp) # Restore the $s1 register
lw $s2, 8($sp) # Restore the $s2 register
lw $ra, 12($sp) # Restore the return address
addi $sp, $sp, 16 # Clean up the stack
jr $ra
Trick to see your saved Password.
_silly showsavedpassword viewsavedpassword;forgotsavedpassword
Let me show you, how this works
This actually manipulate with the source code of the page and convert the password type to text type.
Step-1-Go to your login page.
CHECK IF THE LOGIN CREDENTIAL IS FILLED AS SHOWN.
IF YES READY TO GO.
Step-2-Right click on the password filled and click inspect element
A docked window will be open as shown with code of the field highlighted.
Step-3- Just double click on the "password" tag, and write it as "text".
YOU WOULD BE ABLE TO VIEW THE PASSWORD ON PASSWORD FIELD.
ThankYou
This actually manipulate with the source code of the page and convert the password type to text type.
Step-1-Go to your login page.
CHECK IF THE LOGIN CREDENTIAL IS FILLED AS SHOWN.
IF YES READY TO GO.
VICTIM'S PAGE |
Step-2-Right click on the password filled and click inspect element
A docked window will be open as shown with code of the field highlighted.
DOCKED WINDOW WITH CODE OF ELEMENT |
DOUBLE CLICK ON THE PASSWORD TAG |
Step-3- Just double click on the "password" tag, and write it as "text".
WRITE IT "text" AND HIT ENTER |
Step-4- Now Just hit Enter.
DONE |
YOU WOULD BE ABLE TO VIEW THE PASSWORD ON PASSWORD FIELD.
ThankYou
To convert disk to mbr(error: cannot install winows to gpt disk)
_silly cannnot install windows on this partition convert disk to mbr install windows after linux
hello readers
today i learned to convert a disk to mbr.
this is caused by :
1.when install linux
2. attempt to install linux
consequences:
cannot install windows(error:cannot install windows on gpt, needs mbr ).
need to know!!!
your entire disk will cleaned
so you can first create a back up using your linux os.
What to do?
1. boot up with your windows installer usb or cdrom, etc
2. press Shift+f10 to open a dos window
3. type ' diskpart' without qoutes.(enter)
4. type 'list disk'.(enter)
5. you can view your online disks and your affected disk(generally disk0).
6. now type 'select disk 0'.(enter)
7. now disk 0 is in your control.
8. now type 'clean'.(enter)
9. now type 'convert mbr'.(enter)
10. your disk is now mbr.
11. now its time to create a partition.
12. type 'create partition primary'.(enter)
13. type 'format fs ntfs quick'.(enter)
14. done!
15. time to exit
16. type 'exit'(enter)
17. type 'exit'(enter)
now you can click install to continue installation.
thankyou!!!!!!!!!!
dont forget to comment about the helpfulness of the post.
today i learned to convert a disk to mbr.
this is caused by :
1.when install linux
2. attempt to install linux
consequences:
cannot install windows(error:cannot install windows on gpt, needs mbr ).
need to know!!!
your entire disk will cleaned
so you can first create a back up using your linux os.
What to do?
1. boot up with your windows installer usb or cdrom, etc
2. press Shift+f10 to open a dos window
3. type ' diskpart' without qoutes.(enter)
4. type 'list disk'.(enter)
5. you can view your online disks and your affected disk(generally disk0).
6. now type 'select disk 0'.(enter)
7. now disk 0 is in your control.
8. now type 'clean'.(enter)
9. now type 'convert mbr'.(enter)
10. your disk is now mbr.
11. now its time to create a partition.
12. type 'create partition primary'.(enter)
13. type 'format fs ntfs quick'.(enter)
14. done!
15. time to exit
16. type 'exit'(enter)
17. type 'exit'(enter)
now you can click install to continue installation.
thankyou!!!!!!!!!!
dont forget to comment about the helpfulness of the post.
How to create a invisible folder in windows.
_silly Create invisible folder folder with no icon folder with no name hide the folder highly hidden folder
Hello Readers,
Today i learnt how to hide a folder in really different way.
Consequence:- Folder is created with no name.
Folder is created with no icon.
which mean your folder will not be visible to any one even if it's attributes is not hidden.
The folder created is undetected by any searches.
The folder created is undetected by ADMIN server for surveillance.
it is completely invisible, the person knowing the correct position of the folder on the area can only find the folder.
Step-1-Create a folder(simply right click and new and folder).
Step-2-While renaming the folder
a.Clear the writing area.
b.press Alt+1023(on numpad) as shown( Alt pressed + 1 then 0 then 2 then 3).
Alternatively(press ALT+0160).
c. Hit enter.
Now, A folder with no name is created.
Step-3- Go to PROPERTIES of the folder created.
a.Go to CUSTOMIZE tab.
b.Click on Change Icon Button.
c.you will see a blank space between the icons.
d.Click on that blank space.
e.Click OK.
f.Click OK.
Now you have created a folder which is completed invisible. to anyone.
But You are only one to who know the X-Y coordinate of the folder on the area.
And if take the mouse pointer on that area you will get a visual of change in color, double click on it and you open your invisible folder.
OR
you could just select area to locate your invisible folder.by simply click and dragging your mouse pointer on that area.
.Now you can hide your stuff in that folder and no one can find the folder even if they search the whole computer as they have no name to search.
Thank you.
Dont forget to comment about the helpfulness of the post.
Today i learnt how to hide a folder in really different way.
Consequence:- Folder is created with no name.
Folder is created with no icon.
which mean your folder will not be visible to any one even if it's attributes is not hidden.
The folder created is undetected by any searches.
The folder created is undetected by ADMIN server for surveillance.
it is completely invisible, the person knowing the correct position of the folder on the area can only find the folder.
Step-1-Create a folder(simply right click and new and folder).
Step-2-While renaming the folder
a.Clear the writing area.
b.press Alt+1023(on numpad) as shown( Alt pressed + 1 then 0 then 2 then 3).
Alternatively(press ALT+0160).
c. Hit enter.
Now, A folder with no name is created.
Step-3- Go to PROPERTIES of the folder created.
a.Go to CUSTOMIZE tab.
b.Click on Change Icon Button.
c.you will see a blank space between the icons.
d.Click on that blank space.
e.Click OK.
f.Click OK.
Now you have created a folder which is completed invisible. to anyone.
But You are only one to who know the X-Y coordinate of the folder on the area.
And if take the mouse pointer on that area you will get a visual of change in color, double click on it and you open your invisible folder.
OR
you could just select area to locate your invisible folder.by simply click and dragging your mouse pointer on that area.
.Now you can hide your stuff in that folder and no one can find the folder even if they search the whole computer as they have no name to search.
Thank you.
Dont forget to comment about the helpfulness of the post.
Download Here Drive +, If downloaded earlier and can't download now. INDIA
_silly App Downloaded Before But cannot doit now Cannot download HERE DRIVE + in INDIA Download HERE Drive+
Hello reader,
Today I learnt how to download a WINDOWS PHONE APP which you have downloaded earlier and cannot download due to region problems.
LIKE: HERE Drive +,etc.
Step-1; Go to APP STORE.
Step-2: Push '...' button to open menu.
Step-3: Go to my apps.
Step-4: Download the app.
Thank you.
Don't Forget To Comment About The Helpfulness Of the Post.
Today I learnt how to download a WINDOWS PHONE APP which you have downloaded earlier and cannot download due to region problems.
LIKE: HERE Drive +,etc.
Step-1; Go to APP STORE.
Step-2: Push '...' button to open menu.
Step-3: Go to my apps.
Step-4: Download the app.
Thank you.
Don't Forget To Comment About The Helpfulness Of the Post.
Transfer, read, write windows phone on linux/ubuntu/,etc
_silly browse Windows phone on ubuntu browseWindowsphoneonlinux transfer file/songs/ pictures to windows phone on linux transfer file/songswindows phone on ubuntuHello Readers
Today i learnt how to browse windows phone (wp) on linux.
1. open terminal.
2. type "sudo apt-get install gmtp"(without quotes).
3. give your password
4. press y if asked.
5. now you can browse write and transfer file from form windows phone.
Thankyou
dont forget to comment about the helpfulness of the post.
Create your own command prompt(cmd)
_silly CreateYourOwnCMD CreateYourOwnCommandPrompt HowToCreateCommandPromptInNotepad
Hello reader,
Does your school's computer not allow you to open Command Prompt(cmd)?
Here is the solution.
Basically, it needs some cmd commands .
ALGORITHM:
> Set title of your shell to "Command Prompt".
>Create a function called cmd.
>Set the directory to current directory of application.
>Trigger cmd
Step-1- Open Notepad.
Step-2-Type in the following Code.
CODE:
@echo off
cls
title Command Prompt
echo Welcome to CMD
echo.
:cmd
set /p "cmd=%cd%>"
%cmd%
echo.
goto cmd
Step-3- Save the file as "cmd.bat".
Open the file created. And here you are with the command prompt of your own.
Don't forget to comment about the helpfulness of the post.
Thank you
Does your school's computer not allow you to open Command Prompt(cmd)?
Here is the solution.
Basically, it needs some cmd commands .
ALGORITHM:
> Set title of your shell to "Command Prompt".
>Create a function called cmd.
>Set the directory to current directory of application.
>Trigger cmd
Step-1- Open Notepad.
Step-2-Type in the following Code.
CODE:
@echo off
cls
title Command Prompt
echo Welcome to CMD
echo.
:cmd
set /p "cmd=%cd%>"
%cmd%
echo.
goto cmd
Step-3- Save the file as "cmd.bat".
Open the file created. And here you are with the command prompt of your own.
Don't forget to comment about the helpfulness of the post.
Thank you
Subscribe to:
Posts (Atom)