Maybe I am just stupid... :( 
Author Message
 Maybe I am just stupid... :(

I have been looking around for good tutorials, but ever single one I
find start showing code without explaining what it does, except for
the comments.  But when it shows something like:

3:     mov     es,0b800h                       ;set es to text video
segment

What is 0b800h?  Are there any tutorials on the net directed truely at
beginers?  If so where can I find it.  Please e-mail me at:

-gnaget



Tue, 16 Nov 1999 03:00:00 GMT  
 Maybe I am just stupid... :(

Quote:

> I have been looking around for good tutorials, but ever single one I
> find start showing code without explaining what it does, except for
> the comments.  But when it shows something like:

> 3:     mov     es,0b800h                       ;set es to text video
> segment

> What is 0b800h?  Are there any tutorials on the net directed truely at
> beginers?  If so where can I find it.  Please e-mail me at:

> -gnaget

        Norton Guides has a good assembler tutoirial, as well as full
instruction set and service interrupts.

        0B800h is the segment address of your video ram (memory mapped
i/o) for this screen mode.  Other screen modes have different adresses.
Find documentation on bios interupt 10h (video and screen services) for
more information or see norton guides.



Tue, 16 Nov 1999 03:00:00 GMT  
 Maybe I am just stupid... :(

Get used to stuff like that. 0b800 is the physical segment where the TEXT
is read from by your VGA card. the format is. B800 is a hexadecimal number.

B800:0000  the ASCII byte of position 1.
B800:0001 the attribute byte of position 1.
B800:0002 the ASCII byte of position 2.
etc. etc. etc.
ASCII byte contains ascii code of character. attribute byte contains data
for the thing. in some modes that means fore and background color, or
flashing. in some modes it means underline.
position one is top left. 2 is the one next to it in x,y coordinates..
(1,0). when you get to the top right, the next one would be (0,1). ie: top
left, but one down.

Another, simpler example:

IntroMsg DB 'Hello.$'
MOV AH,9h
MOV DX,OFFSET IntroMsg
INT 21h

what do all the numbers mean?
9h is a function. 9h on interrupt 21h (the dos interrupt) is print String
delimited with $ character onto the primary console output. load the offset
of the first character into DX.

ASM is like that. aside from a few commands, anything serious goes like
this. PRINT? hah, no way. DOS simplifies things though. You should try
reading files from a disk without dos. Couple of pages. That's what makes
HLLs so attractive. However, with ASM you do have the most versatility and
control, and, in general, you can do more neat stuff than you could ever do
with C, or Pascal, or basic.

Where to start? Art of Assembly, randall Hyde. where? download the FAQ of
this newsgroup maintained by Ray Moon.
--



Quote:
> I have been looking around for good tutorials, but ever single one I
> find start showing code without explaining what it does, except for
> the comments.  But when it shows something like:

> 3:     mov     es,0b800h                       ;set es to text video
> segment

> What is 0b800h?  Are there any tutorials on the net directed truely at
> beginers?  If so where can I find it.  Please e-mail me at:

> -gnaget



Tue, 16 Nov 1999 03:00:00 GMT  
 Maybe I am just stupid... :(



:What is 0b800h?

0b800h is the segment address of the memory location where the color
monitor screen buffer is most commonly located.

Best,
        -- Chuck Crayne
-----------------------------------------------------------

-----------------------------------------------------------



Tue, 16 Nov 1999 03:00:00 GMT  
 Maybe I am just stupid... :(



Quote:
>I have been looking around for good tutorials, but ever single one I
>find start showing code without explaining what it does, except for
>the comments.  But when it shows something like:

>3:     mov     es,0b800h                       ;set es to text video
>segment

>What is 0b800h?

0b800h is a memory location where the screen data is stored.
Quote:
> Are there any tutorials on the net directed truely at
>beginers?  If so where can I find it.  Please e-mail me at:

Try Gavins guide and Guadalajara tutorial. do a search on the net. use
assembly as the string, it will be on one of the pages.

Quote:

>-gnaget

--
Setec


Tue, 16 Nov 1999 03:00:00 GMT  
 Maybe I am just stupid... :(


Quote:



>>I have been looking around for good tutorials, but ever single one I
>>find start showing code without explaining what it does, except for
>>the comments.  But when it shows something like:

>>3:     mov     es,0b800h                       ;set es to text video
>>segment

>>What is 0b800h?
>0b800h is a memory location where the screen data is stored.

   Well, for starters, the above line of code is NOT even a valid
assembly language statement.  You can not mode an immediate value
(0B800h in this case) directly into a segmment register (es in this
case).  One must either load such a constant from memory or use a
"work" register to perform the desired operation.  In TERSE this
could be done as a simgle statement like this:

        es = ax = 0B800h;       \ es = Segment of Video RAM.

or in traditional assembly as the two statements:

        Mov     ax,0B800h       ; ax = Segnent of Video RAM
        Mov     ex,ax           ; es = Segnent of Video RAM

   No as for an explanation:  With a 16-bit address, you can
only address 65536 memory locations.  So, when the x86 was
invented, they created "segments" to allow programmers to
access up to 1MB of memory.  A segment register (ds, es, ss, cs)
holds a 16 bit value that is added to a 16-bit offset to yield
a "physical" memory address.  This addition is performed by
first shifting the segment portion left by 4-bits (multiplying
it by 16) and then adding the offset.  So, if you have a
memory address such as B800:1234, this is refering to the
physical memory address B9234.  Here is how the addition works:

                 1234
                B8000  (note the 'extra' zero on the right end)
                -----
                B9234  (note this is a 20-bit address.

Quote:
>> Are there any tutorials on the net directed truely at
>>beginers?  If so where can I find it.  Please e-mail me at:
>Try Gavins guide and Guadalajara tutorial. do a search on the net. use
>assembly as the string, it will be on one of the pages.

   I might also suggest Randy Hyde's Tutorial at

        http://wenster.ucr.edu

   If you are just learning assembly, you might want to consider
TERSE to help you.  I have had many customers tell me how simple
learning machine level porgramming was using TERSE.  To find out
more about TERSE please visit www.terse.com

Quote:

>>-gnaget

>--
>Setec

   I hope this helps.

         Jim Neil           ___  ___/  ____/   ___  /   ____/   ____/
      Creator of The            /     /       /    /   /       /
TERSE Programming Language     /     ___/      ___/ ____  /   ___/
   http://www.terse.com       /     /       /  \         /   /

   ISBN:  0-9652660-0-1



Wed, 17 Nov 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. maybe i'm just stupid but...

2. Sorting list (maybe stupid)

3. ** URGENT ** Only ONE question (maybe stupid)

4. Stupid newb question: What am I doing wrong?

5. I am a stupid newbie.

6. REPOST: I am a stupid forger

7. Stupid question I am afraid, but I could use a pointer or two

8. STUPID QUESTION I AM AFRA

9. I am clinically stupid. (fastcgi.rb bug)

10. Just starting -- am I stupid? (new and initialize)

11. REPOST: I am a stupid forger

12. Is Fortran great or am I stupid?

 

 
Powered by phpBB® Forum Software