Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Summary Sheet for Assembly Programmning

INT 10h BIOS services AH=00h Set video mode > AL=03, CGA text mode > AL=04, 320x200 graphics mode 4-color. > AL=06, 640x200 hi-res graph.mode B/W. > AL=07, monochrome text mode AH=02h Set cursor location > DH=row, DL=col. BH=page AH=03h Get cursor location > DH=row, DL=col. BH=page. CX=cursor AH=06h Clearing the screen > AL=0 for entire page, BH=7 attributes, > CH=0, CL=0, row and col to start. > DH=24, DL=80, row and col to end. AH=0Ch Set a pixel in graphics screen. > AL=(0 black, or 1 for white), > CX=col; DX=row, 80x86 Instruction formats mov dst,src (move data) movsx (move 8-bit sign extended into 16-bit reg) movzx (move 8-bit zeroextended into 16-bit reg) cbw reg (convert byte to sign extended word) add dst,src (dst=dst+src) adc dst,src (dst=dst+src+CF) sub dst,src (dst=dst - src ) sbb dst, src (dst=dst - src - CF) and dst,src ; or dst,src ; xor dst,src (logical) neg op (negation of binary by 2s complement) shl op,1 (shiftleft 1-bit); shl op,cl (shift left cl bits) shr op,1 (shift 1-bit); shr op,cl (shift cl bits) ror op, 1 ; ror op, cl ; rol op, 1 ; rol op, cl ; rotate right and rotate left rcr op, 1 ; rcr op, cl ; rcl op, 1 ; rcl op, cl ; (rotate right and left, over carry flag) INT 21h DOS services AH=01h wait and echo a single character. >>AL returns char keyed to the keyboard. AH=02h display a character on the monitor >DL= ASCII coded char to be displayed. AH=09h display a string to the monitor >DX= offset of ASCII string ending with $. AH=0Ah wait a string input ending with <cr> >DX=offset of buffer area >> input returns in buffer buffer area = {size, length, contents} 05 00 20 20 20 20 20 is buffer of 5 char, 05 03 55 53 41 0D 20 contains USA<cr>. Assembler Directives .model [tiny|small|compact|medium|large|huge] .data (indicates the start of data segment) .code (indicates the start of code sector) .stack n (indicates the size of stack segment) @data (data segment allocated by OS.) equ (equate) db, dw, dd, dq, dt, (define byte; word, double-word, quad-word , 10-digit uBCD.) n dup(x) (duplicate x for n times.) proc [short|near|far]endp (define procedure) end (end of assembler source.) macrolabel macro argumentlistendm (define macro).

mul op (ax=al op or dx:ax=ax op ) div op ( al=ax/op, ah=rem, or ax=dx:ax/op dx=rem) cmp op1, op2 (compare operands for branch) jxx shortaddress (conditional jump) signed: je,jne, jg,jng, jge, jnge, jl, jnl. jle, jnle unsigned je,jne, ja, jna, jae, jnae, jb, jnb, jbe,jnbe on-flags jz, jnz, jc, jnc, js, jns, jo, jno, jp, jpo, jmp nearaddress (jump to near address) call procaddr (calls near subroutine procaddr) ret [n] (removes n bytes from stack and returns from subroutine)

Printable ASCII Table:


-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -A -B -C -D -E -F 2! " # $ % & ' ( ) * + , - . / 3- 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 4- @ A B C D E F G H I J K L M N O 5- P Q R S T U V W X Y Z [ \ ] ^ 6- ` a b c d e f g h i j k l m n o 7- p q r s t u v w x y z { | }

Some ASCII control characters: 07h <BELL> ; 08h <BACK> ; 09h <TAB> ; 0Ah <NL> New-line ; 0Dh <CR> Carriage-Return;

You might also like