Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    mov ax, 13h
    int 10h


You are correct. And using a mov to ax rather than xor+mov to al is counter-intuitively one byte smaller (there's one more byte of immediate value in the former). Every byte counts!

(I tested using "nasm -f bin")


However, in .coms you could assume that AX was 0 upon entry and skip the XOR.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: