Assembler Program Örnekleri:

 



BAŞLIK :ADD PATH ON THE FLY 
KAYNAK :PC COMPUTING 
YAZARI : 
TARİH :01.03.94
SAYI : 
SAYFA :222 
KONU : 

TO ADD A DIRECTORY TO YOUR PATH TYPE 
ADDPATH DIRECTORY NAME 
N ADDPATH.COM 
E 0100 B4 30 CD 21 3C 02 72 16 
E 0108 FC BE 80 00 32 ED 8A 0C 
E 0110 E3 0C 8B FE 41 B4 20 46 
E 0118 38 24 77 05 E2 F9 E9 D1 
E 0120 00 AC 3A C4 76 10 3C 3B 
E 0128 74 0E 3C 61 72 0F 3C 7A 
E 0130 77 0B 2A C4 EB 07 B0 3B 
E 0138 38 45 FF 74 01 AA E2 E1 
E 0140 81 EF 80 00 76 4A 89 3E 
E 0148 FA 01 26 8E 06 16 00 26 
E 0150 3B 06 2C 00 74 09 26 A1 
E 0158 2C 00 E2 EE E9 93 00 8B 
E 0160 D0 48 8E C0 26 8B 0E 03 
E 0168 00 E3 25 D1 E1 D1 E1 D1 
E 0170 E1 D1 E1 8E C2 33 DB 26 
E 0178 80 3F 50 75 10 26 81 7F 
E 0180 01 41 54 75 08 26 81 7F 
E 0188 03 48 3D 74 05 43 E2 E7 
E 0190 EB 60 83 C3 05 83 E9 05 
E 0198 76 58 89 1E FC 01 26 80 
E 01A0 3F 00 74 05 43 E2 F7 EB 
E 01A8 49 8B C3 2B 06 FC 01 A3 
E 01B0 FE 01 4B 8B F3 41 26 83 
E 01B8 3F 00 74 05 43 E2 F7 EB 
E 01C0 31 43 43 2B DE 2B 0E FA 
E 01C8 01 76 27 03 F3 8B FE 03 
E 01D0 3E FA 01 8B 0E FE 01 03 
E 01D8 CB 8E DA FD F3 A4 FC 0E 
E 01E0 1F BE 80 00 8B 0E FA 01 
E 01E8 8B 3E FC 01 F3 A4 FE 0E 
E 01F0 F9 01 A0 F9 01 B4 4C CD 
E 01F8 21 01 
RCX 
00FA 






BAŞLIK :CLEARING THE SCREEN 
KAYNAK :BORLAND C++ HANDBOOK 
YAZARI :CHRIS H. PAPPAS 
TARİH : . . 
SAYI : 
SAYFA :602 
KONU : 

MOV CX,0 "UPPER CORNER OF THE WINDOW" 
MOV DX,2479H "LOWER CORNER OF THE WINDOW" 
MOV BH,7 "NORMAL SCREEN ATTRIBUTE" 
MOV AX,0600H "BIOS INTERRUPT VALUE" 
INT 10H "CALL INTERRUPT" 


 



BAŞLIK :COLD BOOT 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU :PROG 

N COLDBOOT.COM 

MOV AX,0040 
MOV DS,AX 
MOV WO[0072],000 
JMP FFFF:0000 
RCX 
10 






BAŞLIK :CURSOR SIZE CONTROL 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU : 

N CSIZE.COM 
E 100 BE 80 00 AC 0A C0 74 6C 
E 108 AC 3C 0D 74 67 3C 20 74 
E 110 F7 4E AC 2C 30 3C 00 7C 
E 118 5B 3C 08 7F 57 0A C0 75 
E 120 05 B9 09 69 EB 07 FE 08 
E 128 B9 09 07 2A E8 89 0E 4D 
E 130 01 B8 1C 35 CD 21 89 1E 
E 138 4F 01 8C 06 51 01 BA 53 
E 140 01 B8 1C 25 CD 21 BA 20 
E 148 00 B4 31 CD 21 00 00 00 
E 150 00 00 00 1E 50 51 0E 1F 
E 158 86 0E 4D 01 2B C0 8E D8 
E 160 39 0E 60 04 74 04 B4 01 
E 168 CD 10 59 58 1F 9C 2E FF 
E 170 1E 4F 01 CF B4 4C CD 21 
RCX 
CX 0000 
78 






