A problem with MASM!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
VRassouli
Posts: 7
Joined: Mon May 12, 2008 5:09 am

A problem with MASM!

Post by VRassouli »

Hello every body!
as i'm not really good in assembly language, the problem may be easy to solve, but hard for me:-p
there is a piece of code which i found from a tutorial, it works well on NASM but does not in MASM!
the code is for handling IRQs! in fact, its called on an interrupt

Code: Select all

    pusha

    mov ax, ds
    push eax 

    mov ax, 0x10 ; MASM GENERATES AN ERROR FOR THIS LINE:
                         ; error A2206:missing operator in expression
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax

    isr_handler

    pop ebx
    mov ds, bx
    mov es, bx
    mov fs, bx
    mov gs, bx

    popa
    add esp, 8
    sti
    iret 
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: A problem with MASM!

Post by Combuster »

Try:
mov ax, 010h
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
VRassouli
Posts: 7
Joined: Mon May 12, 2008 5:09 am

Re: A problem with MASM!

Post by VRassouli »

YEEEEES! that was right! it worked:) Thanks Combuster:)
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: A problem with MASM!

Post by Troy Martin »

Hey, just so you know, you should use NASM instead of MASM, since developing OSes with MASM is strictly forbidden in the EULA.

Just letting you know :)
Last edited by Troy Martin on Tue Sep 09, 2008 8:25 pm, edited 1 time in total.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: A problem with MASM!

Post by AJ »

Of course, you mean with MASM :)
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: A problem with MASM!

Post by Troy Martin »

Whoops... Typo...
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply