[not getting through to clax, so dropping xpost there]
HexDump file format as seen i.e. '0xHH,0xHH'; crlf every 16 bytes
both use DOS int 3F/40 for stdio.
(assumes bx=0 at start)
bin2hex.hex
Reconstruction:Usage example: hex2bin <bin2hex.hex >bin2hex.com
(assumes ax=bx=0 at start)ignores any input <'0' so skips '-' ,cr, lf
hex2bin.hex
Not tested on files larger than 64k but I think they should handle it.
On Wed, 12 Jun 2024 20:22:36 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
[not getting through to clax, so dropping xpost there]
Slightly smaller versions:
HexDump file format as seen i.e. '0xHH,0xHH'; crlf every 16 bytesUsage example: bin2hex <bin2hex.com >bin2hex.hex
both use DOS int 3F/40 for stdio.
(assumes bx=0 at start)
bin2hex.hex
0xB4,0x3F,0xB5,0x29,0xBA,0x4F,0x01,0xCD,0x21,0x91,0xE3,0x03,0x89,0xD6,0xBF,0xC3
0x2B,0x57,0xB8,0x30,0x78,0xAB,0xAC,0x43,0xD4,0x10,0x86,0xE0,0x27,0x04,0xF0,0x14
0x40,0xAA,0x30,0xF7,0x75,0xF4,0xB0,0x2C,0xAA,0x20,0xD3,0x75,0x05,0x4F,0xB8,0x0D
0x0A,0xAB,0xE2,0xDE,0x4F,0x5A,0xB3,0x01,0x89,0xF9,0x29,0xD1,0xB4,0x40,0xCD,0x21
0x4B,0xEB,0xBD
Usage example: hex2bin <bin2hex.hex >bin2hex.com
Reconstruction:
(assumes ax=bx=0 at start)ignores any input <'0' so skips '-' ,cr, lf
0x95,0xBA,0x47,0x01,0xB4,0x3F,0xB5,0xD2,0xCD,0x21,0x91,0xE3,0x03,0x89,0xD6,0xBF
hex2bin.hex
0xC3,0xD4,0x57,0x89,0xE8,0x88,0xC4,0xAC,0x3C,0x30,0x72,0x1C,0x3D,0x78,0x30,0x74
0x14,0x09,0xED,0x74,0x12,0x88,0xC2,0x95,0x24,0x4F,0xD4,0x37,0x30,0xF7,0x75,0xF5
0x88,0xD4,0xD5,0x10,0xAA,0x31,0xC0,0x95,0xE2,0xD9,0x43,0x5A,0x89,0xF9,0x29,0xD1
0xB4,0x40,0xCD,0x21,0x4B,0xEB,0xBA
Not tested on files larger than 64k but I think they should handle it.
hex2bin:
95 swap ax,bp
BA 47 01 dx=0147
B4 3F ah=3F
B5 D2 ch=D2
CD 21 int21
91 swap ax.cx
E3 03 jcxz+3 ;ret
89 D6 si=dx
BF di=d4c3
C3 ret
??? it may not come here ,0xD4,0x57,0x89,0xE8,0x88,0xC4,0xAC,0x3C,0x30,0x72,0x1C,0x3D,0x78,0x30,0x74 0x14,0x09,0xED,0x74,0x12,0x88,0xC2,0x95,0x24,0x4F,0xD4,0x37,0x30,0xF7,0x75,0xF5
0x88,0xD4,0xD5,0x10,0xAA,0x31,0xC0,0x95,0xE2,0xD9,0x43,0x5A,0x89,0xF9,0x29,0xD1
0xB4,0x40,0xCD,0x21,0x4B,0xEB,0xBA
On Fri, 14 Jun 2024 11:09:11 +0200,I wrote:
hex2bin:
95 swap ax,bp
BA 47 01 dx=0147
B4 3F ah=3F
B5 D2 ch=D2
CD 21 int21
91 swap ax.cx
E3 03 jcxz+3 ;ret
89 D6 si=dx
BF di=d4c3
C3 ret
??? it may not come here
,0xD4,0x57,0x89,0xE8,0x88,0xC4,0xAC,0x3C,0x30,0x72,0x1C,0x3D,0x78,0x30,0x74 >> 0x14,0x09,0xED,0x74,0x12,0x88,0xC2,0x95,0x24,0x4F,0xD4,0x37,0x30,0xF7,0x75,0xF5
0x88,0xD4,0xD5,0x10,0xAA,0x31,0xC0,0x95,0xE2,0xD9,0x43,0x5A,0x89,0xF9,0x29,0xD1
0xB4,0x40,0xCD,0x21,0x4B,0xEB,0xBA
That `xchg ax,bp` intro and the `si=dx` & `di=d4c3` outro codes, may be problematic, since they may rely on specific DOS vendor in order to work properly.
you attempts seems to be shortest available.
But my routines are much smaller and use lesser image byte count,
but of course they wont work under DOS and use 32 bit features :)
And MY hex format use the old DEBUG standard: (no 0x no h)
01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f "optional ASCII"
and depending on options line end with only CR or CR+LF.
are you interested in 32 bit code which could run in DOS environment ?
I hope it works as desired :)
hex2bin:0123 74 12 jz +12 ;**0135**no -- it's jz 137
0100 95 swap ax,bp
0101*BA 47 01 dx=0147
0104 B4 3F ah=3F
0106 B5 D2 ch=D2
0108 CD 21 int21
010a 91 swap ax,cx
010b E3 03 jcxz+3 ;ret
010d 89 D6 si=dx
010f BF di=d4c3
*C3 ret
D4 dummy
0112 57 push di ;d4c3
0113*89 E8 ax=bp
0115 88 C4 ah=al ;initial AL ; 1st byte- (hinybble)
0117 AC lodsb
0118 3C 30 cmp al,30
011a 72 1C jc +1c ;0138 ; invalid, ignore
011c 3D 78 30 cmp ax,"0x" ; reset bp if prefix
011f 74 14 jz +14 ;0135
0121 09 ED or bp.bp ; if no saved chr, go save it
0125*88 C2 dl=al ; save (hi) nybble012c 30 F7 xor bh,dh ; toggle to redo for 2nd byte
0127 95 swap ax,bp
0128 24 4F and al,4f
012a D4 37 DIVMOD 37
012e 75 F5 jnz -0a ;01250135*31 C0 ax-0
0130 88 D4 ah=dl
0132 D5 10 MULADD 010 ; combine nybbles
0134 AA stosb ; store
0137 95 swap ax,bp
0138 E2 D9 loop 0113
013a 43 inc bx
013b 5A pop dx
013c 89 F9 cx=di
013e 29 D1 sub cx,dx
0140 84 40 ah=040
0142 CD 21 int 21
0144 4B dec bx
0145 EB BA jmp 0101
you attempts seems to be shortest available.
But my routines are much smaller and use lesser image byte count,
but of course they wont work under DOS and use 32 bit features :)
And MY hex format use the old DEBUG standard: (no 0x no h)
On Sat, 15 Jun 2024 10:23:32 +0200
wolfgang kern <nowhere@never.at> wrote:
you attempts seems to be shortest available.
But my routines are much smaller and use lesser image byte count,
but of course they wont work under DOS and use 32 bit features :)
And MY hex format use the old DEBUG standard: (no 0x no h)
Yeah, sorry, I already have those pared down. I was allowing the
'0xAB,0xCD' format.
I was out walking to a waterfall on Friday and thought how to save 1
more byte:
hexdump, I mean bin2hex:
0xB4,0x3F,0xB5,0x26,0xBA,0x00,0x0F,0xCD,0x21,0x91,0xE3,0x03,0x89,0xD6,0xBF,0xC3
0x36,0x57,0xB8,0x30,0x78,0xAB,0xAC,0x42,0xD4,0x10,0x86,0xE0,0x27,0x04,0xF0,0x14
0x40,0xAA,0x31,0xF3,0x75,0xF4,0xB0,0x2C,0xAA,0x20,0xF2,0x75,0x05,0x4F,0xB8,0x0D
0x0A,0xAB,0xE2,0xDE,0x4F,0x5A,0x43,0x89,0xF9,0x29,0xD1,0xB4,0x40,0xCD,0x21,0x4B
0xEB,0xBE
On 16/06/2024 22:32, Kerr-Mudd, John wrote:
On Sat, 15 Jun 2024 10:23:32 +0200
wolfgang kern <nowhere@never.at> wrote:
you attempts seems to be shortest available.
But my routines are much smaller and use lesser image byte count,
but of course they wont work under DOS and use 32 bit features :)
And MY hex format use the old DEBUG standard: (no 0x no h)
Yeah, sorry, I already have those pared down. I was allowing the '0xAB,0xCD' format.
I was out walking to a waterfall on Friday and thought how to save 1
more byte:
hexdump, I mean bin2hex:
0xB4,0x3F,0xB5,0x26,0xBA,0x00,0x0F,0xCD,0x21,0x91,0xE3,0x03,0x89,0xD6,0xBF,0xC3
0x36,0x57,0xB8,0x30,0x78,0xAB,0xAC,0x42,0xD4,0x10,0x86,0xE0,0x27,0x04,0xF0,0x14
0x40,0xAA,0x31,0xF3,0x75,0xF4,0xB0,0x2C,0xAA,0x20,0xF2,0x75,0x05,0x4F,0xB8,0x0D
0x0A,0xAB,0xE2,0xDE,0x4F,0x5A,0x43,0x89,0xF9,0x29,0xD1,0xB4,0x40,0xCD,0x21,0x4B
0xEB,0xBE
can't detect on a first glimpse with my single 30% eye where you saved it :)
I was out walking to a waterfall on Friday and thought how to save 1
more byte:
hexdump, I mean bin2hex:
0xB4,0x3F,0xB5,0x26,0xBA,0x00,0x0F,0xCD,0x21,0x91,0xE3,0x03,0x89,0xD6,0xBF,0xC3
0x36,0x57,0xB8,0x30,0x78,0xAB,0xAC,0x42,0xD4,0x10,0x86,0xE0,0x27,0x04,0xF0,0x14
0x40,0xAA,0x31,0xF3,0x75,0xF4,0xB0,0x2C,0xAA,0x20,0xF2,0x75,0x05,0x4F,0xB8,0x0D
0x0A,0xAB,0xE2,0xDE,0x4F,0x5A,0x43,0x89,0xF9,0x29,0xD1,0xB4,0x40,0xCD,0x21,0x4B
0xEB,0xBE
can't detect on a first glimpse with my single 30% eye where you saved it :)
I use 'xor bx,si', to toggle, so ensuring bx is 0 after 2nd toggle - this allows 'inc bx' to set bl to 1 using a 1 byte instruction, rather than
'mov bl,1'; for int 0x21 to write to StdOut.
On Sat, 15 Jun 2024 09:14:10 +0200
wolfgang kern <nowhere@never.at> wrote:
I hope it works as desired :)
Well, I had tested it! And, JJ, I did state that it assumed ax=0 at start.
hex2bin:
0100 95 swap ax,bp ; 0 flag
0101*BA 47 01 dx=0147
0104 B4 3F ah=3F
0106 B5 D2 ch=D2
0108 CD 21 int21 ; Read (assumes bx=0 for Input)
010a 91 swap ax,cx ; put lth read in cx
010b E3 03 jcxz+3 ;ret ; nothing left
010d 89 D6 si=dx ; IBuff
010f BF di=d4c3 ; OBuff
*C3 ret
D4 dummy
0112 57 push di ;d4c3
0113*89 E8 ax=bp ; get 1st byte0123 74 12 jz +12 ;0137
0115 88 C4 ah=al ; ah=1st byte- (hinybble) - for 0x test
0117 AC lodsb
0118 3C 30 cmp al,30
011a 72 1C jc +1c ;0138 ; invalid, ignore
011c 3D 78 30 cmp ax,"0x" ; reset bp if prefix
011f 74 14 jz +14 ;0135
0121 09 ED or bp.bp ; if no saved chr, go save it
0125*88 C2 dl=al ; save (hi) nybble012c 30 F7 xor bh,dh ; toggle to redo for 2nd byte
0127 95 swap ax,bp
0128 24 4F and al,4f ; hex2nyb
012a D4 37 DIVMOD 37 ; in 4 bytes!
012e 75 F5 jnz -0a ;01250135*31 C0 ax-0 ; clear stored byte flag
0130 88 D4 ah=dl ; get hinyb, al is lonyb
0132 D5 10 MULADD 010 ; combine nybbles
0134 AA stosb ; add byte to output
0137 95 swap ax,bp ; store hinyb char
0138 E2 D9 loop 0113
013a 43 inc bx ; Output
013b 5A pop dx ; pt to OBuff
013c 89 F9 cx=di
013e 29 D1 sub cx,dx ; calc lth
0140 84 40 ah=040
0142 CD 21 int 21 ; Write
0144 4B dec bx
0145 EB BA jmp 0101
--
Bah, and indeed Humbug.
On Sun, 16 Jun 2024 21:20:04 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Sat, 15 Jun 2024 09:14:10 +0200
wolfgang kern <nowhere@never.at> wrote:
I hope it works as desired :)
Well, I had tested it! And, JJ, I did state that it assumed ax=0 at start. >>
hex2bin:0123 74 12 jz +12 ;0137
0100 95Â Â Â Â Â Â swap ax,bp ; 0 flag
0101*BA 47 01 dx=0147
0104 B4 3FÂ Â Â ah=3F
0106 B5 D2Â Â Â ch=D2
0108 CD 21Â Â Â int21 ; Read (assumes bx=0 for Input)
010a 91Â Â Â Â Â Â swap ax,cx ; put lth read in cx
010b E3 03Â Â Â jcxz+3Â Â ;ret ; nothing left
010d 89 D6Â Â Â si=dx ; IBuff
010f BFÂ Â Â Â Â Â di=d4c3 ; OBuff
*C3Â Â Â Â Â Â ret
D4 dummy
0112 57 push di ;d4c3
0113*89 E8 ax=bp ; get 1st byte
0115 88 C4 ah=al ; ah=1st byte- (hinybble) - for 0x test
0117 AC lodsb
0118 3C 30 cmp al,30
011a 72 1C jc +1c ;0138 ; invalid, ignore
011c 3D 78 30 cmp ax,"0x" ; reset bp if prefix
011f 74 14 jz +14 ;0135
0121 09 ED or bp.bp ; if no saved chr, go save it
0125*88 C2 dl=al ; save (hi) nybble012c 30 F7 xor bh,dh ; toggle to redo for 2nd byte
0127 95 swap ax,bp
0128 24 4F and al,4f ; hex2nyb
012a D4 37 DIVMOD 37 ; in 4 bytes!
012e 75 F5 jnz -0a ;01250135*31 C0 ax-0 ; clear stored byte flag
0130 88 D4 ah=dl ; get hinyb, al is lonyb
0132 D5 10 MULADD 010 ; combine nybbles
0134 AA stosb ; add byte to output
0137 95 swap ax,bp ; store hinyb char
0138 E2 D9 loop 0113
013a 43 inc bx ; Output
013b 5A pop dx ; pt to OBuff
013c 89 F9 cx=di
013e 29 D1 sub cx,dx ; calc lth
0140 84 40 ah=040
0142 CD 21 int 21 ; Write
0144 4B dec bx
0145 EB BA jmp 0101
I'm disappointed no-ones asked what all the 'bp' juggling's for.
(It's to save the first byte encountered to survive a subsequent read, to allow for the case where a hex pair are split by the read amt.)
On 18/06/2024 23:38, Kerr-Mudd, John wrote:
On Sun, 16 Jun 2024 21:20:04 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Sat, 15 Jun 2024 09:14:10 +0200
wolfgang kern <nowhere@never.at> wrote:
I hope it works as desired :)
Well, I had tested it! And, JJ, I did state that it assumed ax=0 at start. >>
hex2bin:0123 74 12 jz +12 ;0137
0100 95 swap ax,bp ; 0 flag
0101*BA 47 01 dx=0147
0104 B4 3F ah=3F
0106 B5 D2 ch=D2
0108 CD 21 int21 ; Read (assumes bx=0 for Input)
010a 91 swap ax,cx ; put lth read in cx
010b E3 03 jcxz+3 ;ret ; nothing left
010d 89 D6 si=dx ; IBuff
010f BF di=d4c3 ; OBuff
*C3 ret
D4 dummy
0112 57 push di ;d4c3
0113*89 E8 ax=bp ; get 1st byte
0115 88 C4 ah=al ; ah=1st byte- (hinybble) - for 0x test >>> 0117 AC lodsb
0118 3C 30 cmp al,30
011a 72 1C jc +1c ;0138 ; invalid, ignore
011c 3D 78 30 cmp ax,"0x" ; reset bp if prefix
011f 74 14 jz +14 ;0135
0121 09 ED or bp.bp ; if no saved chr, go save it
0125*88 C2 dl=al ; save (hi) nybble012c 30 F7 xor bh,dh ; toggle to redo for 2nd (lo) byte
0127 95 swap ax,bp ; get other chr (hi 1st, then lo)
0128 24 4F and al,4f ; hex2nyb
012a D4 37 DIVMOD 37 ; in 4 bytes!
012e 75 F5 jnz -0a ;01250135*31 C0 ax-0 ; clear stored byte flag
0130 88 D4 ah=dl ; get hinyb, al is lonyb
0132 D5 10 MULADD 010 ; combine nybbles
0134 AA stosb ; add byte to output
0137 95 swap ax,bp ; store hinyb char
0138 E2 D9 loop 0113
013a 43 inc bx ; Output
013b 5A pop dx ; pt to OBuff
013c 89 F9 cx=di
013e 29 D1 sub cx,dx ; calc lth
0140 84 40 ah=040
0142 CD 21 int 21 ; Write
0144 4B dec bx
0145 EB BA jmp 0101
I'm disappointed no-ones asked what all the 'bp' juggling's for.
(It's to save the first byte encountered to survive a subsequent read, to allow for the case where a hex pair are split by the read amt.)
I didn't ask because I saw it in use for initial AL and later as a temp storage.
but I weren't sure where your loop count joined in, assumed it returned
by DOS call.
On 17/06/2024 21:57, Kerr-Mudd, John wrote:
...
I was out walking to a waterfall on Friday and thought how to save 1
more byte:
hexdump, I mean bin2hex:
0xB4,0x3F,0xB5,0x26,0xBA,0x00,0x0F,0xCD,0x21,0x91,0xE3,0x03,0x89,0xD6,0xBF,0xC3
0x36,0x57,0xB8,0x30,0x78,0xAB,0xAC,0x42,0xD4,0x10,0x86,0xE0,0x27,0x04,0xF0,0x14
0x40,0xAA,0x31,0xF3,0x75,0xF4,0xB0,0x2C,0xAA,0x20,0xF2,0x75,0x05,0x4F,0xB8,0x0D
0x0A,0xAB,0xE2,0xDE,0x4F,0x5A,0x43,0x89,0xF9,0x29,0xD1,0xB4,0x40,0xCD,0x21,0x4B
0xEB,0xBE
can't detect on a first glimpse with my single 30% eye where you saved
it :)
I use 'xor bx,si', to toggle, so ensuring bx is 0 after 2nd toggle -
this
allows 'inc bx' to set bl to 1 using a 1 byte instruction, rather than
'mov bl,1'; for int 0x21 to write to StdOut.
clever move :) is that magic waterfall near Stonehenge ?
clever move :) is that magic waterfall near Stonehenge ?No magic.
Have you looked at pouet.net (clever DemoScene coders; there's a
recent^w Feb entry for a (display of course) that uses a VM (forth
like); it's something that hits my buttons.
https://www.pouet.net/prod.php?which=96107
I don't understand it yet; but the concept looks intriguing; use a
select - I'm thinking 4 bit for 16, they use 3, so only 8 instructions;
set of Virtual OP codes to erm do something.
On 01/07/2024 12:37, Kerr-Mudd, John wrote:
https://www.pouet.net/prod.php?which=96107
lovebyte solution is interesting indeed.
On 01.07.2024 17:40, wolfgang kern wrote:
On 01/07/2024 12:37, Kerr-Mudd, John wrote:
https://www.pouet.net/prod.php?which=96107
lovebyte solution is interesting indeed.
30 years ago a tiny program called mars.exe was posted in
usenet which I found so fascinating that I disassembled it,
added some colors and did some optimization. I can't run
DOS programs any more, but the Windows version (not as small
as the DOS version) still works in Win10. Execute the batch
below to generate the exe and just move the mouse. Press any
key to exit.
DOS and Windows source in:
https://www.onlib.de/pub/assembler/erde.zip
@echo off
certutil -f -decode %~f0 erde.exe>nul
erde.exe
goto :eof
-----BEGIN CERTIFICATE----- TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgaGlzIHByb2dyYW0gcmVx dWlyZXMgV2luMzIuDQokAFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwADAAA AAAAAAAAAABUEwAAABAAAAAwAwAAAEAAABAAAAACAAAEAAAAAAAAAAQAAAAAAAAA ADADAAACAAAAAAAAAgAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA dBAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAB0AAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAAAYGAMAABAAAAAMAAAAAgAA AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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KoAAPclrB9DAMHoEIstqB9DACnFiS24J0MAweYG iTWwH0MAg/8QdRTHBagfQwDIAAAAxwWsH0MAAAAAAIsNeBtAAMHhDMHmBynxix18 G0AAZgH7ZsHjBDH2Aw2wH0MAicjB6BCIw/7DD7aDqB9BAP7LD7aTqB9BACnQD7fp D6/FwfgIhtYB0P80tbQjQwCJBLW0I0MA/sMPtoOoH0AA/ssPtpOoH0AAKdAPt+kP r8XB+AiG1gHQ9y2sH0MAwegQixWoH0MAKcKLLLW0H0MAiRS1tB9DAFiB/cgAAAAP jYEAAAA7LLW0H0MAD410AAAAUFUrBLW0I0MAmSsstbQfQwD3/V1aUVNFOyy1tB9D AH9RAcIJ7Xjwgf3HAAAAf0NmgcoAwDstuCdDAH4SZoHi/787LbQnQwB+BWaB8gDA ieuG3wHzjRxbAx2cG0AAD7bOiwyNqBtAAGaJC8HpCIhrAuulW1lGgf4AAQAAD4Lp /v//g+8QD4U8/v//aCAAzABqAGoA/zWUG0AAaMgAAABoAAEAAKGIG0AALcgAAADR 6FChhBtAAC0AAQAA0ehQ/zWQG0AA/xVoEEAAwxAAAABgICAABAQEACAAAADgoKAA AQICABAAAAD/4OAA/v39AEAAAAAAQAAAAQIBAEAAAAAAAEAAAQICAEAAAACAgIAA AgICAAAAAAABAAAAAwAAAAABAAAAAwAAAP///wD9///+//////8AAOgDAADoAwAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
-----END CERTIFICATE-----
Herbert Kleebauer <klee@unibwm.de> writes:
30 years ago a tiny program called mars.exe was posted in
usenet which I found so fascinating that I disassembled it,
added some colors and did some optimization.
Who didn't!? Those were the fun days.
Does anyone know who wrote it - and does he know that we're still
talking about him and his demo?
Herbert Kleebauer <klee@unibwm.de> writes:
30 years ago a tiny program called mars.exe was posted in
usenet which I found so fascinating that I disassembled it,
added some colors and did some optimization.
Who didn't!? Those were the fun days.
Does anyone know who wrote it - and does he know that we're still
talking about him and his demo?
30 years ago a tiny program called mars.exe was posted in
usenet which I found so fascinating that I disassembled it,
added some colors and did some optimization.
On Tue, 18 Jun 2024 03:58:55 +0100, wolfgang kern <nowhere@never.at> wrote:[]
On 17/06/2024 21:57, Kerr-Mudd, John wrote:
...
hexdump, I mean bin2hex:
On Mon, 01 Jul 2024 11:37:50 +0100Argh! Last character on line is dropped!
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Tue, 18 Jun 2024 03:58:55 +0100, wolfgang kern <nowhere@never.at> wrote:
[]On 17/06/2024 21:57, Kerr-Mudd, John wrote:
...
hexdump, I mean bin2hex:
[]
hex 223 bytes;
now can produce 5 spaced formats for dump, also does hex2bin, and
contains (a minimal) usage help text.
C:\TEMP>hex -d 0 <hex.com A083003C68747831EDB43FB53CBADF01CD2191E30389D6BFC33F57A083003C6
On Sun, 8 Sep 2024 21:41:09 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Mon, 01 Jul 2024 11:37:50 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Tue, 18 Jun 2024 03:58:55 +0100, wolfgang kern <nowhere@never.at> wrote:
[]On 17/06/2024 21:57, Kerr-Mudd, John wrote:
...
hexdump, I mean bin2hex:
[]
hex 223 bytes;
now can produce 5 spaced formats for dump, also does hex2bin, and
contains (a minimal) usage help text.
C:\TEMP>hex -d 0 <hex.com A083003C68747831EDB43FB53CBADF01CD2191E30389D6BFC33F57A083003C6Argh! Last character on line is dropped!
More Work Needed.
On Mon, 9 Sep 2024 09:32:20 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Sun, 8 Sep 2024 21:41:09 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Mon, 01 Jul 2024 11:37:50 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Tue, 18 Jun 2024 03:58:55 +0100, wolfgang kern <nowhere@never.at> wrote:
[]On 17/06/2024 21:57, Kerr-Mudd, John wrote:
...
hexdump, I mean bin2hex:
[]
hex 223 bytes;
now can produce 5 spaced formats for dump, also does hex2bin, and contains (a minimal) usage help text.
C:\TEMP>hex -d 0 <hex.com A083003C68747831EDB43FB53CBADF01CD2191E30389D6BFC33F57A083003C6Argh! Last character on line is dropped!
More Work Needed.
Had to trim the text at the end to add code to not delete last char on
line (ususally a trailing blank) if parm was 0
d 100 lDE16B1: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 83 E0 0F-48 88 C6 75-02 B2 EF AC u>......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 88-01 CD 21 C3-55 73 61 67-65 20 69 73 ......!.Usage is 16B1:0190 3A 0D 0A 68-65 78 20 2D-64 20 5B 73-70 5D 3C 66 :..hex -d [sp]<f 16B1:01A0 6E 2E 63 6F-6D 0D 0A 20-73 70 3D 7B-30 2C 31 2C n.com.. sp={0,1, 16B1:01B0 32 2C 34 2C-38 7D 0D 0A-6F 72 0D 0A-68 65 78 20 2,4,8}..or..hex 16B1:01C0 2D 72 3C 66-6E 2E 68 65-78 3E 66 6E-2E 63 6F 6D -r<fn.hex>fn.com 16B1:01D0 0D 0A-24 47 50 4C-20 4D 4A 20-32 30 32 34 ..$GPL MJ 2024
q
On Tue, 10 Sep 2024 20:19:29 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Mon, 9 Sep 2024 09:32:20 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Sun, 8 Sep 2024 21:41:09 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Mon, 01 Jul 2024 11:37:50 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:
On Tue, 18 Jun 2024 03:58:55 +0100, wolfgang kern <nowhere@never.at> wrote:
[]On 17/06/2024 21:57, Kerr-Mudd, John wrote:
...
hexdump, I mean bin2hex:
[]
hex 223 bytes;
now can produce 5 spaced formats for dump, also does hex2bin, and contains (a minimal) usage help text.
d 100 lE016B1: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
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 lE016B1: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
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 lE016B1: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
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
AL=[0085] SUB AX,3C30 DEC AX DH=AL JNZ 012D+2 aka 012F (skip next)
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 ...
to be continuedThanks
On Fri, 13 Sep 2024 16:58:17 +0200
wolfgang kern <nowhere@never.at> wrote:
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)
d 100 lE016B1:0100 A0 83 00 3C-68 74 77 31-ED B4 3F B5-3C BA DF 01 ...<htw1..?.<... 16B1:0110 CD 21 91 E3-03 89 D6 BF-C3 3F 57 A0-83 00 3C 64 .!.......?W...<d 16B1:0120 75 3C 8A 36-85 00 80 EE-31 75 02 B2-EF AC 43 D4 u<.6....1u....C. 16B1:0130 10 86 E0 27-04 F0 14 40-AA 30 CF 75-F4 20 D3 75 ...'...@.0.u. .u 16B1:0140 06 B8 0D 0A-AB EB 07 84-F3 75 03 B0-20 AA E2 DD .........u.. ... 16B1:0150 5A B3 01 89-F9 29 D1 B4-40 CD 21 4B-EB AB AC 3C Z....)..@.!K...< 16B1:0160 30 72 17 09-ED 74 12 88-C6 95 24 4F-D4 37 30 CF 0r...t....$O.70. 16B1:0170 75 F5 88 F4-D5 10 AA 31-C0 95 E2 E2-EB D2 B4 09 u......1........ 16B1:0180 BA 89 01 CD-21 C3 0D 0A-0A 55 73 61-67 65 20 69 ....!....Usage i 16B1:0190 73 3A 0D 0A-68 65 78 20-2D 64 20 5B-73 70 5D 3C s:..hex -d [sp]< 16B1:01A0 66 6E 2E 63-6F 6D 0D 0A-20 73 70 3D-7B 30 2C 31 fn.com.. sp={0,1 16B1:01B0 2C 32 2C 34-2C 38 2C 40-7D 0D 0A 6F-72 0D 0A 68 ,2,4,8,@}..or..h 16B1:01C0 65 78 20 2D-72 3C 66 6E-2E 68 65 78-3E 66 6E 2E ex -r<fn.hex>fn. 16B1:01D0 63 6F 6D 0D-0A 24 47 50-4C 20 4D 4A-32 30 32 34 com..$GPL MJ2024
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 415 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:25:03 |
Calls: | 8,716 |
Calls today: | 5 |
Files: | 13,273 |
Messages: | 5,954,432 |