encrypt.asm

来自「想学习汇编语言的」· 汇编 代码 · 共 31 行

ASM
31
字号
TITLE Encryption Program               (Encrypt.asm)

; This program uses MS-DOS function calls to
; read and encrypt a file. Run it from the
; command prompt, using redirection:
;    Encrypt < infile.txt > outfile.txt
; Function 6 is also used for output, to avoid
; filtering ASCII control characters.
; Last update: 12/13/01

INCLUDE Irvine16.inc
XORVAL = 239	; any value between 0-255
.code
main PROC
	mov   ax,@data
	mov   ds,ax

L1:
	mov  ah,6	; direct console input
	mov  dl,0FFh	; don't wait for character
	int  21h	; AL = character
	jz   L2	; quit if ZF = 1 (EOF)
	xor  al,XORVAL
	mov  ah,6	; write to output
	mov  dl,al
	int  21h
	jmp  L1	; repeat the loop

L2:	exit
main ENDP
END  main

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?