News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Not printing proper message

Started by zak100, December 13, 2009, 03:23:50 PM

Previous topic - Next topic

dedndave

man, Steve, you are a blast from the past - lol

QuoteINCLUDE DEFMS.ASM   ; MACRO and MS-DOS definitions from Heath/Zenith software

what really hurts is, if i dig through my shed, i probably have that file   :lol

EDIT - a little googling - you must have a "bogus" nic on another site - lol

i found the defms.asm file
this index has a lot of z-100 stuff you may find interesting
http://people.cis.ksu.edu/~mcalhoun/Z-100/

FORTRANS

Hi,

   Oh, indeed.  ;-)

Regards,

Steve N.

Edit:

   Hmm, trying to get me to get a Z-100 up and running?
They were fun to tinker with.  But they really scare you
when the smoke comes out...

SRN

dedndave

as a young ham radio operator (living in Michigan, no less), i have built a few heathkits in my time
in fact, the old HF station was a heath sb-101 and sb-220 that i built as a teen
you can imagine my temptation to lean toward the heath-zenith z-100 stuff
fact is - i thought their prices were too high - lol



zak100

Great! I like your interest.

Zulfi.

FORTRANS

Hi again,

Quotethis index has a lot of z-100 stuff you may find interesting

   Nice, thanks.

QuoteI will take a look.

   Rather nice code.  It is going to take a while to digest.
You had a dislike of long labels?  I think I will have to try it
out sometime.

Quoteyou can imagine my temptation to lean toward the heath-zenith z-100 stuff
fact is - i thought their prices were too high - lol

   Well, the Z-100's were used at Eglin, so some showed up
somewhere along the line, and we formed a club.  And for
what you got, they were not more expensive than IBM PC's
or DEC Rainbows.  And you got all sorts of strange documentation
in the Heath tradition.  You could use up a massive amount of
time either with the software or the hardware.  (Or both!  I got
a TV capture board and translated its software from Z-80 land.)

   I wanted to build some of the Heathkit stuff, but chickened
out on the radios.  Nice looking units.

   Did you get things a blinking?

Regards,

Steve N.

zak100

Thanks for mentioning this Z-100 page. It has a large number of zipped programs. I hope they can be useful.


Zulfi.

dedndave

well, Zulfi
Steve and I got a little off-topic and hi-jacked your thread - lol
we didn't think you'd mind    :P

zak100

Hi,
I have modified the boot loader by putting the message (mesg) in data segment. Again I am not getting the mesg displayed. I have checked the debug. SI is pointing to DS but when I do lodsb, AL is not getting correct value from the string.



The code is given below:



.MODEL  SMALL
.data
Msg0    db      "We be bootin234!",0

        .CODE

;----------------------------------------------------------------------------------

LoadOfs EQU     0               ;must match the value in the bootloader source file

;----------------------------------------------------------------------------------

;---------------------- initialize ES segment register

        ORG     0

Start:  ;push    cs
        ;pop     ds
       
;-----------clear screen
mov ax, 3
int 10h

   
;---------------------- writing a message on screen at startup, character by character- we can't use int 21h
overdata:
        mov ax, @data
        mov ds, ax
        xor di, di
        mov ax, 0B800h
        mov es, ax
        mov si, offset msg0
       mov ah, 41h; attribute byte
       cld;
msgloop:
        lodsb; loads al with a byte of data pted by ds:si
        or al, al
        jz Halt0
        stosw; transfers the contents of al to mem location ptd by es:di
        jmp msgloop
       

;---------------------- done - halt

Halt0: hlt
jmp     Halt0

END     Start





Kindly help me with this.

Zulfi.

dedndave

hi Zulfi
well - for testing under DOS, you want to be ORG'ed at 100h - model tiny - that makes a .COM program
(no .data segment)

to make an IO.SYS file - ORG at 0 - again - no .data segment
the data is in the same segment as the code
it needs to appear at the end, after the code (easiest way)
to load a multi-segment program the EXEC loader is required
you don't have an EXEC loader because you have no DOS or other OS installed
so - push cs/pop ds will get the code segment into the DS register for you

for IO.SYS...
        mov si, offset msg0+LoadOfs

zak100

Thanks. But this I had already done with the support of you people on this forum. Now I was trying to prepare myself for protected. I saw in the book that we need data segment for pmode. So waht I conclude from your statement that if want to switch to pmode we cant print any mesg until we are in pmode??

Now I have added another mesg in the above code but its again not printing! I am providing the code below:


.MODEL  TINY



        .CODE

;----------------------------------------------------------------------------------

LoadOfs EQU     0               ;must match the value in the bootloader source file

;----------------------------------------------------------------------------------

;---------------------- initialize ES segment register

        ORG     0

Start:  push    cs
        pop     ds
       
;-----------clear screen
mov ax, 3
int 10h

   
;---------------------- writing a message on screen at startup, character by character- we can't use int 21h
overdata:
       
        xor di, di
        mov ax, 0B800h
        mov es, ax
        mov si, offset msg0+LoadOfs
       mov ah, 41h; attribute byte
       cld;
msgloop:
        lodsb; loads al with a byte of data pted by ds:si
        or al, al
        jz nextmesg
        stosw; transfers the contents of al to mem location ptd by es:di
        jmp msgloop
       
nextmesg:xor di, di
        mov ax, 0B820h
        mov es, ax
        mov si, offset msg2+LoadOfs
       mov ah, 41h; attribute byte
       cld;
msg2loop:
        lodsb; loads al with a byte of data pted by ds:si
        or al, al
        jz Halt0
        stosw; transfers the contents of al to mem location ptd by es:di
        jmp msg2loop
;---------------------- done - halt

Halt0: hlt
jmp     Halt0

;---------------------- data area in code segment


Msg0    db      "We be bootin234!",0
Msg2    db      "Moving to protected mode!",0
;----------------------------------------------------------------------------------

        END     Start




Its showing the first screen prints 'A' using the bootloader code, which I again developed through this forum. After printing 'A' it hangs up. Its not even doing clrscr. I have checked this through debug and I found that AL becomes 0, so the zero flag is enabled.

Kindly help me in this rergard.

Zulfi.

dedndave

hi Zulfi
that code looks like it ought to work
maybe it is not being placed on the floppy at the right location
or, it is not the first entry in the root directory

as for setting up a data segment for protected mode
you have a long way to go to get there
i mean, you can get to protected mode and perhaps do a couple trivials
but, a lot of OS needs to be in place to make it useful
and - yes - once that is loaded, then you can be segmented
but at the time this preliminary code is running, there is no EXEC loader present
that is one of the things you will have to provide

before you worry about getting into protected mode,
you should worry about getting the basics up and running

error handlers - in case there is a disk or other error
disk I/O - in order to load the rest of the OS
EXEC loader so you can load rudimentary programs
keyboard and screen interface so you can use EXEC to run tests without writing a new boot disk 20 times a day

writing an OS is a major undertaking
it is best approached by experienced programmers who have a firm grasp of the hardware

zak100

Thanks for your guidance. What should I be doing to get rid of this error?

Zulfi.

sinsi

Give us all of your code in a zip attachment and your commands to write to a floppy, and we'll see what's going on.
Light travels faster than sound, that's why some people seem bright until you hear them.

FORTRANS

Hi,

   Just tried the posted code.  Once I remembered to hit
a key to go on, it worked.  Showed both messages.

Regards,

Steve

zak100

Hi,
I have tried again and its working now. Sorry for taking your time but thanks for your attention in this regard. Maybe I was using some wrong file last time.

Zulfi.