BAŞLIK :CURSOR SIZE CONTROL-2 
KAYNAK :PC COMPUTING-DATAMED 
YAZARI : 
TARİH :01.10.93
SAYI : 
SAYFA :302 
KONU : 

N BLOCKCUR.COM 
E 0100 B4 12 B3 10 CD 10 B1 07 
E 0108 80 FB 10 74 0D 33 C0 8E 
E 0110 C0 26 8A 0E 85 04 FE C9 
E 0118 EB 00 B4 01 32 ED CD 10 
E 0120 B4 4C CD 21 
RCX 
24 






BAŞLIK :NUM LOCK OFF 
KAYNAK :PC COMPUTING 
YAZARI : 
TARİH :01.05.94
SAYI : 
SAYFA :223 
KONU : 

N NUMOFF.COM 
E 100 B8 40 00 8E D8 80 26 17 
E 108 00 DF C3 
RCX 
0B 






BAŞLIK :NUM LOCK OFF 
KAYNAK :BORLAND C++ HANDBOOK 
YAZARI :CHRIS H. PAPPAS 
TARİH : . . 
SAYI : 
SAYFA :562 
KONU : 

MOV AX,0 "PREPARE TO SET ES TO 0" 
MOV ES,AX "MOVE IT IN" 
MOV AL,ES:[417H] "KEYBOARD STATUS BYTE" 
AND AL,11011111B "PREPARE TO MASK NUMLOCK" 
MOV ES:[417],AL "RETURN ALTERED INFORMATION" 
MOV AH,4CH 
INT 21H 


BIT 
0 RIGHT SHIFT KEY DEPRESSED 
1 LEFT " " " " " " " 
2 CTRL KEY DEP. 
3 ALT KEY DEP. 
4 SCROLL LOCK ACTIVE 
5 NUMLOCK ACTIVE 
6 CAPS LOCK ACTIVE 
7 INSERT ACTIVE 




BAŞLIK :PRINT THE SCREEN 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU :PROG 

N PRTSC.COM 
A 100 
INT 05 
RET 

RCX 





 



BAŞLIK :RESTART YOUR COMPUTER 
KAYNAK :PC COMPUTING 
YAZARI : 
TARİH :01.03.94
SAYI : 
SAYFA :222 
KONU : 

N RESTART.COM 
E 100 B8 40 00 8E D8 
E 105 B8 34 12 BB 72 
E 10A 00 89 07 EA 00 
E 10F 00 FF FF 
RCX 
18 






BAŞLIK :ROM INFORMATION 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU : 

N ROMINFO.COM 
E 100 B4 09 BA 84 01 CD 21 1E BA 00 F0 8E DA B9 08 00 
E 110 BB F5 FF 8A 17 B4 02 CD 21 43 E2 F7 1F B4 09 BA 
E 120 A8 01 CD 21 1E BA 00 F0 8E DA B9 0E 00 BB 08 E0 
E 130 8A 17 B4 02 CD 21 43 E2 F7 1F B4 09 BA CF 01 CD 
E 140 21 1E BA 00 F0 8E DA BB FE FF 8A 17 88 D6 80 E2 
E 150 F0 B1 04 D2 EA 80 E2 0F 80 C2 37 80 FA 41 7D 03 
E 160 80 EA 07 B4 02 CD 21 80 E6 0F 80 C6 37 80 FE 41 
E 170 7D 03 80 EE 07 88 F2 B4 02 CD 21 1F B4 09 BA F3 
E 180 01 CD 21 C3 
E 184 0D 0A 'ROM DATE AT ADDRESS F000:FFF5 IS $' 
E 1A8 2E 0D 0A '(C) NOTICE AT ADDRESS F000:E005 IS $' 
E 1CF 2E 0D 0A 'ID BYTE AT ADDRESS F000:FFFE IS $' 
E 1F3 2E 0D 0A 24 
RCX 
F7 






BAŞLIK :SAFEMOVE /TO MOVE THE FILES 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU :PROG 

