Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #start=simple.exe#
- org 100h
- in ax,112 ;input packet size
- mov word ptr fs,ax
- mov bx,0 ;total packets sent
- mov cx,1 ;next number of packets to be transmitted
- mov dx,1 ;number of transmission
- inc bx ;send first packet
- start:
- cmp ax,bx
- jae break ;if(total packets sent >= file size) break loop
- ;else
- cmp cx,64
- jb less ;if(next number of packets to be transmitted < 64) next number of packets to be transmitted = total packets sent * 2
- cmp cx,64
- jae grteq ;if(next number of packets to be transmitted >= 64) next number of packets to be transmitted = total packets sent * 2
- cmp cx,128
- je equl ;if(next number of packets to be transmitted == 128) next number of packets to be transmitted = total packets sent * 2
- less:
- mov ax,2
- mul cx
- add bx,cx
- inc dx
- jmp start
- grteq:
- inc cx
- add bx,cx
- inc dx
- jmp start
- equl:
- mov cx,1
- add bx,cx
- inc dx
- jmp start
- break:
- mov ax,dx
- out 112,ax
- ret
- fs db ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement