URL
https://opencores.org/ocsvn/amber/amber/trunk
[/] [amber/] [trunk/] [hw/] [tests/] [tst.S] - Diff between revs 83 and 87
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 83 |
Rev 87 |
Line 59... |
Line 59... |
|
|
// should not unset the V flag value
|
// should not unset the V flag value
|
tst r1, #0
|
tst r1, #0
|
|
|
// Check the V flag and Z flag are still set, the C flag
|
// Check the V flag and Z flag are still set, the C flag
|
// is clear, and the N flag gets cleared
|
// is set to the carry out, and the N flag gets cleared
|
bvc testfail
|
bvc testfail
|
bne testfail
|
bne testfail
|
bcs testfail
|
bcc testfail
|
bmi testfail
|
bmi testfail
|
|
|
// Test "Strange issue with r12 after TEQLSP"
|
// Test "Strange issue with r12 after TEQLSP"
|
mov r1, #0x1
|
mov r1, #0x1
|
mov r2, #0x1
|
mov r2, #0x1
|
Line 94... |
Line 94... |
mov r1, #0x00800000
|
mov r1, #0x00800000
|
tst r1, #0x00ff0000
|
tst r1, #0x00ff0000
|
movcc r0, #0
|
movcc r0, #0
|
movcs r0, #1
|
movcs r0, #1
|
|
|
|
// test carry flag
|
|
mov r0, #2
|
|
mov r1, #1
|
|
mov r3, #0x930
|
|
cmp r0, #1
|
|
mov r1, r3
|
|
tst r1, #0x10
|
|
|
|
bcc testfail
|
|
bcc testfail
|
|
bcc testfail
|
|
|
|
|
|
// clears all four flags
|
|
// Cant use p version of instrustion in 32-bit CPU because it writes the upper 4 bits of PC
|
|
teqp pc, #0x00000000
|
|
|
|
mov r0, #2
|
|
mov r1, #1
|
|
mov r3, #0x930
|
|
// next instruction sets the carry flag
|
|
// compare subtracts a 1 from the r0 value of 2
|
|
// means 2's compliment of '1' gets added to '2', so the carry bit is set
|
|
cmp r0, #1
|
|
mov r1, r3
|
|
|
|
// leaves carry flag at previous value
|
|
tst r1, #0x10
|
|
bcc testfail
|
|
|
b testpass
|
b testpass
|
|
|
testfail:
|
testfail:
|
ldr r11, AdrTestStatus
|
ldr r11, AdrTestStatus
|
str r10, [r11]
|
str r10, [r11]
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.