> DOS "write string" (function 9) uses '$' (24h) as the string terminator. > Silly holdover from long ago... Well every string termination is silly basically. I'd prefer the pascal style strings with the length in front so that before you process the string you know how much memory you have to occupy etc. Also for that the string length determination is muuuch easier :-) Tamas On 11/16/06, William Couture wrote: > > On 11/16/06, Peter P. wrote: > > 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 ? > > Quite a few. > > Sorry, I didn't realize until now that you were referring to which > processor, > not "what langauge". It's x86 assembly. > > > > 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 > > I wouldn't pay for that level of "translation" -- it would be worse > than useless. > > > 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). > > DOS "write string" (function 9) uses '$' (24h) as the string terminator. > Silly holdover from long ago... > > Bill > > -- > Psst... Hey, you... Buddy... Want a kitten? straycatblues.petfinder.org > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- unPIC -- The PIC Disassembler http://unpic.sourceforge.net -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist