Forum > Other OS

Assembling 68k

(1/2) > >>

polluks:
Hi!
How do you support a bigger displacement?
error 2030 in line 140338 of "T:27B5522mp.s": displacement out of range
>       mulu.l  -70768(%a5),%d0

Thanks,
Stefan

TRon:

--- Quote from: polluks on April 26, 2020, 02:59:28 pm ---How do you support a bigger displacement?

--- End quote ---
You don't ?.

It is a limitation of the processor, e.g. afaik displacement on a 68k can be 16 bit max.

Are you addressing custom (f.e. fpga) hardware that offers such support ?

polluks:
Thanks for your quick reply :)
The 68020 offers 32-bit displacement
https://books.google.de/books?id=eVcEWDIeTYcC&pg=PA332&lpg=PA332&dq=32-bit+displacement&source=bl&ots=kzktXlrZgr&sig=ACfU3U2vWwsCkgtgc2STL47ji8LNWeRI_g&hl=de&sa=X&ved=2ahUKEwiPiqPTtIbpAhWRiqQKHTN0D4YQ6AEwAHoECAYQAQ#v=onepage&q=32-bit%20displacement&f=false

By the way I'm counting thee errors

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Free Pascal Compiler version 3.2.0-beta [2019/12/14] for m68kCopyright (c) 1993-2018 by Florian Klaempfl and othersTarget OS: Commodore AmigaCompiling mp.pasmp.pas(346,51) Note: Values in enumeration types have to be ascendingmp.pas(1227,15) Warning: Local variable "best" of a managed type does not seem to be initializedmp.pas(1349,12) Warning: Local variable "l" of a managed type does not seem to be initializedmp.pas(2553,21) Warning: Local variable "stackBuf" of a managed type does not seem to be initializedmp.pas(19627,16) Note: Local variable "AllocElementType" is assigned but never usedmp.pas(19628,5) Note: Local variable "NumAllocElements" is assigned but never usedmp.pas(23719,5) Note: Local variable "NumAllocElements" is assigned but never usedmp.pas(23953,22) Note: Local variable "AllocElementType" is assigned but never usedmp.pas(26701,29) Warning: Local variable "CaseLabelArray" of a managed type does not seem to be initializedmp.pas(29733,21) Warning: Local variable "UnitList" of a managed type does not seem to be initializedmp.pas(29262,3) Note: Local variable "NumAllocTypes" not usedAssembling madpascal error 2030 in line 167386 of "T:2035BC7mp.s": displacement out of range>       mulu.l  -70804(%a5),%d0 error 2030 in line 167403 of "T:2035BC7mp.s": displacement out of range>       mulu.l  -70804(%a5),%d0 error 2030 in line 169829 of "T:2035BC7mp.s": displacement out of range>       mulu.l  -70804(%a5),%d0FreePascal:bin/m68k-amiga/vasmm68k_std fehlgeschlagen Rückgabewert 20Error: Error while assembling exitcode 20Fatal: There were 2 errors compiling module, stoppingFatal: Compilation aborted

marcov:
That's a message of the assembler, so which assembler do you use?

FPC generates it, so it probably generates code for 68020 or higher.

TRon:

--- Quote from: polluks on April 26, 2020, 05:40:54 pm ---Thanks for your quick reply :)

--- End quote ---
You're more than welcome :-)


--- Quote ---The 68020 offers 32-bit displacement

--- End quote ---
Sorry, I still interpret the text differently.

That link writes that it is a 16 bit displacement which is extended to 32 bit before doing the actual math.

The motorola user manual has a table that writes:
Addressing mode, Register indirect, Address with Displacement, Syntax: (d16, An)

Which version of vasm are you using, as i have not encountered it it myself (just) yet. I have still to test fpc 3.2.0 rc1

@marcov: that is vasm: http://sun.hasenbraten.de/vasm/

If it is fpc generating the code then i do believe there could be something amiss ?

PS @polluks
Unfortunately  getting sources legitimate is a bit tricky. Try a search for the M68020 user manual (UM) (Motorola/NXP/freescale doesn't matter, any will do). Additionally you could download the datasheet for the 020 as well (you can find the table I referenced there as well) or try the M68000 Programmer's Manual (PRM) and take a peek here: https://www.cs.mcgill.ca/~cs573/fall2002/notes/lec273/lecture10/ where the motorola 'tech' syntax is more or less translated into actual asm instructions that you're probably more familiar with.

Feel free to correct me in case i'm wrong.

Navigation

[0] Message Index

[#] Next page

Go to full version