; CS2011, A Term 1999
; Prof. Sergio A. Alvarez

title JMP, LOOP example

.model small
.stack

; oops, no .data directive anywhere in this file
; will this work? try it out!

.code

.startup
   label1: jmp short label2
   ; above actually generates 1 less byte of machine code
   ; than a plain jmp label2 would (assemble this file and
   ; the plain jmp version using tasm/la/zi filename, then
   ; compare the listing (*.lst) files
   mov cx,10
   loopdeeloop:   ; this loop can't be reached, 
      mov ax,ax   ; but its syntax is just fine!
   loop loopdeeloop
   label2: jmp label1
   ; this jmp is automatically assembled as a short jmp
.exit

end


