Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Apr 10th, 2006, 1:30 PM   #1
Roku
Newbie
 
Join Date: Apr 2006
Posts: 1
Rep Power: 0 Roku is on a distinguished road
Writing to a file from a TSR (MASM16)

Hi,

I am having a hard time writing to a file from a TSR routine. The routine is supposed to write a line of text to a file when the F9 key is pressed. Instead it just prints the line to the screen. I am only posting the parts of the routine I having problems with. I thikn I setup the IVT table correctly.

Thanks,
Kevin

; --------------------------------------------------
; Example layout for interrupt handler.

.model tiny
.486
text segment public 'CODE'

; Note, must put start of program at 100 hex,

org 100h
start:
jmp init

; note, required to "start" just past the "org",
; so jump, not call, since we will not return.

myint proc far
pushf
call CS:oldn

push ax
push bx
push cx
push dx
push ds
push es

mov ax,cs
mov ds,ax

; Check for F9 down
cmp ax, 43h
je no_err

; Check for F9 up, file write
cmp ax, 0c3h
je filewrite

; If we see any other key, just beep
jmp err

; write the stars line to the file
filewrite:
mov ah, 40h
mov bx, es:fhand
mov cx, 82
lea dx, es:stars
int 21h
jc err

; Commit the line
mov ah, 68h
mov bx, es:fhand
int 21h
jmp no_err

Last edited by Roku; Apr 10th, 2006 at 1:43 PM. Reason: Cleaing this up to conform with the forum rules (I am a newbie)
Roku is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:32 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC