Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!world!esegue!compilers-sender From: ch@dce.ie (Charles Bryant) Newsgroups: comp.compilers Subject: Re: Help on disassembler/decompilers Keywords: assembler, debug Message-ID: <1990Sep14.181616.26890@dce.ie> Date: 14 Sep 90 18:16:16 GMT References: <6839.26ea3b0e@vax1.tcd.ie> <3972@bingvaxu.cc.binghamton.edu> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: ch@dce.ie (Charles Bryant) Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 34 Approved: compilers@esegue.segue.boston.ma.us In article <3972@bingvaxu.cc.binghamton.edu> vu0310@bingvaxu.cc.binghamton.edu.cc.binghamton.edu (R. Kym Horsell) writes: >There's no _unique_ mapping from HLL into assembler, or from assembler into >assembler for that matter, either! In _principle_ translation between >assembler and an HLL is no harder than the other way 'round. You can't even >say that "assembly language is close to the machine & you can do things in >it that you can't in HLLs" -- after all, assembly and HLL are both capable >of emulating Turning machines, right? Well how would you translate this C function into Pascal. typedef struct list { struct list *next; int item; } list; list *head; insert(list *newelem) { list **p; for (p = &head; *p; p = &(*p)->next) if ( (*p)->item >= newelem->item) break; newelem->next = *p; *p = newelem; } It seems to me that you either need an extra node, or you have to simulate the pointers in an array. If you manage the Pascal, try BASIC (even with no pointer operations at all it is still "equivalent" to C). -- Charles Bryant (ch@dce.ie) -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.