It is currently Tue Jul 16, 2019 5:31 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Jul 02, 2019 10:21 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 956
POWER9 was released 2017 and POWER10 is coming next year. Someone forgot to tell it it's dead :P


Top
 Profile  
 
PostPosted: Tue Jul 02, 2019 10:23 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21505
Location: NE Indiana, USA (NTSC)
Is "defunct in devices intended for home and small business use" more honest?

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Tue Jul 02, 2019 10:27 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 956
My Blackbird begs to differ.


Top
 Profile  
 
PostPosted: Wed Jul 03, 2019 4:40 pm 
Offline
Formerly Espozo
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3501
Location: Richmond, Virginia
I finally found (or made, rather) a way to find the size of an argument in NASM:

Code:
%macro find_argument_size 1
  %defstr argument %1
 
  %substr test argument 1,4
  %if test ==   'byte'
  %define size  'byte'
  %elif test == 'word'
  %define size  'word'
  %else
    %substr test argument 1,5
    %if test ==   'dword'
    %define size  'dword'
    %elif test == 'qword'
    %define size  'qword'
 
 
    %else
      %substr test argument 1,2
      %if test == 'si' || test == 'di' || test == 'bp' || test == 'sp'
        %substr test argument 3,1
        %if test ==  'l'
        %define size 'byte'
        %else
        %define size 'word'
        %endif
 
 
      %else
        %substr test argument 1,1
        %if test == 'a' || test == 'b' || test == 'c' || test == 'd'
          %substr test argument 2,1
          %if test ==  'x'
          %define size 'word'
          %else
          %define size 'byte'
          %endif
 
 
        %elif test == 'e'
        %define size  'dword'
 
 
        %elif test == 'r'
          %substr test argument 3,1
          %if test ==   'b'
          %define size  'byte'
          %elif test == 'w'
          %define size  'word'
          %elif test == 'd'
          %define size  'dword'
        %else
            %substr test argument 4,1
            %if test == 'b'
            %define size  'byte'
            %elif test == 'w'
            %define size  'word'
            %elif test == 'd'
            %define size  'dword'
            %else
            %define size  'qword'
            %endif
          %endif
        %endif
      %endif
    %endif
  %endif
%endmacro

It's pretty ugly though... :lol: I didn't implement segment registers, but I really don't see that being a problem. However, it only works with lowercase; I don't know if there is some existing functionality to convert to uppercase or lowercase, but if there isn't, I can easily make a solution.

Does anyone know if there is a good website for posting code like this? (I'm not counting github; I think that's more geared toward projects and not code snippets, and it isn't x86 assembly oriented) I figure this could be useful for other assembly programmers. If not, as I now know, web hosting is cheap, lol.


Top
 Profile  
 
PostPosted: Wed Jul 03, 2019 5:26 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21505
Location: NE Indiana, USA (NTSC)
GitHub has a "Gist" service for single-file repositories.

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group