Having learned Intel 8080 structure, I'm now trying to learn Intel 8086 and how the programs here are layed out. For now, it's quite intimidating even looking at the basic examples and what's worse, I can't get the difference between two ways of writing code for 8086 I've stumbled upon. Namely, sometimes i see:
.model small
.stack 100h
.code
start:
mov dl, ‘a’ ; store ascii code of ‘a’ in dl
mov ah, 2h ; ms-dos character output function
int 21h ; displays character in dl register
mov ax, 4c00h ; return to ms-dos
int 21h
end start
While I also found:
Progr segment
assume cs:Progr, ds:dataSeg, ss:stackSeg
start: mov ax,dataSeg
mov ds,ax
mov ax,stackSeg
mov ss,ax
mov sp,offset top
mov ah,4ch
mov al,0
int 21h
Progr ends
dataSeg segment
dataSeg ends
stackSeg segment
dw 100h dup(0)
top Label word
stackSeg ends
end start
Obviously, I know that these two do very different things but what baffles me is how different the general syntax is. In the latter we have some "segment assume" while in the former it's just .model, .stack and .code (and sometimes .data, from what I found). Is there any difference? Can I just choose which one suits me better? The former looks a lot easier to understand and clearer but can I just use it instead of the latter?