Quantcast
Channel: acassis – Alan C. Assis
Viewing all articles
Browse latest Browse all 870

Historic memories: how to create a DOS executable in the EDIT.COM

$
0
0

This is an old trick I used to do in the EDIT.COM of DOS to impress my friends. I discovery that some binary instructions could be represented in the text editor.

This is the sequencia to create an executable that prints the CLAUDIA name:

ALT 180 // 180 = B4h = mov AH
ALT 02  // 2
ALT 178 // 178 = B2h = mov DL
C       // C
ALT 205 // 205 = CDh = INT
!       // ! = 33 = 21h
ALT 178 ...
L
ALT 205
!
ALT 178
A
ALT 205
!
ALT 178
D
ALT 205
!
ALT 178
I
ALT 205
!
ALT 178
A
ALT 205
!
ALT 180 // mov AH
L       // L = 4Ch 
ALT 205 // INT 21 => exit to DOS
!

This will generate this binary file sequence:

B4 02 B2 43 CD 21 B2 4C CD 21 B2 41 CD 21 B2 55
CD 21 B2 44 CD 21 B2 49 CD 21 B2 41 CD 21 B4 4C
CD 21

It is equivalente to this assembly instruction:

MOV AH,02 ; To select subfunction 2, move the appropriate number, 2, to AH.
MOV DL,”A” ; In the interrupt list, it says that the character to output should be
INT 21h ; in register DL. So we move the character to DL.
; Finally when all the registers are set as required, we call the interrupt.

MOV AH,4Ch ; Select the subfunction
INT 21h ; Select a return value (optional but recommended)
; Call the DOS interrupt.



Viewing all articles
Browse latest Browse all 870

Latest Images

Trending Articles



Latest Images