flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly 12 Apr 2011, 17:28
In the last part, better use this:
Code: rb 512 - 2 + $$ - $ dw 0AA55h And as for receiving error code zero, after calling INT 13 you are using POPA which restores the previous AL value (zero). So this is not a compiler problem, I'll move this thread to OS Construction. [edit]Sorry, I made a mistake, error code is returned in AH so you should see 48H again. It seems that when you mention code 00H you mean something else. But still not a compiler problem as disassembling the code gives exactly what you compiled: Code: seg000:7C00 ; seg000:7C00 ; +-------------------------------------------------------------------------+ seg000:7C00 ; ¦ This file is generated by The Interactive Disassembler (IDA) ¦ seg000:7C00 ; ¦ Copyright (c) 2006 by DataRescue sa/nv, <ida@datarescue.com> ¦ seg000:7C00 ; ¦ Licensed to: Freeware version ¦ seg000:7C00 ; +-------------------------------------------------------------------------+ seg000:7C00 ; seg000:7C00 ; --------------------------------------------------------------------------- seg000:7C00 ; File Name : C:\Documents and Settings\Hernan\Escritorio\test.bin seg000:7C00 ; Format : Binary file seg000:7C00 ; Base Address: 0000h Range: 7C00h - 7E00h Loaded length: 0200h seg000:7C00 seg000:7C00 .686p seg000:7C00 .mmx seg000:7C00 .model flat seg000:7C00 seg000:7C00 ; --------------------------------------------------------------------------- seg000:7C00 seg000:7C00 ; Segment type: Pure code seg000:7C00 seg000 segment byte public 'CODE' use16 seg000:7C00 assume cs:seg000 seg000:7C00 ;org 7C00h seg000:7C00 assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing seg000:7C00 jmp short loc_7C14 seg000:7C00 ; --------------------------------------------------------------------------- seg000:7C02 db 10h seg000:7C03 db 0 seg000:7C04 db 1 seg000:7C05 db 0 seg000:7C06 db 0 seg000:7C07 db 0 seg000:7C08 db 10h seg000:7C09 db 8 seg000:7C0A db 1 seg000:7C0B db 0 seg000:7C0C db 0 seg000:7C0D db 0 seg000:7C0E db 0 seg000:7C0F db 0 seg000:7C10 db 0 seg000:7C11 db 0 seg000:7C12 db 80h ; Ç seg000:7C13 db 1 seg000:7C14 ; --------------------------------------------------------------------------- seg000:7C14 seg000:7C14 loc_7C14: ; CODE XREF: seg000:7C00j seg000:7C14 mov bp, 7C00h seg000:7C17 mov ah, 42h ; 'B' seg000:7C19 xor al, al seg000:7C1B mov dl, 80h ; 'Ç' seg000:7C1D mov si, cs seg000:7C1F mov ds, si seg000:7C21 mov si, 7C02h seg000:7C24 mov cl, cs:[bp+14h] seg000:7C28 seg000:7C28 loc_7C28: ; CODE XREF: seg000:7C35j seg000:7C28 pusha seg000:7C29 int 13h ; DISK - seg000:7C2B popa seg000:7C2C jb short loc_7C3A seg000:7C2E add word ptr [si+6], 20h ; ' ' seg000:7C32 inc word ptr [si+8] seg000:7C35 loop loc_7C28 seg000:7C37 seg000:7C37 loc_7C37: ; CODE XREF: seg000:7C38j seg000:7C37 nop seg000:7C38 jmp short loc_7C37 seg000:7C3A ; --------------------------------------------------------------------------- seg000:7C3A seg000:7C3A loc_7C3A: ; CODE XREF: seg000:7C2Cj seg000:7C3A ; seg000:7C3Bj seg000:7C3A nop seg000:7C3B jmp short loc_7C3A seg000:7C3B ; --------------------------------------------------------------------------- seg000:7C3D db 1C1h dup(0), 55h, 0AAh seg000:7C3D seg000 ends seg000:7C3D seg000:7C3D seg000:7C3D end |
|||
![]() |
|
LocoDelAssembly 12 Apr 2011, 17:58
I see you miscalculated the offsets of two variables, DAT_Disk_Num is at bp+12h and DAT_Num_Of_Sects at bp+13h. I think you have some other offsets wrong as well and perhaps you are not incrementing the buffer address correctly. Perhaps you should use plain labels first and then move to use BP-relative stuff (for which I recommend you to learn the "virtual" directive and/or struc)
|
|||
![]() |
|
BOTOKILLER 13 Apr 2011, 11:35
thank you, I changed address, I changed address of variable and it works
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.