ettinos-programs/old_rot13.disasm

49 lines
625 B
Plaintext

; Recreation from disassembly, changing org 0x2000 to 0x3000 should produce
; a binary runnable on current (as of 2021-07-09) EttinOS
cpu 8086
org 0x2000
mov ah, 3
mov al, 255
mov di, buffer
int 0x21
mov bx, buffer
rotloop:
cmp byte [bx], 0
jz .end
cmp byte [bx], 'A'
jl .next
cmp byte [bx], 'M'
jle .inc
cmp byte [bx], 'Z'
jle .dec
cmp byte [bx], 'a'
jl .next
cmp byte [bx], 'm'
jle .inc
cmp byte [bx], 'z'
jle .dec
.next:
inc bx
jmp short rotloop
.inc:
add byte [bx], 13
jmp short .next
.dec:
sub byte [bx], 13
jmp short .next
.end:
mov ah, 2
mov si, buffer
int 0x21
int 0x20
buffer: