Re: All is right !




I posted a bug with this:

_____________________
mov esi,0082h ; I see, you assume a space before the parameters
;cmp byte [esi-2],0 ; a few buyes more, but perhaps useful
;jz error ;if commandline is empty
lodsw ;get both bytes at once
call convert ;modify AL set carry/NC on error/GOOD
jc error
shl al,4
exch al,ah ;save first and use second yet
call convert ;call the same again
jc error
or al,ah
mov offset hexa,AL
jmp short display_quit

convert:
; cmp al,30h ;I'd put this in
; jc oh_no ;jc == jb
cmp al,3ah
jc num
cmp al,41h
jc oh_no
***
cmp al,46h *** make this CMP AL,47h (error if >=)
because 46h shall not be an error.
***
cmc ;invert the carry-bit (error if NoCarry >46h)
jc oh_no
sub al,07h
num:
sub al,30h
oh_no:
ret ;the last SUB will always result in NoCarry
;while any error got a set Carry-flag now.
error:
; mov dx,errtxt
; jmp short error_quit
display_quit:
mov dx,txt
error_quit:
mov AH,09
int 21h
ret ;it will work, even I'd always use:
; mov ax,4c00h ;because DOS will restore its stack and
; int21h ;segment-registers on termination then.
txt:
hexa:
errtxt: ...
______________________________

__
wolfgang



.



Relevant Pages

  • Re: All is right !
    ... call convert;modify AL set carry/NC on error/GOOD ... mov dx, ... cmp al,3ah ... sub al,07h ...
    (alt.lang.asm)
  • Re: All is right !
    ... cmp al,41h; ... i just use 1 byte sure "mov bl,al" do the same. ... so it just need One Sub al, ... mov ah,al;save high nibble value in AH ie:yet ...
    (alt.lang.asm)
  • Re: All is right !
    ... But i did not found any instruction called Wolfgang :-) ... mov dx, ... cmp al,3ah ... sub al,07h ...
    (alt.lang.asm)
  • Re: nulls
    ... sub al, 'W' ... cmp al, 'Z'-'W' ... jbe @found1 ... mov bl, ...
    (borland.public.delphi.language.basm)
  • Re: All is right !
    ... call convert;modify AL set carry/NC on error/GOOD ... mov dx, ... cmp al,3ah ... sub al,07h ...
    (alt.lang.asm)