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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)