Jump to content

Help Please "PANGRAM"

- - - - -

  • Please log in to reply
1 reply to this topic

#1
se7en

se7en

    Learning Programmer

  • Members
  • PipPipPip
  • 30 posts
hey guys I need a program that will check for a pangram, I have the following so far, but it is not working can you guys please help me, it is very urgent?
hex $
code segment 
    mov ax, data
    mov ds, ax
    mov es, ax
    mov dx, offset text1
    mov ah, $0A
    int $21
    mov al, 'A'
    mov si, 'A'
    mov bx, offset text3
tryagain:
    mov cx, size text1
    mov cx, [bp]
    mov di, offset text1 + 2
    REPNZ scasb
    jnz Nextapha
    inc si
    inc al
    cmp si, 90
    jg tryagain
    jmp exit
Nextapha:
    mov [bx], si
    inc bx
    inc al
    inc si
    cmp si, 90
    jg tryagain
exit:
    mov dx, offset NEWLINE
    mov ah, $09
    int $21
    mov dx, offset text3
    mov ah, $09
    int $21
    mov ax, $4c00
    int $21
code ends
data segment
    text1 db 100 dup('$')
    text3 db 26 dup('$')
    NEWLINE DB 10,13,'$'
data ends

I want my program to print out those which are not int the inputted text

#2
se7en

se7en

    Learning Programmer

  • Members
  • PipPipPip
  • 30 posts
I fixed it

hex $
code segment 
    mov ax, data
    mov ds, ax
    mov es, ax
    lea dx, msgprom
    mov ah, $09
    int $21
    lea dx, NEWLINE
    mov ah, $09
    int $21
    mov dx, offset text1
    mov ah, $0A
    int $21
    mov al, 'A'
    mov si, 'A'
    mov bx, offset text3
tryagain:
    mov cx, size text1
    mov di, offset text1 + 2
    REPNZ scasb
    jnz Nextapha
    inc si
    inc al
    cmp si, 91
    jne tryagain
    jmp exit
Nextapha:
    mov [bx], si
    mov flg, 1
    inc bx
    inc al
    inc si
    cmp si, 91
    jne tryagain
    
exit:
    cmp flg, 1
    jl pang
    lea dx, NEWLINE
    mov ah, $09
    int $21
    lea dx, npangram
    mov ah, $09
    int $21
    lea dx, NEWLINE
    mov ah, $09
    int $21
    mov dx, offset text3
    mov ah, $09
    int $21
    jmp npang
pang:
    lea dx, NEWLINE
    mov ah, $09
    int $21
    lea dx, pangram
    mov ah, $09
    int $21
npang:
    mov ax, $4c00
    int $21
code ends
data segment
    msgprom db 'Please Enter The Text$'
    pangram db 'It is a PANGRAM$'
    npangram db 'It is not a PANGRAM$' 
    text1 db 200 dup('$')
    text3 db 26 dup('$')
    NEWLINE DB 10,13,'$'
    flg db 0
data ends





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users