flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Newby floppy IO |
Author |
|
Silux 15 Jun 2007, 12:28
Okay well my problem kind of shifted just a bit. Data writes fine, and it may even read fine. I dont even really know how to explain it, but say i write to (ES:BX) 0050:0000, then i read from the same spot, then i want to store whatever is at that point in memory in SI to print out. I cannot seem to read the data that is written, or atleast not determine the memory address of it so SI can access it.
|
|||
15 Jun 2007, 12:28 |
|
LocoDelAssembly 15 Jun 2007, 13:26
I think it would be better if you paste some code
|
|||
15 Jun 2007, 13:26 |
|
Dex4u 15 Jun 2007, 18:13
Try this:
Code: ;**********************************; ; Simple Floppy dump demo ; ; Assemble like this: ; ; c:\fasm Fddump.asm Fddump.com ; ; ; ; By Dex 16/06/07 ; ;**********************************;org 100huse16start:mov si,Msg1 ; point to mesagecall Print ; call the print functionxor ax,ax ; wait for a key pressint 0x16mov si,Msg2 ; point to mesagecall Print ; call the print functioncall ReadSect ; Read Boot Sectorjc Errorcall PrintBuf ; Print the Bufferxor ax,ax ; wait for a key pressint 0x16ret ; CHANGE this for jmp $ when booting;====================================================;; Error. ;;====================================================;Error:mov si,ErrMsg ; point to mesagecall Print ; call the print functionxor ax,ax ; wait for a key pressint 0x16ret ; CHANGE this for jmp $ when booting;====================================================;; ReadSect. ;;====================================================;ReadSect:mov bx,Buf ; NOTE: it would be best to do 3 retry on error.mov ah,0x02 ; Read drive, write = 0x03mov al,1 ; Number of Sectors to readmov ch,0 ; Track Numbermov cl,1 ; Sector Numbermov dh,0 ; Head Numbermov dl,0 ; Drive Number, 0 = A drive, 0x80 = C driveint 0x13ret ;====================================================;; PrintBuf. ;;====================================================;PrintBuf: mov cx,512@@:mov ah,0x0emov al,[es:bx]int 0x10inc bxloop @bret;====================================================;; Print. ;;====================================================; Print:mov ah,0Eh ; Request displayagain1:lodsb ; load a byte into AL from DS:SIor al,al ; Or ALjz done1 ; Jump 0, to label done1int 10h ; Call interrupt servicejmp again1 ; Jump to label again1done1:ret ; Return ;----------------------------------------------------; ; Data ; ;----------------------------------------------------;Msg1: db 'Press any Key to Dump Boot sector....',13,10,0Msg2: db 'Reading from Drive A:',13,10,0ErrMsg: db 'Error Reading Floppy Drive ',13,10,0Buf: rb 512 Note: you can boot the com file with http://alexfru.chat.ru/epm.html#bootprog Also when it dumps the sector, it will mosty look like garbage. |
|||
15 Jun 2007, 18:13 |
|
Hayden 16 Jun 2007, 16:20
0050h:0000h is not the best address to read/write to... your address should be at least 0600h:0000h.
_________________ New User.. Hayden McKay. |
|||
16 Jun 2007, 16:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.