Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Register" command
#1
I was thinking that it might be incredibly useful, for inline assembly to be able to set what's on the registers as you hit z80 asm.

And a command to do that, that works in a similar way to a function call, might be a good way to do it and avoid a lot of the overhead of a function call for very small jobs.

How about a register and an unregister command?

Register - takes a variable and puts it in the current registers
unregister - takes registers and puts them into a variable.

So you could do something like:

DIM a as long
register a
asm
LD D,0
end asm
unregister a

To kill off the top byte of a long, if that was your whimsy.

Not sure if other people would find this useful, but I could imagine ways it could be useful.

How about:
dim a as fixed
dim b as uinteger
(do things)
register a
unregister b

to put the decimal part of a into b if you wanted to deal with the integer part and the decimal part separately. You could even shunt it back later...

Anyway, just a crazy thought from me, as per usual :-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)