i'm doing this code but it only print one letter and it's letter A together with the binary value of letter A, i hope you could help me correct my code,,really need this,please help me... thanks... hoping for immediate reply... i'm using TASM x8086...
.model small
.stack 100h
    nextLine db 10, 13, '$ '

mov ax, @data
mov ds, ax
mov es, ax

mov al, 'A'
mov ch, 1

cmp ch, 27
je ulit2
mov ah, 2
mov dl, al
int 21h
inc al
inc ch

jmp ulit

XOR BX, BX                   ; clear BX
MOV BL, AL                   ; move AL to BL

XOR BH, BH                   ; clear BH
MOV CX, 8                    ; initialize loop counter
MOV AH, 2                    ; set output function

@OUTPUT:                     ; jump label
SHL BL, 1                  ; shift left BX by 1 bit
JNC @ZERO                  ; jump to label @ZERO if CF=0
INC BH                     ; increment BH
MOV DL, 31H                ; set DL=1
JMP @DISPLAY           ; jump to label @DISPLAY

@ZERO:                     ; jump label
MOV DL, 30H              ; set DL=0

@DISPLAY:                  ; jump label
INT 21H                  ; display digit
LOOP @OUTPUT                ; jump to label @OUTPUT

OR BH, 30H                   ; convert the decimal to ascii code

MOV AH, 2                    ; print the contents of BH

mov ah, 4ch
int 21h

Last edited by shabbir; 29Mar2010 at 09:07.. Reason: Code blocks