Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- Start:
- mov ah,09h
- mov dx,EnterInfo
- int 21h
- call DrawNewLine
- mov ah,08h
- int 21h
- mov ah,02h
- mov dl,al
- int 21h
- sub ax,30h
- xor ah,ah
- mov [a],ax
- call DrawNewLine
- mov ah,08h
- int 21h
- mov ah,02h
- mov dl,al
- int 21h
- sub ax,30h
- xor ah,ah
- mov [b],ax
- call DrawNewLine
- push [a]
- push [b]
- push bx
- push si
- push di
- call Calc
- push ax
- mov ah,09h
- mov dx,ResultInfo
- int 21h
- pop ax
- add ax,30h
- mov ah,02h
- mov dl,al
- int 21h
- mov ax,$0C08
- int 21h
- test al,al
- jnz @F
- mov ah,$08
- int 21h
- @@:
- ret
- Calc:
- push bp
- mov bp,sp
- mov ax,[bp + 12]; a
- mov cx,[bp + 10]; b
- Mul ax
- Div cx; a^2/b = ax /\ dx
- sub ax,cx
- pop bp
- ret 10
- DrawNewLine:
- mov ah,09h
- mov dx,NewLine
- int 21h
- ret
- a dw ?
- b dw ?
- EnterInfo db 'Enter a and b$'
- ResultInfo db 'Result is $'
- NewLine dw 10,13,'$'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement