Hi All
I´m new in this forum and is my first post.
When I try compile a source code in MASM 9. I get following error message:
error A2214: GROUP directive not allowed with /coff option
snippet source code:
stackseg segment stack ;This placates the linker
stackseg ends
codeseg segment ;This assures the the code
codeseg ends ;segment will come first
dataseg segment ;The data segment comes last
old_int_offset dw ? ;address of old disk table
old_int_segment dw ?
new_disk_table db 0bh dup(00h) ;buffer for new disk table
sector db 09h ;sector number of 8192 sector
track db 06h ;track number
drive db 00h ;floppy drive number, A=0, B=1~
head db 00h ;side to read, usually 0
error_code dw ? ;diskette read error code
output_file db "8192byte.dat",00h
sector_buffer label byte ;offset to sector data buffer
dataseg ends
groupseg group codeseg,dataseg [move][/move] == ERROR IS HERE !!!!!!!!!!!!!!!!!
assume cs:groupseg
assume ds:groupseg
assume es:groupseg
codeseg segment
org 100h
main proc near
call save_vector ;save address of old disk table
push ds
pop es
push ds
lea di,groupseg:new_disk_table ;offset to new
mov si,groupseg:old_int_offset ;disk table buffer
mov ds,groupseg:old_int_segment
mov cx,000bh ;read old disk table info
rep movsb ;to new disk table buffer
pop ds
mov byte ptr groupseg:new_disk_table+3,06h ;change sector
mov al,groupseg:sector ;size to 8192
mov groupseg:new_disk_table+4,al ;last sector number
mov cl,al
mov ax,0
mov es,ax
lea ax,groupseg:new_disk_table
mov es:[0078h],ax ;point disk base table INT
mov ax,cs ;to new table location
mov es:[007ah],ax
push cs
pop es
mov bx,offset groupseg:sector_buffer ;setup for
mov ch,groupseg:track ;absolute
mov dl,groupseg:drive ;disk read
mov dh,groupseg:head
mov al,1
mov ah,2
int 13h
mov groupseg:error_code,ax ;save error code
call restore_vector ;restore pointer to old
;disk base table location
sti
xor dx,dx ;reset diskette drive
mov ah,0
int 13h
clc
call write_file
mov ah,4ch ;exit
int 21h
save_vector proc near
push ax
push es
mov ax,0
mov es,ax
mov ax,es:[0078h]
mov groupseg:old_int_offset,ax
mov ax,es:[007ah]
mov groupseg:old_int_segment,ax
pop es
pop ax
ret
save_vector endp
restore_vector proc near
push ax
push es
mov ax,0
mov es,ax
mov ax,groupseg:old_int_offset
mov es:[0078h],ax
mov ax,groupseg:old_int_segment
mov es:[007ah],ax
pop es
pop ax
ret
restore_vector endp
write_file proc near
sub cx,cx ;open output file
mov ax,3c00h ;and get handle
mov dx,offset groupseg:output_file
int 21h
xchg bx,ax ;move file handle to BX
mov ax,4000h
mov cx,2000h ;number of bytes to write
mov dx,offset groupseg:sector_buffer
int 21h
mov ax,3e00h ;close file
int 21h
ret
write_file endp
main endp
codeseg ends
end
Any suggest will wellcome !
Leonard@
I put your code between code tags (like this: [ code]...[ /code], without the spaces) to make it a little easier to read.
You need a 16-bit linker to link this code, see recent posts in this forum for the details.
Using ML 6.14 and the 16-bit linker, and after commenting the "
== ERROR IS HERE" line, I can assemble and link the code OK, but when executed it accesses the diskette drive, displays garbage, and does not create the data file.