BBC BASIC - Changing Colours In Assembler Code
Pages: 1 2
Steve Drain (222) 1620 posts |
+1 and LDRL |
Angel Perez (2908) 84 posts |
Now, assembly language makes the BASIC program executions substantially faster but it may prove temperamental. If one doesn’t know what one is doing, you could be slapped in the face by RISC OS in the BASIC interpreter with “Bad immediate constant” messages for no reason. When that happens, it is nearly impossible to track the bug down that leads to that. |
Angel Perez (2908) 84 posts |
But when you deal with VDU calls for graphic text character size adjustments, to implement, for instance, this BASIC code: VDU 23,17,7,6,8;8;0;0 Do you use an OS command in a sequence in an assembly code such as OS_Write or OS_Byte? |
Rick Murray (539) 13840 posts |
The reason is exactly as stated. While you can store any 32 bit value in a register, instructions such as MOV and ADD have a limited range of valid values, due to having to fit the value into the instruction. Assume it is approximately an 8 bit value which may be shifted. So 255 is valid but 1356347 is not.
You have already asked this and it has been answered. OS_WriteC to write byte by byte, or OS_WriteN to do it as a block all at once. |
Kuemmel (439) 384 posts |
@Angel: Regarding “When that happens, it is nearly impossible to track the bug down that leads to that” I assume you don’t have a line like at the beginning of your BASIC code ? That line also reports the line of the error when you have a bad immediate constant and will show you for debugging…can’t live without that when doing BASIC assembler…
|
Fred Graute (114) 645 posts |
I assume you don’t have a line like Better still is to use throwback. Either Joe Taylor’s !Throwback or Reporter with the |
Pages: 1 2