Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 8th, 2012, 12:14 AM
Errigour Errigour is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 Errigour User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 29 sec
Reputation 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

Reply With Quote
  #2  
Old May 8th, 2012, 08:34 AM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 50 m 16 sec
Reputation Power: 928
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);

Reply With Quote
  #3  
Old May 9th, 2012, 09:34 PM
Errigour Errigour is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 Errigour User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 29 sec
Reputation 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

Reply With Quote
  #4  
Old May 10th, 2012, 07:05 AM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 50 m 16 sec
Reputation Power: 928
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.

Reply With Quote
  #5  
Old May 10th, 2012, 07:58 AM
salem's Avatar
salem salem is offline
Contributed User
Click here for more information
 
Join Date: Jun 2005
Posts: 3,831 salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 2 Months 3 Weeks 2 Days 13 h 12 m 41 sec
Reputation Power: 1774
> 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

Reply With Quote
  #6  
Old May 10th, 2012, 04:54 PM
Errigour Errigour is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 Errigour User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 29 sec
Reputation 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.

Reply With Quote
  #7  
Old May 10th, 2012, 11:41 PM
salem's Avatar
salem salem is offline
Contributed User
Click here for more information
 
Join Date: Jun 2005
Posts: 3,831 salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 2 Months 3 Weeks 2 Days 13 h 12 m 41 sec
Reputation Power: 1774
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.

Reply With Quote
  #8  
Old July 26th, 2012, 01:28 PM
johnfound johnfound is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 2 johnfound User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 54 m 3 sec
Reputation Power: 0
Quote:
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$'


Quote:
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Assembly langauge 10h and 33h arent working

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap