Post Reply 
ASM Programming with HP50g
05-10-2021, 04:59 PM
Post: #14
RE: ASM Programming with HP50g
I had disassemble the programm on the HP50G with skipping the routine that include the wrong compiled command otherwise the calculator will be crashed and I cannot execute the disassemble command.
The result is the same

C0000 STMDB R13 ! { R4 R5 R6 R7 R8 LP }
C0008 MOV R1 $00000008
C0010 MOV R2 $00000008
C0018 MOV R3 $00000000
C0020 MOV R4 $00000050
C0028 BL C0210
C0030 BL C0178
C0038 BL C01D0
C0040 BL C0360
C0048 B C13B0
C0050 STMDB R13 ! { R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 LP }
C0058 SUB PC R3 R4 < R0
C0060 BL C00A8
C0068 ADD R10 R10 $00000002
C0070 LDRB R4 [R10 ]
C0078 CMP R4 $00000000
C0080 BNE C0060
C0088 LDMIA R13 ! { R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 PC }
C0090 $6C6C6548
...

And the distance between the LDA command and the label is only a few instructions. The distance cannot actually be outside the address range.

Because that doesn't work with the label, I use this code instead to get the address into register R10

*PrintText
STMDB SP!, { R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, LR}
BL 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
STMDB SP!, {LR}
MOV R10, PC
LDMIA SP!, {PC}
¢Hello World¢
*NULL
$00

Here I jump to the place of the label and write the address of the PC in register R10 and jump back again. Maybe there is a better way, but it works so far.
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: 1 Guest(s)