asm question
Results 1 to 7 of 7

Thread: asm question

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    148

    asm question

    Sorry for all these asm questions, I just learned of a method in assembly language where you can print strings to the display by moveing them byte by byte into video memory at location 0B800h, I am learning this at http://www.xs4all.nl/~smit/asm02001.htm

    It mentions 80x25 text mode, and in that mode, 4000 bytes of video memory at location B800:0000 can be used, I wrote my own program afterreading the example. If i start MS-DOS and move to the directory where my program resides, and I assemble and link with TASM and TLINK. No problems assembling or linking, I then type the name of the program and hit enter, it prints a blank line to the screen. So I figured maybe B800 is the wrong memory location, I pondered and played with my code for about a hour, still blank lines, I then tryed to asemble their example, and still blank lines, I I went back to the tutorial, I read about the video mode and figured maybe dos dont use that mode, then for some strange reason I decided to open windows explorer, and find my program and double click it, WOW it worked! so it must be something to do with the video mode, I then found theis site http://www.geocities.com/SiliconVall...odeSelect.html

    I read the entire page, it apears there are difernt video modes, and i was useing 80x24 text mode.

    My question is how come my program will work by double clicking the Icon, yet if I try to launch it from DOS all i get is a blank line???
    In snatches, they learn something of the wisdom
    which is of good, and more of the mere knowledge which is of evil. But must I know what must not come, for I shale become those of knowledgedome. Peace~

  2. #2
    Member
    Join Date
    Jan 2002
    Posts
    64
    Sorry man, but I think you're wasting your time on 16 bit asm.
    Try Iczlions Win32 tutes at http://spiff.tripnet.se/~iczelion/

    Krang

    P.S. If you really want to write 16 bit search for "draeden assembly"
    they helped me tons
    .....Brain Failure....dumping core.... z z z

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Posts
    148
    Thank you for the link, I will check it out, however I am still going to learn 16 bit first before 32bit, as this is what I did with C, I learned how to make Dos apps in C, then moved on to makeing Win32 aps. So much to learn in so little time. I will soon learn how to incorporate asm code in C, so that I can write parts of my code in C, and parts in asm. As my goal is to make an operating system from scratch. 10X for the sugestions, I will definately check that link out soon.
    In snatches, they learn something of the wisdom
    which is of good, and more of the mere knowledge which is of evil. But must I know what must not come, for I shale become those of knowledgedome. Peace~

  4. #4
    The Iceman Cometh
    Join Date
    Aug 2001
    Posts
    1,210
    Sorry for the digression, but have you taken an OS class? Writing an operating system sounds a lot easier that it is. Setting up all the processes to work properly's quite a bit of work. I had dreams of writing an OS for a research project my freshman year of college (I was bored and my professors saw potential in me), but gave up after talking with the OS instructor. I ended up making a compiler instead, which was still challenging, but dramatically more easier, plus, I had the opportunity to play around with some assembly for that as well. If you want to incorporate assembly in C or C++, I suggest you start small... don't aim for an OS on your first try... I don't think you'll be happy with the results.

    AJ

  5. #5
    AO Curmudgeon rcgreen's Avatar
    Join Date
    Nov 2001
    Posts
    2,716
    A DOS session is controlled by a PIF ie.DOSPRMPT.PIF etc.
    This is accessible by right clicking on a dos executable
    or its icon.

    I suspect that there is some difference in the PIF
    for your dos prompt compared to the one for
    double clicking the dos executable The PIF controls
    several parameters of the dos session, such as
    whether it runs full screen or windowed, and whether
    the dos session closes when the program terminates,
    memory usage etc. etc.

    Play with these settings and you will uncover the
    mystery of why the program works in one circumstance
    and not the other.


    BTW, here's a snippet of code for video memory

    Code:
    N       NEWBLUE.COM
    A
    MOV     AX,B800                  ;GET ADDRESS OF VIDEO MEMORY
    MOV     DS,AX                    ;INTO DS REGISTER
    MOV     CX,07D0                  ;# OF CHARS TO FILL SCREEN
    MOV     BX,0000                  ;OFFSET OF FIRST BYTE OF VID MEM
    MOV     BYTE PTR [BX],DB         ;PUT CHAR #DB IN FIRST BYTE
    MOV     BYTE PTR [BX+01],01      ;PUT 01h IN 2nd BYTE (ATTRIBUTE)
    ADD     BX,+02                   ;GO TO NEXT CHAR POSITION OF VID MEM
    LOOP    010B                     ;LOOP # OF TIMES IN CX (7D0h)
    INT     20                       ;TERMINATE (AND RETURN TO DOS)
    
    RCX
    19
    W
    Q
    It is a debug script. copy and paste it to a file, like
    NEWBLUE.TXT

    then at the command prompt type DEBUG<NEWBLUE.TXT
    and debug will assemble it into a COM file.
    It should turn the screen blue.



    I came in to the world with nothing. I still have most of it.

  6. #6
    Senior Member
    Join Date
    Jun 2002
    Posts
    148
    rcgreen, thanks so much for that info, it helps alot. Just the kind of info I was looking for. I have got a lot of learning to do. Yes I agree that OS development is a big chalenge, I have however programed in many difernt high level languages such as C, C++, a bit of python and some qbasic. I am egar to get heavy into the deeprer aspects of programing. I have been learning a lot of asm though the past week or so. Development will not start for at least another 2 or more years, as I have much to learn. However I will not give up

    thanks for all your advice and suport.
    In snatches, they learn something of the wisdom
    which is of good, and more of the mere knowledge which is of evil. But must I know what must not come, for I shale become those of knowledgedome. Peace~

  7. #7
    Member
    Join Date
    Jul 2002
    Posts
    50
    Good luck to you and your OS. I'm expecting it'll be FREE and OpenSource.
    Give man a fish and he will ask for more.
    Teach man to fish and he will never ask again.
    \"Chinese proverb\"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •