Advertisement
Guest User

QB MIPS asm for VWF

a guest
Nov 8th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. lhu a3,0x0(s4) #Load current char
  2. lui s6,0x894 #Load data location
  3. ori s6,s6,0xBEC0 #Two instruction because MIPS
  4. nop #No special reason why this is here
  5. move v1,s6 #Not sure why we're doing this also
  6. addiu v1,v1,0x10 #Again not sure
  7.  
  8. pos_0894BE78: #This is the main loop
  9.  
  10. lhu v0,0x0(v1) #Load char from data table
  11. beq v0,zero,pos_0894BE98 #If at end of data table, jump to end
  12. nop #Need nop for beq instruction
  13. bnel v0,a3,pos_0894BE78 #Go back if no match (after doing next instruction)
  14. addiu v1,v1,0x4 #Increment addr
  15. lbu v0,0x3(v1) #(with a match) Load spacing value
  16. mtc1 v0,f21 #Copy spacing value to coprocessor
  17. cvt.s.w f21,f21 #Convert spacing value to single-precision floating point
  18.  
  19. pos_0894BE98: #These are the ending steps
  20.  
  21. add.s f25,f25,f21 #Increment x offset (using spacing value)
  22. li v0,0x0 #Reset registers
  23. li v1,0x0
  24. li a3,0x0
  25. li s6,0x0
  26. j pos_08833A88 #Jump back into game program
  27. addiu s4,s4,0x2 #Move pointer to next character (MIPS executes the next instruction after jumps unless a bnel branch is taken)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement