Author Topic: Transpose a matrix  (Read 922 times)

guga

  • Member
  • ****
  • Posts: 826
  • Assembly is a state of art.
    • RosAsm
Re: Transpose a matrix
« Reply #15 on: April 05, 2017, 04:19:22 AM »
 :bgrin: :bgrin:

Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

jj2007

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: Transpose a matrix
« Reply #16 on: April 05, 2017, 04:20:37 AM »
It's a mystery to me.  :(

For me, too. Did you try different assemblers and/or linkers? I tried a number of options, none produced a non-zero result.

Siekmanski

  • Member
  • *****
  • Posts: 1139
Re: Transpose a matrix
« Reply #17 on: April 05, 2017, 04:51:31 AM »
The commandline options used,

Code: [Select]
@echo off

if exist "Align_64.obj" del "Align_64.obj"
\masm32\bin\ml.exe /c /coff "Align_64.Asm"
if errorlevel 1 goto Einde

if exist "Align_64.exe" del "Align_64.exe"
\masm32\bin\Link.exe /SUBSYSTEM:CONSOLE /OPT:NOREF /OUT:Align_64.exe Align_64.obj
if errorlevel 1 goto Einde

Align_64.exe

:Einde


Microsoft (R) Macro Assembler Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: Align_64.Asm
## current=209      nops added: 47      sum=256      (line 60)
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Align_64 test.

Align4  00
Align16 00
Align64 32

Press any key to continue...

Same result with Polink.exe

nidud

  • Member
  • *****
  • Posts: 1408
    • https://github.com/nidud/asmc
Re: Transpose a matrix
« Reply #18 on: April 05, 2017, 05:29:00 AM »
The exe in the zip file fails. Rebuild using the above works.

Map:
Code: [Select]
Align_64

 Timestamp is 58e3f022 (Tue Apr 04 21:12:34 2017)

 Preferred load address is 00400000

 Start         Length     Name                   Class
 0001:00000000 0000024aH .text                   CODE
 0002:00000000 0000003cH .idata$5                DATA
 0002:0000003c 0000003cH .idata$2                DATA
 0002:00000078 00000014H .idata$3                DATA
 0002:0000008c 0000003cH .idata$4                DATA
 0002:000000c8 000000c2H .idata$6                DATA
 0002:0000018a 00000000H .edata                  DATA
 0003:00000000 00000060H .data                   DATA
 0003:00000060 00000100H .bss                    DATA

  Address         Publics by Value              Rva+Base     Lib:Object

 0001:00000000       _Wait_Key@0                00401000 f   Align_64.obj
 0001:0000003b       _start                     0040103b f   Align_64.obj
 0001:000000f4       _line@24                   004010f4 f   masm32:line.obj
 0001:00000158       _StdOut@4                  00401158 f   masm32:stdout.obj
 0001:00000190       _StrLen@4                  00401190 f   masm32:strlen.obj
 0001:00000202       _CreatePen@12              00401202 f   gdi32:gdi32.dll
 0001:00000208       _DeleteObject@4            00401208 f   gdi32:gdi32.dll
 0001:0000020e       _LineTo@12                 0040120e f   gdi32:gdi32.dll
 0001:00000214       _MoveToEx@16               00401214 f   gdi32:gdi32.dll
 0001:0000021a       _SelectObject@8            0040121a f   gdi32:gdi32.dll
 0001:00000220       _wsprintfA                 00401220 f   user32:user32.dll
 0001:00000226       _GetDC@4                   00401226 f   user32:user32.dll
 0001:0000022c       _ExitProcess@4             0040122c f   kernel32:kernel32.dll
 0001:00000232       _GetStdHandle@4            00401232 f   kernel32:kernel32.dll
 0001:00000238       _ReadFile@20               00401238 f   kernel32:kernel32.dll
 0001:0000023e       _SetConsoleMode@8          0040123e f   kernel32:kernel32.dll
 0001:00000244       _WriteFile@20              00401244 f   kernel32:kernel32.dll
 0002:00000000       __imp__DeleteObject@4      00402000     gdi32:gdi32.dll
 0002:00000004       __imp__LineTo@12           00402004     gdi32:gdi32.dll
 0002:00000008       __imp__MoveToEx@16         00402008     gdi32:gdi32.dll
 0002:0000000c       __imp__SelectObject@8      0040200c     gdi32:gdi32.dll
 0002:00000010       __imp__CreatePen@12        00402010     gdi32:gdi32.dll
 0002:00000014       \177gdi32_NULL_THUNK_DATA  00402014     gdi32:gdi32.dll
 0002:00000018       __imp__WriteFile@20        00402018     kernel32:kernel32.dll
 0002:0000001c       __imp__SetConsoleMode@8    0040201c     kernel32:kernel32.dll
 0002:00000020       __imp__ExitProcess@4       00402020     kernel32:kernel32.dll
 0002:00000024       __imp__GetStdHandle@4      00402024     kernel32:kernel32.dll
 0002:00000028       __imp__ReadFile@20         00402028     kernel32:kernel32.dll
 0002:0000002c       \177kernel32_NULL_THUNK_DATA 0040202c     kernel32:kernel32.dll
 0002:00000030       __imp__wsprintfA           00402030     user32:user32.dll
 0002:00000034       __imp__GetDC@4             00402034     user32:user32.dll
 0002:00000038       \177user32_NULL_THUNK_DATA 00402038     user32:user32.dll
 0002:0000003c       __IMPORT_DESCRIPTOR_gdi32  0040203c     gdi32:gdi32.dll
 0002:00000050       __IMPORT_DESCRIPTOR_user32 00402050     user32:user32.dll
 0002:00000064       __IMPORT_DESCRIPTOR_kernel32 00402064     kernel32:kernel32.dll
 0002:00000078       __NULL_IMPORT_DESCRIPTOR   00402078     gdi32:gdi32.dll

 entry point at        0001:0000003b

 Static symbols

 0001:000000c0       test64                     004010c0 f   Align_64.obj
 0001:00000048       test4                      00401048 f   Align_64.obj
 0001:00000070       test16                     00401070 f   Align_64.obj

