# stupid question

int 10h
function ah=01h

ch bits 0-4 for start line of the cursor and
cl bits 0-4 for end line of the cursor

I take it this means how long the line cursor is or am I wrong?

• : int 10h
: function ah=01h
:
: ch bits 0-4 for start line of the cursor and
: cl bits 0-4 for end line of the cursor
:
: I take it this means how long the line cursor is or am I wrong?
:

[green]
In an 8x8 image (=cursor) you choose the start position & end position you want to show
CH = start position = 6 = start showing the image at the 7th line down, 0-6=7
CL = end position = 7 = end showing the image at the 8th line down, 0-7=8
So an 8x8 image has 8 rows of 8 pixels each, stacked on top of each other.
Each row is a pixel high & you choose which rows you want to show.
Start at 6 end at 7 = underscore
Start at 0 end at 1 = overscore (if there is such a thing)
(I got drunk once & all my condoms disappeared, so there might be such a thing?)

CX=0607h = standard blinking cursor line like underscore
CX=0020h = hidden cursor, or cursor off
You've seen block (square) cursors before I'm sure, thats CH=0 CL=7 ?
Experiment in a small .COM .asm in video mode 3 testing different input values in CH/CL.

I'm not real sure of the info above, confirm it from valid sources.
Bitdog
[/green]

• : : int 10h
: : function ah=01h
: :
: : ch bits 0-4 for start line of the cursor and
: : cl bits 0-4 for end line of the cursor
: :
: : I take it this means how long the line cursor is or am I wrong?
: :
:
: [green]
: In an 8x8 image (=cursor) you choose the start position & end position you want to show
: CH = start position = 6 = start showing the image at the 7th line down, 0-6=7
: CL = end position = 7 = end showing the image at the 8th line down, 0-7=8
: So an 8x8 image has 8 rows of 8 pixels each, stacked on top of each other.
: Each row is a pixel high & you choose which rows you want to show.
: Start at 6 end at 7 = underscore
: Start at 0 end at 1 = overscore (if there is such a thing)
: (I got drunk once & all my condoms disappeared, so there might be such a thing?)
:
: CX=0607h = standard blinking cursor line like underscore
: CX=0020h = hidden cursor, or cursor off

[red][b]Up here ^^^: strange, my DOS docs are saying that to hide cursor it is actually CX=2000h (as opposed to 0020h). I remember trying it and it worked, but I never tried CX=0020h - maybe it works too?..[/b][/red]

: You've seen block (square) cursors before I'm sure, thats CH=0 CL=7 ?
: Experiment in a small .COM .asm in video mode 3 testing different input values in CH/CL.
:
: I'm not real sure of the info above, confirm it from valid sources.
: Bitdog
: [/green]
:
:

• : : int 10h
: : function ah=01h
: :
: : ch bits 0-4 for start line of the cursor and
: : cl bits 0-4 for end line of the cursor
: :
: : I take it this means how long the line cursor is or am I wrong?
: :
:
: [green]
: In an 8x8 image (=cursor) you choose the start position & end position you want to show
: CH = start position = 6 = start showing the image at the 7th line down, 0-6=7
: CL = end position = 7 = end showing the image at the 8th line down, 0-7=8
: So an 8x8 image has 8 rows of 8 pixels each, stacked on top of each other.
: Each row is a pixel high & you choose which rows you want to show.
: Start at 6 end at 7 = underscore
: Start at 0 end at 1 = overscore (if there is such a thing)
: (I got drunk once & all my condoms disappeared, so there might be such a thing?)
:
: CX=0607h = standard blinking cursor line like underscore
: CX=0020h = hidden cursor, or cursor off
: You've seen block (square) cursors before I'm sure, thats CH=0 CL=7 ?
: Experiment in a small .COM .asm in video mode 3 testing different input values in CH/CL.
:
: I'm not real sure of the info above, confirm it from valid sources.
: Bitdog
: [/green]
:
:

I have tried modifying those bits to do that but it seems like it won't do anything to the cursor, to me that is. According to the interrupt list I have int 10h function 01h

ch= bits 0-4 start line of cursor cell
ch= bits 5-6 for blink attribute
cl= bits 0-4 end line of cursor cell

Maybe I'm overdosing on some dumb pills but here is a snippet of my code I'm using to test it.

[code]

