Show Menu
Cheatography

assembly Cheat Sheet (DRAFT) by

assembly interrupts

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Clear Screen

Registers: AH, AL, BH, CH, CL, DH, DL
mov	ah,06h

mov	al,25    ;­Number of Rows

mov	ch,0     ;S­ource Row

mov	cl,0     ;S­ource Column 

mov	dh,24    ;­Des­tin­ation Row

mov	dl,79    ;­Source Column

mov	bh,07h­ ­ ­ ­;Page Attribute

int	10h

Move Pointer

Registers: AH, DH, DL, BH
mov	ah,02h

mov	dh,10    ;­Des­tin­ation row

mov	dl,30    ;­Des­tin­ation Column

mov	bh,0     ;Page Number

int	10h

Print A Character ( set attribute )

Registers: AH, AL, BH, BL, CX
mov	ah,09h

mov	al,03h­ ­ ­ ­ ­ ­;Heart character

mov	bh,0       ;Page number

mov	bl,f0h­ ­ ­ ­ ­ ­;At­tribute

mov	cx,20      ;­Number of print

int	10h

Read A Character ( show char )

Registers: AH, AL
mov	ah,01h

int	21h

mov	help,a­l    ;Store Character in help

Read A Character ( !show char )

Registers: AH, AL
mov	ah,8h

int	21h

mov	help,a­l    ;Store character in help

Read A Character ( !show char ) (copy)

Registers: AH, AL
mov	ah,08h

int	21h

mov	help,a­l    ;Store character in help

Print A Character

Registers: AH, DL
mov	ah,02h

mov	dl,hel­p    ;Move a character to dl

int	21h
 

Read A String

Registers: AH, DX
;define a label to read a string

strlist		LABEL	BYTE

max		db	21                ;Max character

len		db	?                 ;A­ctual length

buffer		db	21	dup(' ')    ;­Memory for characters


;read a string

mov	ah,0Ah

mov	dx,strlist

int	21h

Print A String

Registers: AH, DX
;help db 'Your Str','$'

mov	ah,09h

mov	dx,offset help       ;lea dx,help

int	21h

Print A Character ( !attribute )

Registers: AH, AL, BH, CX
mov	ah,0Ah

mov	al,03h­ ­ ­ ­ ­ ­;Heart character

mov	bh,0       ;Page number

mov	cx,20      ;­Number of print

int	10h
 

Exit

Registers: AH
mov ah,4ch

int 21h