Originally posted by Churchill
View Post

code SEGMENT
ASSUME CS:code, DS:code
ORG 100h
strt:
mov ax,0b800h
int 10h ; al is 0 to set video mode, b8 is invalid video mode, so text mode is used - saves 3 bytes: mov ax,2
mov ds,ax
mov es,ax
mov ax,0730h
xor di,di
mov cx,0ah
rep stosw
mov dl,30h ; put constant in register outside main loop
Label_116:
mov di,12h
Label_119:
mov al,[di]
inc ax ; 1 byte opcode rather than 2 bytes in: inc al
cmp al,3ah
je Label_125
mov [di],al
jmp Label_116
Label_125:
mov [di],dl
dec di ; 2 bytes rather than 3 bytes sub di,2
dec di
jns Label_119
ret ; works in COM files so long as stack undisturbed
code ENDS
END strt

dec di ; 2 bytes rather than 3 bytes sub di,2 dec di
Depending on processor:




Comment