INTERRUPT 21h function 56h provides a safe way to move files 
between directories on the same drive. 
SAFEMOVE oldpath/filename newpath 
N SAFEMOVE.COM 
A 100 
MOV DI,81 
MOV AX,20 
MOV CX,7F 
REPE SCASB 
DEC DI 
MOV SI,DI 
MOV DX,DI 
CMP BYTE PTR [DI],5C 
JNE 11A 
INC DI 
MOV SI,DI 
JMP 110 
CMP BYTE PTR [DI],20 
JNA 122 
INC DI 
JMP 110 
MOV BYTE PTR [DI],0 
INC DI 
REPE SCASB 
DEC DI 
MOV BX,DI 
CMP BYTE PTR [DI],20 
JNA 133 
INC DI 
JMP 12B (YA DA 126) 
CMP BYTE PTR [DI-1],5C 
JE 13D 
MOV BYTE PTR [DI],5C 
INC DI 
MOVSB 
CMP BYTE PTR[SI],0 
JNE 13D 
MOV BYTE PTR [DI],0 
MOV AX,5600 
MOV DI,BX 
INT 21 
JC 151 
MOV AL,0 
MOV AH,4C 
INT 21 

RCX 
55 


Registers DS:DX must point to the current full pathname, and ES:DI
to the new pathname. Once that's been arranged, the program moves 
5600h into the AX register and calls INT21h. If there is any 
trouble, the carry flag is set and the number is put in the AL 
register. If there is no trouble, 0 is put into the AL register. 
The final call to INT 21h, function 4Ch ends the program with the 
ERRORLEVEL set to the whatever was in AL. 




BAŞLIK :SENDING VALUES TO THE PARALLEL PORT 
KAYNAK :BORLAND C++ HANDBOOK 
YAZARI :CHRIS H. PAPPAS 
TARİH : . . 
SAYI : 
SAYFA :602 
KONU : 

MOV DX,956 (DECIMAL) 
MOV AX,8 (OR WHATEVER VALUE) 
OUT DX,AL 


 



BAŞLIK :SERIAL PORT PROGRAMMING 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU :PROG 

MOV DX,3FDh 
REPEAT: IN AL,DX 
TEST AL,20h 
JZ REPEAT 
MOV AL,41h 
MOV DX,3F8h 
OUT DX,AL 
The above code outputs a byte of data (the value 41h loaded into 
AL in the fifth line) to serial port COM1. It first checks the 
status of the COM port 3FDh (the port address of COM1's Line 
Status Register), then enters a loop, alternately rereading the 
status and checking bit 5 of the return value with the instruction
TEST AL,20h. When the bit comes back set, indicating the serial 
port is ready to transmit data, the routine outputs the data by 
OUTing it to port address 3F8h, where the serial port's Transmit 
Holding register is located. 


 



BAŞLIK :SWAP THE PRINTER PORTS 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU :PROG 

N SWAPPORT.COM 
A 100 
XOR AX,AX ZERO AX REGISTER 
MOV DS,AX SET DS TO SEGMENT 0 
MOV SI,408 BIOS DATA AREA OFFSET 
MOV AX,[SI] GET PORT ADDRESS LPT1 
MOV BX,[SI+2] GET PORT ADDRESS LPT2 
XCHG AX,BX EXCHANGE REGISTER VALUES 
MOV [SI],AX REPLACE LPT1 WITH LPT2 ADDRESS 
MOV [SI+2],BX REPLACE LPT2 WITH LPT1 " 
INT 20 RETURN TO DOS 
RCX 

17 




DEBUG <SWAPPORT.SCR 


 



BAŞLIK :TURBO SPEED 
KAYNAK :PC COMPUTING 
YAZARI : 
TARİH :01.05.94
SAYI : 
SAYFA :217 
KONU : 

TO RUN THE PROGRAM TYPE SPEED + OR SPEED - 


N SPPED.COM 
E 100 EB 17 90 4D 75 73 74 20 
E 108 73 70 65 63 69 66 79 20 
E 110 2B 20 6F 72 20 2D 0D 0A 
E 118 24 BE 80 00 80 3C 02 73 
E 120 08 B4 09 BA 03 01 CD 21 
E 128 C3 8A 44 02 3C 2B 75 07 
E 130 E4 3D 0C 04 E6 3D C3 3C 
E 140 3D C3 
RCX 
0042 






BAŞLIK :WARM BOOT 
KAYNAK : 
YAZARI : 
TARİH : . . 
SAYI : 
SAYFA : 
KONU :PROG 

N WARMBOOT.COM 

MOV AX,0040 
MOV DS,AX 
MOV WO[7002],1234 
JMP FFFF:0000 
RCX 
10