... You can statically find *most* jump destinations. Then you can run under an emulator and locate the dynamic jumps, with the emulator's help. Once you know...
... [...] ... There is one problem with that approach: I have seen many old programs that used tricks and had a real opcode used as an immediate value: 100...
... I've seen that at Acorn where they would define a new 6502 opcode called "SKP" which was intended to be a 1-byte skip, but was actually just the opcode of...
... You don't necessarily need 2 bytes to encode the destination. You could very well have 1 byte *offsets*. Typically on the 68k switch/case tables use...
... Yes, I know, it's worse than I said. For example on the 6502 if you use a table of 2-byte addresses, you can only have 128 of them and fetching them from...
After, asking stupid questions, I thought it was time to start doing real work. Right now I have a 8080 disassembler that walks down call tree to identify...
... You'd be surprised. Given 8080 input, you're probably making a correct assumption. However, a some (annoying) chips force the use of indirect addressing...
... Things like redundant flag optimizations immediately spring to mind. Also, I think that local optimizations such as constant folding, dead code ...
... I don't think that's the major disadvantage. We're not going to use superblocks in our PPC recompiler because once you exit, you can't easily get back...
... Does it do things like this? http://www.synthcom.com/~nb/invadersLst.zip Not only does it tell you the "jump to" addresses, but it also tells you where it...
Neil Bradley
nb@...
Jul 4, 2004 1:17 am
150
... Weeeeeeeeeeeeeeelllll.... that's not entirely true. If it can be optimized to Z80 instructions, it should be. ... Yeah, already got that in my core: struct...
Neil Bradley
nb@...
Jul 4, 2004 1:26 am
151
... Sorry to follow up on my on post, but please look for the word "Linear" and look downward. That's where the interesting disassembly begins. The first...
Neil Bradley
nb@...
Jul 4, 2004 1:29 am
152
... My bet is that code that old was optimized for space not for speed. That's why I think inlining may be a win... ... I will look at that, thanks for the...
... If you're generating an intermediate code and compiling to binary from that on the fly, all you need to do is insert a label at the appropriate place in...
Are there any CPUs that require more than 4 bytes to decide what the instruction is (Itanium notwithstanding)? I'm not talking about overall length of the...
... the ... overall ... size. ARM, ... segments ... longer). ... Which leads to the Nuon. The Aries processor is a 128-bit VLIW processor that uses a form of...
... You could :-) I first need to play around with the simpler 8080, then I will move on to something more substantial. Perhaps not 6809 however, 68k is my...
... Fair enough, I think in that case I might do a rough draft of the 6809 today myself. I won't do any of the tree-walking opcode-discovering stuff, because ...
... Is it really hard to extract game drivers from MAME? I have not taken a close look at sources for long but I think they worked hard to unify them... ...
... The AVG/DVGs are unified already, and I can provide code for them (out of Retrocade). Beyond that there are hardware specific hooks that'll be needed, but...
Neil Bradley
nb@...
Jul 4, 2004 5:13 pm
161
If we can digress a moment. The 6502 I did was based on something I found on the net with Neils name on it. Very well written in the sense that each...
... How do you determine when it is safe to do this? Are you doing it manually for now? ... Actually it is. All you need is a disassembler. You start...
Everyone - I've decided to call my compiler Orion (for lack of a better name). It can be downloaded here: ...
Neil Bradley
nb@...
Jul 6, 2004 8:20 am
164
... Well, I'm glad you found some use out of that code. I actually had forgotten that I wrote it in the first place! I also hated the code because it was so...
Neil Bradley
nb@...
Jul 6, 2004 8:31 am
165
... There are about 700 opcodes, but many of them are similar enough that you only need to type in a few. Take for instance the 62 ld r1,r2... Or the bit...
I am still at the thinking stage... While implementing the C emitter for Space Invaders' 8080, something that should have been obvious occurred to me: for...
... That's right. Some destinations cannot be determined statically, and you have to catch them at run-time. However it is not very hard, because you can...
... Hum, I don't get it: RETs have to be considered as dynamic jumps. So there are many indirect jumps, except we can determine their static value most of ...
... Not always. Download Orion and see that there are several return points that are single ended: ./recomp -template template.invaders -outc out.c -outh out.h...