Changeset 378
- Timestamp:
- 07/05/08 16:55:02 (5 months ago)
- Files:
-
- trunk/tools/tools/stackthreads_impl.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tools/tools/stackthreads_impl.d
r377 r378 4 4 static if (size_t.sizeof==8) const string regsize="r", suffix="q"; 5 5 else const string regsize="e", suffix="l"; 6 7 const string pushall = Replace!( 8 "push! #ax\n push! #cx\n push! #dx\n push! #bx\n push! #bp\n push! #si\n push! #di\n ", 9 "#", "%%"~regsize, "!", suffix 10 ); 11 const string popall = Replace!( 12 "pop! #di\n pop! #si\n pop! #bp\n pop! #bx\n pop! #dx\n pop! #cx\n pop! #ax\n ", 13 "#", "%%"~regsize, "!", suffix 14 ); 6 15 7 16 import std.gc; … … 48 57 jmp 1f 49 58 0: 50 pusha! 59 60 "~pushall~" 51 61 52 62 mov #sp, (#cx) 53 63 mov #dx, #sp 54 64 55 popa!65 "~popall~" 56 66 57 67 ret 58 68 1:\" : : \"c\" ep, \"d\" to.esp : \"ax\", \"bx\"; 59 }", "#", "%%"~regsize , "!", suffix));69 }", "#", "%%"~regsize)); 60 70 } else { 61 71 asm { … … 90 100 jmp 1f 91 101 92 0: pusha!93 mov %%sp, (%%bx)94 mov %%cx, %%sp102 0: "~pushall~" 103 mov #sp, (#bx) 104 mov #cx, #sp 95 105 96 106 push $1 97 1: pop %%cx\" : \"=c\" loaded, \"=d\" new_ptr : \"b\" ep, \"c\" esp, \"d\" dg_ptr;98 }", " %%", "%%"~regsize, "!", suffix107 1: pop #cx\" : \"=c\" loaded, \"=d\" new_ptr : \"b\" ep, \"c\" esp, \"d\" dg_ptr; 108 }", "#", "%%"~regsize 99 109 )); 100 110 } else asm {
