Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Part of your code:</p> <pre><code>MOV AH, 02H MOV BH, 00H ----&gt; this is page number MOV CX, 0000H MOV DX, 0C22H ---&gt;why such big number for column number? INT 10H </code></pre> <p>Why are you using page 0h? Sure about you are using that page? How? I know its done with:</p> <p>VIDEO - GET CURRENT VIDEO MODE</p> <pre><code>AH = 0Fh int 10h Return: AH = number of character columns AL = display mode (see #00010 at AH=00h) BH = active page (see AH=05h) ----------------&gt;you will need this </code></pre> <p>VIDEO - SET CURSOR POSITION</p> <pre><code>AH = 02h BH = page number &lt;--------------now you know what to put here 0-3 in modes 2&amp;3 0-7 in modes 0&amp;1 0 in graphics modes DH = row (00h is top) DL = column (00h is left) int 10h Return: Nothing </code></pre> <p>Source: <a href="http://www.ctyme.com/intr/int.htm" rel="nofollow">Ralph Brown's interrupts page</a>.</p> <p><strong>Display Pages</strong></p> <p>Graphics adapters can store several screens of text data (this is because displaying one screen of graphics requires significantly more memory than text). To fully use the display memory, it is divided into display pages. One display page can hold the data for one screen. The pages are numbered starting with 0; the number of pages available depends on the adapter and the display mode selected.</p> <p>For 80 x 25 text mode, each display page is 4 KB. Display page 0 for text mode starts at address B800:0000h. </p> <p>The active display page is the page currently being displayed. For 80 x 25 text mode, the memory requirement is 80 x 25 = 2000 words = 4000 bytes (i.e., the display does not use all of the 4 KB or 4096 bytes in the display page memory).</p> <p>The video controller displays the first WORD in the active display page at the upper left corner of the screen (0,0), then displays the next WORD at (1,0), etc., displaying the screen row by row. The screen display can be looked at as the image of a two-dimensional array.</p> <pre><code>INT 10h Video Functions 00h: Set Video Mode. Selects the video mode and clears the screen automatically. Input: AH = 0 AL = 3 ; mode 3 = 80 cols x 25 rows color text ; to avoid clearing the screen use mode 83h to set high bit AL = 6 ; sets medium resolution (640 x 200) graphics mode When BIOS sets the display mode, it also clears the screen. 01h: Change Cursor Size Input: AH = 1 CH = starting scan line CL = ending scan line The text mode cursor is displayed as a small dot array at a screen position. For the MDA and EGA, the dot array is 14 rows (0-13). For the CGA, the array is 8 rows (0-7). Normally rows 6 and 7 are lit for the CGA and rows 11 and 12 for the MDA/EGA cursor. 02h: Set Cursor Position. Move cursor to specified position. Input: AH = 2 DH = row (0-24) DL = col (0-79 for 80x25 display) BH = video page number (usually 0) 03h: Get Cursor Position. Return row and column position of cursor. Input: AH = 3 BH = video page number (usually 0) Output: DH = row ; position DL = col CH = starting scan line ; size CL = ending scan line 06h: Scroll the Screen or a Window Up Input: AH = 6 AL = number of lines to scroll (0 =&gt; whole screen) BH = attribute for blank lines CH, CL = row, column for upper left corner DH, DL = row, column for lower right window Scrolling the screen up one line means to move each display line UP one row and insert a blank line at the bottom of the screen. The previous top row disappears from the screen. The whole screen or any rectangular area (window) may be scrolled. AL contains the number of lines to scroll. If AL = 0, all the lines are scrolled and this clears the screen or window. Example: Clear the screen to black for the 80x25 display. MOV AH, 6 ; scroll up function XOR AL, AL ; clear entire screen XOR CX, CX ; upper left corner is (0,0) MOV DX, 184FH ; lower right corner is (4Fh, 18H) MOV BH, 7 ; normal video attribute INT 10H ; clear screen 07h: Scroll the Screen/Window down Input: AH = 7 AL = number of lines to scroll (0 =&gt; whole screen) BH = attribute for blank lines CH, CL = row, column for upper left corner DH, DL = row, column for lower right corner Same as function 6, but lines are scrolled down instead of up. 08h: Read character at cursor. Can be used in either text or graphics mode. Input: AH = 8 BH = page number Output: AH = attribute AL = ASCII code of character 09h: Write character and attribute. Display any ASCII character at current position and set desired attribute. Can be used in graphics or video mode. Input: AH = 09 AL = ASCII character code BH = video page number (usually 0) BL = attribute to be used. (In video mode, sets foreground (pixel) color) CX = repetition count Note: cursor will not be moved beyond the last character displayed. Also, if AL contains the ASCII code of a control character, a control function is not performed --- a display symbol is shown instead. Example: change the attribute of the character under the cursor to reverse video for monochrome display. MOV AH, 8 ; read character XOR BH, BH ; on page 0 INT 10H ; character in AL, attribute in AH MOV AH, 9 ; display character MOV CX, 1 ; display 1 character MOV BL, 70H ; reverse video attribute INT 10H ; display character 0Ah: Write character. Display any ASCII character at current position without changing the current attribute. Can be used in text or video mode. Input: AH = 0Ah AL = ASCII character code BH = video page number (usually 0) CX = repetition count 0Eh: Display Character and Advance Cursor Input: AH = 0Eh AL = ASCII code of character BH = page number BL = foreground color (graphics mode only) This function displays the character in AL and advances the cursor to the next position in the row, or if at the end of a row, it sends it to the beginning of the next row. If the cursor is in the lower right corner, the screen is scrolled up and the cursor is set to the beginning of the last row. This is the BIOS function used by INT 21h, function 2, to display a character. The control characters bell (07h), backspace (08h), line feed (0Ah), and carriage return (0Dh) cause control functions to be performed. </code></pre> <p><a href="http://fleder44.net/312/notes/18Graphics/index.html" rel="nofollow">Source is here</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload