Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stack segment stack
- db 80h dup(?)
- stack ends
- data segment
- data ends
- code segment
- main proc far
- push ds ; DS = PSP, save PSP segment on stack
- ; Insert program code here.
- ; Make sure the stack is balanced when finished
- ; -----------------
- assume cs:code,ds:data
- mov dx, @data
- mov ds, dx
- ; -----------------
- ; Exit EXE program with FAR Return to PSP_Segment:0000h where
- ; an Into 20h resides in the word at offset 0000h in the PSP
- xor ax, ax ; AX = 0
- push ax ; Push 0 on the stack
- ; Note: `PUSH` with an immediate value
- ; wasn't a valid instruction on
- ; Intel 8088/8086 processors
- ; At this point the DS (PSP) pushed at the beginning of the program
- ; and the value 0000h forms a CS:IP FAR pointer on the stack
- ret ; Return to PSP_Segment:0000h via FAR pointer
- ; on the stack and execute
- ; the Int 20h at that address
- main endp
- code ends
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement