Mercurial > hg-old > index.cgi
comparison lwasm/lwasm.c @ 238:a9a14e6b4bc8
Fixed os9 module CRC calculation
author | lost |
---|---|
date | Sat, 15 Aug 2009 05:26:02 +0000 |
parents | a58f49a77441 |
children | 1106ec189e4f |
comparison
equal
deleted
inserted
replaced
237:dca5938a64aa | 238:a9a14e6b4bc8 |
---|---|
101 if (as -> outformat == OUTPUT_OS9 && as -> inmod) | 101 if (as -> outformat == OUTPUT_OS9 && as -> inmod) |
102 { | 102 { |
103 // calc the CRC | 103 // calc the CRC |
104 b &= 0xff; | 104 b &= 0xff; |
105 | 105 |
106 b ^= (as -> crc) >> 16; | 106 b ^= (as -> crc)[0]; |
107 as -> crc <<= 8; | 107 (as -> crc)[0] = (as -> crc)[1]; |
108 as -> crc ^= b << 1; | 108 (as -> crc)[1] = (as -> crc)[2]; |
109 as -> crc ^= b << 6; | 109 (as -> crc)[1] ^= (b >> 7); |
110 b ^= b << 1; | 110 (as -> crc)[2] = (b << 1); |
111 b ^= b << 2; | 111 (as -> crc)[1] ^= (b >> 2); |
112 b ^= b << 4; | 112 (as -> crc)[2] ^= (b << 6); |
113 b ^= (b << 1); | |
114 b ^= (b << 2); | |
115 b ^= (b << 4); | |
113 if (b & 0x80) | 116 if (b & 0x80) |
114 as -> crc ^= 0x800021; | 117 { |
115 as -> crc &= 0xffffff; | 118 (as -> crc)[0] ^= 0x80; |
119 (as -> crc)[2] ^= 0x21; | |
120 } | |
116 } | 121 } |
117 } | 122 } |
118 | 123 |
119 void lwasm_emitop(asmstate_t *as, lwasm_line_t *l, int o) | 124 void lwasm_emitop(asmstate_t *as, lwasm_line_t *l, int o) |
120 { | 125 { |