Revision 27,
827 bytes
checked in by pntsvt00, 14 years ago
(diff) |
eliminato baco store consecutivi. esegue correttamente il codice
|
Rev | Line | |
---|
[27] | 1 | // Sample program that writes two words at a predefined address |
---|
| 2 | |
---|
| 3 | int main() { |
---|
| 4 | asm("mov 0x10, %g1 \n"); |
---|
| 5 | asm("mov 0x20, %l1 \n"); |
---|
| 6 | asm("stx %l1, [ %g1 ] \n"); |
---|
| 7 | asm(" nop \n"); |
---|
| 8 | asm("stx %l1, [ %g1 +0x40 ] \n"); |
---|
| 9 | asm(" nop \n"); |
---|
| 10 | asm("ldx [ %g1 ], %l1 \n"); |
---|
| 11 | asm(" nop \n"); |
---|
| 12 | asm("ldx [ %g1 ] , %l1\n"); |
---|
| 13 | asm(" nop \n"); |
---|
| 14 | asm("ldx [ %g1 ] , %l1\n"); |
---|
| 15 | asm("ldx [ %g1 ] , %l1\n"); |
---|
| 16 | asm("stx %l1, [ %g1 ] \n"); |
---|
| 17 | asm(" nop \n"); |
---|
| 18 | asm("stx %l1, [ %g1 +0x40 ] \n"); |
---|
| 19 | asm(" nop \n"); |
---|
| 20 | asm("stx %l1, [ %g1 +0x60 ] \n"); |
---|
| 21 | asm(" nop \n"); |
---|
| 22 | asm("stx %l1, [ %g1 +0x80 ] \n"); |
---|
| 23 | asm(" nop \n"); |
---|
| 24 | register unsigned long* address; |
---|
| 25 | address = (unsigned long*)0x0000CAC0; |
---|
| 26 | (*address) = 0xC1A0C1A0; // First store |
---|
| 27 | address = (unsigned long*)0x0000CAC0; |
---|
| 28 | (*address) = 0xFABA1210; // Second store |
---|
| 29 | return 0; |
---|
| 30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.