flat assembler
Message board for the users of flat assembler.

Index > DOS > Help making first DOS app

Author
Thread Post new topic Reply to topic
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 24 Feb 2009, 23:13
I am having some trouble making my first DOS app can anyone help?
Code:
use16
org 0x100
start:
        mov   di,one
        call  Cls
        mov   di,two
        call  Cls
        mov   di,three
        call  Cls
        mov   di,four
        call  Cls
jmp start

one       db ' / ',0
two       db ' | ',0
three     db '---',0
four      db ' \ ',0
Cls:
        mov   ax,0x0600
        mov   bh,0x07
        mov   cx,0x0000
        mov   dx,0x184f
        int   10h
        ret                    
      

I am used to OS coding so that might explain why I suck at DOS
Programing, so any way I am compiling it to a .com file.

_________________
Want hosting for free for your asm project? You can PM me. (*.fasm4u.net)
Post 24 Feb 2009, 23:13
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 24 Feb 2009, 23:56
Coddy41 wrote:
trouble making my first DOS app can anyone help?


Maybe.

> call Cls

What is it supposed to do ???

> jmp start

Dead loop.

> mov ax,0x0600

Clear screen ? wow What about DI ???

> I am used to OS coding so that might explain why I suck at DOS
Programing

Your code doesn't use DOS at all.

> so any way I am compiling it to a .com file.

format binary as "COM" Idea

> inside the place that rains electrisity

Your primary BUG, should be electricity

> Stop 0x0000000A or IRQL_NOT_LESS_OR_EQUAL

Then it must be bigger ... or did I miss something ? Laughing


Last edited by DOS386 on 25 Feb 2009, 00:02; edited 1 time in total
Post 24 Feb 2009, 23:56
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 25 Feb 2009, 00:01
I have no Idea, It looks really bugged up now. I think I will stick to OSes.
Post 25 Feb 2009, 00:01
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 25 Feb 2009, 00:16
What do you mean by OS coding? Confused

Not very well done but this one will print the spinning thing indefinitely:
Code:
use16
org 0x100
        call  Cls

start:
        mov   bp,one
        call  print

        mov   bp,two
        call  print

        mov   bp,three
        call  print

        mov   bp,four
        call  print
jmp start

one       db ' / ',0
two       db ' | ',0
three     db '---',0
four      db ' \ ',0
Cls:
        mov   ax,0x0600
        mov   bh,0x07
        mov   cx,0x0000
        mov   dx,0x184f
        int   10h
        ret

print:
        mov   ax, $1300
        mov   bx, 7 ; [7:7] = blink bit; [6:4] = background color; [3:0] = font color
        mov   cx, 3 ; string size
        xor   dx, dx ; col and row position
        int   $10
        ret    
Post 25 Feb 2009, 00:16
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 25 Feb 2009, 01:42
It works alot better now, thank you Smile LocoDelAssembly Very Happy I forgot all about the print function, witch is the most important function in it, or close to Confused
Post 25 Feb 2009, 01:42
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 25 Feb 2009, 03:09
Indeed, print is the heart of debugging, without print you are lost.
Post 25 Feb 2009, 03:09
View user's profile Send private message Visit poster's website Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 25 Feb 2009, 16:47
OK, um I re-edited it, It runs much smoother now.

Code:
use16
org 0x100
        call  Cls

start:
        mov   bp,one
        call  print

        mov   bp,two
        call  print

        mov   bp,three
        call  print

        mov   bp,four
        call  print
 
        mov  bp,five
        call print
        
        mov  bp,six
        call print

        mov  bp,seven
        call  print
   
        mov  bp,eight
        call   print

jmp start

one       db ' | ',0
two       db ' / ',0
three     db '---',0
four      db ' \ ',0
five      db ' | ',0
six       db ' / ',0
seven    db '---',0
eight     db ' \ ',0
   

Cls:
        mov   ax,0x0600
        mov   bh,0x07
        mov   cx,0x0000
        mov   dx,0x184f
        int   10h
        ret

print:
        mov   ax, $1300
        mov   bx, 7 ; [7:7] = blink bit; [6:4] = background color; [3:0] = font color
        mov   cx, 3 ; string size
        xor   dx, dx ; col and row position
        int   $10
        ret    
    

It still has a pause before starting the loop over. But I will fix it sometime Smile
Thaks LocoDelAssembly. And thanks for the reminder revolution.

_________________
Want hosting for free for your asm project? You can PM me. (*.fasm4u.net)
Post 25 Feb 2009, 16:47
View user's profile Send private message Visit poster's website Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 20 Apr 2009, 17:52
DOS386 wrote:
> inside the place that rains electrisity

Your primary BUG, should be electricity

> Stop 0x0000000A or IRQL_NOT_LESS_OR_EQUAL

Then it must be bigger ... or did I miss something ? Laughing

Oh, I get that part now, my sig Laughing

_________________
Want hosting for free for your asm project? You can PM me. (*.fasm4u.net)
Post 20 Apr 2009, 17:52
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.