English Amiga Board


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

 
 
Thread Tools
Old 13 April 2021, 23:10   #21
tolkien
AmigaMan
 
tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 760
Quote:
Originally Posted by gigabates View Post
Ok it should work now. I just pushed an update that activates on amiga.disassembly (amiga.assembly didn't seem to exist), but more importantly it also activates when you run either either of the commands: '68kcounter: Toggle counts' or '68kcounter: Count selection' on any file regardless of language. This is what it should have done all along but I'm a bit of a VS Code extension n00b!
Great mate! Now it works flawsely!
Thanks!
tolkien is offline  
Old 13 April 2021, 23:17   #22
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 387
The output is also not coping with my white space choices.

For example, it gets this all wrong except the last line:
Code:
	move.w	a6,(   a2)	
	move.w	d1,( 4,a2)	
	move.w	d3,( 8,a2)	
	move.w	d7,(12,a2)
It'll completely fail for this:
Code:
	lea	(   a6),a6	
	lea	( 2,a6),a6
Probably just needs a bunch of white space trimming. It's cool though!

Last edited by Jobbo; 14 April 2021 at 00:12.
Jobbo is offline  
Old 13 April 2021, 23:45   #23
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
Code:
	move.w	a6,(a2)	
	move.w	d1,4(a2)	
	move.w	d3,8(a2)	
	move.w	d7,12(a2)
fixed
DanScott is online now  
Old 13 April 2021, 23:48   #24
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by Jobbo View Post
That works but it would be nice to have the little icon to click.

amiga.assembly must be part of Bartman's extension.

I don't have any of the other ones you mentioned because I don't have those other extensions that are exclusively for assembly only.

What do the different colors for your output indicate?

Ok I've added amiga.assembly too now. I wasn't seeing it in the language list after installing the extension, I think because it conflicts with the one defined by prb28/vscode-amiga-assembly. I can see it's there in the manifest though.

The colours are meant to signify some kind of 'severity' level based on cycle thresholds that I've set. The idea is to have slow instructions stand out a bit more. The actual colors mapped to these come from your VS Code theme.

These are the levels as they stand:

cycles > 30: VHigh
cycles > 20: High
cycles >= 12: Med
else Low

These are pretty arbritrary and could probably do with tweaking a bit. It might be nice to allow these to be overridden in user settings.
gigabates is offline  
Old 14 April 2021, 00:19   #25
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 387
Quote:
Originally Posted by DanScott View Post
Code:
    move.w    a6,(a2)    
    move.w    d1,4(a2)    
    move.w    d3,8(a2)    
    move.w    d7,12(a2)
fixed

This must be why you're known as a legend.

And they say you should never meet your idols.
Jobbo is offline  
Old 14 April 2021, 00:25   #26
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by Jobbo View Post
The output is also not coping with my white space choices.

For example, it get this all wrong except the last line:
Code:
    move.w    a6,(   a2)    
    move.w    d1,( 4,a2)    
    move.w    d3,( 8,a2)    
    move.w    d7,(12,a2)
It'll completely fail for this:
Code:
    lea    (   a6),a6    
    lea    ( 2,a6),a6
Probably just needs a bunch of white space trimming. It's cool though!

I wasn't aware that this syntax was valid but it's really not a problem to support it. I have it working with all your examples. I'm just having trouble confirming exactly what should be considered valid as neither VASM nor ASMOne seem to support this syntax. Is it just whitespace directly inside the parentheses that's allowed?

Code:
  lea    (    2,a6   ),a6
how about this?

Code:
  lea    (    2  ,  a6   ),a6
or this?
Code:
  lea    2  (    a6   ),a6
gigabates is offline  
Old 14 April 2021, 00:33   #27
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 387
I'm not sure what is all valid.

I'm using GCC with .s files and also inline assembly.

It seems like most white space is valid but not when specifying the register size so not gaps with for example d0.w
Jobbo is offline  
Old 14 April 2021, 00:36   #28
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 387
The timing doesn't show up for inline assembly. If you want to really go crazy you might want to ignore any " markings because the inline assembly is always inside a string.

Sorry for all the complaints, I really like this plugin though and would like it to work as a replacement for copy/pasting things into Easy68k.

Incidentally the timings are sometimes different, are you rounding up some timings for Amiga. I forget the exact rules on that.
Jobbo is offline  
Old 14 April 2021, 01:11   #29
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by Jobbo View Post
The timing doesn't show up for inline assembly. If you want to really go crazy you might want to ignore any " markings because the inline assembly is always inside a string.

Sorry for all the complaints, I really like this plugin though and would like it to work as a replacement for copy/pasting things into Easy68k.

Incidentally the timings are sometimes different, are you rounding up some timings for Amiga. I forget the exact rules on that.
I've just pushed a new build with the whitespace support and hopefully some support for inline assembly. Let me know if this works for you. I'm not rounding anything. If you have any examples of inconsistencies that would be great.


Thanks for all the feedback. I'm just happy if it's useful to anyone!
gigabates is offline  
Old 14 April 2021, 05:09   #30
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 387
Here are some example that seem wrong based on the timings reported in EASy68k and on this website http://oldwww.nvg.ntnu.no/amiga/MC68...s/timmove.HTML

These AKAIK should be 14 cycles but are reported as 16 cycles.
Code:
move.b	(a2,a5.w),d1
move.w	(a3,d4.w),d3
move.w	(2,a3,d4.w),d4
This should be 18 cycles not 20 cycles
Code:
move.b	(a4,a6.w),(a0)+
I might be missing a crucial point about how cycles work on the Amiga so worth checking with others. But there are probably more potential errors, would be good to really double check all the times are correct.

It's also not handling white space all the time, like for this:
Code:
move.b	( a2,a5.w),d1
Also still not showing up the little icon to click on/off for .s files with Bartman's extension.

This could be a really useful tool if it can be made accurate.
Jobbo is offline  
Old 14 April 2021, 12:52   #31
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by Jobbo View Post
Here are some example that seem wrong based on the timings reported in EASy68k and on this website http://oldwww.nvg.ntnu.no/amiga/MC68...s/timmove.HTML

These AKAIK should be 14 cycles but are reported as 16 cycles.
Code:
move.b    (a2,a5.w),d1
move.w    (a3,d4.w),d3
move.w    (2,a3,d4.w),d4
This should be 18 cycles not 20 cycles
Code:
move.b    (a4,a6.w),(a0)+
I might be missing a crucial point about how cycles work on the Amiga so worth checking with others. But there are probably more potential errors, would be good to really double check all the times are correct.

It's also not handling white space all the time, like for this:
Code:
move.b    ( a2,a5.w),d1
Also still not showing up the little icon to click on/off for .s files with Bartman's extension.

This could be a really useful tool if it can be made accurate.
All of these should be addressed in the latest build. The main issue was that it didn't support the ".w" size extension on the index register and defaulted to interpreting that operand as an absolute address expression, hence the incorrect timing.
gigabates is offline  
Old 14 April 2021, 14:01   #32
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
very useful!
KONEY is offline  
Old 15 April 2021, 15:57   #33
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 387
I gave the latest a go and the cycle times are now further off for indexed addressing modes.

I don't have time to look into the details but you might want to take a careful look.

The little button isn't showing up for my .s files either.

Anyway, it's very promising and I hope you'll work through the issues.
Jobbo is offline  
Old 17 April 2021, 01:25   #34
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
asr.w d0,d1

only shows 6 cycles.. perhaps it needs to show potential min / max values
DanScott is online now  
Old 17 April 2021, 21:26   #35
oRBIT
Zone Friend
 
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
I don't see "toggle counts" for live viewing, what am I doing wrong then?
oRBIT is offline  
Old 17 April 2021, 21:46   #36
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by DanScott View Post
asr.w d0,d1

only shows 6 cycles.. perhaps it needs to show potential min / max values

Yeah I was considering what to do when the 'n' multiplier is unknown, either because it's from a register or a constant / expression that it's unable to parse. One option would be to just give the worst case, as is what the timing tables already do for other operations e.g. divide and multiply. It needs to at least indicate when this is the case though.


I agree that showing a range would be the ideal solution where applicable, and showing the calculation would be useful too. I'll have a go at implementing this.
gigabates is offline  
Old 17 April 2021, 22:03   #37
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by oRBIT View Post
I don't see "toggle counts" for live viewing, what am I doing wrong then?

The thing that currently triggers the toggle link is the language of the active document. I've associated it with the language identifiers provided by several 68k asm related extensions. I can keep adding the to list if there are others that I've missed. What language do you see in the bottom right of your editor when you have a source file open?


I'm also considering triggering it on file extension: *.s *.i, *.asm. I was concerned that this would activate it for non-68k source files, but it might be the most robust option.



For now you can toggle by triggering the '68kcounter: Toggle counts' command from the command palette (cmd-shift-p).
gigabates is offline  
Old 18 April 2021, 15:41   #38
oRBIT
Zone Friend
 
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
It says Amiga-Assembly. Now it works, sort of.
I attach a screenshot, shouldn't there be cycle-counting on every row (in my random code-test)?
Attached Thumbnails
Click image for larger version

Name:	asm.jpg
Views:	109
Size:	27.1 KB
ID:	71622  
oRBIT is offline  
Old 18 April 2021, 20:11   #39
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by oRBIT View Post
It says Amiga-Assembly. Now it works, sort of.
I attach a screenshot, shouldn't there be cycle-counting on every row (in my random code-test)?

The parser expects instruction lines to start with whitespace (at least one space or tab) or a label. In your screenshot it looks like you're only getting counts for the lines with labels as the other lines have a mnemonic on the first character of the line. I didn't think this was valid—VASM doesn't seem to support it, but if it is allowed for other assemblers I can add support.
gigabates is offline  
Old 18 April 2021, 20:19   #40
oRBIT
Zone Friend
 
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 48
Posts: 339
Ah ok, you're right!
oRBIT 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
horiz. size & vert. size greyed out in some configurations honx support.WinUAE 3 15 August 2020 21:14
ASM: Asm-ONE or AsmPro - how to set a Hello amiga coders, I hope it is ok to hijack ? Fireball Coders. Asm / Hardware 2 24 April 2020 21:16
Hex2 - my little calculator ALB42 News 0 11 November 2018 11:46
Amiga calculator cla Coders. Releases 35 30 December 2017 15:00
Speccy on Ti-89 calculator Fred the Fop Retrogaming General Discussion 3 27 January 2007 02:30

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 15:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.17223 seconds with 16 queries