0

I am new to assembly language and studying it as my course requirement (SYSTEM PROGRAMMING). Every concept is almost clear about assembly language, but I have confusion in the following terms.

  1. What are PAGES in Graphics Mode?
  2. How to use Different PAGES in Graphics Mode?
  3. How do Use different Pages?

Lastly, I need an Assembly Language Program to Display the value of TWO variables, var1 (which stores an integer value) and var2 (Stores any String) on page # 3 in a graphic mode in Assembly Language using an 8086 processor.

Following is the code sample to print a string on a page in graphics mode, mainly on a current page which is 0 by default. I have used SERVICE 09H of INT 10H. I need to display that string on PAGE 3 instead of PAGE 0.

org 100h
mov  si,OFFSET string

mov  ah,9           ; write character/attribute
mov  al,[si]        ; character to display
mov  bh,0           ; video page 0
mov  bl,1111b       ; attribute
or   bl,10000000b   ; set blink/intensity bit
mov  cx,20          ; display it one time
int  10h
ret

string db "ALpha$"

I'm using EMU8086 for practice. Thank you.

Ali Uzair
  • 3
  • 4
  • Look at https://stackoverflow.com/questions/48648548/graphics-mode-in-assembly-8086 – vitsoft Feb 13 '22 at 16:08
  • 2
    With the VGA type controller, there are different areas of memory which can be displayed, and the controller can be told which will be seen. These are called "pages". The feature can be used to prepare the "next" video page and when ready, you switch the page selection (the visible page). The old BIOS interrupt 10h function 05h was used to select the page. Graphics controllers and their modes are quite complicated and I recommend deeper research. – Weather Vane Feb 13 '22 at 17:00
  • @WeatherVane Thank you so much for your brief answer. How do I print 2 variables on PAGE 3 and then print out the results as an output? – Ali Uzair Feb 13 '22 at 17:41
  • 1
    First you need to convert the number to a string. There are plenty of references for how to do that, as it is a quite basic operation needed everywhere. Then you need to place characters in the video memory, and you can use BIOS interrupt 10h functions 09h or 0Ah for that. In your research, you'll see that one of the registers is used to specify the display page to use. – Weather Vane Feb 13 '22 at 17:53
  • Have you understood the task? The 2 variables are not on "page 3" - that's where the results are to be placed - on page 3 of the video memory. – Weather Vane Feb 14 '22 at 00:41
  • @WeatherVane Yeah Got it! But when I change the default **PAGE No** to 3, It shows me a blank screen, and It works fine if I set the Default page to 0. **org 100h mov si,OFFSET string mov ah,9 ; write character/attribute mov al,[si] ; character to display mov bh,0 ; video page 0 <-------------------- It works fine, But after setting it to 3 it show me ony blank screen mov bl,1111b ; attribute or bl,10000000b ; set blink/intensity bit mov cx,20 ; display it one time int 10h ret string DB "Check$" ** – Ali Uzair Feb 14 '22 at 04:25
  • Have you written something on page 3 yet? – Sebastian Feb 14 '22 at 05:32
  • @Sebastian I have added a short piece of code, you may have a look at that one as well. Instead of displaying the Results on *PAGE 3*, it shows noting a simple blank screen on the other hand the following code works when I change the page number to 0 (Default). – Ali Uzair Feb 14 '22 at 06:14
  • You also have to show page 3 after writing to it! – Sebastian Feb 14 '22 at 06:18
  • @Sebastian How to display on Page 3? Will you please guide me, a CODE is preferable. – Ali Uzair Feb 14 '22 at 10:57
  • Just use function 05h. https://en.wikipedia.org/wiki/INT_10H It only need AH and AL as parameters. – Sebastian Feb 14 '22 at 12:11

0 Answers0