1

I have a program that is supposed to clear the screen and print my name, then new line and print my name again. but when i run it nothing shows up. just program teminated normally. I'm doing this in windows command prompt using debug.

    call 010E
    call 0125
    call 012D
    call 0125
    int 20

    push ax     #clearscreen(010E)
    push bx
    push cx
    push dx
    xor al, al
    xor cx, cx
    mov dh, 18
    mov dl, 4f
    mov bh, 07
    mov ah, 06
    int 20
    pop dx
    pop cx
    pop bx
    pop ax
    ret

    mov dx, 0200    #printline(0125)
    mov ah, 09
    int 21
    ret

    push ax         #new line( 012D)
    push dx
    mov ah, 02
    mov dl, 0d
    int 21
    mov dl, 0a
    int 21,
    pop dx
    pop ax
    ret

    DB' Antarr$ #(0200)
3
  • 1) Why debug? 2) Why are you sure of exact lengths of routines? 3) What makes you think that your name will be at offset 0x200? 4) In clearscreen, is it int 20 or 21? 5) are you sure that CS and DS are equal? Commented Dec 1, 2010 at 16:43
  • I'm exact on the length because I typed it in by hand and then went back and modified the calls Commented Dec 1, 2010 at 16:55
  • I changed the the int 20 to 21 in the clear screen. this help to print my name with the newline but no clear screen Commented Dec 1, 2010 at 17:00

2 Answers 2

2

Your first and most obvious error is calling int 20, Terminate Program, instead of BIOS interrupt int 10 withing the clearscreen function.

EDIT: but why don't you use an assembler for this? Try NASM for example. Also, this program: Tech, will help you with finding the right DOS or BIOS function.

Sign up to request clarification or add additional context in comments.

2 Comments

I dont have access on this machine to install software
O didnt read I guess interrupt 10 worked somewhat. cleared the top of the screen
1

You are trying to call a hardware interrupt (int 20). Because of protected mode, you're not going to be able to enter mode 20. In other words, Windows is going to block you from talking to the hardware directly.

2 Comments

It is to run in the console, where you can run old 16 DOS code. Most calls to interrupts are emulated by Windows. int 20 means Exit program, int 21 is Call DOS.
I don't understand . I have no problem when running a short program like mov dx, 0200; mov ah, 09; int 21; int 20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.