to CS: or not to CS: in F-PC assembler 
Author Message
 to CS: or not to CS: in F-PC assembler

I still dont have a totally clear idea of when I should use the cs: (code
segment override switch )
I have studied F-PC source code and I have concluded that CS: is ONLY used
when directly addressing a variable. That's ok, all the variables are in the
code segment.
However since CS=DS in F-PC, why should I ever use CS: to make a variable
access work?
Am I missing some other cases where CS: should be used?
If I scatter CS: all over the place just to be sure, doesnt this consume
extra clock cycles.
Malcolm Cox
Royce Instruments, Inc.


Sat, 13 Sep 2003 01:30:47 GMT  
 to CS: or not to CS: in F-PC assembler

Quote:
>I still dont have a totally clear idea of when I should use the cs: (code
>segment override switch )
>I have studied F-PC source code and I have concluded that CS: is ONLY used
>when directly addressing a variable. That's ok, all the variables are in the
>code segment.
>However since CS=DS in F-PC, why should I ever use CS: to make a variable
>access work?
>Am I missing some other cases where CS: should be used?
>If I scatter CS: all over the place just to be sure, doesnt this consume
>extra clock cycles.
>Malcolm Cox
>Royce Instruments, Inc.

You need a good reason to need segments. Worry about it when it comes up.

Unix, BTW, has 3 basic "segments" for a process, .text, .data and .bss.  
In keeping with unix's grand lucid names tradition, .text is the program
code :/ . .data is initialized data, and .bss is uninitialized data. .text
is normally read-only, so that several processes can use the same code. I
make the H3sm .text section read-write because it has a classico
Forth-like dictionary with code and data intermixed. .data is read-write.
.bss is allocated at load time. It takes no space in the program stored on
disk. A unix process also has a stack, which the OS maintains
transparently.

Variations of the above may be why you would want to fool with segments.
MAYbe.

Rick Hohensee



Sat, 13 Sep 2003 04:48:12 GMT  
 to CS: or not to CS: in F-PC assembler

Quote:
> You need a good reason to need segments. Worry about it when it comes up.

Actually I have serious lack of interest in {*filter*}ts, I would really like to know
absolutely nothing about the topic, but I do worry when code works some days and
not others, only to find I have forgotten CS: before a memory access.
Those actions I understand, I really worry right now about what I dont
understand., for eg when my assembly language code doesnt access a variable
value correctly and interrupt code disappears into the bushes.


Sat, 13 Sep 2003 14:30:28 GMT  
 to CS: or not to CS: in F-PC assembler

Quote:

> I still dont have a totally clear idea of when I should use the cs: (code
> segment override switch )
> I have studied F-PC source code and I have concluded that CS: is ONLY used
> when directly addressing a variable. That's ok, all the variables are in the
> code segment.

1) In interrupt routines where CS=f-pc.cseg but DS = ???
2) in memory access routines like CMOVEL that load
DS and ES with source and destination segment
(SI -- source index, DI - destination index, DS:SI and ES:DI,
ES cannot be overriden, again IIRC).

Quote:
> However since CS=DS in F-PC, why should I ever use CS: to make a variable
> access work?
> Am I missing some other cases where CS: should be used?
> If I scatter CS: all over the place just to be sure, doesnt this consume
> extra clock cycles.

IIRC it does on 8086/8088 and prevents pipelining on Pentium.
Quote:
> Malcolm Cox
> Royce Instruments, Inc.



Sat, 13 Sep 2003 17:20:07 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. US-NC-CS PC InVision Smalltalk Developer

2. US-NC-CS PC InVision Smalltalk Developer

3. US-NC-CS PC InVision Smalltalk Developer

4. Believe or not, Forth in CS!

5. VWNC: vwnc@cs.uiuc.edu not working?

6. Camp Smalltalk (CS 6) registration

7. APL as First Language for CS

8. SoftEng or CS Graduate Program Search

9. Test and Set (TS) vs Compare and Swap (CS)

10. Refactored Plus All Missing CS ANSI Tests In SIF

11. Camp Smalltalk (CS 6) registration

12. vwnc@cs.uiuc.edu

 

 
Powered by phpBB® Forum Software