diff --git a/messages.asm b/messages.asm index 27583ec..0ee0a69 100644 --- a/messages.asm +++ b/messages.asm @@ -162,7 +162,12 @@ beep: mov ah, 0x00 ; read keypress int 0x16 ;; Read ASCII character is in al - sub al, 'a' ; normalise (a=0, b=1, c=...) + ;; the character must be normalised to a=1, b=2, ... + ;; and not a=0, b=1, ... because during the waiting loop + ;; see #NOTE_LOOP + ;; the duration counter gets decremented BEFORE + ;; it gets compared to zero + sub al, 'b' ; normalise (a=1, b=2, c=...) ;; interrupt 0x16, ah=0 returns the read scancode in ah ;; so ah must be reset @@ -207,6 +212,9 @@ beep: dec cx ; count down jne .pause2 ; if not zero keep counting down + ;; #NOTE_LOOP + ;; the duration gets decremented before being checked + ;; hence why it was normalised to 'b' and not 'a' dec ax ; decrement duration counter jne .pause1 ; keep doing that until it is 0