Re: Sort of Gray code to binary converter



In article <1134352497.340491.182910@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
slebetman@xxxxxxxxx <slebetman@xxxxxxxxx> wrote:
[... me ...]
>>
>> Y = Table[X];
>>
>
>I considered that one. That requires an array of 256 elements 93.75% or
>which simply store errors/illegal values. The switch statement on the
>other hand requires less typing (16 cases instead of 256 values).

In ASM you can do like this:

Table:
rept 256 ; Repeat 256 times
db 0FFH ; Fill with error
endm ; End repeat

org Table+00000011 ; Address the cell
db 1 ; Put the value in
org Table+00000110
db 2
..... etc .......
org Table + 256 ; put the pointer to after the table
.... more code ...

As is often the case, it is easier to do in ASM.



--
--
kensmith@xxxxxxxxx forging knowledge

.



Relevant Pages

  • Re: Sort of Gray code to binary converter
    ... That requires an array of 256 elements 93.75% or ... > As is often the case, it is easier to do in ASM. ... Rich ... Prev by Date: ...
    (sci.electronics.design)
  • Re: [PHP] Array mysteries
    ... but i just used moved his $wdays inside the function... ... When I'm confronted with a case condition, I typically use the switch statement. ... But what's the cost of this in a loop, rebuilding the array each time, as compared to a switch statement? ...
    (php.general)
  • Re: [PHP] Array mysteries
    ... Subject: Array mysteries ... but i just used moved his $wdays inside the function... ... When I'm confronted with a case condition, I typically use the switch statement. ...
    (php.general)
  • Re: [PHP] Array mysteries
    ... but i just used moved his $wdays inside the function... ... When I'm confronted with a case condition, I typically use the switch statement. ... But what's the cost of this in a loop, rebuilding the array each time, as compared to a switch statement? ...
    (php.general)
  • Re: C / asm / long ints
    ... arrays in C, the array encoded integer arithemetic that i wrote in C ... in particular GMP but i was unable to get it to run with my compiler, ... in asm and use it in C. ...
    (comp.lang.c)