@einstein1969.
Coming soon i will upload new feature to bhx.
Using com files is still valid in 32 bit systems. And com files with only printable characters also valid.
I write a 16 bit utility call wrichr.com for create the .chr files:
Note: this will not work on 64 bits system, only 32 bits.
Edit: wrichr.asm revisited: reduced bytes from 55,201 (original, encoded) to 53,199 (new original, new encoded).
Code: Select all
@Echo Off
Del wrichr.com
(
Echo hD1X-s0P_kUHP0UxGWX4ax1y1ieimnfeinklddmemkjanmndnadmndnpbbn
Echo hhpbbnpljhoxolnhaigidpllnbkdnhlkfhlflefblffahfUebdfahhfkokh
Echo v17/@yEh9/@/20My/E652hs4/eDAwl/UubnT6/cukMTt//hz8jys79Ah5/c
Echo yzLb/o9EnVAQn.
) > wrichr.com
Cmd /A /c "For /l %%# in (0,1,255) do wrichr.com %%#>%%#.chr"
The original .com program have 53 bytes, but encoded (using latest convert.bat from Herbert Kleebauer) for have only printable characters the size is 199 bytes.
This is the source for fasm:
wrichr.asm
Code: Select all
;wrichr.asm
;print to screen one byte
;arguments: <int>0-255
;author: Carlos Montiers
;date: 15-feb-2014
org 100h
;set in cl the length of command line
mov bx,80h
mov cx,[bx]
;assign 10 to byte source for multiplication
mov ch,10
;set char to 0
mov al,0
;set bx to 81 for next inc left bx = 82h
;pointing to first character of command line
inc bx
get_char:
;if none char available go to print
cmp cl, 0
je print
;get letter
inc bx
mov dx, [bx]
;if is not digit continue like c keyword
cmp dl, '0'
jl continue
cmp dl, '9'
jg continue
;convert char to digit
sub dl, '0'
;multiply by 10
mul ch
;sum digit
add al, dl
continue:
dec cl
jmp get_char
print:
mov dl,al
;direct console output
mov ah, 06h
cmp dl,255
jne commit
;if character is 255 use other interrupt
;write character to standard output
mov ah, 02h
commit:
int 21h
ret