ADD DEST SRC SUB DEST SRC INC AX DEC AX MUL SRC (MUL DL, if DL = 15, AL = 10, then AX = 150) DIV SRC (DIV DL, if AX=115, DL=10, then AH = 5, AL = 11) Divides AX with SRC, AL pyliko, AH ypoloipo IMUL (signed multiplication) IDIV (signed division) SHOW STRING Dilono string sto tmima dedomenon, Message db 'The result is: ', 10, 13, '$' Sto tmima kwdika metaferoume ston kataxoriti DX tin dieu8nsi tou string LEA DX, message i enalaktika MOV DX, offset message kai meta MOV AH, 09h INT 21h SHOW NUMBER/CHAR mov dl, number add dl, 30h ;ascii int 21h INPUT CHAR mov AH, 01h ;fainetai int 21h mov AH, 08h ;den fainetai int 21h I timi apothikeuetai ston AL DIAKLADWSEIS JMP jump JB jump if less than (unsigned) JAE jump if not less than (unsigned) JBE jump if not greater than (unsigned) JA jump if greater than (unsigned) JE jump if equal JNE jump if not equal JL jump if less than (signed) JGE jump if not less than (signed) JLE jump if not greater than (signed) JG/ jump if greater than (signed) JP jump if equality JNP jump if unequality JS jump if negative result JNS jump if positive result JC jump if yparxei carry (kratoumeno) JNC jump if den yparxei carry JO jump if carry overflow JNO jump if no carry overflow cmp dest, source jne kati: ... jmp skip kati: ... skip: ... LOOP loop decreases CX by and jumps if CX is 0 mov CX, 5 seg: ... ; will be executed 5 times loop seg LOOP with additional checks: LOOPE decrements ecx and checks that ecx is not zero and ZF is set if these conditions are met, it jumps at label, otherwise falls through. LOOPNE is same as LOOPE except that it requires ZF to be not set (i.e be zero) to do the jump. JCXZ jump if CX=0 JCXZ next; if CX=0 do not delay again: loop again ; CX delay Pinakas DB 20 dup(0) ;20 bytes of 0 Pinax DB 23, 20, 7, 81, 11, 203 ;6 bytes Arit DB 1,2,4,10,19 Amesi dieythinsiopoiisi: MOV AL,Arit[0];or MOV AL,[Arit] or MOV AL,Arit Emmesi dieythinsiopoiisi: ++stathera Opou kataxoritis basis enas i kenanas apo tous BX kai BP, pote kai oi dyo Opou kataxoritis basis enas i kenanas apo tous SI kai DI pote kai oi dyo YPOPROGRAMMATA ASSUME CS:KODIKAS, DS:DEDOMENA, SS:SOROS ;******** KODIKAS SEGMENT PUBLIC MAIN PROC NEAR MOV AX,DEDOMENA ; Apokatastash tou DS MOV DS,AX ; Apokatastash tou DS ........................... CALL DISPLAY-HEX ; Kaloume tin Display_hex MOV AH,4CH ; Eksodos sto leitoyrgiko systhma INT 21H MAIN ENDP DISPLAY-HEX PROC NEAR ..................... CALL ONE-DIGIT ; Kaloume tin One_digit ................................. RET ; Epistrefo stin thesi apo opou klithike h yporoutina DISPLAY-HEX ENDP ONE-DIGIT PROC NEAR ....................................... TELOS: RET ; Epistrefo stin thesi apo opou klithike h yporoutina ONE-DIGIT ENDP KODIKAS ENDS DEDOMENA SEGMENT ...... DEDOMENA ENDS SOROS SEGMENT STACK ;******** DB 256 DUP(0) SOROS ENDS ;******** END MAIN Perasma parametron se ypoprogrammata: 1. me kataxorites (menoun idioi ane3artita tou upoprogrammatos) 2. me tin soro: LEA AX,MINIMA PUSH AX ;O AX MPAINEI STI SORO GIA PERASMA CALL EMFANISI_MINIMA