GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Tuesday, December 21, 2010

Assembly Label And JMP

Showing a code for label and JMP. Label just a name to sign block of code. And JMP is a code to jump to specified of label.

start:
    MOV AH,02    ; Function to output char
    MOV DL,"A"   ; Character to output
    INT 21h      ; Call interupt to output char

    JMP output
    MOV AH,02    ; Function to output char
    MOV DL,"B"   ; Character to output
    INT 21h      ; Call interupt to output char

output:
    MOV AH,02    ; Function to output char
    MOV DL,"C"   ; Character to output
    INT 21h      ; Call interrupt to output char

end:
    MOV AH,4Ch   ; Function to exit
    MOV AL,00    ; Return 0
    INT 21h

output>> AC

The yellow background never be printed, because JMP command tell the program to jump to "output" label
          
Share/Bookmark

No comments:

Post a Comment