English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 09 June 2019, 14:50   #1
krustur
Registered User

 
Join Date: Nov 2018
Location: Örebro
Posts: 2
vasm chip section and a.out output module

Hi all

When using vasm (vasmm68k_mot) to assemble a source with "data section" using the a.out output module, the <mem_type> attributes are ignored. According to the vasm manual this is by design, quote "The memory attributes are currently only used in the hunk-format output module.". Here is the link to the quote: http://sun.hasenbraten.de/vasm/relea...-Syntax-Module

However when using gcc (m68k-amigaos-as) to assemble a source with ".datachip" it is possible to place data in chip memory.

I've verified the above using "m68k-amigaos-objdump -x", vasm places the data in .data while as places it in .data_chip. I also managed to move .data sections from the vasm generated a.out files into .data_chip section, and verified that the data is correctly placed in chip memory when running an exe linked with gcc from modified vasm a.out-files.

vasmm68k_mot version is 1.8e.
gcc (incl. vasm) is downloaded from http://franke.ms/download/setup-amiga-gcc.exe

Bottom line I guess my question is this. Are there any alternative (better?) solutions for mixing gcc (build for both Win and Amiga) and vasm (i want to use the motorola syntax)?

This bat-file can be used to test:
t.bat
Code:
@echo off

vasmm68k_mot -Faout -o vasm.o vasm.s
m68k-amigaos-as -o as.o as.s
m68k-amigaos-objcopy -I amiga --rename-section .data=.data_chip vasm.o vasm_fixed.o

@echo.
@echo VASM.O
@echo Error: some_chip_data symbol is in .data section
@echo ================================================
m68k-amigaos-objdump --section-headers --syms vasm.o

@echo.
@echo AS.O
@echo OK: some_chip_data symbol is in .data_chip section
@echo ==================================================
m68k-amigaos-objdump --section-headers --syms as.o

@echo.
@echo VASM_FIXED.O
@echo OK: some_chip_data symbol is in .data_chip section
@echo ==================================================
m68k-amigaos-objdump --section-headers --syms vasm_fixed.o
vasm.s
Code:
some_code_chunk:
        rts

        section    test_d_c,data,chip
        public    some_chip_data
some_chip_data: 
        dc.w       $ffff,$fffe
        dc.w       $ffff,$fffe
as.s
Code:
        .globl some_code_chunk
some_code_chunk:
        rts

.datachip
        .globl some_chip_data
some_chip_data:         
        .word       0xffff,0xfffe
        .word       0xffff,0xfffe
krustur is offline  
Old 09 June 2019, 18:23   #2
hitchhikr
Registered User

 
Join Date: Jun 2008
Location: somewhere
Posts: 401
Probably not.

i'm using:

Code:
section ".data_chip",data
in vasm and the linker just generates chipmem data.
hitchhikr is offline  
Old 09 June 2019, 18:27   #3
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 139
Also try -Fhunk as output format for vasm. Bebbo’s gcc produces and links objects in hunk format.
pipper is offline  
Old 09 June 2019, 19:11   #4
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,425
Quote:
Originally Posted by hitchhikr View Post
Code:
section ".data_chip",data
in vasm and the linker just generates chipmem data.
What is "the linker"? And the output file format is a.out?

I wonder how this works, as you have no section names in a.out format. a.out only knows three sections: .text, .data and .bss.
phx is offline  
Old 09 June 2019, 19:42   #5
krustur
Registered User

 
Join Date: Nov 2018
Location: Örebro
Posts: 2
Quote:
Originally Posted by hitchhikr View Post
Probably not.

i'm using:

Code:
section ".data_chip",data
in vasm and the linker just generates chipmem data.
Quote:
Originally Posted by pipper View Post
Also try -Fhunk as output format for vasm. Bebbo’s gcc produces and links objects in hunk format.
Oh, I didn't realize Bebbo's gcc could use the hunk-format.

-Fhunk in combination with naming the section ".data_chip" seems to do the trick!

Thanks alot for the help!
krustur is offline  
Old 09 June 2019, 20:56   #6
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,425
Quote:
Originally Posted by krustur View Post
-Fhunk in combination with naming the section ".data_chip" seems to do the trick!
When "the linker" claims to support hunk format then it should also work with a chipmem memory-type attribute (like section anyname,data,chip). Otherwise it doesn't completely support hunk-format.
phx is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with VASM - file is not an object module on A500, ok on A1200??? mcgeezer Coders. Asm / Hardware 5 09 July 2018 13:04
Devpac: Data section in Chip-Mem roger_bratseth Coders. Asm / Hardware 6 14 May 2018 10:06
50 Hz output with Intel HD chip ? (NUC) torturedutopian support.FS-UAE 18 15 December 2017 22:25
SECTION statement and the CHIP/FAST attribute Apollo Coders. Asm / Hardware 3 15 June 2013 18:18
Chip memory, VGA output, IPF writing Hideki support.Hardware 10 09 January 2007 15:18

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


All times are GMT +2. The time now is 12:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07341 seconds with 15 queries