Post Reply 
ASM Programming with HP50g
05-09-2021, 02:55 PM
Post: #9
RE: ASM Programming with HP50g
Hallo
It's been some time since my last post. I got a little more experience in ARM assembler programming in administration.
I use the built-in assembler MASD to translate small programs.
Here I have the problem that the LDR command does not work with a label. Here, for example, I would like to load the start address of the text "Hello World" into register R10 with "LDR R10, TEXT". But when I start the program, it crashes immediately

SKUBL{
*START
!ARM
STMDB SP! {R4 R5 R6 R7 R8 LP}

MOV R1, #$8
MOV R2, #$8
MOV R3, #$0
MOV R4, #$50

BL INTOFF
BL CLEARSCREEN
BL PrintText
BL WaitForLS
BL INTON
B ENDE

*PrintText
STMDB SP!, { R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, LR}
LDR R10, TEXT
*NextChar
BL PrintChar
ADD R10, R10, #$2
LDRB R4, [R10]
CMP R4, #$00
BNE NextChar
LDMIA SP!, {R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, PC}

*TEXT
¢Hello World ¢

In the meantime I have also found out how to debug the HP50g with Jtag and OpenOCD from the outside. Now I can set a breakpoint and start my compiled program. It then stops at the breakpoint and I can then run the priogram step by step, view registers and disassemble the memory contents.
This shows that the MASD compiler translates something else from the "LDR R10, TEXT" command. (SUB r15, r3, r4 LSL r0)

Here is a disassembled part of the memory content via JTAG.
The line marked in red is what MASD generated

[Image: Speicherauszug.jpg]

Now my question is now. Is this is a error in MASD or have I made a mistake in the Systax, for example?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
ASM Programming with HP50g - Helge P - 12-04-2020, 01:18 PM
RE: ASM Programming with HP50g - hth - 12-04-2020, 07:49 PM
RE: ASM Programming with HP50g - 3298 - 12-05-2020, 12:24 PM
RE: ASM Programming with HP50g - Helge P - 12-07-2020, 10:38 AM
RE: ASM Programming with HP50g - 3298 - 12-08-2020, 02:38 PM
RE: ASM Programming with HP50g - Helge P - 12-10-2020, 09:13 PM
RE: ASM Programming with HP50g - ijabbott - 12-13-2020, 12:38 PM
RE: ASM Programming with HP50g - Helge P - 05-09-2021 02:55 PM
RE: ASM Programming with HP50g - 3298 - 05-09-2021, 04:12 PM
RE: ASM Programming with HP50g - Helge P - 05-09-2021, 05:04 PM
RE: ASM Programming with HP50g - 3298 - 05-09-2021, 05:51 PM
RE: ASM Programming with HP50g - Helge P - 05-10-2021, 04:59 PM
RE: ASM Programming with HP50g - 3298 - 05-10-2021, 06:24 PM
RE: ASM Programming with HP50g - Helge P - 05-19-2021, 05:40 PM
RE: ASM Programming with HP50g - TRS80 - 11-16-2023, 10:55 AM
RE: ASM Programming with HP50g - TRS80 - 11-27-2023, 11:27 AM
RE: ASM Programming with HP50g - 3298 - 11-27-2023, 08:16 PM



User(s) browsing this thread: 2 Guest(s)