#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Assembly langauge 10h and 33h arent working


    I'm using the flat assembler writer with windows xp and I have these two functions that don't seem to position the cursor but wikipedia and a book I'm reading says they position the cursor. I was hoping someone could tell me why and maybe show me an example of a low level program that will position the cursor.
    Code:
    mov AH, 02h
    mov BH, 00h
    mov DH, 10d
    mov DL, 10d
    int 10h
    Code:
    mov AX, 0004h
    mov CX, 10d
    mov DX, 10d
    int 33h
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    INT 10h/AH=02h works for me. Can you show a short program of how you're using it & explain what you expect to happen and how the program's actual behavior differs?

    INT 33h calls deal with the mouse. I don't know how well they'll operate on a modern system.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    3
    Rep Power
    0
    both of those are how I run the program with the flat assembler for windows. each are different programs and neither make exe files. They make .bin files when I compile them. I'll post the exact code for int 10h again it's exactly what I posted. Also I am a newb at assembly.
    Code:
    mov AH, 02h
    mov BH, 00h
    mov DH, 10d
    mov DL, 10d
    int 10h
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    The code snippet you posted is perfectly fine by itself, so the problem must be in the code that uses it, or in your expectations of what happens. So for me to understand your program I need to see complete code and know how your expectations differ from what the code actually does.

    This website has tips for creating such an example. For example, here's a short program that writes text around the middle of the screen.

    Code:
    .data
        text db 'This is the middle of the screen$'
    
    .code
    
    main proc
        mov ah, 02h
        mov bh, 00h
        mov dh, 0bh
        mov dl, 1Ah
        int 10h
    
        mov ah, 09h
        lea dx, text
        int 21h
    
        mov ah, 4ch
        mov al, 00h
        int 21h
    main endp
    
    end main
    If you're not producing executables, how are you running the programs? I have not used the Flat Assembler program you mention, but from its manual it looks like you would use it to create object modules & link them into an executable like any other assembler. If you're using some type of interpreter or emulator to execute your code you need to make sure it supports the BIOS/DOS interrupts you're using.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  8. #5
  9. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,378
    Rep Power
    1871
    > both of those are how I run the program with the flat assembler for windows
    You need to be creating a segmented 16-bit DOS program, not a flat 32-bit windows program.

    You need to make it a 16-bit executable so that windows knows to load DOS-VM to run your program in - where 16-bit interrupts like int10 actually mean something.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    3
    Rep Power
    0
    Alright the code I posted was exactly what I used and it doesn't work on the flat assembler. Your code doesn't work when I use it because of the .data string the main proc string the main endp string the .code string and the one that really sticks out to me is the lea string doesn't even compile.

    I wanna ask Salem how to make a .bin file into an executable with fasm but I'm gonna do some research for that. That might be the reason 33h isn't working. Heh when I compile the program I get a bin file. Duh that's not executable. I guess My question is if anyone knows how to make exe files out of bin files.
  12. #7
  13. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,378
    Rep Power
    1871
    According to the download page you need to download the DOS version of the program to generate DOS compatible executables.

    They also have a message board which would have been a good place to ask, if you haven't done so already.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by salem
    According to the download page you need to download the DOS version of the program to generate DOS compatible executables.
    No, this is not true. All versions of FASM has the same features. They only run on different operating systems. The above code snippets are simply not in FASM syntax.
    The proper code is:
    Code:
        use16
        org 100h
    
        mov ah, 02h
        mov bh, 00h
        mov dh, 0bh
        mov dl, 1Ah
        int 10h
    
        mov ah, 09h
        lea dx, [text]   ; or simply "mov dx, text"
        int 21h
    
        mov ah, 4ch
        mov al, 00h
        int 21h
    
    text db 'This is the middle of the screen$'
    Originally Posted by salem
    They also have a message board which would have been a good place to ask, if you haven't done so already.
    The flat assembler forum is really great place to ask questions about assembly programming for Windows, Linux and any other OS.

IMN logo majestic logo threadwatch logo seochat tools logo