Siekmanski

  • Member
  • *****
  • Posts: 1139
Re: Transpose a matrix
« Reply #19 on: April 05, 2017, 06:40:04 AM »
Stripped the assembler and the linker from the vs2015.com_enu.iso
Still the same result.....

Code: [Select]
Microsoft (R) Macro Assembler Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: Align_64.Asm
## current=218      nops added: 38      sum=256      (line 60)
Microsoft (R) Incremental Linker Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Align_64 test.

Align4  00
Align16 00
Align64 32

Press any key to continue...

commandline options used,

Code: [Select]
@echo off

if exist "Align_64.obj" del "Align_64.obj"
d:\RadASM2212\Masm2015\ml.exe /c /coff "Align_64.Asm"
if errorlevel 1 goto Einde

if exist "Align_64.exe" del "Align_64.exe"
d:\RadASM2212\Masm2015\link.exe /SUBSYSTEM:CONSOLE /OPT:NOREF /OUT:Align_64.exe Align_64.obj
if errorlevel 1 goto Einde

Align_64.exe

:Einde

jj2007

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: Transpose a matrix
« Reply #20 on: April 05, 2017, 06:42:56 AM »
The commandline options used
...
Same result with Polink.exe

I can produce the error with /debug and the M$ linkers (6.14 and 9.0), but not with polink.

Siekmanski

  • Member
  • *****
  • Posts: 1139
Re: Transpose a matrix
« Reply #21 on: April 05, 2017, 07:12:00 AM »
I'm clueless.
Maybe it's how my CPU handles things......

Entry point is 401120h (32 bit aligned)



jj2007

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: Transpose a matrix
« Reply #22 on: April 05, 2017, 08:20:34 AM »
I'm clueless.
Maybe it's how my CPU handles things......

No, your CPU is not the culprit. I can produce the same error. It's the linker... all linkers, actually :(
The macro adds the right number of nops afaics.

Siekmanski

  • Member
  • *****
  • Posts: 1139
Re: Transpose a matrix
« Reply #23 on: April 05, 2017, 08:42:41 AM »
Which linker do you use ?

jj2007

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: Transpose a matrix
« Reply #24 on: April 05, 2017, 08:48:17 AM »
Mostly polink, then ML link 5.12 or 10.0
I've given up on other LINK versions, it's dll hell:
Code: [Select]
LINKV14 : fatal error LNK2023: bad DLL or entry point 'msobj140.dll' etc etc

I just don't have the energy to shove the missing DLLs around. Besides, polink and link10 are sufficient.

Siekmanski

  • Member
  • *****
  • Posts: 1139
Re: Transpose a matrix
« Reply #25 on: April 05, 2017, 08:54:09 AM »
Then it's not the linker. I used version 5.12 with the same wrong result.

Code: [Select]
d:\RadASM2212\Masm\Projects\Align_64>makeit
Microsoft (R) Macro Assembler Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: Align_64.Asm
## current=219      nops added: 37      sum=256      (line 65)
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Align_64 test.

Align4  00
Align16 00
Align64 32
Entry  401120

nidud

  • Member
  • *****
  • Posts: 1408
    • https://github.com/nidud/asmc
Re: Transpose a matrix
« Reply #26 on: April 05, 2017, 09:20:43 AM »
libraries or include files then..

Siekmanski

  • Member
  • *****
  • Posts: 1139
Re: Transpose a matrix
« Reply #27 on: April 05, 2017, 09:35:09 AM »
libraries or include files then..

No, tried it.

jj2007

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: Transpose a matrix
« Reply #28 on: April 05, 2017, 10:28:57 AM »
Try this one:
Code: [Select]
align_64 MACRO
Local curalign, tmp$
  repeat 3
  curalign=($-_TEXT) and 63
  tmp$ CATSTR <current alignment=>, %curalign
% echo tmp$
if curalign
nop
align 16
echo * align16
endif
  endm
endm

I get the impression that I do not understand what the linker really does :(

Siekmanski

  • Member
  • *****
  • Posts: 1139
Re: Transpose a matrix
« Reply #29 on: April 05, 2017, 05:42:12 PM »
Hi Jochen,
Test with the new macro:

Code: [Select]
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. Alle rechten voorbehouden.

d:\RadASM2212\Masm\Projects\Align_64>makeit
Microsoft (R) Macro Assembler Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: Align_64.Asm
current alignment=27
* align16
current alignment=43
* align16
current alignment=59
* align16
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Align_64 test.

Align4  00
Align16 00
Align64 48
Entry  4010A0

Press any key to continue...d:\RadASM2212\Masm\Projects\Align_64>makeit2 ( with polink )
Microsoft (R) Macro Assembler Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: Align_64.Asm
current alignment=27
* align16
current alignment=43
* align16
current alignment=59
* align16
Align_64 test.

Align4  00
Align16 00
Align64 48
Entry  4010A0

Press any key to continue...d:\RadASM2212\Masm\Projects\Align_64>makeit3
Microsoft (R) Macro Assembler Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: Align_64.Asm
current alignment=36
* align16
current alignment=52
* align16
current alignment=4
* align16
Microsoft (R) Incremental Linker Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Align_64 test.

Align4  00
Align16 00
Align64 48
Entry  3010A0