清华大学出版社 TSINGHUA UNVEHSIYP model small model small data data code code startup (P127) start: moy ax. adata moy ds ax exit 0(P127) end mov ax, 4c00h int 21h model smal1: end start const data code start: mov ax dgroUP moy ds ax mov ax, 4c00h int 21h end start
.model small .data …… .code .startup(P127) …… .exit 0(P127) end .model small .data …… .code start: mov ax, @data mov ds, ax …… mov ax, 4c00h int 21h end start .model small .const …… .data …… .code start: mov ax, DGROUP mov ds, ax …… mov ax, 4c00h int 21h end start
清华大学出版社 TSINGHUA UNIVERSITY PRESS 段组定义伪操作(p126) dsegl segment word public ' data dsegl ends dseg2 segment word public ' data dseg2 ends datagroup group dsegl, dseg2 cseg segment para public 'code assume cs: cseg, ds: datagroup start mov ax, datagroup mov ds, ax mov ax, 4c00h int 21h cseg ends end start
段组定义伪操作(p126) dseg1 segment word public ‘data’ …… dseg1 ends dseg2 segment word public ‘data’ …… dseg2 ends datagroup group dseg1, dseg2 cseg segment para public ‘code’ assume cs:cseg, ds:datagroup start: mov ax, datagroup mov ds, ax …… mov ax, 4c00h int 21h cseg ends end start