04 July 2017, 20:49 | #1 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Basic/System include files
I'm just getting my feet wet in assembler programming, and this is my 'goodbye world' example:
Code:
mainloop: btst #6,$bfe001 ; u wot m8?! test what where now? bne mainloop rts Code:
btst io_bit_lmb,cia_a Can somebody please point me in the right direction? TIA! |
04 July 2017, 21:38 | #2 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
From my point of view I prefer raw version, because I write down this very few lines so many times (as many as sys 49152 on c64 ). And that was also my very first time with amiga asm so is not possible to forget this.
Of course if you have ndk then you can use names from hardware/cia.i Code:
btst #CIAB_GAMEPORT0,_ciaa+ciapra |
04 July 2017, 22:20 | #3 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Excellent pointer, thank you! I must have come across this file, though, having searched the ndk directory for files containing bfe001. I must have been put off by it only appearing in the comments, at first sight.
So how/where does _ciaa get its value? Is it here: Code:
XREF _ciaa |
05 July 2017, 09:40 | #4 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
There are at least two ways to obtain _ciaa. First you can do it in your source code
Code:
_ciaa equ $bfe001 ; or just _ciaa = $bfe001 Code:
xref _ciaa ; _ciaa is defined somewhere else lmb: btst #6,_ciaa bne.b lmb rts Code:
vasm -Fvobj lmb.s -o lmb.o Code:
vlink -bamigahunk -Bstatic -s -LC:/vbcc/targets/m68k-amigaos/lib -lamiga -o lmb lmb.o xdef and xref are used to share symbols/labels between objects. So if you use xref label/symbol then somewhere must be xdef label/symbol. For example Code:
;file1.s xdef _ciaa _ciaa = $bfe001 Code:
;file2.s xref _ciaa lmb: btst #6,_ciaa Last edited by Asman; 05 July 2017 at 09:52. Reason: adding short info about xdef/xref |
05 July 2017, 11:51 | #5 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Thank you, Asman, for taking the time to explain this, I really appreciate this.
I'm still using AsmPro on real hardware, ATM. Do you think I can do this linking to amiga lib too? I'll be having my holidays soon, so hopefully I'll be able to check out that cross compilation route soon, as it seems a lot easier to work like that.. |
05 July 2017, 12:26 | #6 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
Yes you can use AsmPro v1.17 and WL command or just choose from menu WriteLink. And then use linker.
I checked also Asm-One v1.49 RC2 and WL is broken. Barfly is ok . |
05 July 2017, 12:53 | #7 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Thanks, I'll check that out!
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MACRO68 & include files | Shadowfire | request.Apps | 11 | 17 February 2023 23:27 |
Edit system-configuration files | VresiBerba | New to Emulation or Amiga scene | 7 | 12 April 2017 15:38 |
How does one create Blitz Basic compatible anim files? | earok | Coders. Blitz Basic | 6 | 06 February 2017 16:54 |
[bug] FS-UAE-Launcher fails with files that include special characters | luttztfz | support.FS-UAE | 1 | 08 December 2013 21:45 |
Include files needed | Galahad/FLT | support.Apps | 2 | 03 September 2007 20:11 |
|
|