Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- data segment
- ; add your data here!
- A db 60
- B db 16
- C db 5
- D db 18
- H dw 0
- J dw 0
- pkey db "press any key...$"
- ends
- stack segment
- dw 128 dup(0)
- ends
- code segment
- start:
- ; set segment registers:
- mov ax, data
- mov ds, ax
- mov es, ax
- ; add your code here
- mov al, A
- mov cl, 2
- mul cl
- mov H, ax
- mov al, B
- mov cl, C
- mul cl
- mov J, ax
- mov ax, H
- mov bx, J
- add ax, bx
- mov H, ax
- mov al, D
- mov ah, 0
- sub al, 3
- mov J, ax
- mov ax, H
- mov cx, J
- div cx
- lea dx, pkey
- mov ah, 9
- int 21h ; output string at ds:dx
- ; wait for any key....
- mov ah, 1
- int 21h
- mov ax, 4c00h ; exit to operating system.
- int 21h
- ends
- end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment