William Couture gmail.com> writes: > Er... I'm not sure what you mean by "in what language". The original poster > talked about an Assembly to C translator, and I talked about my .ASM > (Assembly) programs. Er ... how many CPUs do you know ? > As for using #define macros, that isn't even close. For a trivial .ASM > program: > > org 100h > assume cs:code,ds:code,ss:code,es:code > entry: > mov ah,9 > mov dx,offset message > int 21h > mov ax,4c00h > int 21h > message: > db "Hello, World!",0dh,0ah,24h > end > > would become the C program: > #include > main() > { > puts("Hello, World!"); > exit(0); /* optional */ > } I think that it would become more something along the lines of: void main(void) { char v_ah; short v_dx, v_ax; // srcfile.asm:someline l_entry: v_ax = 9; v_dx = s_message; f_int21h(); v_ax = 0x4c00; f_int21h(); } // INITIALIZED DATA // srcfile.asm:someline db "Hello, World!",0dh,0ah,24h char s_message[] = "Hello, World!" '\x0d' '\x0a' '\x24' '\0'; //end By the way, what's the 0x24 for ? I am not aware of this control character being used for something (or I forgot about it - I did very little x86 assembly). > > On a more interesting CPU (like the Z80 which has about 10 addressing modes) > > decoding the menmonics could become interesting (LD can stand for a variety > > of operations). > > The x86 equivalent is MOV, and it has enough variations to keep you busy for > quite a while... Yes, I know. But there are disassemblers for this, and they can do the job just fine. Scripting languages are very powerful now. A table driven assembler/disassembler for a Z80 class cpu takes about a week or two to write and test in Perl and there are more powerful languages than Perl for this. Peter P. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist