OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [tools/] [opcodes.asm] - Diff between revs 148 and 194

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 148 Rev 194
Line 30... Line 30...
   lui   $5,0
   lui   $5,0
   ori   $5,$5,0
   ori   $5,$5,0
   lui   $sp,0
   lui   $sp,0
   ori   $sp,$sp,0xfff0
   ori   $sp,$sp,0xfff0
 
 
 
   b     StartTest
 
   nop                      #nops required to place ISR at 0x3c
 
   nop
 
 
 
OS_AsmPatchValue:
 
   #Code to place at address 0x3c
 
   lui   $26, 0x1000
 
   ori   $26, $26, 0x3c
 
   jr    $26
 
   nop
 
 
 
InterruptVector:            #Address=0x3c
 
   mfc0  $26,$14            #C0_EPC=14 (Exception PC)
 
   jr    $26
 
   add   $4,$4,5
 
 
 
StartTest:
   mtc0  $0,$12             #disable interrupts
   mtc0  $0,$12             #disable interrupts
   lui   $20,0x2000         #serial port write address
   lui   $20,0x2000         #serial port write address
   ori   $21,$0,'\n'        # letter
   ori   $21,$0,'\n'        # letter
   ori   $22,$0,'X'         #'X' letter
   ori   $22,$0,'X'         #'X' letter
   ori   $23,$0,'\r'
   ori   $23,$0,'\r'
   ori   $24,$0,0x0f80      #temp memory
   ori   $24,$0,0x0f80      #temp memory
 
 
 
   sb    $23,0($20)
 
   sb    $21,0($20)
 
   sb    $23,0($20)
 
   sb    $21,0($20)
 
   sb    $23,0($20)
 
   sb    $21,0($20)
 
   sb    $23,0($20)
 
   sb    $21,0($20)
 
 
 
   #Patch interrupt vector to 0x1000003c
 
   la    $5, OS_AsmPatchValue
 
   sub   $6,$5,0x1000
 
   blez  $6,NoPatch
 
 
 
   lw    $6, 0($5)
 
   sw    $6, 0x3c($0)
 
   lw    $6, 4($5)
 
   sw    $6, 0x40($0)
 
   lw    $6, 8($5)
 
   sw    $6, 0x44($0)
 
   lw    $6, 12($5)
 
   sw    $6, 0x48($0)
 
NoPatch:
 
 
   ######################################
   ######################################
   #Arithmetic Instructions
   #Arithmetic Instructions
   ######################################
   ######################################
 
ArthmeticTest:
   ori   $2,$0,'A'
   ori   $2,$0,'A'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'r'
   ori   $2,$0,'r'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'i'
   ori   $2,$0,'i'
Line 286... Line 328...
   sb    $21,0($20)
   sb    $21,0($20)
 
 
   ######################################
   ######################################
   #Branch and Jump Instructions
   #Branch and Jump Instructions
   ######################################
   ######################################
 
BranchTest:
   ori   $2,$0,'B'
   ori   $2,$0,'B'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'r'
   ori   $2,$0,'r'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'a'
   ori   $2,$0,'a'
Line 619... Line 662...
   nop
   nop
   sb    $2,0($20)
   sb    $2,0($20)
   sb    $23,0($20)
   sb    $23,0($20)
   sb    $21,0($20)
   sb    $21,0($20)
 
 
 
#   b     LoadTest
 
 
 
BreakTest:
 
   #p: BREAK
 
   ori   $2,$0,'p'
 
   sb    $2,0($20)
 
   ori   $2,$0,'z'
 
   ori   $4,$0,59
 
   break 0
 
   addi  $4,$4,1
 
   sb    $4,0($20)
 
   sb    $23,0($20)
 
   sb    $21,0($20)
 
 
 
   #q: SYSCALL
 
   ori   $2,$0,'q'
 
   sb    $2,0($20)
 
   ori   $4,$0,61
 
   syscall 0
 
   addi  $4,$4,-1
 
   sb    $4,0($20)
 
   sb    $23,0($20)
 
   sb    $21,0($20)
 
 
 
 
   ######################################
   ######################################
   #Load, Store, and Memory Control Instructions
   #Load, Store, and Memory Control Instructions
   ######################################
   ######################################
 
LoadTest:
   ori   $2,$0,'L'
   ori   $2,$0,'L'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'o'
   ori   $2,$0,'o'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'a'
   ori   $2,$0,'a'
Line 783... Line 851...
 
 
 
 
   ######################################
   ######################################
   #Logical Instructions
   #Logical Instructions
   ######################################
   ######################################
 
LogicalTest:
   ori   $2,$0,'L'
   ori   $2,$0,'L'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'o'
   ori   $2,$0,'o'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'g'
   ori   $2,$0,'g'
Line 876... Line 945...
 
 
 
 
   ######################################
   ######################################
   #Move Instructions
   #Move Instructions
   ######################################
   ######################################
 
MoveTest:
   ori   $2,$0,'M'
   ori   $2,$0,'M'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'o'
   ori   $2,$0,'o'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'v'
   ori   $2,$0,'v'
Line 931... Line 1001...
 
 
 
 
   ######################################
   ######################################
   #Shift Instructions
   #Shift Instructions
   ######################################
   ######################################
 
ShiftTest:
   ori   $2,$0,'S'
   ori   $2,$0,'S'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'h'
   ori   $2,$0,'h'
   sb    $2,0($20)
   sb    $2,0($20)
   ori   $2,$0,'i'
   ori   $2,$0,'i'

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.