Skip to navigation

BBC Micro Elite

Market: TT152

Name: TT152 [View in context] Type: Subroutine Category: Market Summary: Print the unit ("t", "kg" or "g") for a market item
Print the unit ("t", "kg" or "g") for the market item whose byte #1 from the market prices table is in QQ19+1, right-padded with spaces to a width of two characters (so that's "t ", "kg" or "g ").
.TT152 { LDA QQ19+1 \ Fetch the economic_factor from QQ19+1 AND #96 \ If bits 5 and 6 are both clear, jump to TT160 to BEQ TT160 \ print "t" for tonne, followed by a space, and return \ from the subroutine using a tail call CMP #32 \ If bit 5 is set, jump to TT161 to print "kg" for BEQ TT161 \ kilograms, and return from the subroutine using a tail \ call JSR TT16a \ Otherwise call TT16a to print "g" for grams, and fall \ through into TT162 to print a space and return from \ the subroutine }