Hi Johannes,
I used to do ARM Assembler on the Archimedes back in the 80s, and I look forward to the next opportunity
I don't know which version of thinBasic you have but if you use the beta version this will have a very recent Oxygen. Conditional jumps were short by default in the past but now I make them all long as it makes no difference to the performance.
To control the jump operand size explicitly:
jmp short foo 'always 1 byte
jmp long foo 'always 4 bytes
jmp fwd foo 'always 4 byte forward jump
'----------------------------------
'TEST
'==================================
Uses "oxygen"
Dim src As String
src="
asm
###
mov eax,4
cmp eax,5
jne long not5
mbox "is 5"
ret
.NOT5
mbox "is not 5"
ret
###
"
MsgBox 0,O2_view src ': Stop
O2_ASMO src
If Len(O2_ERROR) Then
MsgBox 0, O2_ERROR
Else
O2_EXEC
End If
'msgbox 0,v
Thanks for pointing out the case sensitivity of the conditional jumps. I will fix this today.
One feature you may find useful:
Oxygen labels do not have to be unique. Therefore you can use a standard set of labels many times over. The linker will always use the nearest matching label. The linker searches backwards first. If this is unsuccessful then it logs a forward reference. If you use the jmp fwd option, the linker will not search backwards for the target label.
Charles
Bookmarks