Re: All is right !




Hello almas,

Note : if i have to replace [Ctrl - C] ascii 003 ; some programs refuse
it.
Same for ascii [ ALT 10 ] or alt 6

Yes, a few codes are covered by the DOS-prompt itself, so an ALT-10
will just do what it says: "LF" and ALT 7 may just beep once.

Sure i can do a XOR 20h on each bytes of a file ; byte 0 become 20h
and i can move the Space...
then i do again XOR 20h.... and not modified bytes have again same value.

wouldn't it be enough to filter off all non-numeric/hex characters ?
ie: make a question-mark or whatsoever out of it

The idea is to type with numbers and letters
Example i type "50", the program write " P "
If i type "A8" the programm write " ¿ "

Yes, even I'd treat non-printatble chararcters in a special way, some
may be interpreted as CRSR-position, KEY-buffer- or screen-commands
depending on the options of the print-function. I think you use the
'display all' option for INT21h anyway yet.

I can type 00 ; 01 ;02 ... 0E,0F 10,11,12.....and so long...FE FF
I just obtain One byte 0 to 0FFh

The byte falls at the location hexa... i catch it.
The next operation : find the byte a hexa_address and remove it.

With this part of programm i can choose the byte i will remove.
Before it, i had to build 256 tools... for each bytes.

I am sorry, but do not understand you want to do.

after
cmp al,41h jb error
cmp al,46h jb error *** "ja" error
sub al,7 ; i can obtain 3Ah to 40h ( do" :" to " @ ") why ?

It will result in 3A..3F !! followed by the sub 30h => "0A...0F"

I meant the two lines above within my comments :)
lodsb
cmp al,30h
jb not_a_Number ;
cmp al,3Ah
jb chiffre_d ; d for ten : ( forty, *fivety*, 60 and so long)
cmp al,41h ; is it an Hexa letter ?
jb error
cmp al,46h
ja error
;*** > sub al,37h ; "A" > 0Ah "F" become 0Fh
;*** > jmp short high_size
;*** I'd replace the two lines above with sub al,07
;*** a JMP costs more than one *SUB* and the code become shorter too
sub al,07 ;will be executed ONLY IF AL = 41..46h (become 3A..
chiffre_d: ;else it goes here AL = 30..39h
sub al,30h ; "0" > 00h "9" become 09h
shl al,4 ;move it four bits = MUL by 16
mov ah,al ;save high nibble value in AH ie:yet (without using bx)
;AH= x0h (x = 0..F)
lodsb ... ;code for the LOW-nibble goes here
;AL =0xh (x = 0..F)
or AL,AH ;combine the two (same as ADD AL,AH here)
;the final value is now in AL
;mov AH,0 ;not required at all
mov offset hex_string, AL
; if you use AX here the value of AH would go to
; offset "hex-string+1" (little endians in here ...)
; but isn't there a zero anyway ?


I do xor bx,bx so bx=0000
I have to save value of AX, so i put it into bx
then, i must have Ah=0 al =...? come from the lodsbyte

Why do you need AH=0 ? as a string-terminator for a single byte ?
I'd write just the gotten byte into the hexa-string, and
keep the anyway defined zero in there if you really need it.

Yes : the character "d" and "u" make *together* the byte "DU"
So, i do "letter d" becomes "d *16" d = 0 to F

Mmh, after multiply by 16 (= shift left 4):d = 00..F0

and i do d*16 + u U can also have value 0 to 0Fh

Yes, you can ADD 'or' OR this two, because both values are only
four bits in size and at the proper bit-position already.
your byte:
76543210 ;bit position
0000xxxx ;low nibble in AL
+yyyy0000 ;high nibble as saved in AH (or elsewhere)
--------
yyyyxxxx ;regardless of ADD or OR here.

Right : for the low size ; cx, is not usefull
... may be it could be or ah,bl

either
OR AL,.. ;any-byte-reg where you saved the high nibble
or
ADD AL,.. ;
MOV offset ... ,AL ;you got only one byte to alter the display :)

At the end, i just use one "$" for flag end of text.
the most important is text terminate by $

Yes, for int21h-text,
while int10h-text let you choose your own end mark/size.

__
wolfgang



.



Relevant Pages