aboutsummaryrefslogtreecommitdiff
path: root/assembler/main.s
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-07-21 02:29:09 -0500
committerJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-07-21 02:29:09 -0500
commitd23ab4295a865580f6cb7bb4526978bac388b5ac (patch)
tree2ee66c2ff4fd56d89cee4af78fbff0a65a2a769f /assembler/main.s
parenta2d08934b4d927b6a10dd9d8e09627d29e7c00e7 (diff)
Use octal addresses and data in assembler
Diffstat (limited to 'assembler/main.s')
-rw-r--r--assembler/main.s20
1 files changed, 11 insertions, 9 deletions
diff --git a/assembler/main.s b/assembler/main.s
index a9fd109..983437d 100644
--- a/assembler/main.s
+++ b/assembler/main.s
@@ -16,13 +16,15 @@ main: LDR R0, =0x20000000 // SRAM_BASE
MOVS R0, '\r // SEND CR
BL uart_send
MOV R1, R11 // GET ADDRESS
- LSRS R1, 16 // SHIFT OUT LOWER HALFWORD
+ LSRS R1, 12 // SHIFT OUT LOWER 12 BITS
MOVS R0, R1 // SAVE IN R0
- LSLS R1, 16 // SHIFT BACK
+ LSLS R1, 12 // SHIFT BACK
MOV R11, R1 // SAVE ALTERRED ADDRESS
- MOVS R1, 4 // SEND HEX WITH WIDTH 4
- BL send_hex
- BL get_hex // GET HEX INPUT FOR OFFSET
+ MOVS R1, 20 // SEND OCTAL WITH WIDTH 20
+ BL send_oct
+ BL get_oct // GET OCTAL INPUT FOR OFFSET
+ MOVS R0, 0x1
+ BICS R4, R0
MOV R0, R11 // ADD OFFSET TO ADDRESS
ADDS R0, R4
B 0b
@@ -44,14 +46,14 @@ main: LDR R0, =0x20000000 // SRAM_BASE
PROMPT: PUSH {LR}
MOV R0, R11 // CURRENT ADDRESS
- MOVS R1, 8
- BL send_hex
+ MOVS R1, 32
+ BL send_oct
MOVS R0, ' // SPACE
BL uart_send
MOV R1, R11 // CURRENT CONTENTS
LDRH R0, [R1]
- MOVS R1, 4
- BL send_hex
+ MOVS R1, 16
+ BL send_oct
MOVS R0, ' // SPACE
BL uart_send
POP {PC} // RETURN