flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
pool 11 Mar 2008, 06:31
..
Last edited by pool on 17 Mar 2013, 11:44; edited 1 time in total |
|||
![]() |
|
edfed 11 Mar 2008, 11:10
ok!!! then, if i need to have a multisegemnted code.
cs = segmentcode ds = segment0 es = segment1 fs = segment2 gs = segment3 ss = segment4 how can i assign the segment1 to direct to screen memory? is there a value to create in the source? segment code: segment data: segment screen: segment stack: etc... i never code MZ or exe... then, it's new for me. |
|||
![]() |
|
revolution 11 Mar 2008, 11:30
edfed wrote: ok!!! then, if i need to have a multisegemnted code. |
|||
![]() |
|
edfed 11 Mar 2008, 11:58
ok, but the multisegment, what does it mean? can we choose the exact value for a segment during compile? or is it just a segment symbol that don't have assigned value?
in another way, i what to make a .exe, the code segment will be 1000h, the first dta segment will be 2000h, and so on... or are these values undefined? |
|||
![]() |
|
revolution 11 Mar 2008, 12:04
edfed wrote: ok, but the multisegment, what does it mean? can we choose the exact value for a segment during compile? or is it just a segment symbol that don't have assigned value? |
|||
![]() |
|
DOS386 12 Mar 2008, 00:42
pool wrote:
Quote: Why we need to PUSH CS and POP DS in MZ format? CS points to code (surprisingly), DS and ES to the PSP (but is this guaranteed ??? ![]() ![]() In DOS .COM , both CS and DS point to the code, thus PUSH CS and POPE DS is not needed, but won't cause any damage if present ![]() revolution wrote: Quote: IIRC the value of DS if undefined upon entry so we need to give a value so that DS:DX will point to the proper place. Seems to point to the PSP ![]() edfed wrote: Quote:
1. SS is the stack. Abusing SS or SP for anything else is VERY RISKY - DON'T DO do this except with interrupts disabled. BTW, FASM's format MZ will set up the stack for you ![]() 2. You need those stupid RM code segments only if your code is > 64 KiB ... but then DPMI32 is a better choice ![]() revolution wrote: Quote: The relocation mechanism doesn't work that way. You still have to manually load your screen segment (probably 0xb800) into the segment register at runtime. eg. mov ax,0xb800/mov es,ax Yes. Code: mov ax,$B800 ; $B800 for text, $A000 for VGA push ax pop es ; "PUSH const" is not 8086-compatible, OTOH "MOV ES,AX" would be Quote: in another way, i what to make a .exe, the code segment will be 1000h, the first dta segment will be 2000h, and so on... or are these values undefined? Code will be at 0 inside segment (CS:0) for MZ, absolute address is not fixed (CS=???). EDIT: fixed bug pointed by revolution Last edited by DOS386 on 12 Mar 2008, 01:00; edited 1 time in total |
|||
![]() |
|
revolution 12 Mar 2008, 00:50
DOS386 wrote: [DS] Seems to point to the PSP DOS386 wrote: Neither PUSH const nor MOV ES,AX is 8086-compatible |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.