Today, 13:22 | #1 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 200
|
Beginner question: How to use an Include file for own functions (sub routines)
Suppose I have an assembler program that consists of the file main.asm and works. In this program there is a call
Code:
bsr test_func Code:
test_func moveq #111,d0 ; Imagine something useful here rts Code:
include my_functions.asm I come from C, and there includes are included at the beginning of the file and the functions are called further down. How is this properly done in assembler; are the own helper files included below the main code to avoid the entry point problem? |
Today, 14:46 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,077
|
Don't include at the beggining, or add "bra your_main_function" before the include statement (that bra will become the first instruction of your program).
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Include file path priorities for assemblers | phx | Coders. General | 20 | 07 July 2020 16:30 |
C Include file with hardware registers | sparhawk | Coders. General | 4 | 20 November 2019 20:59 |
Beginner question about WHLoad (2 different methods?) | c0dehunter | support.Apps | 17 | 13 January 2019 20:29 |
NDK 3.1 Include file problem. | Thorham | Coders. General | 4 | 04 February 2011 20:58 |
beginner question - how to use USB joystick/pad with WINUAE??! | extentofmysin | support.WinUAE | 7 | 23 August 2006 18:56 |
|
|