Last active
November 29, 2024 00:27
-
-
Save LightningStalker/8b3997d6687d9dbf16a3cfeed87cbce8 to your computer and use it in GitHub Desktop.
DOS assembly program that has a hidden string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .MODEL TINY | |
| .STACK 100h | |
| .DATA | |
| ;msg DB 'hello, world',13,10,'$' | |
| msg DB 0d6h,0dbh,0d2h,0d2h,0d1h,092h,09eh,0c9h,0d1h,0cch,0d2h,0dah,0b3h,0b4h,09ah | |
| .CODE | |
| start: | |
| mov ax, @data | |
| mov ds, ax ;set DS and | |
| mov es, ax ;ES to point to segment of data | |
| cld ;auto-increment SI and DI | |
| mov cx, 15 ;string is 15 chars including terminator | |
| mov si, offset msg ;source and | |
| mov di, offset msg ;destination are the same | |
| caese: | |
| lodsb ;get a char --> AL | |
| xor al, 0beh | |
| stosb ;store result | |
| dec cx ;next char | |
| jnz caese | |
| mov dx, offset msg | |
| mov ax, 900h ;display message | |
| int 21h | |
| mov ax, 4c00h ;4c = exit, 00 = status 0 | |
| int 21h | |
| END start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment