Hi. This piece of code is suppose to scroll the whole screen 3 lines up. The clearScreen procedure is never called, yet, if I leave it in the code, the program clears the screen. If I comment it out, the program scrolls the screen 3 lines up just like it should. Does anyone know whats going on? I'm using nasm on DOS 6.22 and Windows XP command prompt. The results are the same. My command to assemble is "nasm test2.asm -f bin -o test2.com". Thank you for any help.
Mike

[BITS 16]
[ORG 0x0100]

[SECTION .text]

Start:
    mov al, 3
    call scrollXLines
    mov ax, 4c00h
    int 21
    
;clearScreen:
;    mov CX, 0
;    mov DX, 7924
;    mov al, 0
;    mov bh, 7h
;    mov ah, 6h
;    int 10h
;    ret
    
scrollXLines:        ; Requires al to be set to number of lines to scroll.
    mov CX, 0
    mov DX, 7924
    mov al, 3
    mov bh, 7h
    mov ah, 6h
    int 10h
    ret

You propbably want to use int 21H in line 10. What you are actually doing is calling interrupt 15H (21) instead of 21H. I can't verify that AX = 4C00 is correct because my book is for DOS 2.1

You propbably want to use int 21H What you are actually doing is calling interrupt 15H (21) instead of 21H. in line 10.

Good catch. I missed that too. :)

I can't verify that AX = 4C00 is correct because my book is for DOS 2.1

You could however look it up here

Youngstorm: delete line 24 because it overrides the value you set in line 7.

Good catch. I missed that too. :)

Tell me about it. I don't know how many sleepless nights I've had over just this kind of error. I try to use a method of only using one radix, so in assembly I'll always use hex and C++ decimal.

Thanks for the link, but anything I do now that doesn't require XP I go to straight binary and use BIOS calls.

Thank you. That did it. it works as expected.
Now for my next question. :)
See my next thread.

This article has been dead for over six months. Start a new discussion instead.