Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data segment
- ttt dw ?
- a dw ?
- b dw 90
- s db ?
- nmb db ?
- pnt dw 0h
- data ends
- code segment
- assume cs:code, ds:data
- main: mov dx, data
- mov ds, dx
- mov dx, 0B800h
- mov es, dx
- xor di, di
- jmp start
- outp_n:
- mov di, 80*2
- mov ax, 0730h
- add al, nmb
- add di, pnt
- mov es:[di], ax
- ret
- start: xor dx, dx
- mov ax, 0720h
- mov cx, 80*25
- rep stosw
- xor di, di
- mov cx, 01h
- inloop: in al, 60h
- cmp al, bl
- je inloop
- mov bl, al
- cmp al, 01h
- jne NotEsc
- jmp quit
- NotEsc: cmp al, 0Bh
- jne Not0
- mov es:[di], 0730h
- jmp NxtNum
- Not0: cmp al, 02h
- jne Not1
- mov es:[di], 0731h
- jmp NxtNum
- Not1: cmp al, 03h
- jne Not2
- mov a, 2
- mov es:[di], 0732h
- jmp NxtNum
- Not2: cmp al, 04h
- jne Not3
- mov a, 3
- mov es:[di], 0733h
- jmp NxtNum
- Not3: cmp al, 05h
- jne Not4
- mov a, 4
- mov es:[di], 0734h
- jmp NxtNum
- Not4: cmp al, 06h
- jne Not5
- mov a, 5
- mov es:[di], 0735h
- jmp NxtNum
- Not5: cmp al, 07h
- jne Not6
- mov a, 6
- mov es:[di], 0736h
- jmp NxtNum
- Not6: cmp al, 08h
- jne Not7
- mov a, 7
- mov es:[di], 0737h
- jmp NxtNum
- Not7: cmp al, 09h
- jne Not8
- mov a, 8
- mov es:[di], 0738h
- jmp NxtNum
- Not8: cmp al, 0Ah
- jne Not9
- mov a, 9
- mov es:[di], 0739h
- jmp NxtNum
- Not9: jmp inloop
- NxtNum: inc di
- inc di
- dec cx
- jnz Not9
- mov ax, 0h
- mov ax, a
- add ax, b
- mov bl, 0Ah
- div bl
- mov nmb, al
- mov bl, ah
- call outp_n
- add pnt, 2
- mov nmb, bl
- call outp_n
- jmp pause
- mov bx, 80h
- mov di, 80*2
- outloop:mov al, s
- test al, bl
- mov es:[di], 0730h
- jmp NxtBit
- bit1: mov es:[di], 0731h
- NxtBit: inc di
- inc di
- shr bl, 1
- jnc outloop
- pause: in al, 60h
- cmp al, 01h
- jne pause
- quit: mov ax, 4C00h
- int 21h
- code ends
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement