home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,531 of 4,675   
   Kerr-Mudd,John to notsaying@nospicedham.invalid.org   
   Re: DOS debug to com   
   31 Aug 18 17:41:14   
   
   From: notsaying@nospicedham.invalid.org   
      
   On Wed, 13 Jun 2018 16:58:01 GMT, "Kerr-Mudd,John"   
    wrote:   
      
   > On Sun, 10 Jun 2018 11:36:21 GMT, "wolfgang kern"    
   > wrote:   
   >   
   >>  Kerr-Mudd,John wrote:   
   >>   
   >>>>> Having belatedly discovered GNU's xxd with it's -r option,   
   >>>>> I've done a version for DOS.   
   >>   
   >>>>> If you can get the body of the hex into a com file, you can run   
   >>>>> the program so you never need to do it again, IYSWIM. Caters for   
   >>>>> both MS debug and grdb.   
   >>   
   >>>>> Uses DOS redirection, so not much use to you, Wolfgang.   
   >>>>> (might wrap, lines are 78 long)   
   >>   
   >>>> Yes even it doesn't make any sense for me, I couldn't resist to   
   >>>> spend 1/4h to translate it just for fun... and I see many branches   
   >>>> here :)   
   >>   
   >>> Well here's a version that allows for larger files.   
   >>> (it checks for a full line to 0A before processing it; if a partial   
   >>> line it copies the part line and reads another buffer amount; oflw   
   >>> of the output buffer similarly triggers a write). I could save the   
   >>> duplicate read at the expense of a check on each line)   
   >>   
   >> DOS.com files occupy full 64KB (code, PSP and stack are lost for   
   >> data). A common trick to work with a total of 64KB Data is to move   
   >> the stack down (towards your code) and adjust DS/ES to point right   
   >> after SS-top.   
   >>   
   >> if your code + PSP + stack fit 0x400 bytes then I'd use   
   >> (perhaps better after cmdline check and text display)   
   >>   
   >>   mov sp,0x400  ;assume SS=CS   
   >>   mov ax,cs     ;0x168d   
   >>   add ax,0x40   ;0x16cd == 168d:0400   
   >>   mov ds,ax     ;full 64K free there (ie source)   
   >>   add ax,0x1000 ;0x26cd   
   >>   mov es,ax     ;and another free 64KB here (ie destin).   
   >>   
   >> not to mention that FS and GS are available too ...   
   >   
   > Thanks for those pointers (SIC!).   
   >   
   > A definite problem with the code I posted was that it would have   
   > overwritten the stack.   
   > A fix with SP at 0x100 (reusing the PSP), and reading to/from an ES   
   > based segment costs a few more bytes, but still within my limit of   
   > 0x200 of code/text (just).   
   >   
   > Ah well.   
   >   
   >   
      
   Now full 60kish read/write buffer (requires 80 cols to view)   
      
   -d 100 l 100   
      
   0C44:0100  BA BC 01 81 3E 82 00 2D-68 74 6A E8 8C 00 09 C9   ....>..-htj.....   
   0C44:0110  74 60 B0 2D AE 74 04 B0-3E F2 AE 49 80 3D 64 75   t`.-.t..>..I.=du   
   0C44:0120  51 89 D6 B0 0D E8 55 00-E3 4F B0 3A E8 4E 00 E3   Q.....U..O.:.N..   
   0C44:0130  48 B0 20 E8 47 00 E3 41-BB 31 00 8A 05 47 3C 30   H. .G..A.1...G<0   
   0C44:0140  72 11 24 4F D4 37 80 F2-01 75 05 4E 8A 24 D5 10   r.$O.7...u.N.$..   
   0C44:0150  88 04 46 E2 0E 80 FA 00-74 04 4A 4E B4 FF E8 28   ..F.....t.JN...(   
   0C44:0160  00 E3 16 4B 74 BD 80 FC-FF 75 D0 86 04 98 46 42   ...Kt....u....FB   
   0C44:0170  EB CB BA AE 01 B4 09 CD-21 B4 4C CD 21 F2 AE 74   ........!.L.!..t   
   0C44:0180  07 E8 05 00 09 C9 75 F5-C3 50 53 B3 01 89 F1 29   ......u..PS....)   
   0C44:0190  D1 B8 00 40 CD 21 89 D6-5B 58 50 53 BA 00 02 B9   ...@.!..[XPS....   
   0C44:01A0  00 F0 31 DB B4 3F CD 21-89 D7 91 5B 58 C3 4E 6F   ..1..?.!...[X.No   
   0C44:01B0  74 20 64 62 67 20 64 75-6D 70 0D 0A 55 73 61 67   t dbg dump..Usag   
   0C44:01C0  65 20 69 73 3A 20 78 78-64 2D 72 3C 64 62 67 66   e is: xxd-rcomfile..dbg   
   0C44:01E0  66 69 6C 65 3A 20 67 72-64 62 20 6F 72 20 4D 53   file: grdb or MS   
   0C44:01F0  20 64 65 62 75 67 20 22-64 22 75 6D 70 0D 0A 24    debug "d"ump..$   
   -q   
      
   --   
   Bah, and indeed, Humbug.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca