[A83] Re: OP1


[Prev][Next][Index][Thread]

[A83] Re: OP1




If the number you want to store in OP1 is going to be only 1 byte (like 
'16'), you can put it in the accumulator, and then _setxxop1.

Ex:
    ld a,(value)            ;puts your var/num in 'a'
    bcall(_setxxop1)    ;sets a to op1
    ld a,3              ;want to display 3 places (b/c num can go up to 255)
    bcall(_dispop1a)        ;displays value in op1 to 'a' places

If the number is 2 bytes, then you have to load it into 'hl' and then 
bcall(_setxxxxop2), bcall(_op2toop1). 

Ex:
    ld hl,(value)           ;loads var/num in 'hl'
    bcall(_setxxxxop2)  ;sets hl to op2
    bcall(_op2toop1)    ;sets op2 to op1
    ld a,5              ;want to display up to 5 places
    bcall(_dispop1a)        ;displays it to 'a' places

Another useful thing is _convop1.  It puts the value of op1 into 'a'.

-Cole South