;NASM-IDE ASM Assistant Assembler Project File
BITS 16 ;Set code generation to 16 bit mode
ORG 0x0100 ;Set code start address to 0100h

SEGMENT .text ;Main code segment

start:

mov ch, 00111111b
mov cl, 00001111b
int 10h
call key

mov ax, 4c00h
int 21h

key:
mov ah, 00h
int 16h
xor ah, 39h
jnz key
ret

SEGMENT .data ;Initialised data segment

[/code]

• [code]
BITS 16 ;Set code generation to 16 bit mode
ORG 0x0100 ;Set code start address to 0100h
SEGMENT .text ;Main code segment
start:
mov ch, 00111111b ;= 63d = 3Fh
mov cl, 00001111b ;= 15d = 0Fh
int 10h
call key
mov ax, 4c00h
int 21h
key:
mov ah, 00h
int 16h
xor ah, 39h
jnz key
ret
SEGMENT .data ;Initialised data segment
[/code]
[green]
Your program starts out without putting a function # in AH (AH=1)
AX=0 on program start up so you are setting the video mode to 0.

No cursor can show up that way, even with AH=1 INT 10h
The blinking can not be disabled in text modes using CH bits 5-6
CH=6 & CL=7 is your standard cursor, try that first.
I made a small Nasm .asm below that tests some cursor types.

A Nasm .COM file doesn't need SEGMENTS defined
since only 1 64k segment is alloted to a .com file any way.
NASM -f bin MY.asm -o MY.com
is a working Nasm .com file command line.
start: label isn't needed unless you use it.

Your get key check of "XOR AH,39h" I am unfamiluar with,
but was never confident of any flags returned by XOR,
& a call to procedure KEY: could be changed to:
MOV AH,8
INT 21h ; wait/get key without echo = pause
MOV AX,4C00h ;exit program
INT 21h
If you have some XOR flag info, I would like to know it. (post it please?)

Some "good lookin out" by Asmguru62
pointed out that CH=20 is the hide cursor value.
Thankx, I stand approperately corrected.

Bitdog
PS, since yer a Nasm man, you may want this:
[/green]
http://bitdog.home.att.net/files/nasmenv.zip
[code]
BITS 16
ORG 100h ; Nasm .COM file
;uncomment a CX to test it
; MOV CX,0x0607 ;std under score (CH=6 CL=7)
MOV CX,0x0707 ;thin under score (elegant)
; MOV CX,0x0007 ;block (obnoxious)
; MOV CX,0x0001 ;over score (confusing)
; MOV CX,0x2000 ;hide (usefull)
MOV AH,1 ; function 1
INT 10h ; set cursor type
MOV AH,8 ; get key without echo
INT 21h ; pause
MOV AX,0x4C00
INT 21h ; exit program with errorlevel 0 in AL
[/code]

• First off, thanks for bearing with me and helping me out. Second, I feel real stupid now for not initialising the accumulator.

: Your CH=63 end line is greater than your CL=15 start line.
: No cursor can show up that way, even with AH=1 INT 10h
: The blinking can not be disabled in text modes using CH bits 5-6
: CH=6 & CL=7 is your standard cursor, try that first.
: I made a small Nasm .asm below that tests some cursor types.
:

According to this interrupt list I have here it says that bits 0-4 are for the start/end location in ch/cl, and bits 5 & 6 in ch specify the blinking properties like 00=normal, 01=invisible , 10=slow, 11=fast. I don't know if you have a different list than I, but it does say it's Ralph Browns list version 88.8.

: A Nasm .COM file doesn't need SEGMENTS defined
: since only 1 64k segment is alloted to a .com file any way.
: NASM -f bin MY.asm -o MY.com
: is a working Nasm .com file command line.
: start: label isn't needed unless you use it.

True, I just have NASMIDE on auto; however, when I try to use the segmented model it won't assemble it. Could be I still learning it though.

: Your get key check of "XOR AH,39h" I am unfamiluar with,
: but was never confident of any flags returned by XOR,
: & a call to procedure KEY: could be changed to:
: MOV AH,8
: INT 21h ; wait/get key without echo = pause
: MOV AX,4C00h ;exit program
: INT 21h
: If you have some XOR flag info, I would like to know it. (post it please?)

I just have it where you hit space bar and no other key to quit, and figured that would be the best way to test that condition since XOR would zero out AH's scancode if equal causing the zero flag to be set. Is this wrong? Is it working a different way other than what I think it's doing? Please elaborate.

