Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!apple!motcsd!starnet!sschaem From: sschaem@starnet.uucp (Stephan Schaem) Newsgroups: comp.sys.amiga.programmer Subject: Re: Lemmings - a tutorial Part V (last) Message-ID: <1991Apr9.193233.5773@starnet.uucp> Date: 9 Apr 91 19:32:33 GMT References: <1991Mar31.003933.1483@mintaka.lcs.mit.edu> <1991Apr1.020748.26863@mintaka.lcs.mit.edu> <18ee3f47.ARN125e@jsmami <20437@cbmv Organization: Starnet-Public Access UNIX-Los Altos,CA 415-949-3133, login:info Lines: 40 Wasn't that more of a desing problem? Days for changing tables jump? Usally use table because of the compare, not the branching... If you do 'serial' compare you know what your programe do. For exmaple if you try to reconiz instructions, you use table or compare. And In C or ASM its an 'optimization' that you will do. If you are on a 68000 bra.b or bra.w or jrs d16(pc) take 10 cycles... bra.b and bra.w take 8 cycle (or 2 bus cycle) like jsr d16(pc). So what the idea in using bra.b? on a 68000 software. And I haven't check how that follow on a 68020. You will use .s for contidional branching! and will do so you continional braching instruction branch mostly on (Not taken). When analizing a buffer I know the % of instruction I will be likly to find... So I do the routine brnching acordingly. I'm not a cycle optimization fanatic, but logical optimization fanatic:-) Anyway from what I read bra.s VS jmp d16(pc) is a size diference (68000).So keep you bra.b into bra and let your assembler optimize it when possible. And you also have to know when using table that its has to be decided by something else than cycles... If you use a table and 99% of the time it doesn't pass the first element you are lossing time. And you might need to use both.You need to run the software for that... So finaly the point already try to state: a compiler CANT do that, a human can guess... I have programe using table for that instruction decoding, and I keep track of the table usage :-) And I find fun to think the programe could recode itself for each aplication it already knows:-) Also your point is more than true on optimization (case switch example). But doesn't happen often to me, and usally but not always the compare/jump are not time crutical at all. Stephan.