one pass assembler: converts whole at one, jmp instruction references made after assembly two pass: converts in two steps : first generates a symbol table of names and labels used in programs and calculate their relative addresses, then converts the instructions into machine code in the next cycle of assembly, more efficient and easier than first

Linking:

  1. can link multiple obj files into one and forms exe file
  2. additional files that can be produced by the linker .lib .map
  3. completes the address left by the assembler

Loading and executing;

  1. just about the execution of the linked exe file
  2. resolves the remaining addresses
  3. process creates the program segment prefix before loading
  4. executes to genereate result

.COM programs:

  1. memory less than 64k
  2. all segments are bound into one single piece
  3. fits for memory resident programs
  4. org 100H immediately after .code
  5. smaller than .exe programs

Differences:

  1. Segmentation
  2. Program Size
  3. Initialization: automatically in .COM program whereas the one with .EXE programmer needs to manually initialize them
  4. Template

Macro assembler:

  1. Macro key word
  2. requires macro name and parameter list to be initialized
  3. Endm at the end of the macro
  4. Faster, easy coding, less errors, more readable code.

Addressing modes in 8086: a. Register addressing: Use of registers for pointing data in any instruction. eg. MOV AX, BX b. Immediate addressing: Immediate data is a part of the instruction. c. Direct memory addressing:16 bit memory address (offset) is directly specified in the instruction as a part eg. add ax, [5000h] it’s offset from the value pointed by DS d. Direct offset addresssing: varaiartonof direct addressing uses arithmetic operators to modify an address. eg . Arr db 15, 17, 18 MOV AL, Arr[2] e. Indirect memory addressing: Using computer’s capability for segment: offset addressing used with BX, BP base register base pointer and DI and SI eg. Mov [bx], al f. Base displacement addressing: [BX+2] g. Base index : [bx+si] h. base index with displacement: [bx+si+2] i. String addressing: using si and di to point to the first byte or word of source and destination si and di automatically incremented or decremented using the direction flag

Dos functions and interrupts:

INT 21H: move the values to AH for these operations a. 00h terminationDL b. 01h input a character from keyword stored in al c. 02h display a character need to be in DL (sounds like display so display from dl) d. 09h request display ie. display a string DX,string required . ends after a $ is encountered. e. 0ah request keyboard input lea dx, para_list para_list label byte max_len db 20 act_len db ? kb-data db 20 DUP(?) function of each line first line to align a byte boundary and gives location to para_list

INT 10H: called video display control , controls the screen display format color text style scrolling etc. move to AH for operation.

a. 00h: set video mode , mov al,03h to convert to standard color text b. 01h: set cursor size: ch, start_scan_line and cl to end_scan_line ( default size 13:14) c. 02h: set cursor position: BH: page_no , DH:y axis, DL :x axis d. 03h: return cursor status: ch, cl, dh, dl : from same as the above instructions value returned e. 04h: light pen function f. 05h: set active pafe: AL-page_no g. 06H: scroll up screen Al: 00 means full screen and contains no of rows BH: 61: brown back, blue fore it’s attribute or pixel value CX: start : 0000h to DX: 2479h full screen start row:column to end h. 07h: scroll down screen : same as up scroll i. 08h: read char and attribute at cursor : BH- page number(0 as normal) char at AL and attribute comes to BH j. 09h: display character and attribute at cursor BH- page no , AL-character , BL-attribute , CX- no of repeated char k. 0ah: display char at cursor BH- page no , BL- value , CX -repetition l. 0bh: set color palette first select bH: 00 or 01 if 00 : Bl contains 16 colors upto 0fH selects background color if 01 : selects palette m. 0ch: write a pixel dot al = color of pixel BH- page no , CX- column and DX: row n. 0dh: read pixel dot and determine color ar AL o. 0eh: display in teletype mode terminal for simple display AL- char Bl-foreground color p. 0fh: get current video mode AL- current video mode AH- no of screen columns Bh- active video page

CONCLUSIONS FROM PROGRAMMING IN 8086 date:30 july

  1. LEA DX, STR equivalent to MOV SI, OFFSET STR