I need to transform any input characters from lowercase to uppercase and vice versa. This currently only reads the input and prints it out. I'm using HEW with GNU for H8S/2600 Series. I'm new to this language so I'm sorry if I'm missing something.
.h8300s
.equ PUTS,0x114
.equ GETS,0x113
.equ syscall,0x1FF00
.data
input: .space 100
prompt: .asciz "Zadejte vstupni data: "
.align 2
par_input: .long input
par_prompt: .long prompt
.align 1
.space 100
stck:
.text
.global _start
transform the string here:
transform:
lab1: rts
_start: mov.l #stck,ER7
mov.l #input,ER2
mov.w #PUTS,R0
mov.l #par_prompt,ER1
jsr @syscall
mov.w #GETS,R0
mov.l #par_input,ER1
jsr @syscall
xor.l ER1,ER1
lab2: mov.b @ER2,R0L
cmp.b #0x0A,R0L
beq print
jsr @transform
shll.l #2,ER1
shll.l #2,ER1
or.b R0L,R1L
inc.l #1,ER2
bra lab2
print:
mov.w #PUTS,R0
mov.l #par_input,ER1
jsr @syscall
jmp @lab3
lab3: jmp @lab3