• Q: According to this interrupt list I have here it says that bits 0-4 are for the start/end location in ch/cl, and bits 5 & 6 in ch specify the blinking properties like 00=normal, 01=invisible , 10=slow, 11=fast. I don't know if you have a different list than I, but it does say it's Ralph Browns list version 88.8.
A: I have a pocket paper back IBM ROM BIOS book.
I didn't look at Ralf Browns list.
There might be an input confusion between graphics cursors & text mode cursors?
I couldn't get my text cursor test .asm to reliabably set cursor start & end positions.
I mean, I tried different CX inputs that should have worked and they didn't.
Then I tried CX input that shouldn't have worked and it did.
The CX tries that worked, I put in my example code.
I suggest you try CX inputs according to your R.B. info in an .asm .com
and log the ones that work in commented CX=? lines like I did.
I'm rateing my BIOS book as incomplete.

---(Previous message part)---
: : A Nasm .COM file doesn't need SEGMENTS defined

Q: True, I just have NASMIDE on auto; however, when I try to use the segmented model it won't assemble it. Could be I still learning it though.
A: I just use a batch file to invoke Nasm with simple input.
The IDE's go against my KISS policy. (KISS = Keep It Simple Stupid)
What ever works for you, is what you should do.
BUT it looks like you are running into the same troubles I did.
No control over what you are assembling because of bad help info.
If 3 pieces of info are required to get an understanding, and they
are seperated then hidden in a window in a window in a window then
different names are used to refer to the same thing in the different
areas, a human will never get the idea. I know of no one that can configure their Windoze OS unless they have gone to school for it.
It is true that a .COM's .ASM does not need segment defination.
So the problem is in the configuration of your IDE.
Nasm has a built in linker & can generate a .COM file on it's own.
I don't if all versions of Nasm that are out there are like that,
but I think most of them are.
Since IDE configurations are hidden in windows, & require a full understanding of all the many settings available and their combinations
in order to get the IDE to consistantly work properly, you might spend
more time learning and configuring your Nasm IDE operateing system than you will writeing your code. But you'll look really intelegent when you share complicated IDE make files that no one can use.

:"XOR AH,39h" JNZ SOMEWHERE
Q: I just have it where you hit space bar and no other key to quit, and figured that would be the best way to test that condition since XOR
would zero out AH's scancode if equal causing the zero flag to be set.
A: if you've tested it with all AH values 0-255 and it works, use it.
But figguring XOR & JNZ will work and testing to insure that it does work are two different things. I haven't tested it, so I don't know. I just had bad luck using XOR to set flags because I never saw an accurate document on it, and my trial test didn't reviel any valid info I could act upon.
This is what I use as a key check. You might try it too?
NEWKEY:
MOV AH,8 ;git key with out echo
INT 21h
OR AL,AL ;if AL=0 an extended key was pressed, like arrow keys?
JZ EXTENDED
CMP AL,27
JZ ESC_PRESSED ; escape/exit program?
;other key press checks here
JMP TO_LOOP ;jmp somewhere
EXTENDED: ;an extended key was pressed
INT 21h ;get & waste extended key press
JMP NEWKEY ; git NewKey

Bitnut Bitdog & a BitHuman too

• [b][red]This message was edited by shaolin007 at 2003-10-9 8:29:29[/red][/b][hr]
[b][red]This message was edited by shaolin007 at 2003-10-9 8:26:50[/red][/b][hr]
I made another program to cause half of the cursor to go up and down, but it does it with a block type cursor for some reason. I think cl would be the column width of it, and the lower value is the widest.

[code]
;NASM-IDE ASM Assistant Assembler Project File
BITS 16 ;Set code generation to 16 bit mode
ORG 0x0100 ;Set code start address to 0100h

mov ax, 0003h
int 10h

call Loop_Cursor_Down
xor cx,cx
mov ch, 8
call Loop_Cursor_Up
mov ax, 4c00h
int 21h

Loop_Cursor_Down:
mov ah, 01h
int 10h
call key
inc ch
cmp ch, 8
jne Loop_Cursor_Down
ret

Loop_Cursor_Up:
mov ah, 01h
int 10h
call key
dec ch
cmp ch, 1
jne Loop_Cursor_Up
ret

key:
mov ah, 00h
int 16h
cmp ah, 39h ;spacebar to exit
jne key
ret
[/code]