flat assembler
Message board for the users of flat assembler.
Index
> Main > listing file, line numbers |
Author |
|
revolution 29 Apr 2010, 10:30
In the download file there is a folder called "TOOLS", in there is "LISTING.INC". With that you can output listing files.
|
|||
29 Apr 2010, 10:30 |
|
Kicer 29 Apr 2010, 11:05
revolution wrote: In the download file there is a folder called "TOOLS", in there is "LISTING.INC". With that you can output listing files. yes yes i know. i'll try to explain my problem more exactly: i've asm source, something like this: Code: include "includes/symulator.finc" use16 org 0x7c00 mov bx,cs mov ds,bx lgdt [gdt_header] this is only a simple program, my main project is to write a 386 simulator with debuger etc. In my simulator I'd like to highlight the source line with given address (with instruction being actually executed). So in given example i wanna highlight mov bx,cs when my 386 cpu is executing instruction from address 0x7c00. So i used listing tool, but it generated file that contains whole included file ("includes/symulator.finc") so i can't simply guess where is end of included file and where code, that i'm interested in, starts. |
|||
29 Apr 2010, 11:05 |
|
revolution 29 Apr 2010, 11:15
|
|||
29 Apr 2010, 11:15 |
|
Kicer 29 Apr 2010, 11:28
heh i seen it but i thought there will some solution like:
"use patch xxx for listing.asm. That add extra option -x which causes that include files won't be attached to output file" thx anyway |
|||
29 Apr 2010, 11:28 |
|
revolution 29 Apr 2010, 11:39
No one else has asked about it before.
It looks like you will need to patch the listing.inc file yourself. Post the changes needed here, so others that need the same can benefit also. |
|||
29 Apr 2010, 11:39 |
|
Tomasz Grysztar 29 Apr 2010, 13:30
A very quick-and-dirty patch to show you the direction. Find the place in LISTING.INC that looks like this:
Code: write_file_offset: call write_hex_dword mov ax,': ' stosw call list_address call list_code jmp code_listing_ok and add this piece of code just before the "call list_address" line: Code: test byte [esi+7],80h jnz @f mov al,'{' stosb mov edx,[esi+8] call write_hex_dword mov ax,'} ' stosw @@: It will break the precious alignment of the listing, but should be a tiny little bit helpful - it insert the line numbers written in hex (and enclosed with braces) just before the code bytes listing. |
|||
29 Apr 2010, 13:30 |
|
Kicer 29 Apr 2010, 19:25
thx, i'll test it
|
|||
29 Apr 2010, 19:25 |
|
Kicer 30 Apr 2010, 14:35
hmmm it generates something weird:
Code: use16 org 0x7c00 00000000: {00000034} [0000000000007C00] 8C CB mov bx,cs 00000002: {0000003F} [0000000000007C02] 8E DB mov ds,bx i'll try to analyze it in some free time |
|||
30 Apr 2010, 14:35 |
|
baldr 30 Apr 2010, 19:32
Kicer,
Those numbers are offsets into source file at which corresponding line starts. If you need line numbers, use [esi+4] instead of [esi+8]. |
|||
30 Apr 2010, 19:32 |
|
Kicer 07 Aug 2010, 07:16
Tomasz Grysztar wrote: A very quick-and-dirty patch to show you the direction. I'm having problem with this patch today , i guess it's related to my already solved problems: http://board.flatassembler.net/topic.php?t=11789 if i apply your patch and use -a argument i got message that listing was interrupted and the file is cutted on first instruction: Code: 00000000: {00000002} [0000000000007C00] 8C CB gdb says: Code: (gdb) run -a test2.fas test2.lst Starting program: ./listing -a test2.fas test2.lst Program received signal SIGABRT, Aborted. 0xffffe430 in __kernel_vsyscall () (gdb) it used to work perfectly. something wrong with linking libc version of listing ? in windows (the same fasm version and the same patch) it's working |
|||
07 Aug 2010, 07:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.