Sujet : Re: Small(est?) Hexdump/reconstruction DOS programs
De : admin (at) *nospam* 127.0.0.1 (Kerr-Mudd, John)
Groupes : alt.lang.asm comp.os.msdos.programmerDate : 13. Sep 2024, 21:31:40
Autres entêtes
Organisation : Dis
Message-ID : <20240913213140.6a1394bda4b7601e6c001f4c@127.0.0.1>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
On Fri, 13 Sep 2024 16:58:17 +0200
wolfgang kern <
nowhere@never.at> wrote:
On 12/09/2024 21:08, Kerr-Mudd, John wrote:
...
now with '@' for single break per hexdump line.
c:\temp>hex1c8 -d @ <hex1c8.com
A083003C68747931EDB43FB53CBADF01 CD2191E30389D6BFC33F57A083003C64
753EA085002D303C4888C67502B2EFAC 43D41086E02704F01440AA30CF75F420
D37506B80D0AABEB0784F37503B020AA E2DD5AB30189F929D1B440CD214BEBA9
AC3C30721709ED741288C695244FD437 30CF75F588F4D510AA31C095E2E2EBD2
B409BA8B01CD21C30D0A0A5573616765 2069733A0D0A686578202D64205B7370
5D3C666E2E636F6D0D0A2073703D7B30 2C312C322C342C382C407D0D0A6F720D
0A686578202D723C666E2E6865783E66 6E2E636F6D0D0A2447504C204D4A3234
same, just in grdb dump format:
-> d 100 lE0
16B1:0100 A0 83 00 3C-68 74 79 31-ED B4 3F B5-3C BA DF 01 ...<hty1..?.<...
16B1:0110 CD 21 91 E3-03 89 D6 BF-C3 3F 57 A0-83 00 3C 64 .!.......?W...<d
16B1:0120 75 3E A0 85-00 2D 30 3C-48 88 C6 75-02 B2 EF AC u>...-0<H..u....
16B1:0130 43 D4 10 86-E0 27 04 F0-14 40 AA 30-CF 75 F4 20 C....'...@.0.u.
16B1:0140 D3 75 06 B8-0D 0A AB EB-07 84 F3 75-03 B0 20 AA .u.........u.. .
16B1:0150 E2 DD 5A B3-01 89 F9 29-D1 B4 40 CD-21 4B EB A9 ..Z....)..@.!K..
16B1:0160 AC 3C 30 72-17 09 ED 74-12 88 C6 95-24 4F D4 37 .<0r...t....$O.7
16B1:0170 30 CF 75 F5-88 F4 D5 10-AA 31 C0 95-E2 E2 EB D2 0.u......1......
16B1:0180 B4 09 BA 8B-01 CD 21 C3-0D 0A 0A 55-73 61 67 65 ......!....Usage
16B1:0190 20 69 73 3A-0D 0A 68 65-78 20 2D 64-20 5B 73 70 is:..hex -d [sp
16B1:01A0 5D 3C 66 6E-2E 63 6F 6D-0D 0A 20 73-70 3D 7B 30 ]<fn.com.. sp={0
16B1:01B0 2C 31 2C 32-2C 34 2C 38-2C 40 7D 0D-0A 6F 72 0D ,1,2,4,8,@}..or.
16B1:01C0 0A 68 65 78-20 2D 72 3C-66 6E 2E 68-65 78 3E 66 .hex -r<fn.hex>f
16B1:01D0 6E 2E 63 6F-6D 0D 0A 24-47 50 4C 20-4D 4A 32 34 n.com..$GPL MJ24
-> q
while to first may be better readable for machines, my eyes prefer the
latter variant :)
AL=[0083] CMP "h" JZ 0107+79 ;aka 0180
how about 80 36 83 00 68 CMP byte [0083],68 ;same size but keeps AL
maybe, but AL is lost by the Read: ; it was an 'addon' to allow a '-help'
option. 126 bytes (now, see below) for main code.
AH=3F CH=3C DX=01DF (34 ?) INT21 swap AX,CX JCXZ RET
SI=DX DI=3FC3 push DI CMP[0083],"d" JNZ 0122+3E aka 0160
must reload byte at [83] to test after re-read, if source file >15k
AL=[0085] SUB AX,3C30 DEC AX DH=AL JNZ 012D+2 aka 012F (skip next)
Oops!------->^----this bit-----^ is definitely suboptimal!
change to 'sub al,0x31; instead. (again, same lth if using DH directly)
BL=EF -- shorter linelth for printing when 1 space between each hex pair.
LODSB INC BX DIVMOD 10
SWAP AL,AH DAA ADD AL,F0 ADC AL,40 STOSB XOR BH,CL JNZ 0133 <<
I need to think about this last two lines ...
It's just a 'do twice', BH=0 at start, and end, BL is input char count.
CL is any constant for the redo.
(wraps at eol, so BH untouched)
to be continued
Thanks
-- Bah, and indeed Humbug.