Video systems continue - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Video systems continue

Description:

Modify the program to get a string from a keyboard to display ... Modify the previous program to draw horizontal line on the screen using ... exercise (Week ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 24
Provided by: hien2
Category:

less

Transcript and Presenter's Notes

Title: Video systems continue


1
Video systems (continue)
2
Practice
Modify the program to get a string from a
keyboard to display the input string on the
middle of the screen with reverse video Hint
Using INT 10H function 13H (last weeks slide)
with 17H as attribute Review for midterm exam
3
Review (Week 4 and 3)
  • Determine the instruction address for the
    following given values for CS and IP
  • (a) CS 26AE0, IP 0044
  • Instruction address 26B24H
  • (b) CS 25BD0, IP 003F
  • Instruction address 25C0FH
  • (c) CS 272D0, IP 029C.
  • Instruction address 2756C.

4
Review
  • 2. The BIOS Data Area begins in low memory at
    segment address_400H__________
  • 4. A __directive__ enables you to control the way
    in which a program assembles and lists.
  • 5. The first byte of an instruction is the
    _operation__ the other bytes are _operand__,
    which reference an immediate value, register, or
    memory location.

5
Review
  • 3. The value 2505H is stored in locations 130 and
    131, and 1C04H is stored in locations 132 and
    133. What is the effect of the following related
    instructions?
  • (a) MOV BX,0130
  • 0525H in BX
  • (b) ADD BX,0132
  • 0941H in BX
  • (c) MOV 0134,BX
  • 4109H in locations 0134 and 0135.

6
Review
  • 6. The expression in an operand of a data item
    may contain a _____?__ to indicate an
    uninitialized item.
  • 7. The statement DW 10 DUP(25) defines 10 word__
    initialized with the value _25__.
  • 8. A comment following an instruction on the same
    line is preceded by what character?
  • (a) (b)
  • (c) (d) a blank

7
Review
  • 6. The expression in an operand of a data item
    may contain a _____?__ to indicate an
    uninitialized item.
  • 7. The statement DW 10 DUP(25) defines 10 word__
    initialized with the value _25__.
  • 8. A comment following an instruction on the same
    line is preceded by what character?
  • (a) (b)
  • (c) (d) a blank

8
Using Graphic Mode
  • Graphic mode uses pixels to generate color
    patterns.
  • It represents a pixel from one to eights bits
  • There are 10 common graphic modes. They are
    different in terms of pages, colors,
    resolution.
  • EMU8086 supports 1 graphic mode (INT 10H,
    function 13H)
  • Page 1, Resolution 320 x 200, 256 colors

9
Setting graphic mode
  • INT 10H, function 00H
  • Step 1 Set AL 13H
  • Step 2 Set AH 0
  • Step 3 Call INT 10H
  •  

10
Direct Video Display
  • Fastest way to display text or graphic characters
    is to transfer them directly to video display
    area
  • The address of page 0 for mode 3 is B8000H.
    Each character require two bytes (one for
    representing the character itself and one for its
    attribute)
  • Moving a pair of characterattribute into video
    area of the active page will cause the character
    appear immediately on screen

11
Example of direct video display
  • MOV AX, 0B800h
  • MOV ES, AX
  • print message using ES
  • as segment
  • MOV ES00h, 48h H
  • MOV ES02H, 45h E
  • MOV ES04H, 4ch L
  • MOV ES06H, 4ch L
  • MOV ES08H, 4fh O

12
Example of direct video display
13
Example of direct video display
MOV AX, 0B800H MOV ES, AX MOV AX, 0003H Set
the current video mode to text mode INT 10H
INT 10H, function 00H (mode03H is standard
text) MOV AX, 0500H Set the active page
00 INT 10H CALL DISPLAY
14
Example of direct video display
DISPLAY PROC NEAR mov cx,25 vertical line
mov di,0 again1 mov esdi,48h mov
esdi1,4eh add di,80 loop again1 DISPLAY
ENDP
15
Direct Video Display
16
Direct video display Practice
  • Modify the previous program to draw horizontal
    line on the screen using direct video display

17
Review exercise (Week 1 and 2)
  • 1. The smallest unit of data in a computer is a
    _bit___. It may be off so that its value is
    __0___, or on so that its value is __1__.
  • 2. In a byte, the parity bit always requires that
    the number of bits on is a(n) ___odd___ number.
  • 3. The number 210 equals _1024_____, which is
    represented by the letter _K_, for kilobyte.
  • 4. A negative binary number contains a __1___ in
    its leftmost position. A negative value is
    expressed in what is called __twos
    complement__________ notation.

18
Review exercise (Week 1 and 2)
  • 5. The _hexadecimal_____ (base 16) numbering
    system involves the digits 0 through F.
  • To indicate a base 16 number in a program, you
    code the letter _H_ immediately after the number.
  • 6. A segment is an area that begins on a
    _paragraph__________ boundary, that is, at any
    location evenly divisible by decimal 16__, or hex
    10__. A segment may be located almost anywhere in
    memory and in real mode may be up to _64K___
    bytes in size.
  • 7. Within a program, memory locations are
    relative to the start of a __segment________ the
    distance in bytes is expressed as a(n)
    __offset______ from its start.

19
Review exercise (Week 1 and 2)
  • 8. To convert a binary number into its two's
    complement form
  • (a) add 1,
  • (b) reverse the bit values,
  • (c) reverse the bit values and add 1,
  • (d) reverse the bit values and subtract 1.
  • 9. Reverse-byte sequence means that the processor
    stores
  • (a) byte values upside down,
  • (b) byte addresses backwards,
  • (c) numeric values with bytes in reverse
    sequence,
  • (d) all values with bytes in reverse sequence.

20
Review exercise (Week 1 and 2)
  • 10. The general purpose registers are
  • (a) AX, BX, CX, DX (b) SP, BP, IP
  • (c) DI, SI (d) CS, DS, ES, SS
  • 11. The index registers are the
  • (a) AX, BX, CX, DX (b) SP, BP, IP
  • (c) DI, SI (d) CS, DS, ES, SS
  • 12. What is the maximum size of a segment?
  • (a) 4K (b) 64K
  • (c) 256K (d) no limit

21
Review exercise (Week 1 and 2)
  • 13. Provide the two instructions to initialize
    the address of the data segment in the DS
    register, given the name DATSG.
  • MOV AX,DATSG
  • MOV DS,AX

22
Review exercise (Week 1 and 2)
  • 14.

23
Practice
2B360H
PSP
DS2B360H
Stack Segment
SS2B360H100H 2B460H
Data Segment
ES2B360H SP0030H
CS2B360H100H 30H 70H
2B500H
Code Segment
Memory
Write a Comment
User Comments (0)
About PowerShow.com