URL
https://opencores.org/ocsvn/lxp32/lxp32/trunk
Subversion Repositories lxp32
[/] [lxp32/] [trunk/] [verify/] [lxp32/] [src/] [firmware/] [test008.asm] - Rev 2
Go to most recent revision | Compare with Previous | Blame | View Log
/** This test calculates a CRC-32 checksum of a small byte array* CRC32("123456789")=0xCBF43926*/lc r100, 0x10000000 // test result output pointerlc r101, haltlc r102, failurelc r16, 0x10000004 // output pointerlc r17, 0xFFFFFFFF // initial CRC valuelc r18, 0xEDB88320 // polynomlc r19, data // input pointerlc r32, byte_looplc r33, bit_looplc r34, dont_xormov r20, 0 // byte counterbyte_loop:lub r0, r19mov r21, 0 // bit counterbit_loop:and r1, r0, 1and r2, r17, 1sru r17, r17, 1xor r3, r1, r2cjmpe r34, r3, 0xor r17, r17, r18dont_xor:sru r0, r0, 1add r21, r21, 1cjmpul r33, r21, 8add r19, r19, 1add r20, r20, 1cjmpul r32, r20, 9not r17, r17sw r16, r17lc r0, 0xCBF43926cjmpne r102, r0, r17sw r100, 1jmp r101failure:sw r100, 2halt:hltjmp r101data:.byte "123456789"
Go to most recent revision | Compare with Previous | Blame | View Log
