A question about pulling an item from he stack (ARM assembly)

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
User avatar
Iggypop
Posts: 195
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

A question about pulling an item from he stack (ARM assembly)

Post by Iggypop »

STMFD R13!, {R14} (this puts an item on the stack)

LDMFD R13!, {R14} ???? does R13 not get decreased by 4 (goint up the stack) after memory access?

should i not use LDMFI R13!,{R14} ???
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
SKS1
Posts: 330
Joined: Sat Sep 19, 2020 12:04 am
Location: Highland Perthshire
Contact:

Re: A question about pulling an item from he stack (ARM assembly)

Post by SKS1 »

It can be clearer to use STMDB sp!,{list} and LDMIA sp!,{list} rather than the FD suffix.
Miserable old curmudgeon who still likes a bit of an ARM wrestle now and then. Pi 4, 3, ARMX6, SA Risc PC, A540, A440
User avatar
Iggypop
Posts: 195
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: A question about pulling an item from he stack (ARM assembly)

Post by Iggypop »

Ah yes, that makes sence!! but why than bother with FD and EI ?
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
User avatar
SKS1
Posts: 330
Joined: Sat Sep 19, 2020 12:04 am
Location: Highland Perthshire
Contact:

Re: A question about pulling an item from he stack (ARM assembly)

Post by SKS1 »

Iggypop wrote: Sat Feb 17, 2024 12:56 pm Ah yes, that makes sence!! but why than bother with FD and EI ?
Someone at the time thought that using aliases (...FD == LDMIA/STMDB) to represent stack configurations was a good idea! Can't imagine why, but that's me. Just write Push/Pull macros once, you're done.
Miserable old curmudgeon who still likes a bit of an ARM wrestle now and then. Pi 4, 3, ARMX6, SA Risc PC, A540, A440
User avatar
SKS1
Posts: 330
Joined: Sat Sep 19, 2020 12:04 am
Location: Highland Perthshire
Contact:

Re: A question about pulling an item from he stack (ARM assembly)

Post by SKS1 »

Iggypop wrote: Sat Feb 17, 2024 12:56 pm Ah yes, that makes sence!! but why than bother with FD and EI ?
Dug a little more into this. The original VLSI ARM data book did have these suffixes listed for stack use (FD, ED, FA, EA) in the Addressing Mode Names table in addition to the (to me more sensible) IA, IB, DA, DB modes, but the 1990 data book does not.
Miserable old curmudgeon who still likes a bit of an ARM wrestle now and then. Pi 4, 3, ARMX6, SA Risc PC, A540, A440
User avatar
Iggypop
Posts: 195
Joined: Thu Mar 05, 2020 6:34 pm
Location: The Netherlands
Contact:

Re: A question about pulling an item from he stack (ARM assembly)

Post by Iggypop »

thank you for your insightfull answer...
Igor

Acorn Electron, BBC Master 128, Acorn Archimedes A3000
Post Reply

Return to “programming”