Skip to content

Instantly share code, notes, and snippets.

@alexsunday
Last active November 23, 2019 03:00
Show Gist options
  • Save alexsunday/1fff5625b743edb99f3cc60131243407 to your computer and use it in GitHub Desktop.
Save alexsunday/1fff5625b743edb99f3cc60131243407 to your computer and use it in GitHub Desktop.
assume cs:code
; 用div 计算 data 段中,第一个数据除以第二个数据,商存第三个存储单元中
data segment
dd 100001
dw 100
dw 0
data ends
stack segment stack
dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
stack ends
code segment
start:
mov ax, data
mov ds, ax
; for div, high => dx, low => ax
mov ax, ds:[0]
mov dx, ds:[2]
div word ptr ds:[4]
mov ds:[6], ax
mov ax, 4c00h
int 21h
code ends
end start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment